Skip to content

Commit ffbf29e

Browse files
Copilotrenemadsen
andcommitted
Add workerEmail support to BackendConfigurationPropertyWorkers page objects
Co-authored-by: renemadsen <[email protected]>
1 parent a6f33b4 commit ffbf29e

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

eform-client/cypress/e2e/plugins/backend-configuration-pn/BackendConfigurationPropertyWorkers.page.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ class BackendConfigurationPropertyWorkersPage extends PageWithNavbarPage {
4242
return cy.get('#lastName').should('be.visible').should('be.enabled');
4343
};
4444

45+
public createEmailInput() {
46+
return cy.get('#workerEmail').should('be.visible').should('be.enabled');
47+
};
48+
4549
public getFirstRowObject() {
4650
return new WorkerRowObject().getRow(1);
4751
};
@@ -66,6 +70,10 @@ class BackendConfigurationPropertyWorkersPage extends PageWithNavbarPage {
6670
return cy.get('#lastName').should('be.visible').should('be.enabled');
6771
};
6872

73+
public editEmailInput() {
74+
return cy.get('#workerEmail').should('be.visible').should('be.enabled');
75+
};
76+
6977
public saveEditBtn() {
7078
return cy.get('#saveEditBtn').should('be.visible').should('be.enabled');
7179
};
@@ -126,6 +134,9 @@ class BackendConfigurationPropertyWorkersPage extends PageWithNavbarPage {
126134
if (propertyWorker.surname) {
127135
this.createLastNameInput().should('be.visible').clear().type(propertyWorker.surname);
128136
}
137+
if (propertyWorker.workerEmail) {
138+
this.createEmailInput().should('be.visible').clear().type(propertyWorker.workerEmail);
139+
}
129140
if (propertyWorker.language) {
130141
selectLanguage('#profileLanguageSelector', propertyWorker.language);
131142
}
@@ -233,4 +244,5 @@ export class PropertyWorker {
233244
language?: string;
234245
properties?: string[];
235246
workOrderFlow?: boolean;
247+
workerEmail?: string;
236248
}

eform-client/e2e/Page objects/BackendConfiguration/BackendConfigurationPropertyWorkers.page.ts

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ class BackendConfigurationPropertyWorkersPage extends Page {
4646
return ele;
4747
}
4848

49+
public async createEmailInput(): Promise<WebdriverIO.Element> {
50+
const ele = await $('#workerEmail');
51+
await ele.waitForDisplayed({ timeout: 40000 });
52+
// ele.waitForClickable({timeout: 40000});
53+
return ele;
54+
}
55+
4956
async getFirstRowObject(): Promise<PropertyWorkerRowObject> {
5057
const result = new PropertyWorkerRowObject();
5158
return await result.getRow(1);
@@ -84,6 +91,13 @@ class BackendConfigurationPropertyWorkersPage extends Page {
8491
return ele;
8592
}
8693

94+
public async editEmailInput(): Promise<WebdriverIO.Element> {
95+
const ele = await $('#workerEmail');
96+
await ele.waitForDisplayed({ timeout: 40000 });
97+
// await ele.waitForClickable({ timeout: 40000 });
98+
return ele;
99+
}
100+
87101
public async saveEditBtn(): Promise<WebdriverIO.Element> {
88102
const ele = await $('#saveEditBtn');
89103
await ele.waitForDisplayed({ timeout: 40000 });
@@ -192,6 +206,11 @@ class BackendConfigurationPropertyWorkersPage extends Page {
192206
await backendConfigurationPropertyWorkersPage.createLastNameInput()
193207
).setValue(propertyWorker.surname);
194208
}
209+
if (propertyWorker.workerEmail) {
210+
await (
211+
await backendConfigurationPropertyWorkersPage.createEmailInput()
212+
).setValue(propertyWorker.workerEmail);
213+
}
195214
if (propertyWorker.language) {
196215
await (
197216
await (
@@ -335,6 +354,12 @@ export class PropertyWorkerRowObject {
335354
).setValue(propertyWorker.surname);
336355
await browser.pause(500);
337356
}
357+
if (propertyWorker.workerEmail) {
358+
await (
359+
await backendConfigurationPropertyWorkersPage.editEmailInput()
360+
).setValue(propertyWorker.workerEmail);
361+
await browser.pause(500);
362+
}
338363
if (propertyWorker.language) {
339364
await (
340365
await (
@@ -415,5 +440,6 @@ export class PropertyWorker {
415440
surname?: string;
416441
language?: string;
417442
properties?: number[];
418-
workOrderFlow?: boolean
443+
workOrderFlow?: boolean;
444+
workerEmail?: string;
419445
}

0 commit comments

Comments
 (0)