Skip some tests, fix a mislabeled test, and add default condition for tabs (#7422)

* wrong format

* skip the flake for now

* Add Tabs test

* one more flake
This commit is contained in:
John Hill 2024-01-28 16:28:49 -08:00 committed by GitHub
parent dc5a3236b3
commit 735c8236e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 95 additions and 49 deletions

View File

@ -35,7 +35,7 @@ import { expect, test } from '../../../../pluginFixtures.js';
let conditionSetUrl; let conditionSetUrl;
test.describe.serial('Condition Set CRUD Operations on @localStorage', () => { test.describe.serial('Condition Set CRUD Operations on @localStorage @2p', () => {
test.beforeAll(async ({ browser }) => { test.beforeAll(async ({ browser }) => {
//TODO: This needs to be refactored //TODO: This needs to be refactored
const context = await browser.newContext(); const context = await browser.newContext();
@ -68,30 +68,35 @@ test.describe.serial('Condition Set CRUD Operations on @localStorage', () => {
}); });
//Begin suite of tests again localStorage //Begin suite of tests again localStorage
test('Condition set object properties persist in main view and inspector @localStorage', async ({ test.fixme(
page 'Condition set object properties persist in main view and inspector @localStorage',
}) => { async ({ page }) => {
//Navigate to baseURL with injected localStorage test.info().annotations.push({
await page.goto(conditionSetUrl, { waitUntil: 'networkidle' }); type: 'issue',
description: 'https://github.com/nasa/openmct/issues/7421'
});
//Navigate to baseURL with injected localStorage
await page.goto(conditionSetUrl, { waitUntil: 'networkidle' });
//Assertions on loaded Condition Set in main view. This is a stateful transition step after page.goto() //Assertions on loaded Condition Set in main view. This is a stateful transition step after page.goto()
await expect await expect
.soft(page.locator('.l-browse-bar__object-name')) .soft(page.locator('.l-browse-bar__object-name'))
.toContainText('Unnamed Condition Set'); .toContainText('Unnamed Condition Set');
//Assertions on loaded Condition Set in Inspector //Assertions on loaded Condition Set in Inspector
expect.soft(page.locator('_vue=item.name=Unnamed Condition Set')).toBeTruthy(); expect.soft(page.locator('_vue=item.name=Unnamed Condition Set')).toBeTruthy();
//Reload Page //Reload Page
await Promise.all([page.reload(), page.waitForLoadState('networkidle')]); await Promise.all([page.reload(), page.waitForLoadState('networkidle')]);
//Re-verify after reload //Re-verify after reload
await expect await expect
.soft(page.locator('.l-browse-bar__object-name')) .soft(page.locator('.l-browse-bar__object-name'))
.toContainText('Unnamed Condition Set'); .toContainText('Unnamed Condition Set');
//Assertions on loaded Condition Set in Inspector //Assertions on loaded Condition Set in Inspector
expect.soft(page.locator('_vue=item.name=Unnamed Condition Set')).toBeTruthy(); expect.soft(page.locator('_vue=item.name=Unnamed Condition Set')).toBeTruthy();
}); }
);
test('condition set object can be modified on @localStorage', async ({ page, openmctConfig }) => { test('condition set object can be modified on @localStorage', async ({ page, openmctConfig }) => {
const { myItemsFolderName } = openmctConfig; const { myItemsFolderName } = openmctConfig;

View File

@ -136,7 +136,11 @@ test.describe('Gauge', () => {
// TODO: Verify changes in the UI // TODO: Verify changes in the UI
}); });
test('Gauge does not display NaN when data not available', async ({ page }) => { test.fixme('Gauge does not display NaN when data not available', async ({ page }) => {
test.info().annotations.push({
type: 'issue',
description: 'https://github.com/nasa/openmct/issues/7421'
});
// Create a Gauge // Create a Gauge
const gauge = await createDomainObjectWithDefaults(page, { const gauge = await createDomainObjectWithDefaults(page, {
type: 'Gauge' type: 'Gauge'

View File

@ -226,31 +226,37 @@ test.describe('Overlay Plot', () => {
expect(yAxis3Group.getByRole('listitem').nth(0).getByText(swgB.name)).toBeTruthy(); expect(yAxis3Group.getByRole('listitem').nth(0).getByText(swgB.name)).toBeTruthy();
}); });
test('Clicking on an item in the elements pool brings up the plot preview with data points', async ({ test.fixme(
page 'Clicking on an item in the elements pool brings up the plot preview with data points',
}) => { async ({ page }) => {
const overlayPlot = await createDomainObjectWithDefaults(page, { test.info().annotations.push({
type: 'Overlay Plot' type: 'issue',
}); description: 'https://github.com/nasa/openmct/issues/7421'
});
const swgA = await createDomainObjectWithDefaults(page, { const overlayPlot = await createDomainObjectWithDefaults(page, {
type: 'Sine Wave Generator', type: 'Overlay Plot'
parent: overlayPlot.uuid });
});
await page.goto(overlayPlot.url); const swgA = await createDomainObjectWithDefaults(page, {
// Wait for plot series data to load and be drawn type: 'Sine Wave Generator',
await waitForPlotsToRender(page); parent: overlayPlot.uuid
await page.getByLabel('Edit Object').click(); });
await page.getByRole('tab', { name: 'Elements' }).click(); await page.goto(overlayPlot.url);
// Wait for plot series data to load and be drawn
await waitForPlotsToRender(page);
await page.getByLabel('Edit Object').click();
await page.locator(`#inspector-elements-tree >> text=${swgA.name}`).click(); await page.getByRole('tab', { name: 'Elements' }).click();
const plotPixels = await getCanvasPixels(page, '.js-overlay canvas'); await page.locator(`#inspector-elements-tree >> text=${swgA.name}`).click();
const plotPixelSize = plotPixels.length;
expect(plotPixelSize).toBeGreaterThan(0); const plotPixels = await getCanvasPixels(page, '.js-overlay canvas');
}); const plotPixelSize = plotPixels.length;
expect(plotPixelSize).toBeGreaterThan(0);
}
);
}); });
/** /**

View File

@ -52,7 +52,11 @@ test.describe('Plot Rendering', () => {
expect(createMineFolderRequests.length).toEqual(0); expect(createMineFolderRequests.length).toEqual(0);
}); });
test('Plot is rendered when infinity values exist', async ({ page }) => { test.fixme('Plot is rendered when infinity values exist', async ({ page }) => {
test.info().annotations.push({
type: 'issue',
description: 'https://github.com/nasa/openmct/issues/7421'
});
// Edit Plot // Edit Plot
await editSineWaveToUseInfinityOption(page, sineWaveGeneratorObject); await editSineWaveToUseInfinityOption(page, sineWaveGeneratorObject);

View File

@ -24,13 +24,18 @@ import { createDomainObjectWithDefaults } from '../../../../appActions.js';
import { expect, test } from '../../../../pluginFixtures.js'; import { expect, test } from '../../../../pluginFixtures.js';
test.describe('Tabs View', () => { test.describe('Tabs View', () => {
test('Renders tabbed elements', async ({ page }) => { let tabsView;
let table;
let notebook;
let sineWaveGenerator;
test.beforeEach(async ({ page }) => {
await page.goto('./', { waitUntil: 'domcontentloaded' }); await page.goto('./', { waitUntil: 'domcontentloaded' });
const tabsView = await createDomainObjectWithDefaults(page, { tabsView = await createDomainObjectWithDefaults(page, {
type: 'Tabs View' type: 'Tabs View'
}); });
const table = await createDomainObjectWithDefaults(page, { table = await createDomainObjectWithDefaults(page, {
type: 'Telemetry Table', type: 'Telemetry Table',
parent: tabsView.uuid parent: tabsView.uuid
}); });
@ -38,16 +43,18 @@ test.describe('Tabs View', () => {
type: 'Event Message Generator', type: 'Event Message Generator',
parent: table.uuid parent: table.uuid
}); });
const notebook = await createDomainObjectWithDefaults(page, { notebook = await createDomainObjectWithDefaults(page, {
type: 'Notebook', type: 'Notebook',
parent: tabsView.uuid parent: tabsView.uuid
}); });
const sineWaveGenerator = await createDomainObjectWithDefaults(page, { sineWaveGenerator = await createDomainObjectWithDefaults(page, {
type: 'Sine Wave Generator', type: 'Sine Wave Generator',
parent: tabsView.uuid parent: tabsView.uuid
}); });
});
page.goto(tabsView.url); test('Renders tabbed elements', async ({ page }) => {
await page.goto(tabsView.url);
// select first tab // select first tab
await page.getByLabel(`${table.name} tab`, { exact: true }).click(); await page.getByLabel(`${table.name} tab`, { exact: true }).click();
@ -86,3 +93,23 @@ test.describe('Tabs View', () => {
await expect(page.locator('canvas[id=webglContext]')).toBeHidden(); await expect(page.locator('canvas[id=webglContext]')).toBeHidden();
}); });
}); });
test.describe('Tabs View CRUD', () => {
let tabsView;
test.beforeEach(async ({ page }) => {
await page.goto('./', { waitUntil: 'domcontentloaded' });
tabsView = await createDomainObjectWithDefaults(page, {
type: 'Tabs View'
});
});
test('Eager Load Tabs is the default', async ({ page }) => {
await page.goto(tabsView.url);
await page.getByLabel('Edit Object').click();
await page.getByLabel('More actions').click();
await page.getByLabel('Edit Properties...').click();
await expect(await page.getByLabel('Eager Load Tabs')).toHaveValue('true');
});
});