Skip to content

Commit

Permalink
chore(cypress): migrate to Cypress v6 (freeCodeCamp#40396)
Browse files Browse the repository at this point in the history
* Update Cypress version from 5.3.0 to 6.0.0

* Replace `not.be.visible` with `not.exist`

Co-authored-by: Oliver Eyton-Williams <[email protected]>
  • Loading branch information
Twaha-Rahman and ojeytonwilliams committed Dec 7, 2020
1 parent 080154b commit bf0c49f
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 177 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
run: |
echo "CYPRESS_RECORD_KEY=${{ secrets.CYPRESS_RECORD_KEY }}" >> $GITHUB_ENV
echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
echo "CYPRESS_INSTALL_BINARY=5.3.0" >> $GITHUB_ENV
echo "CYPRESS_INSTALL_BINARY=6.0.0" >> $GITHUB_ENV
- name: Checkout Source Files
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/landing.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('Landing page', () => {

cy.viewport(1199, 660)
.get(selectors.landingPageImage)
.should('not.be.visible');
.should('not.exist');
});

it('Has links to all the certifications', function() {
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/learn/common-components/navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('Navbar', () => {
cy.get('input').clear();
});

cy.get('div.ais-Hits').should('not.be.visible');
cy.get('div.ais-Hits').should('not.exist');
});

it('Should have a Sign In button', () => {
Expand Down
6 changes: 2 additions & 4 deletions cypress/integration/learn/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ describe('Superblocks and Blocks', () => {
cy.contains(superBlockNames[0])
.click()
.should('have.attr', 'aria-expanded', 'false');
cy.contains('Basic HTML and HTML5').should('not.be.visible');
cy.contains('Basic HTML and HTML5').should('not.exist');

cy.contains(superBlockNames[0])
.click()
Expand All @@ -107,9 +107,7 @@ describe('Superblocks and Blocks', () => {
cy.contains('Basic HTML and HTML5')
.click()
.should('have.attr', 'aria-expanded', 'false');
cy.contains('Introduction to Basic HTML and HTML5').should(
'not.be.visible'
);
cy.contains('Introduction to Basic HTML and HTML5').should('not.exist');

cy.contains('Basic HTML and HTML5')
.click()
Expand Down
10 changes: 4 additions & 6 deletions cypress/integration/settings/username-change.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ describe('Username input field', () => {
.clear({ force: true })
.type('twaha', { force: true });

cy.contains('Username is available.').should('not.be.visible');
cy.contains('Username not available.').should('not.be.visible');
cy.contains('Username is available.').should('not.exist');
cy.contains('Username not available.').should('not.exist');
cy.contains(
'Please note, changing your username will also change ' +
'the URL to your profile and your certifications.'
).should('not.be.visible');
).should('not.exist');

cy.get('@usernameForm')
.contains('Save')
Expand Down Expand Up @@ -191,9 +191,7 @@ describe('Username input field', () => {
cy.get('button').click();
});

cy.contains('We have updated your username to bjorno').should(
'not.be.visible'
);
cy.contains('We have updated your username to bjorno').should('not.exist');

cy.resetUsername();
});
Expand Down
Loading

0 comments on commit bf0c49f

Please sign in to comment.