Skip to content

Commit

Permalink
Merge branch 'master' into flakefinder
Browse files Browse the repository at this point in the history
  • Loading branch information
unlikelyzero authored Jan 30, 2024
2 parents 490da90 + 068ac48 commit 5167ff7
Show file tree
Hide file tree
Showing 41 changed files with 1,272 additions and 476 deletions.
3 changes: 2 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,8 @@
"WCAG",
"stackedplot",
"Andale",
"checksnapshots"
"checksnapshots",
"specced"
],
"dictionaries": ["npm", "softwareTerms", "node", "html", "css", "bash", "en_US"],
"ignorePaths": [
Expand Down
1 change: 0 additions & 1 deletion e2e/avpFixtures.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ export async function scanForA11yViolations(page, testCaseName, options = {}) {
const builder = new AxeBuilder({ page });
builder.withTags(['wcag2aa']);
// https://github.com/dequelabs/axe-core/blob/develop/doc/rule-descriptions.md
builder.disableRules(['color-contrast']);
const accessibilityScanResults = await builder.analyze();

// Assert that no violations should be present
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
110 changes: 54 additions & 56 deletions e2e/tests/functional/plugins/plot/overlayPlot.e2e.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,80 +63,78 @@ test.describe('Overlay Plot', () => {
await expect(seriesColorSwatch).toHaveCSS('background-color', 'rgb(255, 166, 61)');
});

//skipping due to https://github.com/nasa/openmct/issues/7405
test.fixme(
'Limit lines persist when series is moved to another Y Axis and on refresh',
async ({ page }) => {
test.info().annotations.push({
type: 'issue',
description: 'https://github.com/nasa/openmct/issues/6338'
});
// Create an Overlay Plot with a default SWG
const overlayPlot = await createDomainObjectWithDefaults(page, {
type: 'Overlay Plot'
});
test('Limit lines persist when series is moved to another Y Axis and on refresh', async ({
page
}) => {
test.info().annotations.push({
type: 'issue',
description: 'https://github.com/nasa/openmct/issues/6338'
});
// Create an Overlay Plot with a default SWG
const overlayPlot = await createDomainObjectWithDefaults(page, {
type: 'Overlay Plot'
});

const swgA = await createDomainObjectWithDefaults(page, {
type: 'Sine Wave Generator',
parent: overlayPlot.uuid
});
const swgA = await createDomainObjectWithDefaults(page, {
type: 'Sine Wave Generator',
parent: overlayPlot.uuid
});

await page.goto(overlayPlot.url);
await page.goto(overlayPlot.url);

// Assert that no limit lines are shown by default
await page.waitForSelector('.js-limit-area', { state: 'attached' });
expect(await page.locator('.c-plot-limit-line').count()).toBe(0);
// Assert that no limit lines are shown by default
await page.waitForSelector('.js-limit-area', { state: 'attached' });
expect(await page.locator('.c-plot-limit-line').count()).toBe(0);

// Enter edit mode
await page.getByLabel('Edit Object').click();
// Enter edit mode
await page.getByLabel('Edit Object').click();

// Expand the "Sine Wave Generator" plot series options and enable limit lines
await page.getByRole('tab', { name: 'Config' }).click();
await page
.getByRole('list', { name: 'Plot Series Properties' })
.locator('span')
.first()
.click();
await page
.getByRole('list', { name: 'Plot Series Properties' })
.locator('[title="Display limit lines"]~div input')
.check();
// Expand the "Sine Wave Generator" plot series options and enable limit lines
await page.getByRole('tab', { name: 'Config' }).click();
await page
.getByRole('list', { name: 'Plot Series Properties' })
.locator('span')
.first()
.click();
await page
.getByRole('list', { name: 'Plot Series Properties' })
.locator('[title="Display limit lines"]~div input')
.check();

await assertLimitLinesExistAndAreVisible(page);
await assertLimitLinesExistAndAreVisible(page);

// Save (exit edit mode)
await page.locator('button[title="Save"]').click();
await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click();
// Save (exit edit mode)
await page.locator('button[title="Save"]').click();
await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click();

await assertLimitLinesExistAndAreVisible(page);
await assertLimitLinesExistAndAreVisible(page);

await page.reload();
await page.reload();

await assertLimitLinesExistAndAreVisible(page);
await assertLimitLinesExistAndAreVisible(page);

// Enter edit mode
await page.getByLabel('Edit Object').click();
// Enter edit mode
await page.getByLabel('Edit Object').click();

await page.getByRole('tab', { name: 'Elements' }).click();
await page.getByRole('tab', { name: 'Elements' }).click();

// Drag Sine Wave Generator series from Y Axis 1 into Y Axis 2
await page
.locator(`#inspector-elements-tree >> text=${swgA.name}`)
.dragTo(page.locator('[aria-label="Element Item Group Y Axis 2"]'));
// Drag Sine Wave Generator series from Y Axis 1 into Y Axis 2
await page
.locator(`#inspector-elements-tree >> text=${swgA.name}`)
.dragTo(page.locator('[aria-label="Element Item Group Y Axis 2"]'));

await assertLimitLinesExistAndAreVisible(page);
await assertLimitLinesExistAndAreVisible(page);

// Save (exit edit mode)
await page.locator('button[title="Save"]').click();
await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click();
// Save (exit edit mode)
await page.locator('button[title="Save"]').click();
await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click();

await assertLimitLinesExistAndAreVisible(page);
await assertLimitLinesExistAndAreVisible(page);

await page.reload();
await page.reload();

await assertLimitLinesExistAndAreVisible(page);
}
);
await assertLimitLinesExistAndAreVisible(page);
});

test('The elements pool supports dragging series into multiple y-axis buckets', async ({
page
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ const setBorderColor = '#ff00ff';
const setBackgroundColor = '#5b0f00';
const setTextColor = '#e6b8af';
const defaultFrameBorderColor = '#e6b8af'; //default border color
const defaultBorderTargetColor = '#aaaaaa';
const defaultTextColor = '#aaaaaa'; // default text color
const inheritedColor = '#aaaaaa'; // inherited from the body style
const defaultBorderTargetColor = '#acacac';
const defaultTextColor = '#acacac'; // default text color
const inheritedColor = '#acacac'; // inherited from the body style
const pukeGreen = '#6aa84f'; //Ugliest green known to man
const NO_STYLE_RGBA = 'rgba(0, 0, 0, 0)'; //default background color value

Expand Down Expand Up @@ -397,8 +397,8 @@ test.describe('Flexible Layout styling', () => {
page.getByLabel('StackedPlot1 Frame').getByLabel('Stacked Plot Style Target')
);
// Save Flexible Layout
await page.locator('button[title="Save"]').click();
await page.locator('text=Save and Finish Editing').click();
await page.getByRole('button', { name: 'Save' }).click();
await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click();

// Reload page and verify that styles persist
await page.reload({ waitUntil: 'domcontentloaded' });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ import { test } from '../../../../pluginFixtures.js';
const setBorderColor = '#ff00ff';
const setBackgroundColor = '#5b0f00';
const setTextColor = '#e6b8af';
const defaultTextColor = '#aaaaaa'; // default text color
const defaultTextColor = '#acacac'; // default text color
const NO_STYLE_RGBA = 'rgba(0, 0, 0, 0)'; //default background color value
const DEFAULT_PLOT_VIEW_BORDER_COLOR = '#AAAAAA';
const DEFAULT_PLOT_VIEW_BORDER_COLOR = '#acacac';
const setFontSize = '72px';
const setFontWeight = '700'; //bold for monospace bold
const setFontFamily = '"Andale Mono", sans-serif';
Expand Down
10 changes: 6 additions & 4 deletions e2e/tests/visual-a11y/a11y.visual.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/

import { scanForA11yViolations, test } from '../../avpFixtures.js';
import { test } from '../../avpFixtures.js';
import { VISUAL_URL } from '../../constants.js';

test.describe('a11y - Default @a11y', () => {
test.describe('a11y - Default', () => {
test.beforeEach(async ({ page }) => {
await page.goto(VISUAL_URL, { waitUntil: 'domcontentloaded' });
});
test('main view @a11y', async ({ page }, testInfo) => {
await scanForA11yViolations(page, testInfo.title);
test('main view', async ({ page }, testInfo) => {
await page.goto('./');
//Skipping for https://github.com/nasa/openmct/issues/7421
//await scanForA11yViolations(page, testInfo.title);
});
});
9 changes: 5 additions & 4 deletions e2e/tests/visual-a11y/components/header.visual.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Tests the branding associated with the default deployment. At least the about mo

import percySnapshot from '@percy/playwright';

import { expect, scanForA11yViolations, test } from '../../../avpFixtures.js';
import { expect, test } from '../../../avpFixtures.js';
import { VISUAL_URL } from '../../../constants.js';

//Declare the scope of the visual test
Expand Down Expand Up @@ -78,6 +78,7 @@ test.describe('Visual - Header @a11y', () => {
await expect(await page.getByLabel('Show Snapshots')).toBeVisible();
});
});
test.afterEach(async ({ page }, testInfo) => {
await scanForA11yViolations(page, testInfo.title);
});
// Skipping for https://github.com/nasa/openmct/issues/7421
// test.afterEach(async ({ page }, testInfo) => {
// await scanForA11yViolations(page, testInfo.title);
// });
9 changes: 5 additions & 4 deletions e2e/tests/visual-a11y/components/inspector.visual.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import percySnapshot from '@percy/playwright';

import { scanForA11yViolations, test } from '../../../avpFixtures.js';
import { test } from '../../../avpFixtures.js';
import { MISSION_TIME, VISUAL_URL } from '../../../constants.js';

//Declare the scope of the visual test
Expand Down Expand Up @@ -55,6 +55,7 @@ test.describe('Visual - Inspector @ally', () => {
});
});
});
test.afterEach(async ({ page }, testInfo) => {
await scanForA11yViolations(page, testInfo.title);
});
// Skipping for https://github.com/nasa/openmct/issues/7421
// test.afterEach(async ({ page }, testInfo) => {
// await scanForA11yViolations(page, testInfo.title);
// });
13 changes: 7 additions & 6 deletions e2e/tests/visual-a11y/notebook.visual.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
import percySnapshot from '@percy/playwright';

import { createDomainObjectWithDefaults, expandTreePaneItemByName } from '../../appActions.js';
import { scanForA11yViolations, test } from '../../avpFixtures.js';
import { test } from '../../avpFixtures.js';
import { VISUAL_URL } from '../../constants.js';
import { enterTextEntry, startAndAddRestrictedNotebookObject } from '../../helper/notebookUtils.js';

test.describe('Visual - Restricted Notebook', () => {
test.describe('Visual - Restricted Notebook @a11y', () => {
test.beforeEach(async ({ page }) => {
const restrictedNotebook = await startAndAddRestrictedNotebookObject(page);
await page.goto(restrictedNotebook.url + '?hideTree=true&hideInspector=true');
Expand All @@ -39,7 +39,7 @@ test.describe('Visual - Restricted Notebook', () => {
});
});

test.describe('Visual - Notebook', () => {
test.describe('Visual - Notebook @a11y', () => {
let notebook;
test.beforeEach(async ({ page }) => {
await page.goto(VISUAL_URL, { waitUntil: 'domcontentloaded' });
Expand Down Expand Up @@ -125,7 +125,8 @@ test.describe('Visual - Notebook', () => {
// Take a snapshot
await percySnapshot(page, `Notebook Selected Entry Text Area Active (theme: '${theme}')`);
});
test.afterEach(async ({ page }, testInfo) => {
await scanForA11yViolations(page, testInfo.title);
});
// Skipping for https://github.com/nasa/openmct/issues/7421
// test.afterEach(async ({ page }, testInfo) => {
// await scanForA11yViolations(page, testInfo.title);
// });
});
11 changes: 6 additions & 5 deletions e2e/tests/visual-a11y/planning.visual.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import percySnapshot from '@percy/playwright';
import fs from 'fs';

import { createDomainObjectWithDefaults, createPlanFromJSON } from '../../appActions.js';
import { scanForA11yViolations, test } from '../../avpFixtures.js';
import { test } from '../../avpFixtures.js';
import { VISUAL_URL } from '../../constants.js';
import { setBoundsToSpanAllActivities, setDraftStatusForPlan } from '../../helper/planningUtils.js';

Expand All @@ -34,7 +34,7 @@ const examplePlanSmall = JSON.parse(

const snapshotScope = '.l-shell__pane-main .l-pane__contents';

test.describe('Visual - Planning @a11y', () => {
test.describe('Visual - Planning', () => {
test.beforeEach(async ({ page }) => {
await page.goto(VISUAL_URL, { waitUntil: 'domcontentloaded' });
});
Expand Down Expand Up @@ -99,7 +99,8 @@ test.describe('Visual - Planning @a11y', () => {
scope: snapshotScope
});
});
test.afterEach(async ({ page }, testInfo) => {
await scanForA11yViolations(page, testInfo.title);
});
// Skipping for https://github.com/nasa/openmct/issues/7421
// test.afterEach(async ({ page }, testInfo) => {
// await scanForA11yViolations(page, testInfo.title);
// });
});
Loading

0 comments on commit 5167ff7

Please sign in to comment.