From ff078cbc801af121c0dd853f0958f058a36aed7e Mon Sep 17 00:00:00 2001 From: Madhurya Liyanage Date: Tue, 9 May 2023 21:36:54 +0530 Subject: [PATCH] Updated button paths and added some waits --- spiffworkflow-frontend/cypress/support/commands.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/spiffworkflow-frontend/cypress/support/commands.js b/spiffworkflow-frontend/cypress/support/commands.js index 5531d7bd..0737e842 100644 --- a/spiffworkflow-frontend/cypress/support/commands.js +++ b/spiffworkflow-frontend/cypress/support/commands.js @@ -59,11 +59,13 @@ Cypress.Commands.add('login', (username, password) => { }); 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) { // otherwise we can click logout, quickly load the next page, and the javascript // doesn't have time to actually sign you out + //cy.wait(4000); cy.contains('Sign in to your account'); } else { cy.get('#spiff-login-button').should('exist'); @@ -104,7 +106,10 @@ Cypress.Commands.add( (expectAutoRedirectToHumanTask = false, returnToProcessModelShow = true) => { // cy.getBySel('start-process-instance').click(); // 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$/) .click(); if (expectAutoRedirectToHumanTask) {