Skip to content

Commit 1c274f9

Browse files
authored
Merge branch 'master' into telemetry-comps
2 parents 075e4f7 + b476d1e commit 1c274f9

File tree

13 files changed

+98
-30
lines changed

13 files changed

+98
-30
lines changed

e2e/appActions.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -747,13 +747,30 @@ async function getNextSineValueFromSWG(page, objectIdentifier, returnOnlyValue =
747747
return getTelemValuePromise;
748748
}
749749

750+
async function expandInspectorPane(page) {
751+
await page.getByRole('button', { name: 'Inspect' }).click();
752+
// eslint-disable-next-line playwright/no-raw-locators
753+
await expect(page.locator('.l-shell__pane-inspector > .l-pane__contents')).toHaveCSS(
754+
'opacity',
755+
'1'
756+
);
757+
}
758+
759+
async function expandTreePane(page) {
760+
await page.getByRole('button', { name: 'Browse' }).click();
761+
// eslint-disable-next-line playwright/no-raw-locators
762+
await expect(page.locator('.l-shell__pane-tree > .l-pane__contents')).toHaveCSS('opacity', '1');
763+
}
764+
750765
export {
751766
createDomainObjectWithDefaults,
752767
createExampleTelemetryObject,
753768
createNotification,
754769
createPlanFromJSON,
755770
createStableStateTelemetry,
756771
expandEntireTree,
772+
expandInspectorPane,
773+
expandTreePane,
757774
getCanvasPixels,
758775
getNextSineValueFromSWG,
759776
linkParameterToObject,

e2e/tests/functional/plugins/operatorStatus/operatorStatus.e2e.spec.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,20 @@ test.describe('Operator Status', () => {
158158
expect(updatedRowValuesArr[COLUMN_STATUS_INDEX]).toEqual(UNSET_VALUE_LABEL);
159159
});
160160

161+
test('Poll indicator is visible when window is really small', async ({ page }) => {
162+
const pollIndicator = page.locator('div[title="Set my operator status"]');
163+
//Make window narrow
164+
await page.setViewportSize({ width: 640, height: 480 });
165+
await page.getByLabel('Display as single line').click();
166+
const indicatorsCount = await page.locator('.c-indicator').count();
167+
//Assert that multiple indicators are active
168+
expect(indicatorsCount).toBeGreaterThanOrEqual(3);
169+
//Assert that indicators are expanded
170+
await expect(page.locator('.l-shell__head')).toContainClass('l-shell__head--expanded');
171+
//Expect poll indicator to be visible
172+
await expect(pollIndicator).toBeInViewport({ ratio: 1 });
173+
});
174+
161175
test.fixme('iterate through all possible response values', async ({ page }) => {
162176
// test all possible response values for the poll
163177
});

e2e/tests/visual-a11y/components/inspector.visual.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
import percySnapshot from '@percy/playwright';
2424

25+
import { expandInspectorPane } from '../../../appActions.js';
2526
import { scanForA11yViolations, test } from '../../../avpFixtures.js';
2627
import { MISSION_TIME, VISUAL_FIXED_URL } from '../../../constants.js';
2728

@@ -44,8 +45,7 @@ test.describe('Visual - Inspector @ally @clock', () => {
4445
await page.getByRole('gridcell', { name: 'Overlay Plot with 5s Delay' }).click();
4546

4647
//Expand the Inspector Pane
47-
await page.getByRole('button', { name: 'Inspect' }).click();
48-
48+
await expandInspectorPane(page);
4949
await percySnapshot(page, `Inspector view of overlayPlot (theme: ${theme})`, {
5050
scope: inspectorPane
5151
});

e2e/tests/visual-a11y/components/tree.visual.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
import percySnapshot from '@percy/playwright';
2424

25-
import { createDomainObjectWithDefaults } from '../../../appActions.js';
25+
import { createDomainObjectWithDefaults, expandTreePane } from '../../../appActions.js';
2626
import { test } from '../../../avpFixtures.js';
2727
import { VISUAL_FIXED_URL } from '../../../constants.js';
2828

@@ -34,7 +34,7 @@ test.describe('Visual - Tree Pane', () => {
3434
await page.goto(VISUAL_FIXED_URL, { waitUntil: 'domcontentloaded' });
3535

3636
//Open Tree
37-
await page.getByRole('button', { name: 'Browse' }).click();
37+
await expandTreePane(page);
3838

3939
//Create a Folder Structure
4040
const foo = await createDomainObjectWithDefaults(page, {

e2e/tests/visual-a11y/displayLayout.visual.spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import percySnapshot from '@percy/playwright';
2525
import {
2626
createDomainObjectWithDefaults,
2727
createStableStateTelemetry,
28+
expandInspectorPane,
2829
linkParameterToObject
2930
} from '../../appActions.js';
3031
import { MISSION_TIME, VISUAL_FIXED_URL } from '../../constants.js';
@@ -105,7 +106,7 @@ test.describe('Visual - Display Layout @clock', () => {
105106
type: 'issue',
106107
description: 'https://github.com/nasa/openmct/issues/7036'
107108
});
108-
await page.getByLabel('Expand Inspect Pane').click();
109+
await expandInspectorPane(page);
109110
await page.getByLabel('Resize Inspect Pane').dragTo(page.getByLabel('X:'));
110111
await page.getByRole('tab', { name: 'Elements' }).click();
111112
await percySnapshot(page, `Toolbar does not overflow into inspector (theme: '${theme}')`);

e2e/tests/visual-a11y/imagery.visual.spec.js

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,18 @@
2121
*****************************************************************************/
2222
import percySnapshot from '@percy/playwright';
2323

24-
import { createDomainObjectWithDefaults, setRealTimeMode } from '../../appActions.js';
25-
import { waitForAnimations } from '../../baseFixtures.js';
26-
import { VISUAL_FIXED_URL } from '../../constants.js';
24+
import { createDomainObjectWithDefaults } from '../../appActions.js';
25+
import { MISSION_TIME, VISUAL_FIXED_URL } from '../../constants.js';
2726
import { expect, test } from '../../pluginFixtures.js';
27+
const TEN_MINUTES = 10 * 60 * 1000;
2828

2929
test.describe('Visual - Example Imagery', () => {
3030
let exampleImagery;
3131
let parentLayout;
3232

3333
test.beforeEach(async ({ page }) => {
34+
//Start at UNIX epoch time while initializing. The clock needs to run so that debounce functions etc. work.
35+
await page.clock.install({ time: 0 });
3436
await page.goto(VISUAL_FIXED_URL, { waitUntil: 'domcontentloaded' });
3537

3638
parentLayout = await createDomainObjectWithDefaults(page, {
@@ -54,6 +56,7 @@ test.describe('Visual - Example Imagery', () => {
5456
'https://raw.githubusercontent.com/nasa/openmct/554f77c42fec81cf0f63e62b278012cb08d82af9/e2e/test-data/rick.jpg,https://raw.githubusercontent.com/nasa/openmct/554f77c42fec81cf0f63e62b278012cb08d82af9/e2e/test-data/rick.jpg'
5557
);
5658
await page.getByRole('button', { name: 'Save' }).click();
59+
await page.clock.pauseAt(MISSION_TIME);
5760
await page.reload({ waitUntil: 'domcontentloaded' });
5861

5962
//Hide the Browse and Inspect panes to make the image more stable
@@ -63,10 +66,10 @@ test.describe('Visual - Example Imagery', () => {
6366

6467
test('Example Imagery in Fixed Time', async ({ page, theme }) => {
6568
await page.goto(exampleImagery.url, { waitUntil: 'domcontentloaded' });
66-
67-
// Wait for the thumbnails to finish their scroll animation
68-
// (Wait until the rightmost thumbnail is in view)
69-
await expect(page.getByLabel('Image Thumbnail from').last()).toBeInViewport();
69+
// Scroll the rightmost thumbnail into view
70+
const lastImageThumbnail = page.getByLabel('Image Thumbnail from').last();
71+
await lastImageThumbnail.scrollIntoViewIfNeeded();
72+
await expect(lastImageThumbnail).toBeInViewport();
7073

7174
await expect(page.getByLabel('Image Wrapper')).toBeVisible();
7275

@@ -80,22 +83,31 @@ test.describe('Visual - Example Imagery', () => {
8083
test('Example Imagery in Real Time', async ({ page, theme }) => {
8184
await page.goto(exampleImagery.url, { waitUntil: 'domcontentloaded' });
8285

83-
// Wait for the thumbnails to finish their scroll animation
84-
// (Wait until the rightmost thumbnail is in view)
85-
await expect(page.getByLabel('Image Thumbnail from').last()).toBeInViewport();
86-
await setRealTimeMode(page, true);
86+
// Scroll the rightmost thumbnail into view
87+
await scrollLastThumbnailIntoView(page);
8788

88-
await expect(page.getByLabel('Image Wrapper')).toBeVisible();
89+
await page.getByRole('button', { name: 'Time Conductor Mode', exact: true }).click();
90+
await page.getByRole('button', { name: 'Time Conductor Mode Menu' }).click();
91+
await page.getByRole('menuitem', { name: /Real-Time/ }).click();
92+
//dismiss the time conductor popup
93+
await page.getByLabel('Submit time offsets').click();
94+
await page.clock.pauseAt(MISSION_TIME + TEN_MINUTES);
95+
await page.waitForURL(/tc\.mode=local/);
96+
await scrollLastThumbnailIntoView(page);
8997

90-
await waitForAnimations(page.locator('.animate-scroll'));
9198
await percySnapshot(page, `Example Imagery in Real Time (theme: ${theme})`);
9299
});
93100

94101
test('Example Imagery in Display Layout', async ({ page, theme }) => {
95102
await page.goto(parentLayout.url, { waitUntil: 'domcontentloaded' });
96103

97104
await expect(page.getByLabel('Image Wrapper')).toBeVisible();
98-
99105
await percySnapshot(page, `Example Imagery in Display Layout (theme: ${theme})`);
100106
});
101107
});
108+
109+
async function scrollLastThumbnailIntoView(page) {
110+
const lastImageThumbnail = page.getByLabel('Image Thumbnail from').last();
111+
await lastImageThumbnail.scrollIntoViewIfNeeded();
112+
await expect(lastImageThumbnail).toBeInViewport();
113+
}

e2e/tests/visual-a11y/notebook.visual.spec.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@
2222

2323
import percySnapshot from '@percy/playwright';
2424

25-
import { createDomainObjectWithDefaults } from '../../appActions.js';
25+
import {
26+
createDomainObjectWithDefaults,
27+
expandInspectorPane,
28+
expandTreePane
29+
} from '../../appActions.js';
2630
import { expect, scanForA11yViolations, test } from '../../avpFixtures.js';
2731
import { VISUAL_FIXED_URL } from '../../constants.js';
2832
import { enterTextEntry, startAndAddRestrictedNotebookObject } from '../../helper/notebookUtils.js';
@@ -95,8 +99,7 @@ test.describe('Visual - Notebook @a11y', () => {
9599
});
96100

97101
//Open Tree to perform drag
98-
await page.getByRole('button', { name: 'Browse' }).click();
99-
102+
await expandTreePane(page);
100103
await page.getByLabel('Expand My Items folder').click();
101104

102105
await page.goto(notebook.url);
@@ -115,7 +118,7 @@ test.describe('Visual - Notebook @a11y', () => {
115118
await percySnapshot(page, `Notebook Entry (theme: '${theme}')`);
116119

117120
// Open the Inspector
118-
await page.getByRole('button', { name: 'Inspect' }).click();
121+
await expandInspectorPane(page);
119122
// Open the Annotations tab
120123
await page.getByRole('tab', { name: 'Annotations' }).click();
121124

e2e/tests/visual-a11y/planning-gantt.visual.spec.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@
2323
import percySnapshot from '@percy/playwright';
2424
import fs from 'fs';
2525

26-
import { createDomainObjectWithDefaults, createPlanFromJSON } from '../../appActions.js';
26+
import {
27+
createDomainObjectWithDefaults,
28+
createPlanFromJSON,
29+
expandInspectorPane
30+
} from '../../appActions.js';
2731
import { scanForA11yViolations, test } from '../../avpFixtures.js';
2832
import { VISUAL_FIXED_URL } from '../../constants.js';
2933
import {
@@ -60,7 +64,7 @@ test.describe('Visual - Gantt Chart @a11y', () => {
6064
await percySnapshot(page, `Gantt Chart View (theme: ${theme}) - Clipped Activity Names`);
6165

6266
// Expand the inspect pane and uncheck the 'Clip Activity Names' option
63-
await page.getByRole('button', { name: 'Expand Inspect Pane' }).click();
67+
await expandInspectorPane(page);
6468
await page.getByRole('tab', { name: 'Config' }).click();
6569
await page.getByLabel('Edit Object').click();
6670
await page.getByLabel('Clip Activity Names').click();
@@ -94,7 +98,7 @@ test.describe('Visual - Gantt Chart @a11y', () => {
9498
await percySnapshot(page, `Gantt Chart View w/ draft status (theme: ${theme})`);
9599

96100
// Expand the inspect pane and uncheck the 'Clip Activity Names' option
97-
await page.getByRole('button', { name: 'Expand Inspect Pane' }).click();
101+
await expandInspectorPane(page);
98102
await page.getByRole('tab', { name: 'Config' }).click();
99103
await page.getByLabel('Edit Object').click();
100104
await page.getByLabel('Clip Activity Names').click();

e2e/tests/visual-a11y/styling.visual.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ test.describe('Stacked Plot styling @a11y', () => {
201201
// Save Flexible Layout
202202
await page.getByRole('button', { name: 'Save' }).click();
203203
await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click();
204-
204+
await page.getByRole('tab', { name: 'Styles' }).click();
205205
await percySnapshot(page, `Saved Styled StackedPlot (theme: '${theme}')`);
206206
});
207207
test.afterEach(async ({ page }, testInfo) => {

src/plugins/condition/criterion/TelemetryCriterion.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,10 @@ export default class TelemetryCriterion extends EventEmitter {
158158
}
159159

160160
createNormalizedDatum(telemetryDatum, endpoint) {
161+
if (!telemetryDatum) {
162+
return;
163+
}
164+
161165
const id = this.openmct.objects.makeKeyString(endpoint.identifier);
162166
const metadata = this.openmct.telemetry.getMetadata(endpoint).valueMetadatas;
163167
const normalizedDatum = Object.values(metadata).reduce((datum, metadatum) => {

0 commit comments

Comments
 (0)