Skip to content
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

Optimize tests #1027

Merged
merged 12 commits into from
May 13, 2021
Merged

Optimize tests #1027

merged 12 commits into from
May 13, 2021

Conversation

Tbaut
Copy link
Collaborator

@Tbaut Tbaut commented May 12, 2021

  • Store in a file the outcome of the first test (whatever it is, we don't need to run them in a specific order). Tested locally with 2 simple itin 2 exactly similar spec files. The first takes 30s, the second 15s 🚀 because it's leveraging what was stored in the first.
  • Get anything stored loaded in local and session storage.
  • adds a new REACT_APP_TEST variable to disable the shared transfer that may or may not be present and that Cypress tells that it's really bad to do conditional testing based on the UI (also it's hard). And because there's no way to know because it comes from IPFS, I thought we should first test all the other things, and by the time we're good, we'll have notifications rather than an aggressive popup :D

@render
Copy link

render bot commented May 12, 2021

@Tbaut Tbaut added the Status: Review Needed 👀 Added to PRs when they need more review label May 12, 2021
packages/files-ui/cypress/integration/settings.ts Outdated Show resolved Hide resolved
describe("Settings", () => {
it("can navigate to the settings profile page", () => {
cy.web3Login()
cy.get("[data-cy=settings-nav]").click()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there perhaps a way we could make these markers constant or avoid needing magic strings?

CC: @FSM1 @tanmoyAtb

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if I misunderstood what you mean but those data-cy are based on Cypress best practices, to make sure tests fail as little as possible, even when changing the copy, or the classes https://docs.cypress.io/guides/references/best-practices#Selecting-Elements

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean we could have a bunch of string constants, but I dont know if there is much benefit to be had yet. If we do start feeling overwhelmed by this, its easy enough to Ctrl+f data-cy and fix it later

Copy link
Collaborator Author

@Tbaut Tbaut May 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah now I get it. This is not something that should ever change, so I don't think we would get any benefit from having a list of strings there indeed.

packages/files-ui/cypress/support/commands.ts Outdated Show resolved Hide resolved
Co-authored-by: Michael Yankelev <12774278+FSM1@users.noreply.github.com>
@Tbaut Tbaut merged commit dcfd3d8 into dev May 13, 2021
@Tbaut Tbaut deleted the mnt/tbaut-optimize-tests branch May 13, 2021 20:41
@FSM1 FSM1 mentioned this pull request May 27, 2021
FSM1 added a commit that referenced this pull request May 31, 2021
* Fix upload (#1010)
* Bulk operations for Bin (#1017)
* Set the base for Cypress tests and automation (#1016)
* Update Send Feedback Link (#1024)
* only enable logging in non-mainnet env (#1020)
* Optimize tests (#1027)
* fix (#1030)
* File browser context provider (#1026)
* work on selections  (#1029)
* Remove release drafter for now (#1038)
* Update Readme for tests (#1036)
* Delete release_drafter.yml (#1039)
* Bulk DND Move files (#1028)
* Test file upload (#1035)
* Selection removal preventions (#1037)
* Theme selection UI fix (#1033)
* Update API client (#1032)
* make it light and the files blue (#1049)
* React-PDF Worker fixes (#1052)
* Store screenshots and video of failing tests (#1054)
* fix test classes and add rename test (#1055)
* Hide date for folders (#1060)
* s/testId/testid (#1064)
* folder path in route fixed (#1066)
* Resolve File Browser race condition (#1069)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Review Needed 👀 Added to PRs when they need more review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants