From 0a4306748c8e079ec75ab33d21b9917caf03a4ad Mon Sep 17 00:00:00 2001 From: Toby Bellwood Date: Thu, 30 Jan 2025 16:14:39 +1100 Subject: [PATCH] tests: rejig waits on certain tests --- cypress/e2e/rbac/organizations/orgAdmin.cy.ts | 1 + cypress/e2e/rbac/organizations/orgViewer.cy.ts | 4 ++-- .../e2e/rbac/organizations/platformAndOrgOwnerJourney.cy.ts | 2 +- cypress/support/actions/organizations/GroupsAction.ts | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cypress/e2e/rbac/organizations/orgAdmin.cy.ts b/cypress/e2e/rbac/organizations/orgAdmin.cy.ts index 78533124..98207a62 100644 --- a/cypress/e2e/rbac/organizations/orgAdmin.cy.ts +++ b/cypress/e2e/rbac/organizations/orgAdmin.cy.ts @@ -101,6 +101,7 @@ orgAdmin.forEach(admin => { }); it('Navigates to a project, adds a group and notifications', () => { + cy.waitForNetworkIdle('@idle', 1000); cy.visit( `${Cypress.env('url')}/organizations/lagoon-demo-organization/projects/${ testData.organizations.project.projectName diff --git a/cypress/e2e/rbac/organizations/orgViewer.cy.ts b/cypress/e2e/rbac/organizations/orgViewer.cy.ts index 6bf35bac..41b7d402 100644 --- a/cypress/e2e/rbac/organizations/orgViewer.cy.ts +++ b/cypress/e2e/rbac/organizations/orgViewer.cy.ts @@ -62,7 +62,7 @@ describe(`Organizations ORGVIEWER journey`, () => { project.doFailedaddProject(testData.organizations.project); }); - it('Navigates to notifications and fails to create any - no permission for ORVIEWER', () => { + it('Navigates to notifications and fails to create any - no permission for ORGVIEWER', () => { cy.intercept('POST', Cypress.env('api'), req => { aliasMutation(req, 'addNotificationSlack'); aliasMutation(req, 'UpdateNotificationSlack'); @@ -91,8 +91,8 @@ describe(`Organizations ORGVIEWER journey`, () => { }); it('Navigates to a project, fails to add a group or notifications - no permission for ORGVIEWER', () => { - cy.visit(`${Cypress.env('url')}/organizations/lagoon-demo-organization/projects/lagoon-demo-org`); cy.waitForNetworkIdle('@idle', 1000); + cy.visit(`${Cypress.env('url')}/organizations/lagoon-demo-organization/projects/lagoon-demo-org`); cy.getBySel('addGroupToProject').click(); diff --git a/cypress/e2e/rbac/organizations/platformAndOrgOwnerJourney.cy.ts b/cypress/e2e/rbac/organizations/platformAndOrgOwnerJourney.cy.ts index c8a66ff5..8ed9e5fc 100644 --- a/cypress/e2e/rbac/organizations/platformAndOrgOwnerJourney.cy.ts +++ b/cypress/e2e/rbac/organizations/platformAndOrgOwnerJourney.cy.ts @@ -102,12 +102,12 @@ orgownerAndPlatformOwner.forEach(owner => { }); it('Navigates to a project, adds a group and notifications', () => { + cy.waitForNetworkIdle('@idle', 1000); cy.visit( `${Cypress.env('url')}/organizations/lagoon-demo-organization/projects/${ testData.organizations.project.projectName }` ); - cy.waitForNetworkIdle('@idle', 1000); cy.getBySel('addGroupToProject').click(); diff --git a/cypress/support/actions/organizations/GroupsAction.ts b/cypress/support/actions/organizations/GroupsAction.ts index 9e13c04c..4f26b11f 100644 --- a/cypress/support/actions/organizations/GroupsAction.ts +++ b/cypress/support/actions/organizations/GroupsAction.ts @@ -6,6 +6,7 @@ export default class GroupAction { doAddGroup(newGroup1: string, newGroup2: string) { groupRepo.getAddGroupBtn('addNewGroup').click(); groupRepo.getGroupNameInput().type(newGroup1); + cy.waitForNetworkIdle('@idle', 1000); groupRepo.getAddGroupSubmitBtn().click(); cy.wait(['@gqladdGroupToOrganizationMutation', '@gqlgetOrganizationQuery']);