Skip to content

Commit

Permalink
test(table-of-contents): add e2e-storybook test coverage (#7673)
Browse files Browse the repository at this point in the history
### Related Ticket(s)

Closes: #7444 #7445 #7446 

### Description

- Adds new e2e-storybook test for table-of-contents web components component
- Adds new e2e-storybook test for table-of-contents react component
- Adds new cypress-local.json config & yarn commands to make test writing & debugging easier

### Changelog

**New**

- Adds new command `yarn test:e2e-storybook:dev` that opens the Cypress client on a currently-running storybook instance to ease test writing & debugging
- Adds e2e-storybook test coverage for `table of contents` component
  • Loading branch information
andy-blum authored Nov 24, 2021
1 parent 9f5203d commit 4c0da7d
Show file tree
Hide file tree
Showing 8 changed files with 713 additions and 34 deletions.
1 change: 1 addition & 0 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"test:e2e:test:no-percy": "start-server-and-test 'yarn test:e2e:run' 8080 'cypress run --config video=false --config-file tests/e2e/cypress.json'",
"test:e2e-storybook:run": "http-server -c-1 storybook-static --silent -p 8082",
"test:e2e-storybook:test": "start-server-and-test 'yarn test:e2e-storybook:run' 8082 'percy exec --config tests/e2e-storybook/.percy.json -- cypress run --config video=false --config-file tests/e2e-storybook/cypress.json'",
"test:e2e-storybook:dev": "cypress open --config-file ./tests/e2e-storybook/cypress-local.json",
"test:e2e-storybook:test:no-percy": "start-server-and-test 'yarn test:e2e-storybook:run' 8082 'cypress run --config video=false --config-file tests/e2e-storybook/cypress.json'",
"test:e2e-storybook:test:no-percy:with-video": "start-server-and-test 'yarn test:e2e-storybook:run' 8082 'cypress run --config-file tests/e2e-storybook/cypress.json'",
"test:e2e-storybook:browserstack:canary": "browserstack-cypress run --cf tests/e2e-storybook/browserstack.json --ccf tests/e2e-storybook/cypress-canary.json --sync",
Expand Down
17 changes: 17 additions & 0 deletions packages/react/tests/e2e-storybook/cypress-local.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"baseUrl": "http://localhost:9000",
"browser": "chrome",
"headless": true,
"fixturesFolder": "tests/e2e-storybook/cypress/fixtures",
"fileServerFolder": "storybook-static",
"screenshotsFolder": "tests/e2e-storybook/cypress/screenshots",
"videosFolder": "tests/e2e-storybook/cypress/videos",
"integrationFolder": "tests/e2e-storybook/cypress/integration",
"supportFile": "tests/e2e-storybook/cypress/support/index.js",
"pluginsFile": "tests/e2e-storybook/cypress/plugins/index.js",
"nodeVersion": "system",
"includeShadowDom": true,
"testFiles": "**/*.e2e.js",
"pageLoadTimeout": 40000,
"defaultCommandTimeout": 40000
}
Loading

0 comments on commit 4c0da7d

Please sign in to comment.