Skip to content

Commit 8920d4e

Browse files
Copilotrenemadsen
andcommitted
Fix timeout issues in device-users Cypress tests (directory d)
Co-authored-by: renemadsen <[email protected]>
1 parent da63188 commit 8920d4e

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

eform-client/cypress/e2e/d/device-users.add.spec.cy.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ describe('Device users page - Add new device user', function () {
1212
before(() => {
1313
cy.visit('http://localhost:4200');
1414
loginPage.login();
15+
cy.intercept('POST', '**/api/device-users/index').as('loadDeviceUsers');
1516
deviceUsersPage.Navbar.goToDeviceUsersPage();
16-
cy.get('#newDeviceUserBtn').should('be.visible');
17+
cy.wait('@loadDeviceUsers', { timeout: 30000 });
18+
cy.get('#newDeviceUserBtn', { timeout: 10000 }).should('be.visible');
1719
});
1820

1921
it('should add new device user with first name and last name', () => {
@@ -49,8 +51,10 @@ describe('Device users page - Should not add new device user', function () {
4951
before(() => {
5052
cy.visit('http://localhost:4200');
5153
loginPage.login();
54+
cy.intercept('POST', '**/api/device-users/index').as('loadDeviceUsers');
5255
deviceUsersPage.Navbar.goToDeviceUsersPage();
53-
cy.get('#newDeviceUserBtn').should('be.visible');
56+
cy.wait('@loadDeviceUsers', { timeout: 30000 });
57+
cy.get('#newDeviceUserBtn', { timeout: 10000 }).should('be.visible');
5458
});
5559

5660
it('should NOT add device user with only first name', () => {

eform-client/cypress/e2e/d/device-users.delete.spec.cy.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ describe('Device users page - Delete device user', function () {
77
before(() => {
88
cy.visit('http://localhost:4200');
99
loginPage.login();
10+
cy.intercept('POST', '**/api/device-users/index').as('loadDeviceUsers');
1011
deviceUsersPage.Navbar.goToDeviceUsersPage();
12+
cy.wait('@loadDeviceUsers', { timeout: 30000 });
1113

1214
// Create a test user to delete
1315
const firstName = Guid.create().toString();
1416
const lastName = Guid.create().toString();
15-
cy.get('#newDeviceUserBtn').should('be.visible').click();
17+
cy.get('#newDeviceUserBtn', { timeout: 10000 }).should('be.visible').click();
1618
cy.get('#firstName').should('be.visible').type(firstName);
1719
cy.get('#lastName').should('be.visible').type(lastName);
1820
cy.get('#saveCreateBtn').should('be.visible').click();

eform-client/cypress/e2e/d/device-users.edit.spec.cy.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ describe('Device users page - Edit device user', function () {
77
before(() => {
88
cy.visit('http://localhost:4200');
99
loginPage.login();
10+
cy.intercept('POST', '**/api/device-users/index').as('loadDeviceUsers');
1011
deviceUsersPage.Navbar.goToDeviceUsersPage();
12+
cy.wait('@loadDeviceUsers', { timeout: 30000 });
1113

1214
// Create a test user
1315
const firstName = Guid.create().toString();
1416
const lastName = Guid.create().toString();
15-
cy.get('#newDeviceUserBtn').should('be.visible').click();
17+
cy.get('#newDeviceUserBtn', { timeout: 10000 }).should('be.visible').click();
1618
cy.get('#firstName').should('be.visible').type(firstName);
1719
cy.get('#lastName').should('be.visible').type(lastName);
1820
cy.get('#saveCreateBtn').should('be.visible').click();

0 commit comments

Comments
 (0)