-
Notifications
You must be signed in to change notification settings - Fork 14k
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
test(native filter): refactor and add new test #19821
Conversation
Codecov Report
@@ Coverage Diff @@
## master #19821 +/- ##
==========================================
- Coverage 66.54% 66.50% -0.05%
==========================================
Files 1692 1714 +22
Lines 64807 64999 +192
Branches 6661 6713 +52
==========================================
+ Hits 43129 43226 +97
- Misses 19978 20065 +87
- Partials 1700 1708 +8
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jinghua-qa Thanks for improving the tests! I left some comments 😉
superset-frontend/cypress-base/cypress/integration/dashboard/nativeFilters.test.ts
Outdated
Show resolved
Hide resolved
superset-frontend/cypress-base/cypress/integration/dashboard/dashboard.helper.ts
Outdated
Show resolved
Hide resolved
superset-frontend/cypress-base/cypress/integration/dashboard/nativeFilters.test.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jinghua-qa I executed the tests locally and it's really slow. The main reason is that we are recreating the dashboard and waiting for all charts to be loaded for each test as you can see in the beforeEach
below:
beforeEach(() => {
cy.login();
cleanUp();
copyTestDashboard("World Bank's Data");
WORLD_HEALTH_CHARTS.forEach(waitForChartLoad);
closeDashboardToastMessage();
});
The majority of tests don't need a fresh initial state to execute. We can start the initial state with an existing filter and handle these types of tests without recreating the whole dashboard:
- 'User can expand / retract native filter sidebar on a dashboard
- Verify setting options and tooltips for value filter
- User can check 'Filter has default value
...
For tests like:
- User can create a time range filter
- User can create a time grain filter
- User can create a time column filter
...
We can just add new filters to execute the tests.
Only a few tests will required a complete fresh initial state. Making these suggested changes will greatly improve execution time.
superset-frontend/cypress-base/cypress/integration/dashboard/dashboard.helper.ts
Outdated
Show resolved
Hide resolved
Can you also add a PR description with the summary of your changes? |
superset-frontend/cypress-base/cypress/integration/dashboard/nativeFilter.helper.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pulled the branch and tested it in my local. It looks like the biggest extra overhead in the current Cypress Test is repeatedly login()
and refresh tested page
in every test case. There is a new feature introduced from Cypress Community.
IMO, we need to upgrade to the latest Cypress and try this feature. Of course, this work is not related to this PR. The PR intends to upgrade the cypress.
others, LGTM.
Done, added PR description |
Separated the tests into 2 different setup suite |
* refactor and add new test * fix lint * fix fail test * fix front end error * fix frontend error * fix fail test for front end check * add native filter helper * more changes * seperated test for different state * seperated tests by initail state * fix failure * one more fix * enable test
* refactor and add new test * fix lint * fix fail test * fix front end error * fix frontend error * fix fail test for front end check * add native filter helper * more changes * seperated test for different state * seperated tests by initail state * fix failure * one more fix * enable test
SUMMARY
1, Put native filter related function to nativeFilter.helpers.ts
2, Separated native filter tests depend on different initial state
3, add new native filter tests:
User can stop filtering when filter is removed
User can create a numerical range filter
User can remove parent filters
User can apply value filter with selected values
Verify that default value is respected after revisit
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION