From aad1068a92a58bff22ea1e822e3f7cf0b539cec4 Mon Sep 17 00:00:00 2001 From: Capryc0rne Date: Thu, 22 Aug 2024 22:58:17 +0200 Subject: [PATCH] TEST test 91.108.112.237:3001 to frontend --- frontend/cypress/e2e/loginPage.cy.ts | 18 +++++++++--------- frontend/cypress/e2e/utils.ts | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/frontend/cypress/e2e/loginPage.cy.ts b/frontend/cypress/e2e/loginPage.cy.ts index 81b3a63..bd0219d 100644 --- a/frontend/cypress/e2e/loginPage.cy.ts +++ b/frontend/cypress/e2e/loginPage.cy.ts @@ -2,13 +2,13 @@ import { loginAsSuperAdmin } from "./utils"; describe('Login page', () => { it('Login with empty email and password', () => { - cy.visit('http://91.108.112.237:3001/connexion'); + cy.visit('http://frontend/connexion'); cy.get(':nth-child(4) > .ant-row > .ant-col > .ant-form-item-control-input > .ant-form-item-control-input-content > .ant-btn').should('be.visible').click(); // Check if error messages are displayed cy.get('#logInForm_email_help > .ant-form-item-explain-error').and('contain', 'Veuillez entrer votre adresse e-mail'); cy.get('#logInForm_password_help > .ant-form-item-explain-error').should('be.visible').and('contain', 'Veuillez entrer votre mot de passe'); - cy.url().should('eq', 'http://91.108.112.237:3001/connexion'); + cy.url().should('eq', 'http://frontend/connexion'); }); it('Login with right credentials', () => { @@ -16,13 +16,13 @@ describe('Login page', () => { }); it('Login with wrong credentials', () => { - cy.visit('http://91.108.112.237:3001/connexion'); + cy.visit('http://frontend/connexion'); cy.intercept('POST', '/api/login').as('loginRequest'); cy.get('#logInForm_email').type('aa.bb@cc.dd'); cy.get('#logInForm_password').type('ee'); cy.get(':nth-child(4) > .ant-row > .ant-col > .ant-form-item-control-input > .ant-form-item-control-input-content > .ant-btn').should('be.visible').click(); - cy.url().should('eq', 'http://91.108.112.237:3001/connexion'); + cy.url().should('eq', 'http://frontend/connexion'); // input fields should be empty cy.get('#logInForm_email').should('have.value', ''); @@ -37,7 +37,7 @@ describe('Login page', () => { cy.intercept('POST', '/api/login').as('loginRequest'); // Visit the login page - cy.visit('http://91.108.112.237:3001/connexion'); + cy.visit('http://frontend/connexion'); // Enter the login credentials cy.get('#logInForm_email').should('be.visible').type('john.ban@example.com'); @@ -46,7 +46,7 @@ describe('Login page', () => { // Submit the form cy.get(':nth-child(4) > .ant-row > .ant-col > .ant-form-item-control-input > .ant-form-item-control-input-content > .ant-btn').should('be.visible').click(); - cy.url().should('eq', 'http://91.108.112.237:3001/connexion'); + cy.url().should('eq', 'http://frontend/connexion'); // Wait for the login request to complete cy.wait('@loginRequest').its('response.statusCode').should('eq', 403); @@ -57,7 +57,7 @@ describe('Login page', () => { cy.intercept('POST', '/api/login').as('loginRequest'); // Visit the login page - cy.visit('http://91.108.112.237:3001/connexion'); + cy.visit('http://frontend/connexion'); // Enter the login credentials cy.get('#logInForm_email').should('be.visible').type('john.sup@example.com'); @@ -65,7 +65,7 @@ describe('Login page', () => { // Submit the form cy.get(':nth-child(4) > .ant-row > .ant-col > .ant-form-item-control-input > .ant-form-item-control-input-content > .ant-btn').should('be.visible').click(); - cy.url().should('eq', 'http://91.108.112.237:3001/connexion'); + cy.url().should('eq', 'http://frontend/connexion'); // Wait for the login request to complete cy.wait('@loginRequest').its('response.statusCode').should('eq', 403); @@ -75,7 +75,7 @@ describe('Login page', () => { // toggle password visibility it('Toggle password visibility', () => { - cy.visit('http://91.108.112.237:3001/connexion'); + cy.visit('http://frontend/connexion'); cy.get('#logInForm_password').type('aze'); cy.get('.ant-form-item-has-success > .ant-row > .ant-form-item-control > .ant-form-item-control-input > .ant-form-item-control-input-content > .ant-input-affix-wrapper > .ant-input-suffix').click(); cy.get('#logInForm_password').should('have.attr', 'type', 'text'); diff --git a/frontend/cypress/e2e/utils.ts b/frontend/cypress/e2e/utils.ts index 48d2685..828f145 100644 --- a/frontend/cypress/e2e/utils.ts +++ b/frontend/cypress/e2e/utils.ts @@ -6,7 +6,7 @@ export const loginAsSuperAdmin = () => { cy.intercept('POST', '/api/login').as('loginRequest'); // Visit the login page - cy.visit('http://91.108.112.237:3001/connexion'); + cy.visit('http://frontend/connexion'); // Enter the login credentials cy.get('#logInForm_email').should('be.visible').type('c.arthur@gmail.com');