feat: Semaine 13

This commit is contained in:
gauvainboiche
2026-09-04 17:25:11 +02:00
parent d0b00802d7
commit 1a3b11555b
44 changed files with 14807 additions and 31 deletions
@@ -0,0 +1,44 @@
function makeRandomString(length) {
let string = '';
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
const charactersLength = characters.length;
let counter = 0;
while (counter < length) {
string += characters.charAt(Math.floor(Math.random() * charactersLength));
counter += 1;
}
return string;
};
const frontendUrl = process.env.FRONTEND_URL;
describe('Frontend Morning News', () => {
beforeEach("Site frontal", () => {
cy.visit('http://localhost:3001')
});
it("Inscription", () => {
const username = makeRandomString(6)
const password = makeRandomString(10)
cy.contains('Bookmarks');
cy.get('.Header_linkContainer__hNrE8 > :nth-child(2)').click();
cy.wait(500);
cy.get('[class*="Header_userSection"]').click();
cy.wait(500);
cy.contains('Sign-up');
cy.get('#signUpUsername').type(username);
cy.wait(500);
cy.get('#signUpPassword').type(password);
cy.wait(500);
cy.get('#register').click();
cy.wait(500);
cy.contains(username);
});
/*
it("Marque-pages", () => {
cy.contains('Articles');
cy.get(':nth-child(1) > [class*="Article_articleHeader] > fa-eye-slash > path').click();
});
*/
})
@@ -0,0 +1,5 @@
{
"name": "Using fixtures to represent data",
"email": "hello@cypress.io",
"body": "Fixtures are a great way to mock data for responses to routes"
}
@@ -0,0 +1,25 @@
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add('login', (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
+20
View File
@@ -0,0 +1,20 @@
// ***********************************************************
// This example support/e2e.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************
// Import commands.js using ES2015 syntax:
import './commands'
// Alternatively you can use CommonJS syntax:
// require('./commands')