-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add e2e test with Cypress * Try with normal tsconfig.json * Fix environments * Avoid build * Fix tests E2E * Try with a build version * Fix coverage * Improve linting * Fix cypress * Enable always cypress records * Add screenshots
- Loading branch information
1 parent
311c70d
commit dc2b15b
Showing
17 changed files
with
3,478 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"all": true, | ||
"reporter": [ | ||
"html", | ||
"clover" | ||
], | ||
"exclude": [ | ||
"**/__setups__/**", | ||
"**/__tests__/**", | ||
"**/public/vendor/**", | ||
"**/{jest,next,prettier}.config.js", | ||
"**/**.d.ts" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,7 @@ | |
*.json | ||
*.min.css | ||
*.module.css | ||
node_modules/* | ||
node_modules | ||
coverage | ||
.next | ||
.coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"baseUrl": "http://localhost:3000/", | ||
"testFiles": "**/*.feature", | ||
"fixturesFolder": "tests/e2e/fixtures", | ||
"integrationFolder": "tests/e2e/features", | ||
"pluginsFile": "tests/e2e/plugins", | ||
"screenshotsFolder": "tests/e2e/screenshots", | ||
"supportFile": "tests/e2e/support", | ||
"videosFolder": "tests/e2e/videos", | ||
"env": { | ||
"codeCoverage": { | ||
"url": "/api/__coverage__" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/*! | ||
* This file is part of the Stooa codebase. | ||
* | ||
* (c) 2020 - present Runroom SL | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
export { default } from '@cypress/code-coverage/middleware/nextjs'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/*! | ||
* This file is part of the Stooa codebase. | ||
* | ||
* (c) 2020 - present Runroom SL | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
import { Then, When } from 'cypress-cucumber-preprocessor/steps'; | ||
|
||
When('navigates to {string}', (url = '') => { | ||
cy.visit(url, { timeout: 10000 }); | ||
}); | ||
|
||
When('clicks on {string}', (text = '') => { | ||
cy.findAllByRole('link', { name: text }).first().click({ force: true }); | ||
}); | ||
|
||
Then('sees {string}', (text = '') => { | ||
cy.findByText(text).should('be.visible'); | ||
|
||
cy.screenshot(); | ||
}); | ||
|
||
Then('gets redirect to {string}', (url = '') => { | ||
cy.location('pathname', { timeout: 10000 }).should('eq', url); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Feature: Home | ||
As a Stooa user | ||
I can access the Home page | ||
|
||
Scenario: User can see the Home page | ||
When navigates to "/" | ||
Then sees "The online fishbowl tool" | ||
|
||
Scenario: User will be redirect to register when trying to create a fishbowl | ||
When navigates to "/" | ||
And clicks on "Create a free fishbowl" | ||
Then gets redirect to "/register" | ||
And sees the register form |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/*! | ||
* This file is part of the Stooa codebase. | ||
* | ||
* (c) 2020 - present Runroom SL | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
import { Then } from 'cypress-cucumber-preprocessor/steps'; | ||
|
||
Then('sees the register form', () => { | ||
cy.findByRole('heading', { name: 'Register to get started' }); | ||
|
||
cy.screenshot(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/*! | ||
* This file is part of the Stooa codebase. | ||
* | ||
* (c) 2020 - present Runroom SL | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
import { defaultOptions } from '@cypress/browserify-preprocessor'; | ||
import coverage from '@cypress/code-coverage/task'; | ||
import { sync } from 'resolve'; | ||
|
||
const cucumber = require('cypress-cucumber-preprocessor').default // eslint-disable-line @typescript-eslint/no-var-requires | ||
|
||
export default function handler(on, config) { | ||
coverage(on, config); | ||
|
||
const options = { | ||
...defaultOptions, | ||
typescript: sync('typescript', { baseDir: config.projectRoot }) | ||
}; | ||
|
||
on('file:preprocessor', cucumber(options)); | ||
|
||
return config; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/*! | ||
* This file is part of the Stooa codebase. | ||
* | ||
* (c) 2020 - present Runroom SL | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
import '@testing-library/cypress/add-commands'; | ||
import '@cypress/code-coverage/support'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.