Skip to content

Commit

Permalink
chore: solving conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
tnicola committed Sep 10, 2021
1 parent a63610e commit 43578e9
Show file tree
Hide file tree
Showing 38 changed files with 1,739 additions and 1,072 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: ci
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
permissions:
actions: none
checks: none
contents: read
deployments: none
issues: none
packages: none
pull-requests: none
repository-projects: none
security-events: none
statuses: none
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Prepare demo-app
run: |
cd demo-app
npm ci
- name: Prepare lib
run: |
cd lib
npm ci
- name: Prepare root
run: |
npm ci
- name: Execute tests with defaults
run: |
npm run serve-and-test:parallel
- name: Execute tests with spec reporter
run: |
npm run serve-and-test:parallel:spec
- name: Execute tests with junit reporter
run: |
npm run serve-and-test:parallel:junit
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ demo-app/db.json
demo-app/reporting/*
cypress/parallel-weights.json
cypress/screenshots/*
runner-results/
multi-reporter-config.json
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@

Reduce up to 40% your Cypress suite execution time parallelizing the test run on the same machine.

| cypress | cypress-parallel |
:-------------------------:|:-------------------------:
| cypress | cypress-parallel |
| :-----------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------: |
| ![cy-serial-small](https://user-images.githubusercontent.com/38537547/114301114-92600a80-9ac3-11eb-9166-e95ae9cd5178.gif) | ![cy-parallel_small](https://user-images.githubusercontent.com/38537547/114301127-9db33600-9ac3-11eb-9bfc-c2096023bba7.gif) |


# Run your Cypress tests in parallel (locally)

## How it works
Expand Down Expand Up @@ -72,7 +71,8 @@ npm run cy:parallel
| --specsDir | -d | Cypress specs directory. | string |
| --reporter | -r | Reporter to pass to Cypress. | string |
| --reporterOptions | -o | Reporter options | string |
| --weightsFile | -w | Custom route to weights file | string |
| --bail | -b | Exit on first failing thread | string |
| --verbose | -v | Some additional logging | string |

# Contributors

Expand Down
93 changes: 56 additions & 37 deletions cypress/integration/1/delete-pizza.js
Original file line number Diff line number Diff line change
@@ -1,37 +1,56 @@
describe('Delete pizza', () => {
beforeEach(() => {
cy.server();
cy.fixture('pizzas').as('pizzasAPI');
cy.fixture('addTopping').as('addToppingAPI');
cy.route({
method: 'DELETE',
url: '/api/pizzas/*',
response: {}
}).as('deletePizza');
cy.route({
method: 'GET',
status: 200,
url: '/api/pizzas',
response: '@pizzasAPI'
}).as('getPizzas');

cy.visit('');
});

it('should delete a pizza', () => {
cy.wait(5000);
cy.get('.pizza-item')
.contains(`Seaside Surfin'`)
.within(() => {
cy.get('.btn.btn__ok').click();
});

cy.get('.btn.btn__warning')
.contains('Delete Pizza')
.click();

cy.wait('@deletePizza').should(res => {
expect(res.status).to.equal(200);
});
});
});
describe('Delete pizza', () => {
beforeEach(() => {
cy.server();
cy.fixture('pizzas').as('pizzasAPI');
cy.fixture('addTopping').as('addToppingAPI');
cy.route({
method: 'DELETE',
url: '/api/pizzas/*',
response: {}
}).as('deletePizza');
cy.route({
method: 'GET',
status: 200,
url: '/api/pizzas',
response: '@pizzasAPI'
}).as('getPizzas');

cy.visit('');
});

it('should delete a pizza', () => {
cy.wait(5000);
cy.get('.pizza-item')
.contains(`Seaside Surfin'`)
.within(() => {
cy.get('.btn.btn__ok').click();
});

cy.get('.btn.btn__warning')
.contains('Delete Pizza')
.click();

cy.wait('@deletePizza').should(res => {
expect(res.status).to.equal(200);
});
});

describe('Nested pizza deletion', () => {
it('should delete a nested pizza', () => {
cy.wait(5000);
cy.get('.pizza-item')
.contains(`Seaside Surfin'`)
.within(() => {
cy.get('.btn.btn__ok').click();
});

cy.get('.btn.btn__warning')
.contains('Delete Pizza')
.click();

cy.wait('@deletePizza').should(res => {
expect(res.status).to.equal(200);
});
});
})
});
78 changes: 39 additions & 39 deletions others/2/delete-pizza.js → cypress/integration/2/delete-pizza.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
describe('Delete pizza', () => {
beforeEach(() => {
cy.server();
cy.fixture('pizzas').as('pizzasAPI');
cy.fixture('addTopping').as('addToppingAPI');
cy.route({
method: 'DELETE',
url: '/api/pizzas/*',
response: {}
}).as('deletePizza');
cy.route({
method: 'GET',
status: 200,
url: '/api/pizzas',
response: '@pizzasAPI'
}).as('getPizzas');

cy.visit('');
});

it('should delete a pizza', () => {
cy.wait(5000);

cy.get('.pizza-item')
.contains(`Seaside Surfin'`)
.within(() => {
cy.get('.btn.btn__ok').click();
});

cy.get('.btn.btn__warning')
.contains('Delete Pizza')
.click();

cy.wait('@deletePizza')
.should(res => {
expect(res.status).to.equal(200);
});
});
});
describe('Delete pizza', () => {
beforeEach(() => {
cy.server();
cy.fixture('pizzas').as('pizzasAPI');
cy.fixture('addTopping').as('addToppingAPI');
cy.route({
method: 'DELETE',
url: '/api/pizzas/*',
response: {}
}).as('deletePizza');
cy.route({
method: 'GET',
status: 200,
url: '/api/pizzas',
response: '@pizzasAPI'
}).as('getPizzas');

cy.visit('');
});

it('should delete a pizza', () => {
cy.wait(5000);

cy.get('.pizza-item')
.contains(`Seaside Surfin'`)
.within(() => {
cy.get('.btn.btn__ok').click();
});

cy.get('.btn.btn__warning')
.contains('Delete Pizza')
.click();

cy.wait('@deletePizza')
.should(res => {
expect(res.status).to.equal(200);
});
});
});
Loading

0 comments on commit 43578e9

Please sign in to comment.