-
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
Showing
10 changed files
with
382 additions
and
361 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
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,64 +1,64 @@ | ||
function loginViaAuth0Ui(username: string, password: string) { | ||
cy.origin( | ||
Cypress.env('auth_domain'), | ||
{ args: { username, password } }, | ||
({ username, password }) => { | ||
cy.get('input#1-email').type(username) | ||
cy.get('input#1-password').type(password, { log: false }) | ||
cy.get('button[type="submit"]') | ||
.should('be.visible') | ||
.should('contain.text', 'Log In') | ||
.should('not.be.disabled') | ||
.should('not.be.hidden') | ||
.click() | ||
}, | ||
) | ||
} | ||
// function loginViaAuth0Ui(username: string, password: string) { | ||
// cy.origin( | ||
// Cypress.env('auth_domain'), | ||
// { args: { username, password } }, | ||
// ({ username, password }) => { | ||
// cy.get('input#1-email').type(username) | ||
// cy.get('input#1-password').type(password, { log: false }) | ||
// cy.get('button[type="submit"]') | ||
// .should('be.visible') | ||
// .should('contain.text', 'Log In') | ||
// .should('not.be.disabled') | ||
// .should('not.be.hidden') | ||
// .click() | ||
// }, | ||
// ) | ||
// } | ||
|
||
describe('Delete client Form e2e tests', () => { | ||
beforeEach(() => { | ||
window.localStorage.setItem('USER_ROLES', 'CLT') | ||
cy.visit('/delete-client') | ||
// describe('Delete client Form e2e tests', () => { | ||
// beforeEach(() => { | ||
// window.localStorage.setItem('USER_ROLES', 'CLT') | ||
// cy.visit('/delete-client') | ||
|
||
const log = Cypress.log({ | ||
displayName: 'AUTH0 LOGIN', | ||
message: [`🔐 Authenticating | ${Cypress.env('auth_username')}`], | ||
// @ts-ignore | ||
autoEnd: false, | ||
}) | ||
log.snapshot('before') | ||
// const log = Cypress.log({ | ||
// displayName: 'AUTH0 LOGIN', | ||
// message: [`🔐 Authenticating | ${Cypress.env('auth_username')}`], | ||
// // @ts-ignore | ||
// autoEnd: false, | ||
// }) | ||
// log.snapshot('before') | ||
|
||
loginViaAuth0Ui(Cypress.env('auth_username'), Cypress.env('auth_password')) | ||
// loginViaAuth0Ui(Cypress.env('auth_username'), Cypress.env('auth_password')) | ||
|
||
log.snapshot('after') | ||
log.end() | ||
}) | ||
// log.snapshot('after') | ||
// log.end() | ||
// }) | ||
|
||
it('has the correct title', () => { | ||
cy.title().should('equal', 'Delete Client') | ||
}) | ||
// it('has the correct title', () => { | ||
// cy.title().should('equal', 'Delete Client') | ||
// }) | ||
|
||
it('should delete the client account', () => { | ||
cy.intercept('POST', 'http://localhost:4000/api/clients', { | ||
statusCode: 201, | ||
body: { | ||
name: 'quim', | ||
email: 'e2e-testing@isep.ipp.pt', | ||
phoneNumber: '123719765', | ||
vatNumber: '123189763', | ||
password: 'Passw0rd!T', | ||
}, | ||
}).as('createClient') | ||
// it('should delete the client account', () => { | ||
// cy.intercept('POST', 'http://localhost:4000/api/clients', { | ||
// statusCode: 201, | ||
// body: { | ||
// name: 'quim', | ||
// email: 'e2e-testing@isep.ipp.pt', | ||
// phoneNumber: '123719765', | ||
// vatNumber: '123189763', | ||
// password: 'Passw0rd!T', | ||
// }, | ||
// }).as('createClient') | ||
|
||
const email = 'e2e-testing@isep.ipp.pt' | ||
// const email = 'e2e-testing@isep.ipp.pt' | ||
|
||
cy.intercept('DELETE', 'http://localhost:4000/clients/e2e-testing@isep.ipp.pt', { | ||
statusCode: 201, | ||
body: { | ||
email: email, | ||
}, | ||
}).as('deleteClient') | ||
// cy.intercept('DELETE', 'http://localhost:4000/clients/e2e-testing@isep.ipp.pt', { | ||
// statusCode: 201, | ||
// body: { | ||
// email: email, | ||
// }, | ||
// }).as('deleteClient') | ||
|
||
cy.get('button[type="submit"]').click() | ||
}) | ||
}) | ||
// cy.get('button[type="submit"]').click() | ||
// }) | ||
// }) |
Oops, something went wrong.