-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: fetch tests in before hook (#7)
* style: decouple onSkip and make request to fetch quarantined tests in before hook * fix: types * test: setup simple e2e test * test: add e2e test * ci: adjust timeout * ci: add path filter * docs: add changeset * style: remove unused db.json
- Loading branch information
Showing
12 changed files
with
676 additions
and
68 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@deploysentinel/cypress-quarantine': patch | ||
--- | ||
|
||
perf: call fetchTestsToBeQuarantined task in before hook |
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,25 @@ | ||
name: E2E | ||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
paths: | ||
- 'cypress/**' | ||
- 'src/**' | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
jobs: | ||
main: | ||
timeout-minutes: 4 | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Install deps | ||
uses: bahmutov/npm-install@v1 | ||
- name: Build pkg | ||
run: yarn build | ||
- name: Run tests | ||
run: yarn ci:e2e |
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,5 @@ | ||
{ | ||
"tests": { | ||
"describe A > visits a website (should be skipped)": true | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,33 @@ | ||
describe('describe A', () => { | ||
it('visits a website (should be skipped)', () => { | ||
cy.visit('https://www.wikipedia.org'); | ||
// Click on <input> #searchInput | ||
cy.get('#searchInput').click(); | ||
|
||
// Fill "milk tea" on <input> #searchInput | ||
cy.get('#searchInput').type('milk tea'); | ||
|
||
// Press Enter on input | ||
cy.get('#searchInput').type('{Enter}'); | ||
|
||
cy.get('#firstHeading').should('include.text', 'Milk tea'); | ||
|
||
cy.get('[href="/wiki/Tea"]').click(); | ||
}); | ||
|
||
it('visits a website (should pass)', () => { | ||
cy.visit('https://www.wikipedia.org'); | ||
// Click on <input> #searchInput | ||
cy.get('#searchInput').click(); | ||
|
||
// Fill "milk tea" on <input> #searchInput | ||
cy.get('#searchInput').type('milk tea'); | ||
|
||
// Press Enter on input | ||
cy.get('#searchInput').type('{Enter}'); | ||
|
||
cy.get('#firstHeading').should('include.text', 'Milk tea'); | ||
|
||
cy.get('[href="/wiki/Milk"]').click(); | ||
}); | ||
}); |
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,22 @@ | ||
const path = require('path') | ||
const jsonServer = require('json-server'); | ||
const server = jsonServer.create(); | ||
const router = jsonServer.router(path.join(__dirname, 'db.json')) | ||
const middlewares = jsonServer.defaults(); | ||
|
||
server.use(middlewares); | ||
server.use(jsonServer.bodyParser); | ||
server.use((req, res, next) => { | ||
if (req.method === 'POST') { | ||
// Converts POST to GET and move payload to query params | ||
// This way it will make JSON Server that it's GET request | ||
req.method = 'GET' | ||
req.query = req.body | ||
} | ||
// Continue to JSON Server router | ||
next() | ||
}); | ||
server.use(router); | ||
server.listen(3000, () => { | ||
console.log('JSON Server is running'); | ||
}); |
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
Oops, something went wrong.