test(e2e): unique names for created objects by default (#5945)

* feat(e2e): default unique names for new objects

* refactor(e2e): reference generated object names

- Fixes the tests that were locating "Unnamed <object_type>" to use the generated unique names

* feat(e2e): add testInfo into domainObject notes

- adds info about the currently running test and its project to notes

* fix(e2e): fix selector for notes section

* feat: ARIA: menu role for menus and SuperMenus

- Implements the [ARIA: menu role](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/roles/menu_role) for Menus and SuperMenus,

* refactor(e2e): use role selectors for menu items

* refactor(e2e): better selectors for "OK" button

* refactor(e2e): better selectors for menu items

* refactor(e2e): improve selector

* refactor(e2e): update test to use appActions

* refactor(e2e): update test to use object name

* refactor(e2e): improve selectors for menu items

* test(e2e): fix search test

* refactor(e2e): update more plain 'text=' selectors

* fix: resolve codeQL error

- remove superfluous argument

* refactor(e2e): move testNotes to `pluginFixtures` and update imports

* refactor(e2e): remove unused fixture from test

* refactor: add dynamic id to form textareas

* refactor(e2e): improve notes textarea selector

* refactor(e2e): remove unused fixture
This commit is contained in:
Jesse Mazzella
2022-11-07 15:50:33 -08:00
committed by GitHub
parent 6abdbfdff0
commit d545124942
30 changed files with 238 additions and 238 deletions

View File

@ -36,27 +36,27 @@ test.describe('Restricted Notebook', () => {
});
test('Can be renamed @addInit', async ({ page }) => {
await expect(page.locator('.l-browse-bar__object-name')).toContainText(`Unnamed ${CUSTOM_NAME}`);
await expect(page.locator('.l-browse-bar__object-name')).toContainText(`${notebook.name}`);
});
test('Can be deleted if there are no locked pages @addInit', async ({ page, openmctConfig }) => {
test('Can be deleted if there are no locked pages @addInit', async ({ page }) => {
await openObjectTreeContextMenu(page, notebook.url);
const menuOptions = page.locator('.c-menu ul');
await expect.soft(menuOptions).toContainText('Remove');
const restrictedNotebookTreeObject = page.locator(`a:has-text("Unnamed ${CUSTOM_NAME}")`);
const restrictedNotebookTreeObject = page.locator(`a:has-text("${notebook.name}")`);
// notebook tree object exists
expect.soft(await restrictedNotebookTreeObject.count()).toEqual(1);
// Click Remove Text
await page.locator('text=Remove').click();
await page.locator('li[role="menuitem"]:has-text("Remove")').click();
// Click 'OK' on confirmation window and wait for save banner to appear
await Promise.all([
page.waitForNavigation(),
page.locator('text=OK').click(),
page.locator('button:has-text("OK")').click(),
page.waitForSelector('.c-message-banner__message')
]);
@ -134,7 +134,7 @@ test.describe('Restricted Notebook with at least one entry and with the page loc
// Click text=Ok
await Promise.all([
page.waitForNavigation(),
page.locator('text=Ok').click()
page.locator('button:has-text("OK")').click()
]);
// deleted page, should no longer exist
@ -145,10 +145,9 @@ test.describe('Restricted Notebook with at least one entry and with the page loc
test.describe('Restricted Notebook with a page locked and with an embed @addInit', () => {
test.beforeEach(async ({ page, openmctConfig }) => {
const { myItemsFolderName } = openmctConfig;
await startAndAddRestrictedNotebookObject(page);
await nbUtils.dragAndDropEmbed(page, myItemsFolderName);
test.beforeEach(async ({ page }) => {
const notebook = await startAndAddRestrictedNotebookObject(page);
await nbUtils.dragAndDropEmbed(page, notebook);
});
test('Allows embeds to be deleted if page unlocked @addInit', async ({ page }) => {