diff --git a/cypress/.eslintrc.js b/cypress/.eslintrc.js new file mode 100644 index 000000000..b8816e120 --- /dev/null +++ b/cypress/.eslintrc.js @@ -0,0 +1,5 @@ +module.exports = { + extends: [ + 'plugin:cypress/recommended', + ], +} diff --git a/cypress/e2e/boardFeatures.js b/cypress/e2e/boardFeatures.js index e2bdace64..ae7f56ba0 100644 --- a/cypress/e2e/boardFeatures.js +++ b/cypress/e2e/boardFeatures.js @@ -1,4 +1,4 @@ -import { randHash } from '../utils' +import { randHash } from '../utils/index.js' const randUser = randHash() describe('Board', function() { diff --git a/cypress/e2e/cardFeatures.js b/cypress/e2e/cardFeatures.js index d5449440c..1321f41fe 100644 --- a/cypress/e2e/cardFeatures.js +++ b/cypress/e2e/cardFeatures.js @@ -1,4 +1,4 @@ -import { randHash } from '../utils' +import { randHash } from '../utils/index.js' const randUser = randHash() const testBoardData = { diff --git a/cypress/e2e/deckDashboard.js b/cypress/e2e/deckDashboard.js index f61e744e3..0cdf61d70 100644 --- a/cypress/e2e/deckDashboard.js +++ b/cypress/e2e/deckDashboard.js @@ -1,4 +1,4 @@ -import { randHash } from '../utils' +import { randHash } from '../utils/index.js' const randUser = randHash() describe('Deck dashboard', function() { @@ -14,8 +14,8 @@ describe('Deck dashboard', function() { it('Can show the right title on the dashboard', function() { cy.get('.board-title h2') - .should('have.length', 1).first() - .should('have.text', 'Upcoming cards') + .should('have.length', 1).first() + .should('have.text', 'Upcoming cards') }) it('Can see the default "Personal Board" created for user by default', function() { diff --git a/cypress/e2e/stackFeatures.js b/cypress/e2e/stackFeatures.js index 7754643ec..eeec43fcd 100644 --- a/cypress/e2e/stackFeatures.js +++ b/cypress/e2e/stackFeatures.js @@ -1,4 +1,4 @@ -import { randHash } from '../utils' +import { randHash } from '../utils/index.js' const randUser = randHash() describe('Stack', function() { diff --git a/cypress/support/e2e.js b/cypress/support/e2e.js index d68db96df..b6ca34662 100644 --- a/cypress/support/e2e.js +++ b/cypress/support/e2e.js @@ -14,7 +14,7 @@ // *********************************************************** // Import commands.js using ES2015 syntax: -import './commands' +import './commands.js' // Alternatively you can use CommonJS syntax: // require('./commands') diff --git a/package-lock.json b/package-lock.json index 80494637c..a00df5179 100644 --- a/package-lock.json +++ b/package-lock.json @@ -53,6 +53,7 @@ "@relative-ci/agent": "^4.1.3", "@vue/test-utils": "^1.3.3", "cypress": "^12.2.0", + "eslint-plugin-cypress": "^2.12.1", "eslint-webpack-plugin": "^3.2.0", "jest": "^29.3.1", "jest-serializer-vue": "^3.1.0", @@ -7879,6 +7880,18 @@ "dev": true, "peer": true }, + "node_modules/eslint-plugin-cypress": { + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-cypress/-/eslint-plugin-cypress-2.12.1.tgz", + "integrity": "sha512-c2W/uPADl5kospNDihgiLc7n87t5XhUbFDoTl6CfVkmG+kDAb5Ux10V9PoLPu9N+r7znpc+iQlcmAqT1A/89HA==", + "dev": true, + "dependencies": { + "globals": "^11.12.0" + }, + "peerDependencies": { + "eslint": ">= 3.2.1" + } + }, "node_modules/eslint-plugin-es": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-4.1.0.tgz", @@ -9673,9 +9686,10 @@ } }, "node_modules/globals": { - "version": "11.9.0", + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true, - "license": "MIT", "engines": { "node": ">=4" } @@ -24810,6 +24824,15 @@ } } }, + "eslint-plugin-cypress": { + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-cypress/-/eslint-plugin-cypress-2.12.1.tgz", + "integrity": "sha512-c2W/uPADl5kospNDihgiLc7n87t5XhUbFDoTl6CfVkmG+kDAb5Ux10V9PoLPu9N+r7znpc+iQlcmAqT1A/89HA==", + "dev": true, + "requires": { + "globals": "^11.12.0" + } + }, "eslint-plugin-es": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-4.1.0.tgz", @@ -25873,7 +25896,9 @@ } }, "globals": { - "version": "11.9.0", + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true }, "globby": { diff --git a/package.json b/package.json index 340a95cea..656127b28 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "watch": "NODE_ENV=development webpack --progress --watch --config webpack.js", "lint": "eslint --ext .js,.vue src", "lint:fix": "eslint --ext .js,.vue src --fix", + "lint:cypress": "eslint --ext .js cypress", "stylelint": "stylelint src", "stylelint:fix": "stylelint src --fix", "test": "jest", @@ -79,6 +80,7 @@ "@relative-ci/agent": "^4.1.3", "@vue/test-utils": "^1.3.3", "cypress": "^12.2.0", + "eslint-plugin-cypress": "^2.12.1", "eslint-webpack-plugin": "^3.2.0", "jest": "^29.3.1", "jest-serializer-vue": "^3.1.0",