diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 625c93e..aa261c1 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -33,7 +33,7 @@ jobs: with: browser: chrome headless: true - spec: "cypress/integration/*" + spec: "cypress/e2e/*" publish: needs: [build, tests] if: github.ref == 'refs/heads/master' diff --git a/.gitignore b/.gitignore index 5cb947c..15eff53 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ cypress/videos cypress/fixtures cypress/screenshots *.tgz +.vscode \ No newline at end of file diff --git a/README.md b/README.md index 130aeac..3a2aeac 100644 --- a/README.md +++ b/README.md @@ -191,7 +191,7 @@ _This project uses npm ≥ 8 and Node ≥ 18 - however any project using this pa 6. To add error/warning styles and messages to your features, `@extend` one of the placeholders and `@include contentMessage()` from `src/_base.scss`. 7. Add tests to your features in cypress folder (edit the element file or create a new one if needed) 8. Run tests: `npm run test:ui` or `npm run test` (headless) - - You can also run tests for a specific tag/attribute by doing `npm run test -- --spec cypress/integration/{file-to-test}` + - You can also run tests for a specific tag/attribute by doing `npm run test -- --spec cypress/e2e/{file-to-test}` 9. Add the feature to the [features.md](./features.md) & [codes.md](./codes.md) with a new error or warning code --- diff --git a/cypress.config.js b/cypress.config.js new file mode 100644 index 0000000..24a2b8c --- /dev/null +++ b/cypress.config.js @@ -0,0 +1,12 @@ +const { defineConfig } = require('cypress') + +module.exports = defineConfig({ + projectId: '8purx7', + // defaultCommandTimeout: 4000, + retries: { openMode: 2, runMode: 1 }, + e2e: { + setupNodeEvents(on, config) { + // implement node event listeners here + }, + }, +}) diff --git a/cypress.json b/cypress.json deleted file mode 100644 index 69a88e3..0000000 --- a/cypress.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/cypress/integration/accesskey_spec.js b/cypress/e2e/accesskey_spec.cy.js similarity index 83% rename from cypress/integration/accesskey_spec.js rename to cypress/e2e/accesskey_spec.cy.js index fc9a2ab..7c6ae40 100644 --- a/cypress/integration/accesskey_spec.js +++ b/cypress/e2e/accesskey_spec.cy.js @@ -1,7 +1,7 @@ describe("[accesskey]", () => { - before(() => { - cy.visit("/test/index.html"); - }); + beforeEach(() => { + cy.visit('/test/index.html') + }) it('should show warning on elements with accesskey', () => { cy.get("[accesskey]") diff --git a/cypress/integration/autoplay_spec.js b/cypress/e2e/autoplay_spec.cy.js similarity index 82% rename from cypress/integration/autoplay_spec.js rename to cypress/e2e/autoplay_spec.cy.js index 0bef4b2..004a7ce 100644 --- a/cypress/integration/autoplay_spec.js +++ b/cypress/e2e/autoplay_spec.cy.js @@ -3,9 +3,9 @@ import { } from "../support/constants"; describe("[autoplay]", () => { - before(() => { - cy.visit("/test/index.html"); - }); + beforeEach(() => { + cy.visit('/test/index.html') + }) it('should show warning outline on elements with autoplay', () => { cy.get("[autoplay]") diff --git a/cypress/e2e/buttons_spec.cy.js b/cypress/e2e/buttons_spec.cy.js new file mode 100644 index 0000000..3acb707 --- /dev/null +++ b/cypress/e2e/buttons_spec.cy.js @@ -0,0 +1,49 @@ +import { ERROR_BORDER_COLOR } from '../support/constants' + +describe('