Skip to content

Commit 9ef2244

Browse files
Copilotrenemadsen
andcommitted
Fix timeout issues in navigation menu and workers Cypress tests
Co-authored-by: renemadsen <[email protected]>
1 parent 8920d4e commit 9ef2244

8 files changed

+27
-6
lines changed

eform-client/cypress/e2e/c/navigation-menu.create-item.spec.cy.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ describe('Navigation menu - Create item', function () {
55
beforeEach(() => {
66
cy.visit('http://localhost:4200');
77
loginPage.login();
8+
cy.intercept('GET', '**/api/navigation-menu').as('loadMenu');
89
navigationMenuPage.goToMenuEditor();
10+
cy.wait('@loadMenu', { timeout: 30000 });
11+
cy.wait(1000);
912
});
1013

1114
it('element must be moved from templates to list', () => {

eform-client/cypress/e2e/c/navigation-menu.delete-item.spec.cy.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ describe('Navigation menu - Delete item', function () {
55
beforeEach(() => {
66
cy.visit('http://localhost:4200');
77
loginPage.login();
8+
cy.intercept('GET', '**/api/navigation-menu').as('loadMenu');
89
navigationMenuPage.goToMenuEditor();
10+
cy.wait('@loadMenu', { timeout: 30000 });
11+
cy.wait(2000);
912
});
1013

1114
it('element must be created from custom dropdown which elements and create templates elements', () => {

eform-client/cypress/e2e/c/navigation-menu.drag-item.spec.cy.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ describe('Navigation menu - Drag item', function () {
55
beforeEach(() => {
66
cy.visit('http://localhost:4200');
77
loginPage.login();
8+
cy.intercept('GET', '**/api/navigation-menu').as('loadMenu');
89
navigationMenuPage.goToMenuEditor();
10+
cy.wait('@loadMenu', { timeout: 30000 });
911
cy.wait(5000);
1012
});
1113

eform-client/cypress/e2e/c/navigation-menu.edit-item.spec.cy.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ describe('Navigation menu - Edit item', function () {
55
beforeEach(() => {
66
cy.visit('http://localhost:4200');
77
loginPage.login();
8+
cy.intercept('GET', '**/api/navigation-menu').as('loadMenu');
89
navigationMenuPage.goToMenuEditor();
10+
cy.wait('@loadMenu', { timeout: 30000 });
11+
cy.wait(2000);
912
});
1013

1114
it('element must be created from custom link with security group', () => {

eform-client/cypress/e2e/e/password-settings.change-password.spec.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ describe('Password settings - Change password', function () {
66
cy.visit('http://localhost:4200');
77
loginPage.login();
88
passwordSettingsPage.Navbar.goToPasswordSettings();
9-
cy.get('#oldPassword').should('be.visible');
9+
cy.get('#oldPassword', { timeout: 10000 }).should('be.visible');
1010
});
1111

1212
it('should change password to new password', () => {

eform-client/cypress/e2e/e/user-administration.name-change.spec.cy.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ describe('User Administration - Name Change', function () {
1111
before(() => {
1212
cy.visit('http://localhost:4200');
1313
loginPage.login();
14+
cy.intercept('GET', '**/api/admin/get-users').as('loadUsers');
1415
userAdministrationPage.Navbar.goToUserAdministration();
15-
cy.get('#createNewUserBtn').should('be.visible');
16+
cy.wait('@loadUsers', { timeout: 30000 });
17+
cy.get('#createNewUserBtn', { timeout: 10000 }).should('be.visible');
1618
});
1719

1820
it('should set name to Foo Bar', () => {

eform-client/cypress/e2e/h/workers.add.spec.cy.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,18 @@ describe('Workers page - Add new worker', function () {
1515
loginPage.login();
1616

1717
// First, create a device user that will be associated with the worker
18+
cy.intercept('POST', '**/api/device-users/index').as('loadDeviceUsers');
1819
deviceUsersPage.Navbar.goToDeviceUsersPage();
19-
cy.get('#newDeviceUserBtn').should('be.visible');
20+
cy.wait('@loadDeviceUsers', { timeout: 30000 });
21+
cy.get('#newDeviceUserBtn', { timeout: 10000 }).should('be.visible');
2022
deviceUsersPage.createNewDeviceUser(deviceUserFirstName, deviceUserLastName);
2123
cy.wait(1000);
2224

2325
// Navigate to Workers page
26+
cy.intercept('POST', '**/api/workers/index').as('loadWorkers');
2427
workersPage.Navbar.goToWorkers();
25-
cy.get('#workerCreateBtn').should('be.visible');
28+
cy.wait('@loadWorkers', { timeout: 30000 });
29+
cy.get('#workerCreateBtn', { timeout: 10000 }).should('be.visible');
2630
});
2731

2832
it('should add new worker with first and last name', () => {

eform-client/cypress/e2e/h/workers.edit.spec.cy.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,18 @@ describe('Workers page - Edit worker', function () {
1414
loginPage.login();
1515

1616
// First, create a device user that will be associated with the worker
17+
cy.intercept('POST', '**/api/device-users/index').as('loadDeviceUsers');
1718
deviceUsersPage.Navbar.goToDeviceUsersPage();
18-
cy.get('#newDeviceUserBtn').should('be.visible');
19+
cy.wait('@loadDeviceUsers', { timeout: 30000 });
20+
cy.get('#newDeviceUserBtn', { timeout: 10000 }).should('be.visible');
1921
deviceUsersPage.createNewDeviceUser(deviceUserFirstName, deviceUserLastName);
2022
cy.wait(1000);
2123

2224
// Navigate to Workers page and create a test worker
25+
cy.intercept('POST', '**/api/workers/index').as('loadWorkers');
2326
workersPage.Navbar.goToWorkers();
24-
cy.get('#workerCreateBtn').should('be.visible');
27+
cy.wait('@loadWorkers', { timeout: 30000 });
28+
cy.get('#workerCreateBtn', { timeout: 10000 }).should('be.visible');
2529

2630
const initialFirstName = Guid.create().toString();
2731
const initialLastName = Guid.create().toString();

0 commit comments

Comments
 (0)