-
Notifications
You must be signed in to change notification settings - Fork 10
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(e2e): remove static waits and add new commands #1001
Conversation
… dynamically for each test
…tegory to use new commands
c8f70bf
to
0071673
Compare
Test summaryRun details
View run in Cypress Dashboard ➡️ Failures
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
this is to avoid inconsistent dashboard messages for cypress - during push events, the title is empty so cypress uses the commit hash for hte dashboard; this isn't useful and this commit changes it to the PR title instead. see https://docs.cypress.io/guides/continuous-integration/github-actions#Pull-requests-commit-message-is-merge-SHA-into-SHA for more info
SO CLOSE TO A PERFECT RUN GDI |
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.
lgtm, thanks for fixing tests!
* chore(package lock): update deps * fix(cards): update cards to avoid broken styling * chore(package-lock): down to npm v6 * fix(foldercard.jsx): updated old folder card to prevent weird ui styling * chore(cypress commands): shift assertion into commands and remove wait * fix(files/folders spec): fix spec * test(cypress.config): update cypress config to hold only 10 tests in mem * fix(move.spec): update commands for new context menu dom structure * fix(cypress specs): fix remaining specs affected by context menu refactor * test(e2e): remove static waits and add new commands (#1001) * refactor(cypress commands): add more custom commands to cypress * fix(cypress tests): fixed using static wait times and instead use assertions * chore(settings.spec): refactor settings spec to use new constants * test(cypress commands): add new command for setting up default interceptors * test(editpage.spec): update editpage.spec to use new interceptor commnad * fix(cypress specs): remove accidental .only * test(cypress.config): change base url to be set in config rather than dynamically for each test * test(files.spec): use new commands to smooth api * chore(cypress constants): add more cypress constants * refactor(folders.spec): refactor to use new commands and remove old constants * refactor(cypress specs): use new commands and constants * test(resourcecategory.spec): add new command and refactor resource category to use new commands * refactor(resources.spec): shift to new api * chore(settings.spec): use new constants * refactor(sites.spec): update to new interceptors * chore(workspace.spec): update to new commands * chore(cypress constants): remove wait time constants * fix(editpage.spec): updddate test to have more specific wait * fix(cypress specs): update flakey tests * chore(cypress commands): update commands and docs * test(cypress specs): fix remaining specs * ci(ci-e2e): adds github commit message and info this is to avoid inconsistent dashboard messages for cypress - during push events, the title is empty so cypress uses the commit hash for hte dashboard; this isn't useful and this commit changes it to the PR title instead. see https://docs.cypress.io/guides/continuous-integration/github-actions#Pull-requests-commit-message-is-merge-SHA-into-SHA for more info
* chore(package): update cypress * chore(cypress): removed unused plugins index file see here https://docs.cypress.io/guides/references/migration-guide#Plugins-File-Removed for more details * chore(cypress): ran automatic migration tool * chore(cypress.config): update cypress config * chore(cypress): add support for component testing * chore(editpage): migrate to ts * refactor(cypress commands): shift to ts * chore(waitfordom): remove waitfordom and related files this is because the wait for dom file runs into errors with pre-processing using webpack (see our cypress config, which loads and uses webpack). this means that the file is currently incompatible with ts (however, it does work if js). as this file is only used in medias, the file is removed and the call sites will be updated accordingly * refactor(files.spec): migrate to ts * refactor(folders): migrate to ts * refactor(homepage.spec): migrate to ts * refactor(images.spec): migrate to ts * refactor(move.spec): migrate to ts * chore(support/index.d.ts): remove outdated function declartation * refactor(resourceacategory): migrate to ts * refactor(resources.spec): migrate to ts * refactor(settings.spec): migrate custom commands to own file and migrate to ts * feat(cypress.config): shift to transpiling ts * refactor(cypress): migrate remaining specs from js to ts and add allowJS option * docs(cypress/support): shift JSDocs for commands to index.d.ts so TS reflect them * refactor(legacy): shift utils to utils/ and renamed it legacy to avoid more code * build(cypress/tsconfig): update cypress tsconfig to point to the base src/ folder * chore(cypress/e2e): shorten imports * chore(toasts): change to ts from jsx * chore(utils): split some util functions into scoped file * chore(utils/index): add index * fix(api): change import to avoid dep cycle * fix(leftnavgeneration): change export to deslugifyDirectory * fix(validators): fixed deps cycle * fix(jest.config): specify setup files to enable mockign for testdecoder * fix(context-menu): update context menu styling to fix UI breakage (#998) * chore(package lock): update deps * fix(cards): update cards to avoid broken styling * chore(package-lock): down to npm v6 * fix(foldercard.jsx): updated old folder card to prevent weird ui styling * chore(cypress commands): shift assertion into commands and remove wait * fix(files/folders spec): fix spec * test(cypress.config): update cypress config to hold only 10 tests in mem * fix(move.spec): update commands for new context menu dom structure * fix(cypress specs): fix remaining specs affected by context menu refactor * test(e2e): remove static waits and add new commands (#1001) * refactor(cypress commands): add more custom commands to cypress * fix(cypress tests): fixed using static wait times and instead use assertions * chore(settings.spec): refactor settings spec to use new constants * test(cypress commands): add new command for setting up default interceptors * test(editpage.spec): update editpage.spec to use new interceptor commnad * fix(cypress specs): remove accidental .only * test(cypress.config): change base url to be set in config rather than dynamically for each test * test(files.spec): use new commands to smooth api * chore(cypress constants): add more cypress constants * refactor(folders.spec): refactor to use new commands and remove old constants * refactor(cypress specs): use new commands and constants * test(resourcecategory.spec): add new command and refactor resource category to use new commands * refactor(resources.spec): shift to new api * chore(settings.spec): use new constants * refactor(sites.spec): update to new interceptors * chore(workspace.spec): update to new commands * chore(cypress constants): remove wait time constants * fix(editpage.spec): updddate test to have more specific wait * fix(cypress specs): update flakey tests * chore(cypress commands): update commands and docs * test(cypress specs): fix remaining specs * ci(ci-e2e): adds github commit message and info this is to avoid inconsistent dashboard messages for cypress - during push events, the title is empty so cypress uses the commit hash for hte dashboard; this isn't useful and this commit changes it to the PR title instead. see https://docs.cypress.io/guides/continuous-integration/github-actions#Pull-requests-commit-message-is-merge-SHA-into-SHA for more info
This PR builds upon #998 and the newly introduced commands there
Problem
e2e tests are flakey and take extremely long to run, leading to them being a chore to maintain and run (on a release to prod).
the flakiness is due to 2 parts:
point 1/2 above is also part of why the e2e tests take extremely long - because our e2e tests incur a real network call, the strategy taken is to wait for an arbitrary period of time (which, as noted here, is an anti-pattern). this means that even if the request completes early, we still have to wait. in addition, e2e tests at present also wait for the dom to stabilize through waiting. this also incurs additional time.
Solution
This PR is focused towards tackling point 2 above. this is done through
wait
ing on the actual network request so that once the request terminates, e2e tests can continue execution rather than continue waiting