Skip to content

Commit

Permalink
ADD first cypress test
Browse files Browse the repository at this point in the history
  • Loading branch information
ndelangen committed Oct 12, 2019
1 parent 2dd1dac commit 4fb8e87
Show file tree
Hide file tree
Showing 5 changed files with 493 additions and 42 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ htpasswd
storybook-out
/addons/docs/common/config-*
built-storybooks
cypress/videos
1 change: 1 addition & 0 deletions cypress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
11 changes: 11 additions & 0 deletions cypress/integration/mine.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
context('Actions', () => {
beforeEach(() => {
cy.visit('http://localhost:8001/official-storybook/');
});

it('do something', () => {
cy.contains('Invalid contrast').click();

cy.url().should('include', 'path=/story/addons-a11y-basebutton--invalid-contrast');
});
});
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@
"start": "yarn --cwd examples/official-storybook storybook",
"test": "node ./scripts/test.js",
"test-latest-cra": "yarn --prefix --cwd lib/cli run test-latest-cra",
"test:cli": "npm --prefix lib/cli run test"
"test:cli": "npm --prefix lib/cli run test",
"serve-storybooks": "serve ./built-storybooks -l 8001",
"test:e2e-start": "yarn serve-storybooks & yarn test:e2e-run",
"test:e2e-run": "wait-on http://localhost:8001 && cypress run"
},
"husky": {
"hooks": {
Expand Down Expand Up @@ -114,7 +117,10 @@
},
"browserslist": "defaults",
"dependencies": {
"node-sass": "^4.12.0"
"cypress": "^3.4.1",
"node-sass": "^4.12.0",
"serve": "^11.2.0",
"wait-on": "^3.3.0"
},
"devDependencies": {
"@angular/common": "^8.2.8",
Expand Down
Loading

0 comments on commit 4fb8e87

Please sign in to comment.