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

Support cypress 10 #70

Merged
merged 10 commits into from
Jun 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ module.exports = {
asyncArrow: 'always',
},
],
'quotes': ['error', 'single', { avoidEscape: true }],
},
overrides: [
{
files: ['cypress/integration/**/*'],
files: ['cypress/e2e/**/*'],
rules: {
'sonarjs/no-identical-functions': 'warn',
'sonarjs/no-duplicate-string': ['warn', 5],
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
fail-fast: false
matrix:
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
node-version: [10.x, 14.x, 16.x]
node-version: [16.x, 18.x]

# Runs with `package.json` use the version defined in `~/package.lock.json`.
cypress-version: [package.json, 8.2, 6]
cypress-version: [package.json]

steps:
- uses: actions/checkout@v2
Expand Down
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,30 @@

All notable changes to this project will be documented in this file.

## 3.0.0 - 2022-06-06

## Breaking changes

### Dropped support for node@10

Cypress 10 supports node@16 or up, to simplify CI we're no longer testing with Node@10. It should
still work, but it's no longer guaranteed.

### Dropped support for Cypress@<=9

Cypress 10 introduces a new configuration format. To simplify CI we're no longer testing with
Cypress@9 or lower. It should still work, but it's no longer guaranteed.

If you're not ready to upgrade to Cypress 10 yet, stick to cypress-commands@2.

## Changes

### Added support for Cypress@10

Cypress 10 introduces breaking changes to the plugin system. None of these breaking changes have
impact on `cypress-commands`. Changes to ensure support for Cypress@10 are mainly documentation
changes.

## 2.0.1 - 2021-10-08

### Fixes
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ commands.
}
```

#### Known issue: `cypress.config.ts` limitation

Due to the way Cypress defines its types, it's currently not possible for plugin authors to extend
the Cypress config types.

Because of this limitation, it's not possible to set the `requestBaseUrl` option in
`cypress.config.ts`. For the time being, you can work around this limitation by using
`cypress.config.js` instead.

See https://github.com/cypress-io/cypress/issues/22127 for more details.

## Extended commands

These commands have been extended to be able to do more than originally intended. For these
Expand Down
10 changes: 10 additions & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from 'cypress';

export default defineConfig({
Lakitna marked this conversation as resolved.
Show resolved Hide resolved
video: false,

e2e: {
baseUrl: 'http://localhost:1337/',
requestBaseUrl: 'http://api.localhost:1337',
},
});
5 changes: 0 additions & 5 deletions cypress.json

This file was deleted.

18 changes: 9 additions & 9 deletions cypress/integration/attribute.js → cypress/e2e/attribute.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe('The added command `attribute`', function () {
expect(__logs.length).to.eq(2);
expect(lastLog.get('error')).to.eq(err);
expect(err.message).to.include(
`Expected element to have attribute 'id', but never found it.`
"Expected element to have attribute 'id', but never found it."
);
done();
});
Expand All @@ -66,7 +66,7 @@ describe('The added command `attribute`', function () {
cy.on('fail', (err) => {
expect(__logs.length).to.eq(3);
expect(err.message).to.include(
`Expected element to have attribute 'id', but never found it.`
"Expected element to have attribute 'id', but never found it."
);
done();
});
Expand All @@ -78,7 +78,7 @@ describe('The added command `attribute`', function () {
cy.on('fail', (err) => {
expect(__logs.length).to.eq(3);
expect(err.message).to.include(
`Expected element to not have attribute 'class', ` +
"Expected element to not have attribute 'class', " +
'but it was continuously found.'
);
done();
Expand Down Expand Up @@ -149,7 +149,7 @@ describe('The added command `attribute`', function () {
expect(__logs.length).to.eq(2);
expect(err.message).to.include(
'Expected all 4 elements to have attribute ' +
`'data-relation', but never found it on 1 elements.`
"'data-relation', but never found it on 1 elements."
);
done();
});
Expand All @@ -164,7 +164,7 @@ describe('The added command `attribute`', function () {
expect(__logs.length).to.eq(2);
expect(err.message).to.include(
'Expected all 4 elements to have attribute ' +
`'data-hello', but never found it on 3 elements.`
"'data-hello', but never found it on 3 elements."
);
done();
});
Expand Down Expand Up @@ -198,7 +198,7 @@ describe('The added command `attribute`', function () {
expect(__logs.length).to.eq(3);
expect(err.message).to.include(
'Expected all 4 elements to have attribute ' +
`'data-relation', but never found it on 1 elements.`
"'data-relation', but never found it on 1 elements."
);
done();
});
Expand Down Expand Up @@ -227,7 +227,7 @@ describe('The added command `attribute`', function () {
expect(__logs.length).to.eq(3);
expect(err.message).to.include(
'Expected all 4 elements to not have attribute ' +
`'data-relation', but it was continuously found on 3 ` +
"'data-relation', but it was continuously found on 3 " +
'elements.'
);
done();
Expand All @@ -249,7 +249,7 @@ describe('The added command `attribute`', function () {
expect(__logs.length).to.eq(2);
expect(err.message).to.include(
'Expected all 4 elements to not have attribute ' +
`'data-relation', but it was continuously found on 3 ` +
"'data-relation', but it was continuously found on 3 " +
'elements.'
);
done();
Expand All @@ -272,7 +272,7 @@ describe('The added command `attribute`', function () {
expect(__logs.length).to.eq(6);
expect(err.message).to.include(
'Expected all 4 elements to have attribute ' +
`'data-relation', but never found it on 1 elements`
"'data-relation', but never found it on 1 elements"
);
done();
});
Expand Down
Loading