Skip to content

Commit 0fe1be9

Browse files
renemadsenclaude
andcommitted
fix: resolve Playwright test failures in jobs B and C
- Add .trim() to all textContent() calls in PlanningRowObject to fix whitespace comparison failures - Increase selectFolder treeViewport timeout from 2000ms to 20000ms - Fix pairing spec hook timeouts using testInfo.setTimeout(240000) in beforeAll/afterAll - Add wait after createTag for DOM update in tags spec - Increase import test timeouts for slower CI environment Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ce444f6 commit 0fe1be9

5 files changed

Lines changed: 16 additions & 13 deletions

File tree

eform-client/playwright/e2e/plugins/items-planning-pn/ItemsPlanningModal.page.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class ItemsPlanningModalPage {
3939
const treeViewport = this.page.locator('app-eform-tree-view-picker');
4040
await treeViewport.waitFor({ state: 'visible', timeout: 20000 });
4141
await this.page.locator('.folder-tree-name', { hasText: nameFolder }).first().click();
42-
await treeViewport.waitFor({ state: 'hidden', timeout: 2000 });
42+
await treeViewport.waitFor({ state: 'hidden', timeout: 20000 });
4343
}
4444

4545
public get createFolderName(): Locator {

eform-client/playwright/e2e/plugins/items-planning-pn/ItemsPlanningPlanningPage.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -265,10 +265,10 @@ export class PlanningRowObject {
265265
this.checkboxDelete = this.row.locator('.cdk-column-MtxGridCheckboxColumnDef mat-checkbox');
266266
this.checkboxDeleteForClick = this.row.locator('.cdk-column-MtxGridCheckboxColumnDef mat-checkbox label');
267267
this.id = +(await this.row.locator('.cdk-column-id span').textContent() || '0');
268-
this.name = (await this.row.locator('.cdk-column-translatedName span').textContent()) || '';
269-
this.description = (await this.row.locator('.cdk-column-description span').textContent()) || '';
270-
this.folderName = (await this.row.locator('.cdk-column-folder-eFormSdkFolderName span').textContent()) || '';
271-
this.eFormName = (await this.row.locator('.cdk-column-planningRelatedEformName span').textContent()) || '';
268+
this.name = ((await this.row.locator('.cdk-column-translatedName span').textContent()) || '').trim();
269+
this.description = ((await this.row.locator('.cdk-column-description span').textContent()) || '').trim();
270+
this.folderName = ((await this.row.locator('.cdk-column-folder-eFormSdkFolderName span').textContent()) || '').trim();
271+
this.eFormName = ((await this.row.locator('.cdk-column-planningRelatedEformName span').textContent()) || '').trim();
272272

273273
const tagsText = (await this.row.locator('.cdk-column-tags').textContent()) || '';
274274
const tags = tagsText.split('discount');
@@ -278,10 +278,10 @@ export class PlanningRowObject {
278278
}
279279

280280
this.repeatEvery = +(await this.row.locator('.cdk-column-reiteration-repeatEvery span').textContent() || '0');
281-
this.repeatType = (await this.row.locator('.cdk-column-reiteration-repeatType span').textContent()) || '';
282-
this.planningDayOfWeek = (await this.row.locator('.cdk-column-reiteration-dayOfWeek span').textContent()) || '';
283-
this.lastExecution = (await this.row.locator('.cdk-column-lastExecutedTime span').textContent()) || '';
284-
this.nextExecution = (await this.row.locator('.cdk-column-nextExecutionTime span').textContent()) || '';
281+
this.repeatType = ((await this.row.locator('.cdk-column-reiteration-repeatType span').textContent()) || '').trim();
282+
this.planningDayOfWeek = ((await this.row.locator('.cdk-column-reiteration-dayOfWeek span').textContent()) || '').trim();
283+
this.lastExecution = ((await this.row.locator('.cdk-column-lastExecutedTime span').textContent()) || '').trim();
284+
this.nextExecution = ((await this.row.locator('.cdk-column-nextExecutionTime span').textContent()) || '').trim();
285285
this.pairingBtn = this.row.locator('.cdk-column-actions button').nth(0);
286286
this.updateBtn = this.row.locator('.cdk-column-actions button').nth(1);
287287
if (!skipDelete) {

eform-client/playwright/e2e/plugins/items-planning-pn/c/items-planning.import.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ test.describe.serial('Items planning - Import', () => {
3535
const filePath = path.join(localPath, 'e2e', 'Assets', 'Skabelon Døvmark NEW.xlsx');
3636
await page.locator('app-eforms-bulk-import-modal * *').first().waitFor({ state: 'visible', timeout: 20000 });
3737
await myEformsPage.xlsxImportInput().setInputFiles(filePath);
38-
await myEformsPage.newEformBtn().waitFor({ state: 'visible', timeout: 60000 });
39-
await page.waitForTimeout(2000);
38+
await myEformsPage.newEformBtn().waitFor({ state: 'visible', timeout: 120000 });
39+
await page.waitForTimeout(5000);
4040
expect(eformsBeforeImport).not.toBe(await myEformsPage.rowNum());
4141

4242
await itemsPlanningPlanningPage.goToPlanningsPage();

eform-client/playwright/e2e/plugins/items-planning-pn/c/items-planning.pairing.spec.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ const countPlanning = 4;
2222

2323
test.describe.serial('Items planning plugin - Pairing', () => {
2424
test.describe.configure({ timeout: 240000 });
25-
test.beforeAll(async ({ browser }) => {
25+
test.beforeAll(async ({ browser }, testInfo) => {
26+
testInfo.setTimeout(240000);
2627
page = await browser.newPage();
2728
const loginPage = new LoginPage(page);
2829
const myEformsPage = new MyEformsPage(page);
@@ -80,7 +81,8 @@ test.describe.serial('Items planning plugin - Pairing', () => {
8081
await itemsPlanningPairingPage.goToPairingPage();
8182
});
8283

83-
test.afterAll(async () => {
84+
test.afterAll(async ({}, testInfo) => {
85+
testInfo.setTimeout(240000);
8486
const myEformsPage = new MyEformsPage(page);
8587
const foldersPage = new FoldersPage(page);
8688
const deviceUsersPage = new DeviceUsersPage(page);

eform-client/playwright/e2e/plugins/items-planning-pn/c/items-planning.tags.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ test.describe.serial('Items planning - Tags', () => {
2828
const tagsModalPage = new TagsModalPage(page);
2929
const tagsRowsBeforeCreate = await tagsModalPage.rowNum();
3030
await tagsModalPage.createTag(tagName);
31+
await page.waitForTimeout(1000);
3132
const tagsRowsAfterCreate = await tagsModalPage.rowNum();
3233
const tagRowObject = new TagRowObject(page);
3334
const tagRowObj = await tagRowObject.getRow(tagsRowsAfterCreate);

0 commit comments

Comments
 (0)