From 2624f435481949dd7ff47e54345372be0f21688d Mon Sep 17 00:00:00 2001 From: Jamie V Date: Mon, 28 Apr 2025 12:36:38 -0700 Subject: [PATCH] fixing some couch tests affected by tab updtaes --- .../displayLayout/displayLayout.e2e.spec.js | 22 +++++++++---------- .../notebook/notebookWithCouchDB.e2e.spec.js | 7 +++--- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/e2e/tests/functional/plugins/displayLayout/displayLayout.e2e.spec.js b/e2e/tests/functional/plugins/displayLayout/displayLayout.e2e.spec.js index a2e8fd42a7..c97d507954 100644 --- a/e2e/tests/functional/plugins/displayLayout/displayLayout.e2e.spec.js +++ b/e2e/tests/functional/plugins/displayLayout/displayLayout.e2e.spec.js @@ -236,7 +236,7 @@ test.describe('Display Layout', () => { name: new RegExp(sineWaveObject.name) }); await sineWaveGeneratorTreeItem.dragTo(page.getByLabel('Layout Grid')); - await page.locator('button[title="Save"]').click(); + await page.getByLabel('Save', { exact: true }).click(); await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); // Subscribe to the Sine Wave Generator data @@ -278,7 +278,7 @@ test.describe('Display Layout', () => { name: new RegExp(sineWaveObject.name) }); await sineWaveGeneratorTreeItem.dragTo(page.getByLabel('Layout Grid')); - await page.locator('button[title="Save"]').click(); + await page.getByLabel('Save', { exact: true }).click(); await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); // Subscribe to the Sine Wave Generator data @@ -317,7 +317,7 @@ test.describe('Display Layout', () => { name: new RegExp(sineWaveObject.name) }); await sineWaveGeneratorTreeItem.dragTo(page.getByLabel('Layout Grid')); - await page.locator('button[title="Save"]').click(); + await page.getByLabel('Save', { exact: true }).click(); await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); expect.soft(await page.locator('.l-layout .l-layout__frame').count()).toEqual(1); @@ -358,7 +358,7 @@ test.describe('Display Layout', () => { name: new RegExp(sineWaveObject.name) }); await sineWaveGeneratorTreeItem.dragTo(page.getByLabel('Layout Grid')); - await page.locator('button[title="Save"]').click(); + await page.getByLabel('Save', { exact: true }).click(); await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); expect.soft(await page.locator('.l-layout .l-layout__frame').count()).toEqual(1); @@ -413,7 +413,7 @@ test.describe('Display Layout', () => { await page.locator('div[title="Resize object width"] > input').click(); await page.locator('div[title="Resize object width"] > input').fill('70'); - await page.locator('button[title="Save"]').click(); + await page.getByLabel('Save', { exact: true }).click(); await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); const startDate = '2021-12-30 01:01:00.000Z'; @@ -429,7 +429,7 @@ test.describe('Display Layout', () => { await expect(page.getByText('2021-12-30 01:11:00.000Z')).toBeHidden(); }); - test('When multiple plots are contained in a layout, we only ask for annotations once @couchdb @network', async ({ + test.only('When multiple plots are contained in a layout, we only ask for annotations once @couchdb @network', async ({ page }) => { await setFixedTimeMode(page); @@ -473,7 +473,7 @@ test.describe('Display Layout', () => { await page.getByText('View type').click(); await page.getByText('Overlay Plot').click(); - await page.getByLabel('Save').click(); + await page.getByLabel('Save', { exact: true }).click(); await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); // Time to inspect some network traffic @@ -531,7 +531,7 @@ test.describe('Display Layout', () => { await stateGeneratorTreeItem.click({ button: 'right' }); await page.getByLabel('Edit Properties...').click(); await page.getByLabel('State Duration (seconds)', { exact: true }).fill('0.1'); - await page.getByLabel('Save').click(); + await page.getByLabel('Save', { exact: true }).click(); // Create a Table for filtering ON values const tableFilterOnValue = await createDomainObjectWithDefaults(page, { @@ -555,14 +555,14 @@ test.describe('Display Layout', () => { await page.goto(tableFilterOnValue.url); await stateGeneratorTreeItem.dragTo(page.getByLabel('Object View')); await selectFilterOption(page, '1'); - await page.getByLabel('Save').click(); + await page.getByLabel('Save', { exact: true }).click(); await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); // Navigate to OFF filtering table and add state generator and setup filters await page.goto(tableFilterOffValue.url); await stateGeneratorTreeItem.dragTo(page.getByLabel('Object View')); await selectFilterOption(page, '0'); - await page.getByLabel('Save').click(); + await page.getByLabel('Save', { exact: true }).click(); await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); // Navigate to the display layout and edit it @@ -586,7 +586,7 @@ test.describe('Display Layout', () => { // eslint-disable-next-line playwright/no-force-option force: true }); - await page.getByLabel('Save').click(); + await page.getByLabel('Save', { exact: true }).click(); await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); // Get the tables so we can verify filtering is working as expected diff --git a/e2e/tests/functional/plugins/notebook/notebookWithCouchDB.e2e.spec.js b/e2e/tests/functional/plugins/notebook/notebookWithCouchDB.e2e.spec.js index 62e9df6229..e6c1d88963 100644 --- a/e2e/tests/functional/plugins/notebook/notebookWithCouchDB.e2e.spec.js +++ b/e2e/tests/functional/plugins/notebook/notebookWithCouchDB.e2e.spec.js @@ -47,8 +47,6 @@ test.describe('Notebook Tests with CouchDB @couchdb @network', () => { }); test('Inspect Notebook Entry Network Requests', async ({ page }) => { - //Ensure we're on the annotations Tab in the inspector - await page.getByText('Annotations').click(); // Expand sidebar await page.locator('.c-notebook__toggle-nav-button').click(); @@ -86,6 +84,9 @@ test.describe('Notebook Tests with CouchDB @couchdb @network', () => { await page.waitForLoadState('networkidle'); expect(notebookElementsRequests.length).toBeLessThanOrEqual(2); + //Ensure we're on the annotations Tab in the inspector + await page.getByText('Annotations').click(); + // Add some tags // Network Requests are for each tag creation are: // 1) Getting the original path of the parent object @@ -180,8 +181,8 @@ test.describe('Notebook Tests with CouchDB @couchdb @network', () => { type: 'issue', description: 'https://github.com/akhenry/openmct-yamcs/issues/69' }); - await page.getByText('Annotations').click(); await nbUtils.enterTextEntry(page, 'First Entry'); + await page.getByText('Annotations').click(); // Add three tags await addTagAndAwaitNetwork(page, 'Science');