This repository has been archived by the owner on Nov 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TEST test 91.108.112.237:3001 to frontend
- Loading branch information
1 parent
6ac47bd
commit aad1068
Showing
2 changed files
with
10 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,27 +2,27 @@ 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', () => { | ||
loginAsSuperAdmin(); | ||
}); | ||
|
||
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('[email protected]'); | ||
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('[email protected]'); | ||
|
@@ -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,15 +57,15 @@ 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('[email protected]'); | ||
cy.get('#logInForm_password').should('be.visible').type('aze'); | ||
|
||
// 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'); | ||
|
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 |
---|---|---|
|
@@ -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('[email protected]'); | ||
|