-
Notifications
You must be signed in to change notification settings - Fork 242
[QA] Set control multi select tests #1558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
l0uden
wants to merge
86
commits into
main
Choose a base branch
from
qa/set_control_multi_select_tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
86 commits
Select commit
Hold shift + click to select a range
8795181
data frame parameter test
l0uden 69f17b2
Revert "data frame parameter test"
l0uden 3134da0
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden b71e210
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 7f01cae
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden e3c7f93
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 008cb72
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 6305456
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden ace4b5b
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden b11ed48
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden ae42e28
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden b8711b5
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 38cebdc
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 4d3464f
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 0cb855a
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 55591e6
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 2bb768e
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 1389c95
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden b10cc9c
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 32287e9
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 242b101
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 5ca5573
test extra parameter for graph
l0uden 18682c4
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden bd2b546
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 31b8775
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 0f46334
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden a5f9730
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden b8e3790
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 6722cd4
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 3ab01a6
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 5ac3db6
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 55a2a8e
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 7fcc6cd
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 56ae702
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 8919bd5
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 3456ee0
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden de2de79
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 7cbb864
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden db4be72
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden f35e7eb
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden a5e4eae
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden b03889f
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden cb60a21
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden b0d68b3
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 8c223f9
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 53eebac
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 96f7de8
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden fcfb46a
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden f56a9bf
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 895b1a2
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 662c6e7
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 94d857c
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden e8b1940
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 5732e21
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 26e153b
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 865ca7a
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 55b25ba
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 4b1d1a4
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 8f97a56
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden cae16f2
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden c0a0b7e
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 8293ad8
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden fdb7e3e
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden d60f1a3
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 26ffe04
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden ba474f9
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden fe9ba38
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 36e96fb
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 873ecce
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden e1aa2b5
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden dadd7ed
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 698c220
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden b3aef82
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden ad7d1a5
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 437fb3e
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 673b815
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden d6d16df
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden b93b318
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 2bd704b
Merge branch 'main' of https://github.com/mckinsey/vizro
l0uden 3f8ffa0
basic scenarios
l0uden 8c564d1
all scenarios
l0uden 3aadc50
Merge branch 'main' of https://github.com/mckinsey/vizro into qa/set_…
l0uden 85285fd
refactoring and screenshots
l0uden 4ec9926
Merge branch 'main' of https://github.com/mckinsey/vizro into qa/set_…
l0uden c5a73e8
fix tests
l0uden 7987ced
Merge branch 'main' of https://github.com/mckinsey/vizro into qa/set_…
l0uden File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file modified
BIN
-1 Byte
(100%)
vizro-core/tests/e2e/screenshots/chrome/main_notifications_page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+14 Bytes
(100%)
vizro-core/tests/e2e/screenshots/chrome/main_notifications_page_dark_theme.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
226 changes: 226 additions & 0 deletions
226
vizro-core/tests/e2e/vizro/dashboards/default/pages/set_control_multi_select_pages.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,226 @@ | ||
| import e2e.vizro.constants as cnst | ||
|
|
||
| import vizro.models as vm | ||
| import vizro.plotly.express as px | ||
| from vizro.actions import set_control | ||
| from vizro.models.types import capture | ||
| from vizro.tables import dash_ag_grid | ||
|
|
||
| iris = px.data.iris() | ||
|
|
||
| iris_unique_species = px.data.iris() | ||
| unique_species = iris_unique_species["species"].unique() | ||
| n_species = len(unique_species) | ||
| n_rows = len(iris_unique_species) | ||
| iris_unique_species["species"] = [unique_species[i % n_species] for i in range(n_rows)] | ||
|
|
||
| gapminder = px.data.gapminder() | ||
|
|
||
|
|
||
l0uden marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| @capture("graph") | ||
| def scatter_with_clickmode_event(data_frame, **kwargs): | ||
| fig = px.scatter(data_frame, **kwargs) | ||
| fig.update_layout(clickmode="event") | ||
| return fig | ||
|
|
||
|
|
||
| cross_filter_multi_select_page = vm.Page( | ||
| title=cnst.SET_CONTROL_MULTI_SELECT_PAGE, | ||
| layout=vm.Grid(grid=[[0, 3], [1, 3], [2, 3]]), | ||
| components=[ | ||
| vm.Graph( | ||
| id=cnst.SCATTER_SET_CONTROL_EVENT_SELECT, | ||
| figure=px.scatter( | ||
| iris, | ||
| x="sepal_length", | ||
| y="petal_width", | ||
| color="species", | ||
| custom_data=["species"], | ||
| ), | ||
| actions=[ | ||
| set_control(control="chl_filter", value="species"), | ||
| set_control(control="ri_filter", value="species"), | ||
| ], | ||
| ), | ||
| vm.Graph( | ||
| id=cnst.SCATTER_SET_CONTROL_EVENT, | ||
| figure=scatter_with_clickmode_event( | ||
| iris, | ||
| x="sepal_length", | ||
| y="petal_width", | ||
| color="species", | ||
| custom_data=["species"], | ||
| ), | ||
| actions=[ | ||
| set_control(control="chl_filter", value="species"), | ||
| set_control(control="ri_filter", value="species"), | ||
| ], | ||
| ), | ||
| vm.AgGrid( | ||
| id=cnst.TABLE_SET_CONTROL_MULTI_SELECT, | ||
| figure=dash_ag_grid(iris_unique_species), | ||
| actions=[ | ||
| set_control(control="chl_filter", value="species"), | ||
| set_control(control="ri_filter", value="species"), | ||
| ], | ||
| ), | ||
| vm.Graph( | ||
| id=cnst.BOX_SET_CONTROL_TARGET_MULTI_SELECT, | ||
| figure=px.box( | ||
| iris, | ||
| x="sepal_length", | ||
| y="petal_width", | ||
| color="species", | ||
| ), | ||
| ), | ||
| ], | ||
| controls=[ | ||
| vm.Filter( | ||
| id="chl_filter", | ||
| column="species", | ||
| targets=[cnst.BOX_SET_CONTROL_TARGET_MULTI_SELECT], | ||
| selector=vm.Checklist(id=cnst.CHECKLIST_SET_CONTROL_MULTI_SELECT_FILTER), | ||
| ), | ||
| vm.Filter( | ||
| id="ri_filter", | ||
| column="species", | ||
| targets=[cnst.BOX_SET_CONTROL_TARGET_MULTI_SELECT], | ||
| selector=vm.RadioItems(id=cnst.RADIOITEMS_SET_CONTROL_MULTI_SELECT_FILTER), | ||
| ), | ||
| ], | ||
| ) | ||
|
|
||
|
|
||
| button_card_trigger_set_control = vm.Page( | ||
| title=cnst.SET_CONTROL_BUTTON_CARD, | ||
| components=[ | ||
| vm.Button( | ||
| id=cnst.SET_CONTROL_BUTTON_NONE, | ||
| actions=[ | ||
| set_control(control="chl_bc_filter", value=None), | ||
| set_control(control="ri_bc_filter", value=None), | ||
| ], | ||
| ), | ||
| vm.Button( | ||
| id=cnst.SET_CONTROL_BUTTON_EMPTY_LIST, | ||
| actions=[ | ||
| set_control(control="chl_bc_filter", value=[]), | ||
| set_control(control="ri_bc_filter", value=[]), | ||
| ], | ||
| ), | ||
| vm.Card( | ||
| id=cnst.SET_CONTROL_CARD_SINGLE_VALUE, | ||
| text="Set to 'virginica'", | ||
| actions=[ | ||
| set_control(control="chl_bc_filter", value=["virginica"]), | ||
| set_control(control="ri_bc_filter", value=["virginica"]), | ||
| ], | ||
| ), | ||
| vm.Card( | ||
| id=cnst.SET_CONTROL_CARD_MULTI_VALUE, | ||
| text="Set to 'virginica' and 'versicolor'", | ||
| actions=[ | ||
| set_control(control="chl_bc_filter", value=["virginica", "versicolor"]), | ||
| set_control(control="ri_bc_filter", value=["virginica", "versicolor"]), | ||
| ], | ||
| ), | ||
| vm.AgGrid( | ||
| id=cnst.TABLE_SET_CONTROL_BUTTON_CARD, | ||
| figure=dash_ag_grid(iris_unique_species), | ||
| ), | ||
| ], | ||
| controls=[ | ||
| vm.Filter( | ||
| id="chl_bc_filter", | ||
| column="species", | ||
| targets=[cnst.TABLE_SET_CONTROL_BUTTON_CARD], | ||
| selector=vm.Checklist(id=cnst.CHECKLIST_SET_CONTROL_BUTTON_CARD), | ||
| ), | ||
| vm.Filter( | ||
| id="ri_bc_filter", | ||
| column="species", | ||
| targets=[cnst.TABLE_SET_CONTROL_BUTTON_CARD], | ||
| selector=vm.RadioItems(id=cnst.RADIOITEMS_SET_CONTROL_BUTTON_CARD), | ||
| ), | ||
| ], | ||
| ) | ||
|
|
||
|
|
||
| filtered_graph_aggrid_trigger_set_control = vm.Page( | ||
| title=cnst.FILTERED_GRAPH_AGGRID_TRIGGER_SET_CONTROL_PAGE, | ||
| layout=vm.Grid(grid=[[0, 1]]), | ||
| components=[ | ||
| vm.Tabs( | ||
| tabs=[ | ||
| vm.Container( | ||
| title="Graph", | ||
| controls=[ | ||
| vm.Filter(column="species", selector=vm.Checklist(id=cnst.CHECKLIST_FT_GRAPH_SET_CONTROL)) | ||
| ], | ||
| components=[ | ||
| vm.Graph( | ||
| id=cnst.FILTERED_SCATTER_TRIGGER_SET_CONTROL_ID, | ||
| figure=px.scatter( | ||
| iris, | ||
| x="sepal_width", | ||
| y="sepal_length", | ||
| color="species", | ||
| custom_data=["species"], | ||
| ), | ||
| actions=set_control(control="chl_ft_filter", value="species"), | ||
| ), | ||
| ], | ||
| ), | ||
| vm.Container( | ||
| title="AgGrid", | ||
| controls=[ | ||
| vm.Filter(column="species", selector=vm.Checklist(id=cnst.CHECKLIST_FT_AGGRID_SET_CONTROL)) | ||
| ], | ||
| components=[ | ||
| vm.AgGrid( | ||
| id=cnst.FILTERED_AGGRID_TRIGGER_SET_CONTROL_ID, | ||
| figure=dash_ag_grid(iris_unique_species), | ||
| actions=set_control(control="chl_ft_filter", value="species"), | ||
| ), | ||
| ], | ||
| ), | ||
| ] | ||
| ), | ||
| vm.AgGrid(id=cnst.TARGETED_AGGRID_FROM_FILTERED_GRAPH, figure=dash_ag_grid(iris)), | ||
| ], | ||
| controls=[ | ||
| vm.Filter( | ||
| id="chl_ft_filter", | ||
| column="species", | ||
| targets=[cnst.TARGETED_AGGRID_FROM_FILTERED_GRAPH], | ||
| selector=vm.Checklist(id=cnst.CHECKLIST_FILTERED_GRAPH_TARGET_AGGRID_SET_CONTROL), | ||
| ), | ||
| ], | ||
| ) | ||
|
|
||
|
|
||
| self_filter_set_control_page = vm.Page( | ||
| title=cnst.SELF_FILTER_SET_CONTROL_PAGE, | ||
| components=[ | ||
| vm.Graph( | ||
| id=cnst.SCATTER_SET_CONTROL_SELF_FILTER, | ||
| figure=px.scatter( | ||
| iris, | ||
| x="sepal_length", | ||
| y="petal_width", | ||
| color="species", | ||
| custom_data=["species"], | ||
| ), | ||
| actions=[ | ||
| set_control(control="chl_self_filter", value="species"), | ||
| ], | ||
| ), | ||
| ], | ||
| controls=[ | ||
| vm.Filter( | ||
| id="chl_self_filter", | ||
| column="species", | ||
| selector=vm.Checklist(id=cnst.CHECKLIST_SET_CONTROL_SELF_FILTER), | ||
| ), | ||
| ], | ||
| ) | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.