Updated button paths and added some waits

This commit is contained in:
Madhurya Liyanage 2023-05-09 21:36:54 +05:30
parent c7e43c58ce
commit ff078cbc80
1 changed files with 8 additions and 3 deletions

View File

@ -59,11 +59,13 @@ Cypress.Commands.add('login', (username, password) => {
}); });
Cypress.Commands.add('logout', (selector, ...args) => { Cypress.Commands.add('logout', (selector, ...args) => {
cy.getBySel('logout-button').click(); cy.wait(2000);
//cy.getBySel('logout-button').click();
cy.get('#root > div > header > div.cds--header__global > span:nth-child(3) > button > svg').click();
if (Cypress.env('SPIFFWORKFLOW_FRONTEND_AUTH_WITH_KEYCLOAK') === true) { if (Cypress.env('SPIFFWORKFLOW_FRONTEND_AUTH_WITH_KEYCLOAK') === true) {
// otherwise we can click logout, quickly load the next page, and the javascript // otherwise we can click logout, quickly load the next page, and the javascript
// doesn't have time to actually sign you out // doesn't have time to actually sign you out
//cy.wait(4000);
cy.contains('Sign in to your account'); cy.contains('Sign in to your account');
} else { } else {
cy.get('#spiff-login-button').should('exist'); cy.get('#spiff-login-button').should('exist');
@ -104,7 +106,10 @@ Cypress.Commands.add(
(expectAutoRedirectToHumanTask = false, returnToProcessModelShow = true) => { (expectAutoRedirectToHumanTask = false, returnToProcessModelShow = true) => {
// cy.getBySel('start-process-instance').click(); // cy.getBySel('start-process-instance').click();
// click on button with text Start // click on button with text Start
cy.get('button') //cy.get('button')
//cy.get('#process-model-tile-manage-procurement\\/procurement\\/requisition-order-management\\/new-demand-request-procurement > div > button')
cy.get('#process-model-tile-manage-procurement\\/procurement\\/requisition-order-management\\/request-goods-services > div > button')
//cy.get('#process-model-tile-manage-procurement\\/procurement\\/requisition-order-management\\/raise-new-demand-request > div > button')
.contains(/^Start$/) .contains(/^Start$/)
.click(); .click();
if (expectAutoRedirectToHumanTask) { if (expectAutoRedirectToHumanTask) {