From fed785b50c8e86ab372aae119606f1ea9f81ea7f Mon Sep 17 00:00:00 2001 From: Kevin Burnett <18027+burnettk@users.noreply.github.com> Date: Sun, 24 Mar 2024 05:02:15 +0000 Subject: [PATCH] fix a couple cypress test issues (#1267) Co-authored-by: burnettk --- spiffworkflow-frontend/cypress/support/commands.js | 5 ++--- spiffworkflow-frontend/src/routes/ProcessGroupShow.tsx | 6 +++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/spiffworkflow-frontend/cypress/support/commands.js b/spiffworkflow-frontend/cypress/support/commands.js index ecee7651..92976087 100644 --- a/spiffworkflow-frontend/cypress/support/commands.js +++ b/spiffworkflow-frontend/cypress/support/commands.js @@ -35,8 +35,6 @@ Cypress.Commands.add('getBySel', (selector, ...args) => { Cypress.Commands.add('navigateToHome', () => { cy.getBySel('header-menu-expand-button').click(); cy.getBySel('side-nav-items').contains('Home').click(); - // ensure we close the nav - cy.getBySel('header-menu-expand-button').click(); }); Cypress.Commands.add('navigateToAdmin', () => { @@ -93,7 +91,8 @@ Cypress.Commands.add('createGroup', (groupId, groupDisplayName) => { Cypress.Commands.add('createModel', (groupId, modelId, modelDisplayName) => { cy.contains(modelId).should('not.exist'); - cy.contains('Add a process model').click(); + const dasherizedGroupId = groupId.replace(/\//g, '-'); + cy.getBySel(`add-process-model-for-group-${dasherizedGroupId}`).click(); cy.get('input[name=display_name]').type(modelDisplayName); cy.get('input[name=display_name]').should('have.value', modelDisplayName); cy.get('input[name=id]').should('have.value', modelId); diff --git a/spiffworkflow-frontend/src/routes/ProcessGroupShow.tsx b/spiffworkflow-frontend/src/routes/ProcessGroupShow.tsx index 83b2584b..27c80dc8 100644 --- a/spiffworkflow-frontend/src/routes/ProcessGroupShow.tsx +++ b/spiffworkflow-frontend/src/routes/ProcessGroupShow.tsx @@ -71,6 +71,7 @@ export default function ProcessGroupShow() { const modifiedProcessGroupId = modifyProcessIdentifierForPathParam( processGroup.id ); + const dasherizedProcessGroupId = modifiedProcessGroupId.replace(/:/g, '-'); const showNoItemsDisplayText = (processGroup.process_groups || []).length < 1 && (processGroup.process_models || []).length < 1; @@ -129,7 +130,10 @@ export default function ProcessGroupShow() { a={targetUris.processModelCreatePath} ability={ability} > -