-
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.
- Loading branch information
Sophie
committed
Feb 17, 2023
1 parent
dcd0248
commit 6a8d335
Showing
15 changed files
with
318 additions
and
862 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM cypress/included:cypress-12.6.0-node-16.18.1-chrome-110.0.5481.96-1-ff-109.0-edge-110.0.1587.41-1 as base | ||
WORKDIR /app | ||
COPY package.json ./ | ||
COPY ./ ./ | ||
RUN npm install -g [email protected] | ||
RUN npm install | ||
CMD ["npm", "run", "test: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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM cypress/included:cypress-12.6.0-node-16.18.1-chrome-110.0.5481.96-1-ff-109.0-edge-110.0.1587.41-1 as base | ||
WORKDIR /app | ||
COPY package.json ./ | ||
COPY ./ ./ | ||
RUN npm install -g [email protected] | ||
RUN npm install | ||
CMD ["npm", "run", "start:server:local"] |
48 changes: 22 additions & 26 deletions
48
server/apps/frontend/cypress/e2e/display-sellers/display-sellers.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 |
---|---|---|
@@ -1,54 +1,50 @@ | ||
/// <reference types="cypress" /> | ||
import { Given, When, Then } from "@badeball/cypress-cucumber-preprocessor"; | ||
import "@testing-library/cypress/add-commands"; | ||
import { When, Then } from '@badeball/cypress-cucumber-preprocessor'; | ||
import '@testing-library/cypress/add-commands'; | ||
|
||
const checkTableSellers = (table) => { | ||
cy.get(".sellers tbody tr").each(($el, index) => { | ||
cy.get('.sellers tbody tr').each(($el, index) => { | ||
cy.get('[aria-label="the name of seller"]') | ||
.eq(index) | ||
.should("have.text", table.rawTable[index + 1][0]); | ||
.should('have.text', table.rawTable[index + 1][0]); | ||
cy.get('[aria-label="the cash of seller"]') | ||
.eq(index) | ||
.contains(table.rawTable[index + 1][1]); | ||
if (table.rawTable[index + 1][2] == "false") { | ||
cy.get('[aria-label="the statut of seller"]').eq(index).find("svg"); | ||
if (table.rawTable[index + 1][2] == 'false') { | ||
cy.get('[aria-label="the statut of seller"]').eq(index).find('svg'); | ||
} else { | ||
cy.get('[aria-label="the statut of seller"]') | ||
.eq(index) | ||
.find("svg") | ||
.should("not.exist"); | ||
.find('svg') | ||
.should('not.exist'); | ||
} | ||
}); | ||
cy.get(".sellers tr").should("have.length", table.rawTable.length); | ||
cy.get('.sellers tr').should('have.length', table.rawTable.length); | ||
}; | ||
|
||
Given(/^I'm on the website$/, () => { | ||
cy.visit("http://localhost:3000/"); | ||
}); | ||
|
||
When("There are 3 sellers", () => { | ||
cy.intercept("GET", "http://localhost:3000/sellers", { | ||
When('There are 3 sellers', () => { | ||
cy.intercept('GET', 'http://localhost:3000/sellers', { | ||
statusCode: 200, | ||
body: [ | ||
{ cash: 60, name: "Lukasz", online: true }, | ||
{ cash: 12000.21, name: "Santane", online: false }, | ||
{ cash: 0.3, name: "Faustine", online: true } | ||
] | ||
{ cash: 60, name: 'Lukasz', online: true }, | ||
{ cash: 12000.21, name: 'Santane', online: false }, | ||
{ cash: 0.3, name: 'Faustine', online: true }, | ||
], | ||
}); | ||
}); | ||
|
||
Then("I see sellers:", (table) => { | ||
Then('I see sellers:', (table) => { | ||
checkTableSellers(table); | ||
}); | ||
|
||
Then("there is a updating of sellers", () => { | ||
cy.intercept("GET", "http://localhost:3000/sellers", { | ||
Then('there is a updating of sellers', () => { | ||
cy.intercept('GET', 'http://localhost:3000/sellers', { | ||
statusCode: 200, | ||
body: [ | ||
{ cash: 10000023210, name: "Lukasz", online: true }, | ||
{ cash: 12000.21, name: "Santane", online: true }, | ||
{ cash: 0.4, name: "Faustine", online: false } | ||
] | ||
{ cash: 10000023210, name: 'Lukasz', online: true }, | ||
{ cash: 12000.21, name: 'Santane', online: true }, | ||
{ cash: 0.4, name: 'Faustine', online: false }, | ||
], | ||
}); | ||
cy.wait(1000); | ||
}); |
7 changes: 1 addition & 6 deletions
7
server/apps/frontend/cypress/e2e/history-sellers/history-sellers.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
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,7 @@ | ||
import { Given } from '@badeball/cypress-cucumber-preprocessor'; | ||
|
||
Given(/^I'm on the website$/, () => { | ||
cy.get('html').invoke('css', 'height', 'initial'); | ||
cy.get('body').invoke('css', 'height', 'initial'); | ||
cy.visit('http://localhost:3000/'); | ||
}); |
Binary file modified
BIN
-913 Bytes
(96%)
...press/screenshots/features/history-sellers.feature/chart-history-100-actual.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1.06 KB
(96%)
...press/screenshots/features/history-sellers.feature/chart-history-200-actual.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-913 Bytes
(96%)
...ress/snapshots/base/features/history-sellers.feature/chart-history-100-base.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1.06 KB
(96%)
...ress/snapshots/base/features/history-sellers.feature/chart-history-200-base.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-397 Bytes
(97%)
...ress/snapshots/diff/features/history-sellers.feature/chart-history-100-diff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-330 Bytes
(98%)
...ress/snapshots/diff/features/history-sellers.feature/chart-history-200-diff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,17 @@ | ||
version: '12.5.1' | ||
services: | ||
front: | ||
build: ./ | ||
environment: | ||
- PORT=3000 | ||
cypress: | ||
|
||
image: cypress/included:cypress-12.6.0-node-16.18.1-chrome-110.0.5481.96-1-ff-109.0-edge-110.0.1587.41-1 | ||
environment: | ||
- CYPRESS_BASE_URL=http://front:3000 | ||
depends_on: | ||
- front | ||
command: "--browser chrome" | ||
working_dir: /test | ||
volumes: | ||
- ./:/test |
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.