Skip to content

Commit 4277be0

Browse files
🧪 FT_0103 + optimized helper
1 parent 51f52b5 commit 4277be0

4 files changed

Lines changed: 37 additions & 12 deletions

File tree

others/playwright/playwright-report/index.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"status": "passed",
3+
"failedTests": []
4+
}

others/playwright/tests/links.spec.ts

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@ import {
1010
} from '../tools/helpers';
1111

1212
const DOMAIN = 'FtDomain';
13+
const INLINE_DOMAIN = 'FtDomainInline';
1314
const O2M_OBJECT = 'FtRelationshipO2m';
1415
const M2M_OBJECT = 'FtRelationshipM2m';
1516
const M2M_CHILD_OBJECT = 'FtM2mChild';
17+
const INLINE_OBJECT = 'FtObjInlineParent';
18+
const INLINE_CHILD = 'FtObjInlineChild';
1619

1720
const O2M_FORM = '#form_FtRelationshipO2m_the_ajax_FtRelationshipO2m_0';
1821
const O2M_CHILD_PANEL = '#list_FtO2mChild_panel_ajax_FtO2mChild_ftO2mcO2mId';
@@ -51,7 +54,7 @@ test('FT_0104', {
5154
await childPanel.locator("[data-action='create']").click();
5255
await skeletonDismissed(page);
5356

54-
await expect(page.locator('#field_ftO2mcO2mId__ftO2mCode')).toContainText(o2mCode);
57+
await expect(page.locator('#field_ftO2mcO2mId__ftO2mCode')).toHaveValue(o2mCode);
5558
const childCode = randomString(10);
5659
await page.locator('#field_ftO2mcCode').fill(childCode);
5760
await page.locator("[data-action='saveclose']").click();
@@ -98,3 +101,26 @@ test('FT_0107', {
98101

99102
await expect(page.locator(`[data-list='${M2M_PANEL_LIST_DATA}'] tr`)).toHaveCount(2);
100103
});
104+
105+
106+
test('FT_0103', {
107+
annotation: {
108+
type: 'feature',
109+
description: 'Creates a parent with an inlined child object, fills parent and child fields, saves, and verifies parent description is updated by child hooks.'
110+
},
111+
}, async ({ page }) => {
112+
await openList(page, INLINE_DOMAIN, INLINE_OBJECT);
113+
114+
await page.locator("[data-action='create']").click();
115+
await skeletonDismissed(page);
116+
117+
await expect(page.locator(`[data-object='${INLINE_CHILD}']`)).toHaveAttribute('data-rowid', '0');
118+
await page.locator("#field_ftObjInlineParentName").fill(randomString(10));
119+
await page.locator("#field_ftObjInlineName_idftObjInlineChildParentId").fill(randomString(10));
120+
121+
await page.locator("[data-action='save']").click();
122+
await expect(page.locator("#field_ftObjInlineParentDescription")).toHaveValue("Updated by child postCreate");
123+
124+
await page.locator("[data-action='save']").click();
125+
await expect(page.locator("#field_ftObjInlineParentDescription")).toHaveValue("Updated by child postUpdate");
126+
});

others/playwright/tools/helpers.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,11 @@ export function randomString(length: number) {
8181
}
8282

8383
export async function openList(page: Page, domain: string, object: string, path?: string) {
84-
/*if (!(await page.locator(`[data-obj='${object}']`).isVisible())) {
85-
if (path) {
86-
let parent = path.split('.')[0];
87-
if (parent) {
88-
await page.locator(`[data-domain='${parent}']`).click();
89-
await page.locator(` [data-path='${path}']`).click();
90-
}
91-
} else {
84+
await expect(page.locator("ul.main-menu")).toBeVisible();
85+
const objVisible = await page.locator(`[data-obj='${object}']`).isVisible();
86+
if (!objVisible) {
9287
await page.locator(`[data-domain='${domain}']`).click();
93-
}
94-
} */
88+
}
89+
await expect(page.locator(`[data-obj='${object}']`)).toBeVisible();
9590
await page.locator(`[data-obj='${object}']`).click();
9691
}

0 commit comments

Comments
 (0)