-
Notifications
You must be signed in to change notification settings - Fork 38
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: add e2e tests for superset embedded dashboards feature #3197
base: feat/embedded-superset-dashboards-DHIS2-17891
Are you sure you want to change the base?
test: add e2e tests for superset embedded dashboards feature #3197
Conversation
🚀 Deployed on https://pr-3197.dashboard.netlify.dhis2.org |
This prevents the js spec from being included in each cucumber feature. badeball/cypress-cucumber-preprocessor#1262
dashboards-app Run #5104
Run Properties:
|
Project |
dashboards-app
|
Branch Review |
chore/add-e2e-tests
|
Run status |
Passed #5104
|
Run duration | 02m 13s |
Commit |
4a3696b60a ℹ️: Merge 0ac529e1f43940ddfbe66a3b3f012eebaadc5ea0 into d606f385247775a23eb45e6b369f...
|
Committer | Hendrik de Graaf |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
1
|
Pending |
0
|
Skipped |
0
|
Passing |
23
|
View all changes introduced in this branch ↗︎ |
@@ -42,7 +42,8 @@ | |||
"cy:run": "start-server-and-test 'yarn cy:start' http://localhost:3000 'yarn cypress run --browser chrome headless'" | |||
}, | |||
"devDependencies": { | |||
"@badeball/cypress-cucumber-preprocessor": "^20.1.0", | |||
"@babel/plugin-syntax-dynamic-import": "^7.8.3", |
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.
Why is this dependency added?
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.
After I upgraded and added some some dev-dependencies, I cleared my node_modules
and ran npx yarn-deduplicate
. This resulted in a significant amount of changes in the yarn.lock
and the package @dhis2/cli-app-scripts
started complaining about this missing dependency, so I just added it. Since this was a change in the dev dependencies only I didn't worry about it too much. Do you think we need to investigate it further.
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.
No, I don't think so. But maybe just add a short comment to the PR description.
@@ -65,7 +67,8 @@ | |||
"redux-mock-store": "^1.5.4", | |||
"resize-observer-polyfill": "^1.5.1", | |||
"semantic-release": "^20", | |||
"start-server-and-test": "^1.14.0" | |||
"start-server-and-test": "^1.14.0", | |||
"typescript": "^5.7.3" |
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.
Could you add a comment in the PR description about why you added typescript?
Ensure it matches my local version where all tests pass
Quality Gate failedFailed conditions See analysis details on SonarQube Cloud Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE |
The main point of this PR is to add an e2e suite for the new embedded dashboards feature. To run this suite (locally) you will need have a v42 (current dev) DHIS2 Core backend in place and you will need to update the cypress environment config (
cypress.env.json
) so that version42
of the web API is used. Note that you do not need a fully functioning superset and superset-gateway instance in place: we usecy.intercept()
to fake that.While writing this PR some loosely related points were also addressed:
excludeByVersionTags
plugin in this repo. Unfortunately we cannot use version tags on our tests yet because thecypress-cucumber-preprocessor
andcypress-tags
plugins cannot be used alongside each other. For now "version toggling" of e2e tests needs to be done using a hardcoded check, like this one.cypress/e2e
andcypress/e2e_cucumber
dir. This will be convenient when we work on removing the cucumber tests in DHIS2-18930Also while writing the tests, two bugs were identified and fixed.
Note that SonarCube has identified as many as 19 "new" issues, which are in fact all pre-existing issues which have now popped up because a lot of files have been moved from
cypress/e2e
tocypress/e2e_cucumber
.Also note that the
typescript
dev-dependency was added because it is needed bycypress-tagify
. Additionally I also added@babel/plugin-syntax-dynamic-import
for reasons I explain in #3197 (comment)The node-versions in the workflow files have also been upgraded. This was initially done to ensure the remote NodeJS environment matched my local setup where tests were passing, hoping that this would help getting the tests to pass on CI. Later on I realised that the e2e tests were failing on CI because a change was needed in
cypress/support/generateTestMatrix.js
, but I decided to keep the node version upgrades because it's a good bit of maintenance.