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

Cypress enhancements #1130

Merged
merged 6 commits into from
Dec 3, 2018
Merged

Cypress enhancements #1130

merged 6 commits into from
Dec 3, 2018

Conversation

Betree
Copy link
Member

@Betree Betree commented Nov 30, 2018

ℹ️ Resolve opencollective/opencollective#1452


Website URL is now configured by setting baseUrl with env variable

cy.visit(${WEBSITE_URL}/apex);
cy.visit(/apex);

If you need to, you can still get the base url with Cypress.config('baseUrl').

New cypress login command

This will reduce duplicated code and increase performances as we skip visiting a page, filling a form and submitting it (with some cy.wait(...) in the middle) by instead directly fetching the redirect URL from the API.

Diff

New cypress fillInputField command

Removes the boilerplate fill function that we were copying in a lot of tests.

Change tests names for clear ordering

Test names used namings like 1-xxx, 2-xxx... 15-xxx. Cypress sort them alphabetically, so 15-xxx ran before 2-xxx. This is not what one would expect when looking at the test files names.

Tests list

Add npm run cypress:open to run cypress browser

Preview

Disable video recording when running in dev

Makes running tests way faster. We have npm run cypress:open if we need to check the results graphically which provides a lot more info than a video.

@vercel
Copy link

vercel bot commented Nov 30, 2018

This pull request is automatically deployed with Now.
To access deployments, click Details below or on the icon next to each push.

@Betree Betree force-pushed the enhancement/cypress-good-practices branch from de62ab0 to 9a2f2a4 Compare November 30, 2018 19:27
@Betree Betree force-pushed the enhancement/cypress-good-practices branch from eb266a4 to 059812a Compare November 30, 2018 20:28
@Betree Betree changed the title [WIP] Cypress enhancements Cypress enhancements Nov 30, 2018
@Betree Betree force-pushed the enhancement/cypress-good-practices branch from 0446c87 to d49ef97 Compare December 3, 2018 08:40
Copy link
Contributor

@HipsterBrown HipsterBrown left a comment

Choose a reason for hiding this comment

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

Awesome work! 👏 Definitely makes cypress testing more approachable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants