fix(e2e): remove webkit skip conditions (#21611)

* fix(e2e): remove webkit skip conditions

* chore: revert uniqueness spec to test others on ci

* fix(e2e): ctb navigation

* chore: ci config to speed up testing

* chore: revert lock

* chore(e2e): wip add webkit waiting

* chore: single out history spec changes for ci

* chore(e2e): use new webkit navigation for all affected test files

* chore(e2e): revert e2e ci config so all tests run again

* chore(e2e): temp skip uniqueness to test others

* chore(e2e): revert so all tests run again

* chore(e2e): re-skip uniqueness in webkit

* chore(e2e): revert workflow yaml

* chore(e2e): pr feedback

---------

Co-authored-by: Ben Irvin <ben.irvin@strapi.io>
This commit is contained in:
Jamie Howard 2024-10-17 16:19:03 +01:00 committed by GitHub
parent c23fb8e09d
commit 4cf36024d8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 107 additions and 118 deletions

View File

@ -1,7 +1,7 @@
import { test, expect, Page } from '@playwright/test';
import { login } from '../../utils/login';
import { resetDatabaseAndImportDataFromPath } from '../../utils/dts-import';
import { describeOnCondition, findAndClose } from '../../utils/shared';
import { clickAndWait, describeOnCondition, findAndClose, skipCtbTour } from '../../utils/shared';
import { resetFiles } from '../../utils/file-reset';
import { waitForRestart } from '../../utils/restart';
@ -37,6 +37,11 @@ const goToHistoryPage = async (page: Page) => {
}
};
const goToContentTypeBuilder = async (page: Page) => {
await clickAndWait(page, page.getByRole('link', { name: 'Content-Type Builder' }));
await skipCtbTour(page);
};
describeOnCondition(edition === 'EE')('History', () => {
test.beforeEach(async ({ page }) => {
await resetDatabaseAndImportDataFromPath('with-admin.tar', (cts) => cts, { coreStore: false });
@ -52,8 +57,8 @@ describeOnCondition(edition === 'EE')('History', () => {
});
test('A user should be able to restore a history version', async ({ page }) => {
await page.getByRole('link', { name: 'Content Manager' }).click();
await page.getByRole('link', { name: /Create new entry/, exact: true }).click();
await clickAndWait(page, page.getByRole('link', { name: 'Content Manager' }));
await clickAndWait(page, page.getByRole('link', { name: /Create new entry/, exact: true }));
await page.waitForURL(ARTICLE_CREATE_URL);
const titleInput = page.getByRole('textbox', { name: 'title' });
@ -87,10 +92,10 @@ describeOnCondition(edition === 'EE')('History', () => {
page,
}) => {
// Navigate to the content-manager - collection type - article
await page.getByRole('link', { name: 'Content Manager' }).click();
await clickAndWait(page, page.getByRole('link', { name: 'Content Manager' }));
await page.getByRole('combobox', { name: 'Select a locale' }).click();
await page.getByRole('option', { name: 'French (fr)' }).click();
await page.getByRole('link', { name: /Create new entry/, exact: true }).click();
await clickAndWait(page, page.getByRole('link', { name: /Create new entry/, exact: true }));
await page.waitForURL(ARTICLE_CREATE_URL);
/**
@ -111,8 +116,8 @@ describeOnCondition(edition === 'EE')('History', () => {
// Go back to the CM to create a new english entry
await page.goto('/admin');
await page.getByRole('link', { name: 'Content Manager' }).click();
await page.getByRole('link', { name: /Create new entry/, exact: true }).click();
await clickAndWait(page, page.getByRole('link', { name: 'Content Manager' }));
await clickAndWait(page, page.getByRole('link', { name: /Create new entry/, exact: true }));
await page.waitForURL(ARTICLE_CREATE_URL);
// Create an english version
@ -139,7 +144,7 @@ describeOnCondition(edition === 'EE')('History', () => {
await expect(page.getByText(frenchTitle)).not.toBeVisible();
// Go back to the entry
await page.getByRole('link', { name: 'Back' }).click();
await clickAndWait(page, page.getByRole('link', { name: 'Back' }));
/**
* Update
@ -160,7 +165,7 @@ describeOnCondition(edition === 'EE')('History', () => {
await expect(previousVersion.getByText('(current)')).not.toBeVisible();
// Go back to the entry
await page.getByRole('link', { name: 'Back' }).click();
await clickAndWait(page, page.getByRole('link', { name: 'Back' }));
/**
* Publish
@ -178,7 +183,7 @@ describeOnCondition(edition === 'EE')('History', () => {
await expect(titleInput).toHaveValue('Being from Kansas City');
// Go back to the entry
await page.getByRole('link', { name: 'Back' }).click();
await clickAndWait(page, page.getByRole('link', { name: 'Back' }));
/**
* Modified
@ -195,28 +200,20 @@ describeOnCondition(edition === 'EE')('History', () => {
await expect(titleInput).toHaveValue('Being from Kansas City, Missouri');
});
test('A user should see the relations and whether some are missing', async ({
page,
browserName,
}) => {
// TODO: there is a webkit bug to be fixed
if (browserName === 'webkit') {
return test.fixme();
}
test('A user should see the relations and whether some are missing', async ({ page }) => {
// Create new author
await page.getByRole('link', { name: 'Content Manager' }).click();
await page.getByRole('link', { name: 'Author' }).click();
await page.getByRole('link', { name: /Create new entry/, exact: true }).click();
await clickAndWait(page, page.getByRole('link', { name: 'Content Manager' }));
await clickAndWait(page, page.getByRole('link', { name: 'Author' }));
await clickAndWait(page, page.getByRole('link', { name: /Create new entry/, exact: true }));
await page.waitForURL(AUTHOR_CREATE_URL);
await page.getByRole('textbox', { name: 'name' }).fill('Will Kitman');
await page.getByRole('button', { name: 'Save' }).click();
await page.waitForURL(AUTHOR_EDIT_URL);
// Create new article and add authors to it
await page.getByRole('link', { name: 'Article' }).click();
await clickAndWait(page, page.getByRole('link', { name: 'Article' }));
await page.waitForURL(ARTICLE_LIST_URL);
await page.getByRole('link', { name: 'Create new entry' }).click();
await clickAndWait(page, page.getByRole('link', { name: 'Create new entry' }));
await page.getByRole('textbox', { name: 'title' }).fill('Zava retires');
await page.getByRole('combobox', { name: 'Authors' }).click();
await page.getByText('Will Kitman').click();
@ -226,14 +223,14 @@ describeOnCondition(edition === 'EE')('History', () => {
await page.waitForURL(ARTICLE_EDIT_URL);
// Delete one of the authors, leaving only Coach Beard
await page.getByRole('link', { name: 'Will Kitman' }).click();
await clickAndWait(page, page.getByRole('link', { name: 'Will Kitman' }));
await page.waitForURL(AUTHOR_EDIT_URL);
await page.getByRole('button', { name: /more actions/i }).click();
await page.getByRole('menuitem', { name: /delete entry/i }).click();
await page.getByRole('button', { name: /confirm/i }).click();
// Go to the the article's history page
await page.getByRole('link', { name: 'Article' }).click();
await clickAndWait(page, page.getByRole('link', { name: 'Article' }));
await page.getByRole('gridcell', { name: 'Zava retires' }).click();
await page.waitForURL(ARTICLE_EDIT_URL);
await goToHistoryPage(page);
@ -251,8 +248,8 @@ describeOnCondition(edition === 'EE')('History', () => {
/**
* Create an initial entry to also create an initial version
*/
await page.getByRole('link', { name: 'Content Manager' }).click();
await page.getByRole('link', { name: /Create new entry/, exact: true }).click();
await clickAndWait(page, page.getByRole('link', { name: 'Content Manager' }));
await clickAndWait(page, page.getByRole('link', { name: /Create new entry/, exact: true }));
await page.waitForURL(ARTICLE_CREATE_URL);
await page.getByRole('textbox', { name: 'title' }).fill('Being from Kansas');
await page.getByRole('textbox', { name: 'slug' }).fill('being-from-kansas');
@ -262,9 +259,7 @@ describeOnCondition(edition === 'EE')('History', () => {
/**
* Rename field in content-type builder
*/
await page.getByRole('link', { name: 'Content-Type Builder' }).click();
await page.waitForURL('**/content-type-builder');
await page.getByRole('link', { name: 'Article' }).click();
await goToContentTypeBuilder(page);
await page.waitForURL(
'/admin/plugins/content-type-builder/content-types/api::article.article'
);
@ -279,8 +274,8 @@ describeOnCondition(edition === 'EE')('History', () => {
* Update the existing entry to create another version
*/
await page.goto('/admin');
await page.getByRole('link', { name: 'Content Manager' }).click();
await page.getByRole('link', { name: 'Article' }).click();
await clickAndWait(page, page.getByRole('link', { name: 'Content Manager' }));
await clickAndWait(page, page.getByRole('link', { name: 'Article' }));
await page.getByRole('gridcell', { name: 'being-from-kansas' }).click();
await page.waitForURL(ARTICLE_EDIT_URL);
await page.getByRole('textbox', { name: 'titleRename' }).fill('Being from Kansas City');
@ -316,8 +311,8 @@ describeOnCondition(edition === 'EE')('History', () => {
/\/admin\/content-manager\/single-types\/api::homepage.homepage\/history(\?.*)?/;
// Navigate to the content-manager - single type - homepage
await page.getByRole('link', { name: 'Content Manager' }).click();
await page.getByRole('link', { name: 'Homepage' }).click();
await clickAndWait(page, page.getByRole('link', { name: 'Content Manager' }));
await clickAndWait(page, page.getByRole('link', { name: 'Homepage' }));
await page.getByRole('combobox', { name: 'Locales' }).click();
await page.getByRole('option', { name: 'French (fr)' }).click();
@ -335,7 +330,7 @@ describeOnCondition(edition === 'EE')('History', () => {
await expect(titleInput).toHaveValue(frenchTitle);
// Go back to the CM to create a new english entry
await page.getByRole('link', { name: 'Back' }).click();
await clickAndWait(page, page.getByRole('link', { name: 'Back' }));
await page.getByRole('combobox', { name: 'Locales' }).click();
await page.getByRole('option', { name: 'English (en)' }).click();
@ -362,7 +357,7 @@ describeOnCondition(edition === 'EE')('History', () => {
await expect(page.getByText(frenchTitle)).not.toBeVisible();
// Go back to the entry
await page.getByRole('link', { name: 'Back' }).click();
await clickAndWait(page, page.getByRole('link', { name: 'Back' }));
/**
* Update
@ -380,7 +375,7 @@ describeOnCondition(edition === 'EE')('History', () => {
await expect(titleInput).toHaveValue('AFC Richmond');
// Go back to the entry
await page.getByRole('link', { name: 'Back' }).click();
await clickAndWait(page, page.getByRole('link', { name: 'Back' }));
/**
* Publish
@ -399,7 +394,7 @@ describeOnCondition(edition === 'EE')('History', () => {
await expect(titleInput).toHaveValue('Welcome to AFC Richmond');
// Go back to the entry
await page.getByRole('link', { name: 'Back' }).click();
await clickAndWait(page, page.getByRole('link', { name: 'Back' }));
/**
* Modified
@ -415,18 +410,11 @@ describeOnCondition(edition === 'EE')('History', () => {
await expect(currentVersion.getByText('Modified')).toBeVisible();
});
test('A user should see the relations and whether some are missing', async ({
page,
browserName,
}) => {
// TODO: there is a webkit bug to be fixed
if (browserName === 'webkit') {
return test.fixme();
}
test('A user should see the relations and whether some are missing', async ({ page }) => {
// Create relation in Content-Type Builder
await page.getByRole('link', { name: 'Content-Type Builder' }).click();
await page.getByRole('link', { name: 'Homepage' }).click();
await goToContentTypeBuilder(page);
await clickAndWait(page, page.getByRole('link', { name: 'Homepage' }));
await page.waitForURL(
'/admin/plugins/content-type-builder/content-types/api::homepage.homepage'
);
@ -441,16 +429,18 @@ describeOnCondition(edition === 'EE')('History', () => {
await expect(page.getByRole('cell', { name: 'authors', exact: true })).toBeVisible();
// Create new author
await page.getByRole('link', { name: 'Content Manager' }).click();
await page.getByRole('link', { name: 'Author' }).click();
await page.getByRole('link', { name: /Create new entry/, exact: true }).click();
await clickAndWait(page, page.getByRole('link', { name: 'Content Manager' }));
// await page.waitForSelector('text=Author');
await clickAndWait(page, page.getByRole('link', { name: 'Author' }));
// await page.waitForSelector('text=Create new entry');
await clickAndWait(page, page.getByRole('link', { name: /Create new entry/, exact: true }));
await page.waitForURL(AUTHOR_CREATE_URL);
await page.getByRole('textbox', { name: 'name' }).fill('Will Kitman');
await page.getByRole('button', { name: 'Save' }).click();
await page.waitForURL(AUTHOR_EDIT_URL);
// Add author to homepage
await page.getByRole('link', { name: 'Homepage' }).click();
await clickAndWait(page, page.getByRole('link', { name: 'Homepage' }));
await page.waitForURL(HOMEPAGE_EDIT_URL);
await page.getByRole('combobox', { name: 'Authors' }).click();
await page.getByText('Will Kitman').click();
@ -459,14 +449,14 @@ describeOnCondition(edition === 'EE')('History', () => {
await page.getByRole('button', { name: 'Save' }).click();
// Delete one of the authors, leaving only Coach Beard
await page.getByRole('link', { name: 'Will Kitman' }).click();
await clickAndWait(page, page.getByRole('link', { name: 'Will Kitman' }));
await page.waitForURL(AUTHOR_EDIT_URL);
await page.getByRole('button', { name: /more actions/i }).click();
await page.getByRole('menuitem', { name: /delete entry/i }).click();
await page.getByRole('button', { name: /confirm/i }).click();
// Go to the the article's history page
await page.getByRole('link', { name: 'Homepage' }).click();
await clickAndWait(page, page.getByRole('link', { name: 'Homepage' }));
await page.waitForURL(HOMEPAGE_EDIT_URL);
await page.getByRole('button', { name: /more actions/i }).click();
await page.getByRole('menuitem', { name: /content history/i }).click();
@ -484,8 +474,8 @@ describeOnCondition(edition === 'EE')('History', () => {
/**
* Create an initial entry to also create an initial version
*/
await page.getByRole('link', { name: 'Content Manager' }).click();
await page.getByRole('link', { name: 'Homepage' }).click();
await clickAndWait(page, page.getByRole('link', { name: 'Content Manager' }));
await clickAndWait(page, page.getByRole('link', { name: 'Homepage' }));
await page.getByRole('textbox', { name: 'title' }).fill('Welcome to AFC Richmond');
await page.getByRole('button', { name: 'Save' }).click();
await findAndClose(page, 'Saved Document');
@ -493,10 +483,9 @@ describeOnCondition(edition === 'EE')('History', () => {
/**
* Rename field in content-type builder
*/
await page.getByRole('link', { name: 'Content-Type Builder' }).click();
await page.waitForURL('**/content-type-builder');
await goToContentTypeBuilder(page);
await page.getByRole('link', { name: 'Homepage' }).click();
await clickAndWait(page, page.getByRole('link', { name: 'Homepage' }));
await page.waitForURL(
'/admin/plugins/content-type-builder/content-types/api::homepage.homepage'
);
@ -511,8 +500,8 @@ describeOnCondition(edition === 'EE')('History', () => {
* Update the existing entry to create another version
*/
await page.goto('/admin');
await page.getByRole('link', { name: 'Content Manager' }).click();
await page.getByRole('link', { name: 'Homepage' }).click();
await clickAndWait(page, page.getByRole('link', { name: 'Content Manager' }));
await clickAndWait(page, page.getByRole('link', { name: 'Homepage' }));
await page.getByRole('textbox', { name: 'titleRename' }).fill('Welcome to AFC Richmond!');
await page.getByRole('button', { name: 'Save' }).click();
await findAndClose(page, 'Saved Document');

View File

@ -1,7 +1,7 @@
import { test, expect, Page } from '@playwright/test';
import { login } from '../../utils/login';
import { resetDatabaseAndImportDataFromPath } from '../../utils/dts-import';
import { findAndClose } from '../../utils/shared';
import { findAndClose, clickAndWait } from '../../utils/shared';
type Field = {
name: string;
@ -20,8 +20,8 @@ test.describe('Uniqueness', () => {
await page.goto('/admin');
await login({ page });
await page.getByRole('link', { name: 'Content Manager' }).click();
await page.getByRole('link', { name: 'Unique' }).click();
await clickAndWait(page, page.getByRole('link', { name: 'Content Manager' }));
await clickAndWait(page, page.getByRole('link', { name: 'Unique' }));
});
const SCALAR_FIELDS: Field[] = [
@ -101,8 +101,8 @@ test.describe('Uniqueness', () => {
const clickSave = async (page: Page) => {
await page.getByRole('button', { name: 'Save' }).isEnabled();
await page.getByRole('tab', { name: 'Draft' }).click();
await page.getByRole('button', { name: 'Save' }).click();
await clickAndWait(page, page.getByRole('tab', { name: 'Draft' }));
await clickAndWait(page, page.getByRole('button', { name: 'Save' }));
await expect(page.getByText('Saved document')).toBeVisible();
};
@ -114,20 +114,20 @@ test.describe('Uniqueness', () => {
// testing against
if (isSingle) {
await page.getByRole('button', { name: 'No entry yet. Click' }).first().click();
await page.getByRole('button', { name: 'No entry yet. Click' }).first().click();
await clickAndWait(page, page.getByRole('button', { name: 'No entry yet. Click' }).first());
await clickAndWait(page, page.getByRole('button', { name: 'No entry yet. Click' }).first());
} else {
await page.getByRole('button', { name: 'No entry yet. Click' }).nth(1).click();
await page
.getByLabel('', { exact: true })
.getByRole('button', { name: 'No entry yet. Click' })
.click();
await clickAndWait(page, page.getByRole('button', { name: 'No entry yet. Click' }).nth(1));
await clickAndWait(
page,
page.getByLabel('', { exact: true }).getByRole('button', { name: 'No entry yet. Click' })
);
}
}
};
const createNewEntry = async (page: Page, url: RegExp) => {
await page.getByRole('link', { name: 'Create new entry' }).first().click();
await clickAndWait(page, page.getByRole('link', { name: 'Create new entry' }).first());
await page.waitForURL(url);
};
@ -137,22 +137,22 @@ test.describe('Uniqueness', () => {
};
const publishDocument = async (page: Page) => {
await page.getByRole('button', { name: 'Publish' }).click();
await clickAndWait(page, page.getByRole('button', { name: 'Publish' }));
await expect(page.getByText('Published document')).toBeVisible();
};
const navigateToListView = async (page: Page) => {
await page.getByRole('link', { name: 'Unique' }).click();
await clickAndWait(page, page.getByRole('link', { name: 'Unique' }));
if (await page.getByText('Confirmation').isVisible()) {
await page.getByRole('button', { name: 'Confirm' }).click();
await clickAndWait(page, page.getByRole('button', { name: 'Confirm' }));
}
await page.waitForURL(LIST_URL);
};
const changeLocale = async (page: Page, locale: string) => {
await page.getByRole('combobox', { name: 'Select a locale' }).click();
await page.getByText(locale).click();
await clickAndWait(page, page.getByRole('combobox', { name: 'Select a locale' }));
await clickAndWait(page, page.getByText(locale));
};
/**
@ -179,6 +179,7 @@ test.describe('Uniqueness', () => {
if (browserName === 'webkit') {
return test.fixme();
}
await createNewEntry(page, CREATE_URL);
const fieldRole = 'role' in field ? field.role : 'textbox';
@ -187,17 +188,20 @@ test.describe('Uniqueness', () => {
if (isRepeatableComponentField) {
// If the field is a repeatable component field, we add an entry and fill
// it with the same value to test uniqueness within the same entity.
await page.getByRole('button', { name: 'Add an entry' }).click();
await page.getByRole('region').getByRole('button', { name: 'No entry yet. Click' }).click();
await clickAndWait(page, page.getByRole('button', { name: 'Add an entry' }));
await clickAndWait(
page,
page.getByRole('region').getByRole('button', { name: 'No entry yet. Click' })
);
await page.getByRole(fieldRole, { name: field.name }).fill(field.value);
await clickSave(page);
await findAndClose(page, 'Saved document');
await page.getByRole('button', { name: 'Publish' }).click();
await clickAndWait(page, page.getByRole('button', { name: 'Publish' }));
await expect(page.getByText('Warning:2 errors occurred')).toBeVisible();
await page.getByRole('button', { name: 'Delete' }).nth(1).click();
await clickAndWait(page, page.getByRole('button', { name: 'Delete' }).nth(1));
}
await clickSave(page);
@ -222,7 +226,7 @@ test.describe('Uniqueness', () => {
await clickSave(page);
await findAndClose(page, 'Saved document');
await page.getByRole('button', { name: 'Publish' }).click();
await clickAndWait(page, page.getByRole('button', { name: 'Publish' }));
await expect(page.getByText('Warning:This attribute must be unique')).toBeVisible();
await navigateToListView(page);

View File

@ -3,6 +3,7 @@ import { login } from '../../../utils/login';
import { resetDatabaseAndImportDataFromPath } from '../../../utils/dts-import';
import { waitForRestart } from '../../../utils/restart';
import { resetFiles } from '../../../utils/file-reset';
import { clickAndWait } from '../../../utils/shared';
test.describe('Create collection type', () => {
// very long timeout for these tests because they restart the server multiple times
@ -14,7 +15,7 @@ test.describe('Create collection type', () => {
await page.goto('/admin');
await login({ page });
await page.getByRole('link', { name: 'Content-Type Builder' }).click();
await clickAndWait(page, page.getByRole('link', { name: 'Content-Type Builder' }));
// close the tutorial modal if it's visible
const modal = page.getByRole('button', { name: 'Close' });
@ -31,7 +32,7 @@ test.describe('Create collection type', () => {
});
test('Can create a collection type', async ({ page, browserName }) => {
await page.getByRole('button', { name: 'Create new collection type' }).click();
await clickAndWait(page, page.getByRole('button', { name: 'Create new collection type' }));
await expect(page.getByRole('heading', { name: 'Create a collection type' })).toBeVisible();
@ -44,20 +45,15 @@ test.describe('Create collection type', () => {
const pluralId = page.getByLabel('API ID (Plural)');
await expect(pluralId).toHaveValue('secret-documents');
await page.getByRole('button', { name: 'Continue' }).click();
await clickAndWait(page, page.getByRole('button', { name: 'Continue' }));
await expect(page.getByText('Select a field for your collection type')).toBeVisible();
// TODO: fix the bug that causes webkit location to be off
if (browserName === 'webkit') {
return test.fixme();
}
await page.getByText('Small or long text').click();
await clickAndWait(page, page.getByText('Small or long text'));
await page.getByLabel('Name', { exact: true }).fill('myattribute');
await page.getByRole('button', { name: 'Finish' }).click();
await page.getByRole('button', { name: 'Save' }).click();
await clickAndWait(page, page.getByRole('button', { name: 'Finish' }));
await clickAndWait(page, page.getByRole('button', { name: 'Save' }));
await waitForRestart(page);

View File

@ -3,6 +3,7 @@ import { login } from '../../../utils/login';
import { resetDatabaseAndImportDataFromPath } from '../../../utils/dts-import';
import { waitForRestart } from '../../../utils/restart';
import { resetFiles } from '../../../utils/file-reset';
import { clickAndWait } from '../../../utils/shared';
test.describe('Create collection type', () => {
// very long timeout for these tests because they restart the server multiple times
@ -14,7 +15,7 @@ test.describe('Create collection type', () => {
await page.goto('/admin');
await login({ page });
await page.getByRole('link', { name: 'Content-Type Builder' }).click();
await clickAndWait(page, page.getByRole('link', { name: 'Content-Type Builder' }));
// close the tutorial modal if it's visible
const modal = page.getByRole('button', { name: 'Close' });
@ -31,7 +32,7 @@ test.describe('Create collection type', () => {
});
test('Can create a single type', async ({ page, browserName }) => {
await page.getByRole('button', { name: 'Create new single type' }).click();
await clickAndWait(page, page.getByRole('button', { name: 'Create new single type' }));
await expect(page.getByRole('heading', { name: 'Create a single type' })).toBeVisible();
@ -44,20 +45,15 @@ test.describe('Create collection type', () => {
const pluralId = page.getByLabel('API ID (Plural)');
await expect(pluralId).toHaveValue('secret-documents');
await page.getByRole('button', { name: 'Continue' }).click();
await clickAndWait(page, page.getByRole('button', { name: 'Continue' }));
await expect(page.getByText('Select a field for your single type')).toBeVisible();
// TODO: fix the bug that causes webkit location to be off
if (browserName === 'webkit') {
return test.fixme();
}
await page.getByText('Small or long text').click();
await clickAndWait(page, page.getByText('Small or long text'));
await page.getByLabel('Name', { exact: true }).fill('myattribute');
await page.getByRole('button', { name: 'Finish' }).click();
await page.getByRole('button', { name: 'Save' }).click();
await clickAndWait(page, page.getByRole('button', { name: 'Finish' }));
await clickAndWait(page, page.getByRole('button', { name: 'Save' }));
await waitForRestart(page);

View File

@ -370,11 +370,6 @@ test.describe('Edit view', () => {
});
test('As a user I want to publish multiple locales of my document', async ({ page, browser }) => {
if (browser.browserType().name() === 'webkit') {
// See DX-1550
return test.fixme();
}
const LIST_URL = /\/admin\/content-manager\/collection-types\/api::article.article(\?.*)?/;
const EDIT_URL =
/\/admin\/content-manager\/collection-types\/api::article.article\/[^/]+(\?.*)?/;
@ -461,11 +456,6 @@ test.describe('Edit view', () => {
page,
browser,
}) => {
if (browser.browserType().name() === 'webkit') {
// See DX-1550
return test.fixme();
}
const LIST_URL = /\/admin\/content-manager\/collection-types\/api::article.article(\?.*)?/;
const EDIT_URL =
/\/admin\/content-manager\/collection-types\/api::article.article\/[^/]+(\?.*)?/;

View File

@ -75,6 +75,20 @@ export const skipCtbTour = async (page: Page) => {
}
};
/**
* Clicks on a link and waits for the page to load completely.
*
* NOTE: this util is used to avoid inconsistent behaviour on webkit
*
*/
export const clickAndWait = async (page: Page, locator: Locator) => {
await locator.click();
if (page.context().browser()?.browserType().name() === 'webkit') {
await page.waitForLoadState('networkidle');
}
};
/**
* Look for an element containing text, and then click a sibling close button
*/