-
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
6a8d335
commit 31066c1
Showing
12 changed files
with
1,089 additions
and
1,011 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 |
---|---|---|
@@ -1,7 +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 | ||
FROM cypress/browsers:node-16.18.1-chrome-110.0.5481.96-1-ff-109.0-edge-110.0.1587.41-1 | ||
WORKDIR /app | ||
COPY package.json ./ | ||
COPY ./ ./ | ||
RUN npm install -g [email protected] | ||
RUN npm install | ||
CMD ["npm", "run", "test:e2e"] | ||
RUN npm ci | ||
CMD ["npm", "run", "start:server:local"] |
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,10 @@ | ||
|
||
entrypoint: /bin/sh -c " CYPRESS_BASE_URL=http://front:3000 cypress run --headless --browser chrome" | ||
|
||
|
||
Faire un npm install avant, | ||
docker build -f Dockerfile -t front . | ||
docker run -it -p 4001:3000 front | ||
docker-compose up --abort-on-container-exit --exit-code-from cypress | ||
|
||
Il faut modifier l'adresse environnement ? |
52 changes: 26 additions & 26 deletions
52
server/apps/frontend/cypress/e2e/create-a-seller/create-a-seller.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,66 +1,66 @@ | ||
/// <reference types="cypress" /> | ||
import { Given, When, Then } from "@badeball/cypress-cucumber-preprocessor"; | ||
import "@testing-library/cypress/add-commands"; | ||
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor'; | ||
import '@testing-library/cypress/add-commands'; | ||
|
||
Given(/^I'm a Seller$/, () => { | ||
cy.intercept( | ||
"POST", | ||
"http://localhost:3000/seller", | ||
'POST', | ||
'baseUrlseller', | ||
|
||
(req) => { | ||
if (req.body.includes("Xavier") || req.body.includes("newPassword")) { | ||
if (req.body.includes('Xavier') || req.body.includes('newPassword')) { | ||
req.reply({ statusCode: 201, body: {} }); | ||
} else if (req.body.includes("Sandrine")) { | ||
} else if (req.body.includes('Sandrine')) { | ||
req.reply({ statusCode: 500 }); | ||
} else { | ||
req.reply({ statusCode: 404, body: {} }); | ||
} | ||
} | ||
); | ||
cy.visit("http://localhost:3000/"); | ||
cy.visit('http://localhost:3000/'); | ||
}); | ||
When("I write the field {string} {string} with {string}", (_, label, value) => { | ||
When('I write the field {string} {string} with {string}', (_, label, value) => { | ||
cy.get(`[aria-label="your ${label}"]`).type(value); | ||
}); | ||
|
||
Then("I click on the button {string}", (label) => { | ||
Then('I click on the button {string}', (label) => { | ||
cy.contains(label).click(); | ||
}); | ||
|
||
Then("I see on the tab {string} with {string}", (name, cash) => { | ||
cy.get(".table-responsive").contains(name); | ||
cy.get(".table-responsive").contains(cash); | ||
Then('I see on the tab {string} with {string}', (name, cash) => { | ||
cy.get('.table-responsive').contains(name); | ||
cy.get('.table-responsive').contains(cash); | ||
}); | ||
|
||
Then("I see an error message: {string}", (message) => { | ||
cy.get(".alert").contains(message); | ||
Then('I see an error message: {string}', (message) => { | ||
cy.get('.alert').contains(message); | ||
}); | ||
|
||
Then("I see an error message for the input: {string}", (label) => { | ||
cy.get("input:invalid").should("have.length", 1); | ||
Then('I see an error message for the input: {string}', (label) => { | ||
cy.get('input:invalid').should('have.length', 1); | ||
cy.get(`#${label}`).then((input) => { | ||
expect(input[0].validationMessage).to.eq("Please fill out this field."); | ||
expect(input[0].validationMessage).to.eq('Please fill out this field.'); | ||
}); | ||
}); | ||
|
||
Then("I don't see on the tab {string} with {string}", (name, cash) => { | ||
cy.get(".table-responsive").contains(name).should("not.exist"); | ||
cy.get(".table-responsive").contains(cash).should("not.exist"); | ||
cy.get('.table-responsive').contains(name).should('not.exist'); | ||
cy.get('.table-responsive').contains(cash).should('not.exist'); | ||
}); | ||
|
||
Then("I observe the reset of input", () => { | ||
cy.get(`[aria-label="your username"]`).should("have.value", ""); | ||
cy.get(`[aria-label="your password"]`).should("have.value", ""); | ||
cy.get(`[aria-label="your url"]`).should("have.value", ""); | ||
Then('I observe the reset of input', () => { | ||
cy.get(`[aria-label="your username"]`).should('have.value', ''); | ||
cy.get(`[aria-label="your password"]`).should('have.value', ''); | ||
cy.get(`[aria-label="your url"]`).should('have.value', ''); | ||
}); | ||
|
||
Then("I don't see an error message: {string}", (message) => { | ||
cy.get(".alert").should("not.exist"); | ||
cy.get('.alert').should('not.exist'); | ||
}); | ||
|
||
Then( | ||
"I observe the field {string} {string} with {string}", | ||
'I observe the field {string} {string} with {string}', | ||
(_, label, value) => { | ||
cy.get(`[aria-label="your ${label}"]`).should("have.value", value); | ||
cy.get(`[aria-label="your ${label}"]`).should('have.value', value); | ||
} | ||
); |
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,7 +1,9 @@ | ||
import { Given } from '@badeball/cypress-cucumber-preprocessor'; | ||
|
||
export const baseUrl = 'http://localhost:3000/'; | ||
|
||
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/'); | ||
cy.visit(baseUrl); | ||
}); |
Binary file removed
BIN
-21.2 KB
...press/screenshots/features/history-sellers.feature/chart-history-100-actual.png
Binary file not shown.
Binary file removed
BIN
-24.4 KB
...press/screenshots/features/history-sellers.feature/chart-history-200-actual.png
Binary file not shown.
Binary file added
BIN
+45.9 KB
...y-sellers.feature/An uncaught error was detected outside of a test (failed).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
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.