Skip to content

Commit a116b7e

Browse files
committed
2 parents 18f4fdc + f758d45 commit a116b7e

23 files changed

+388
-107
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
push:
44
branches: [ master ]
55
pull_request:
6-
branches: [ master ]
6+
workflow_dispatch:
77
permissions:
88
actions: none
99
checks: none
@@ -38,6 +38,9 @@ jobs:
3838
- name: Execute tests with defaults
3939
run: |
4040
npm run serve-and-test:parallel
41+
- name: Execute only some tests
42+
run: |
43+
npm run serve-and-test:parallel:some
4144
- name: Execute tests with spec reporter
4245
run: |
4346
npm run serve-and-test:parallel:spec

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ Run with npx (no package installation needed)
6767
npx cy:parallel -s cy:run -t 2 -d '<your-cypress-specs-folder>' -a '"<your-cypress-cmd-args>"'
6868
```
6969

70+
## Passing Specs
71+
72+
```
73+
cypress-parallel -s cy:run -t 2 -a '\"<your-cypress-cmd-args>\"' --spec path/to/spec1.spec.js path/to/spec2.spec.js
74+
```
75+
7076
### Scripts options
7177

7278
| Option | Alias | Description | Type |
@@ -77,6 +83,7 @@ npx cy:parallel -s cy:run -t 2 -d '<your-cypress-specs-folder>' -a '"<your-cypre
7783
| --args | -a | Your npm Cypress command arguments | string |
7884
| --threads | -t | Number of threads | number |
7985
| --specsDir | -d | Cypress specs directory | string |
86+
| --spec | | Cypress spec file paths | string |
8087
| --weightsJson | -w | Parallel weights json file | string |
8188
| --reporter | -r | Reporter to pass to Cypress. | string |
8289
| --reporterOptions | -o | Reporter options | string |

cypress/e2e/2/delete-pizza.cy.js

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
11
describe('Delete pizza', () => {
22
beforeEach(() => {
3-
cy.fixture('pizzas').as('pizzasAPI');
3+
4+
cy.fixture('pizzas').then((pizzas) => {
5+
cy.intercept({
6+
method: 'DELETE',
7+
url: '/api/pizzas/*'
8+
}, pizzas).as('deletePizza');
9+
10+
cy.intercept({
11+
method: 'GET',
12+
url: '/api/pizzas'
13+
}, pizzas).as('getPizzas');
14+
});
415
cy.fixture('addTopping').as('addToppingAPI');
5-
cy.intercept('DELETE', '/api/pizzas/*', {}).as('deletePizza');
6-
cy.intercept('GET', '/api/pizzas', { fixture: 'pizzas' }).as('getPizzas');
716

817
cy.visit('');
918
});
1019

1120
it('should delete a pizza', () => {
1221
cy.wait(5000);
22+
1323
cy.get('.pizza-item')
1424
.contains(`Seaside Surfin'`)
1525
.within(() => {
@@ -20,27 +30,6 @@ describe('Delete pizza', () => {
2030
.contains('Delete Pizza')
2131
.click();
2232

23-
cy.wait('@deletePizza').should(interception => {
24-
expect(interception.response.statusCode).to.equal(200);
25-
});
33+
cy.wait('@deletePizza').its('response.statusCode').should('eq', 200)
2634
});
27-
28-
describe('Nested pizza deletion', () => {
29-
it('should delete a nested pizza', () => {
30-
cy.wait(5000);
31-
cy.get('.pizza-item')
32-
.contains(`Seaside Surfin'`)
33-
.within(() => {
34-
cy.get('.btn.btn__ok').click();
35-
});
36-
37-
cy.get('.btn.btn__warning')
38-
.contains('Delete Pizza')
39-
.click();
40-
41-
cy.wait('@deletePizza').should(interception => {
42-
expect(interception.response.statusCode).to.equal(200);
43-
});
44-
});
45-
})
4635
});

cypress/e2e/2/pizza.cy.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
describe('Pizza', () => {
2+
beforeEach(() => {
3+
<<<<<<< HEAD:cypress/e2e/2/pizzas.cy.js
4+
cy.fixture('pizzas').as('pizzasAPI');
5+
cy.intercept('GET', '/api/pizzas', { fixture: 'pizzas' }).as('getPizzas');
6+
=======
7+
cy.fixture('pizzas').then((pizzas) => {
8+
cy.intercept('GET', '/api/pizzas', pizzas).as('getPizzas');
9+
});
10+
>>>>>>> f758d4533ee3df353641cb529c6ae0ab4bfa52e4:cypress/e2e/2/pizza.cy.js
11+
12+
cy.visit('');
13+
});
14+
15+
it('should navigate to products when products button is clicked', () => {
16+
cy.wait(5000);
17+
18+
cy.get('.app__nav a').contains('Products').click();
19+
cy.url().should('include', 'products');
20+
21+
cy.get('.products__new a').click();
22+
23+
cy.get('.app__nav a').contains('Products').click();
24+
cy.url().should('include', 'products');
25+
});
26+
27+
it('should load all pizzas', () => {
28+
cy.get('pizza-item').should('have.length', 3);
29+
});
30+
31+
it('should open each pizza with proper ingredients', () => {
32+
cy.get('pizza-item button').first().should('contain', 'View Pizza').click();
33+
34+
cy.get('.pizza-form__input').should('have.value', "Blazin' Inferno");
35+
});
36+
});

cypress/e2e/2/pizzas.cy.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
describe('Pizza', () => {
22
beforeEach(() => {
3+
<<<<<<< HEAD:cypress/e2e/2/pizzas.cy.js
34
cy.fixture('pizzas').as('pizzasAPI');
45
cy.intercept('GET', '/api/pizzas', { fixture: 'pizzas' }).as('getPizzas');
6+
=======
7+
cy.fixture('pizzas').then((pizzas) => {
8+
cy.intercept('GET', '/api/pizzas', pizzas).as('getPizzas');
9+
});
10+
>>>>>>> f758d4533ee3df353641cb529c6ae0ab4bfa52e4:cypress/e2e/2/pizza.cy.js
511

612
cy.visit('');
713
});

cypress/e2e/3/delete-pizza.cy.js

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
11
describe('Delete pizza', () => {
22
beforeEach(() => {
3-
cy.fixture('pizzas').as('pizzasAPI');
3+
4+
cy.fixture('pizzas').then((pizzas) => {
5+
cy.intercept({
6+
method: 'DELETE',
7+
url: '/api/pizzas/*'
8+
}, pizzas).as('deletePizza');
9+
10+
cy.intercept({
11+
method: 'GET',
12+
url: '/api/pizzas'
13+
}, pizzas).as('getPizzas');
14+
});
415
cy.fixture('addTopping').as('addToppingAPI');
5-
cy.intercept('DELETE', '/api/pizzas/*', {}).as('deletePizza');
6-
cy.intercept('GET', '/api/pizzas', { fixture: 'pizzas' }).as('getPizzas');
716

817
cy.visit('');
918
});
1019

1120
it('should delete a pizza', () => {
1221
cy.wait(5000);
22+
1323
cy.get('.pizza-item')
1424
.contains(`Seaside Surfin'`)
1525
.within(() => {
@@ -20,27 +30,6 @@ describe('Delete pizza', () => {
2030
.contains('Delete Pizza')
2131
.click();
2232

23-
cy.wait('@deletePizza').should(interception => {
24-
expect(interception.response.statusCode).to.equal(200);
25-
});
33+
cy.wait('@deletePizza').its('response.statusCode').should('eq', 200)
2634
});
27-
28-
describe('Nested pizza deletion', () => {
29-
it('should delete a nested pizza', () => {
30-
cy.wait(5000);
31-
cy.get('.pizza-item')
32-
.contains(`Seaside Surfin'`)
33-
.within(() => {
34-
cy.get('.btn.btn__ok').click();
35-
});
36-
37-
cy.get('.btn.btn__warning')
38-
.contains('Delete Pizza')
39-
.click();
40-
41-
cy.wait('@deletePizza').should(interception => {
42-
expect(interception.response.statusCode).to.equal(200);
43-
});
44-
});
45-
})
4635
});

cypress/e2e/3/pizza.cy.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
describe('Pizza', () => {
2+
beforeEach(() => {
3+
<<<<<<< HEAD:cypress/e2e/3/pizzas.cy.js
4+
cy.fixture('pizzas').as('pizzasAPI');
5+
cy.intercept('GET', '/api/pizzas', { fixture: 'pizzas' }).as('getPizzas');
6+
=======
7+
cy.fixture('pizzas').then((pizzas) => {
8+
cy.intercept('GET', '/api/pizzas', pizzas).as('getPizzas');
9+
});
10+
>>>>>>> f758d4533ee3df353641cb529c6ae0ab4bfa52e4:cypress/e2e/3/pizza.cy.js
11+
12+
cy.visit('');
13+
});
14+
15+
it('should navigate to products when products button is clicked', () => {
16+
cy.wait(5000);
17+
18+
cy.get('.app__nav a').contains('Products').click();
19+
cy.url().should('include', 'products');
20+
21+
cy.get('.products__new a').click();
22+
23+
cy.get('.app__nav a').contains('Products').click();
24+
cy.url().should('include', 'products');
25+
});
26+
27+
it('should load all pizzas', () => {
28+
cy.get('pizza-item').should('have.length', 3);
29+
});
30+
31+
it('should open each pizza with proper ingredients', () => {
32+
cy.get('pizza-item button').first().should('contain', 'View Pizza').click();
33+
34+
cy.get('.pizza-form__input').should('have.value', "Blazin' Inferno");
35+
});
36+
});

cypress/e2e/3/pizzas.cy.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
describe('Pizza', () => {
22
beforeEach(() => {
3+
<<<<<<< HEAD:cypress/e2e/3/pizzas.cy.js
34
cy.fixture('pizzas').as('pizzasAPI');
45
cy.intercept('GET', '/api/pizzas', { fixture: 'pizzas' }).as('getPizzas');
6+
=======
7+
cy.fixture('pizzas').then((pizzas) => {
8+
cy.intercept('GET', '/api/pizzas', pizzas).as('getPizzas');
9+
});
10+
>>>>>>> f758d4533ee3df353641cb529c6ae0ab4bfa52e4:cypress/e2e/3/pizza.cy.js
511

612
cy.visit('');
713
});

cypress/e2e/4/delete-pizza.cy.js

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
11
describe('Delete pizza', () => {
22
beforeEach(() => {
3-
cy.fixture('pizzas').as('pizzasAPI');
3+
4+
cy.fixture('pizzas').then((pizzas) => {
5+
cy.intercept({
6+
method: 'DELETE',
7+
url: '/api/pizzas/*'
8+
}, pizzas).as('deletePizza');
9+
10+
cy.intercept({
11+
method: 'GET',
12+
url: '/api/pizzas'
13+
}, pizzas).as('getPizzas');
14+
});
415
cy.fixture('addTopping').as('addToppingAPI');
5-
cy.intercept('DELETE', '/api/pizzas/*', {}).as('deletePizza');
6-
cy.intercept('GET', '/api/pizzas', { fixture: 'pizzas' }).as('getPizzas');
716

817
cy.visit('');
918
});
1019

1120
it('should delete a pizza', () => {
1221
cy.wait(5000);
22+
1323
cy.get('.pizza-item')
1424
.contains(`Seaside Surfin'`)
1525
.within(() => {
@@ -20,27 +30,6 @@ describe('Delete pizza', () => {
2030
.contains('Delete Pizza')
2131
.click();
2232

23-
cy.wait('@deletePizza').should(interception => {
24-
expect(interception.response.statusCode).to.equal(200);
25-
});
33+
cy.wait('@deletePizza').its('response.statusCode').should('eq', 200)
2634
});
27-
28-
describe('Nested pizza deletion', () => {
29-
it('should delete a nested pizza', () => {
30-
cy.wait(5000);
31-
cy.get('.pizza-item')
32-
.contains(`Seaside Surfin'`)
33-
.within(() => {
34-
cy.get('.btn.btn__ok').click();
35-
});
36-
37-
cy.get('.btn.btn__warning')
38-
.contains('Delete Pizza')
39-
.click();
40-
41-
cy.wait('@deletePizza').should(interception => {
42-
expect(interception.response.statusCode).to.equal(200);
43-
});
44-
});
45-
})
4635
});

cypress/e2e/4/pizza.cy.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
describe('Pizza', () => {
2+
beforeEach(() => {
3+
<<<<<<< HEAD:cypress/e2e/4/pizzas.cy.js
4+
cy.fixture('pizzas').as('pizzasAPI');
5+
cy.intercept('GET', '/api/pizzas', { fixture: 'pizzas' }).as('getPizzas');
6+
=======
7+
cy.fixture('pizzas').then((pizzas) => {
8+
cy.intercept('GET', '/api/pizzas', pizzas).as('getPizzas');
9+
});
10+
>>>>>>> f758d4533ee3df353641cb529c6ae0ab4bfa52e4:cypress/e2e/4/pizza.cy.js
11+
12+
cy.visit('');
13+
});
14+
15+
it('should navigate to products when products button is clicked', () => {
16+
cy.wait(5000);
17+
18+
cy.get('.app__nav a').contains('Products').click();
19+
cy.url().should('include', 'products');
20+
21+
cy.get('.products__new a').click();
22+
23+
cy.get('.app__nav a').contains('Products').click();
24+
cy.url().should('include', 'products');
25+
});
26+
27+
it('should load all pizzas', () => {
28+
cy.get('pizza-item').should('have.length', 3);
29+
});
30+
31+
it('should open each pizza with proper ingredients', () => {
32+
cy.get('pizza-item button').first().should('contain', 'View Pizza').click();
33+
34+
cy.get('.pizza-form__input').should('have.value', "Blazin' Inferno");
35+
});
36+
});

0 commit comments

Comments
 (0)