diff --git a/test/fields/e2e.spec.ts b/test/fields/e2e.spec.ts index ac9fe2b4eb..cfa9c7dd4b 100644 --- a/test/fields/e2e.spec.ts +++ b/test/fields/e2e.spec.ts @@ -86,7 +86,7 @@ describe('fields', () => { const json = page.locator('.json-field .inputarea'); await json.fill(input); - await saveDocAndAssert(page); + await saveDocAndAssert(page, '.form-submit button'); await expect(page.locator('.json-field')).toContainText('"foo": "bar"'); }); }); diff --git a/test/helpers.ts b/test/helpers.ts index 69ea35f90d..40afe7d681 100644 --- a/test/helpers.ts +++ b/test/helpers.ts @@ -36,8 +36,8 @@ export async function login(args: LoginArgs): Promise { await page.waitForURL(`${serverURL}/admin`); } -export async function saveDocAndAssert(page: Page): Promise { - await page.click('#action-save', { delay: 100 }); +export async function saveDocAndAssert(page: Page, selector = '#action-save'): Promise { + await page.click(selector, { delay: 100 }); await expect(page.locator('.Toastify')).toContainText('successfully'); expect(page.url()).not.toContain('create'); }