Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/telemetry-comps' into combined-r…
Browse files Browse the repository at this point in the history
…odap-stuff
  • Loading branch information
scottbell committed Oct 28, 2024
2 parents 1da60b0 + 9ca489c commit dc13592
Show file tree
Hide file tree
Showing 25 changed files with 242 additions and 162 deletions.
12 changes: 6 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ orbs:
executors:
pw-focal-development:
docker:
- image: mcr.microsoft.com/playwright:v1.47.2-focal
- image: mcr.microsoft.com/playwright:v1.48.1-focal
environment:
NODE_ENV: development # Needed to ensure 'dist' folder created and devDependencies installed
PERCY_POSTINSTALL_BROWSER: 'true' # Needed to store the percy browser in cache deps
Expand Down Expand Up @@ -198,7 +198,7 @@ jobs:
steps:
- build_and_install:
node-version: lts/hydrogen
- run: npx playwright@1.47.2 install #Necessary for bare ubuntu machine
- run: npx playwright@1.48.1 install #Necessary for bare ubuntu machine
- run: |
export $(cat src/plugins/persistence/couch/.env.ci | xargs)
docker compose -f src/plugins/persistence/couch/couchdb-compose.yaml up --detach
Expand Down Expand Up @@ -286,8 +286,8 @@ workflows:
overall-circleci-commit-status: #These jobs run on every commit
jobs:
- lint:
name: node20-lint
node-version: lts/iron
name: node22-lint
node-version: '22'
- unit-test:
name: node18-chrome
node-version: lts/hydrogen
Expand All @@ -304,8 +304,8 @@ workflows:
the-nightly: #These jobs do not run on PRs, but against master at night
jobs:
- unit-test:
name: node20-chrome-nightly
node-version: lts/iron
name: node22-chrome-nightly
node-version: '22'
- unit-test:
name: node18-chrome
node-version: lts/hydrogen
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-couchdb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- run: npx playwright@1.47.2 install
- run: npx playwright@1.48.1 install

- name: Start CouchDB Docker Container and Init with Setup Scripts
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-flakefinder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
restore-keys: |
${{ runner.os }}-node-
- run: npx playwright@1.47.2 install
- run: npx playwright@1.48.1 install
- run: npm ci --no-audit --progress=false

- name: Run E2E Tests (Repeated 10 Times)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
restore-keys: |
${{ runner.os }}-node-
- run: npx playwright@1.47.2 install
- run: npx playwright@1.48.1 install
- run: npm ci --no-audit --progress=false
- run: npm run test:perf:localhost
- run: npm run test:perf:contract
Expand Down
116 changes: 0 additions & 116 deletions .github/workflows/release.yml

This file was deleted.

3 changes: 3 additions & 0 deletions e2e/helper/planningUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ export async function setBoundsToSpanAllActivities(page, planJson, planObjectUrl
*/
export function getEarliestStartTime(planJson) {
const activities = Object.values(planJson).flat();

return Math.min(...activities.map((activity) => activity.start));
}

Expand All @@ -139,6 +140,7 @@ export function getEarliestStartTime(planJson) {
*/
export function getLatestEndTime(planJson) {
const activities = Object.values(planJson).flat();

return Math.max(...activities.map((activity) => activity.end));
}

Expand All @@ -151,6 +153,7 @@ export function getFirstActivity(planJson) {
const groups = Object.keys(planJson);
const firstGroupKey = groups[0];
const firstGroupItems = planJson[firstGroupKey];

return firstGroupItems[0];
}

Expand Down
2 changes: 1 addition & 1 deletion e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"devDependencies": {
"@percy/cli": "1.27.4",
"@percy/playwright": "1.0.4",
"@playwright/test": "1.47.2",
"@playwright/test": "1.48.1",
"@axe-core/playwright": "4.8.5"
},
"author": {
Expand Down
Binary file added e2e/test-data/rick space roll.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,6 @@ test.describe('Example Imagery Object', () => {
expect(newPage.url()).toContain('.jpg');
});

// this requires CORS to be enabled in some fashion
test.fixme('Can right click on image and save it as a file', async ({ page }) => {});

test('Can adjust image brightness/contrast by dragging the sliders', async ({
page,
browserName
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2024, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/

/*
* This test suite verifies modifying the image location of the example imagery object.
*/

import { createDomainObjectWithDefaults } from '../../../../appActions.js';
import { expect, test } from '../../../../pluginFixtures.js';

test.describe('Example Imagery Object Custom Images', () => {
let exampleImagery;
test.beforeEach(async ({ page }) => {
//Go to baseURL
await page.goto('./', { waitUntil: 'domcontentloaded' });

// Create a default 'Example Imagery' object
exampleImagery = await createDomainObjectWithDefaults(page, {
name: 'Example Imagery',
type: 'Example Imagery'
});

// Verify that the created object is focused
await expect(page.locator('.l-browse-bar__object-name')).toContainText(exampleImagery.name);
await page.getByLabel('Focused Image Element').hover({ trial: true });

// Wait for image thumbnail auto-scroll to complete
await expect(page.getByLabel('Image Thumbnail from').last()).toBeInViewport();
});
// this requires CORS to be enabled in some fashion
test.fixme('Can right click on image and save it as a file', async ({ page }) => {});
test('Can provide a custom image location for the example imagery object', async ({ page }) => {
// Modify Example Imagery to create a really stable image which will never let us down
await page.getByRole('button', { name: 'More actions' }).click();
await page.getByRole('menuitem', { name: 'Edit Properties...' }).click();
await page
.locator('#imageLocation-textarea')
.fill(
'https://raw.githubusercontent.com/nasa/openmct/554f77c42fec81cf0f63e62b278012cb08d82af9/e2e/test-data/rick.jpg,https://raw.githubusercontent.com/nasa/openmct/554f77c42fec81cf0f63e62b278012cb08d82af9/e2e/test-data/rick.jpg'
);
await page.getByRole('button', { name: 'Save' }).click();
await page.reload({ waitUntil: 'domcontentloaded' });

// Wait for the thumbnails to finish their scroll animation
// (Wait until the rightmost thumbnail is in view)
await expect(page.getByLabel('Image Thumbnail from').last()).toBeInViewport();

await expect(page.getByLabel('Image Wrapper')).toBeVisible();
});
test.fixme('Can provide a custom image with spaces in name', async ({ page }) => {
test.info().annotations.push({
type: 'issue',
description: 'https://github.com/nasa/openmct/issues/7903'
});
await page.goto(exampleImagery.url, { waitUntil: 'domcontentloaded' });

// Modify Example Imagery to create a really stable image which will never let us down
await page.getByRole('button', { name: 'More actions' }).click();
await page.getByRole('menuitem', { name: 'Edit Properties...' }).click();
await page
.locator('#imageLocation-textarea')
.fill(
'https://raw.githubusercontent.com/nasa/openmct/d8c64f183400afb70137221fc1a035e091bea912/e2e/test-data/rick%20space%20roll.jpg'
);
await page.getByRole('button', { name: 'Save' }).click();
await page.reload({ waitUntil: 'domcontentloaded' });

// Wait for the thumbnails to finish their scroll animation
// (Wait until the rightmost thumbnail is in view)
await expect(page.getByLabel('Image Thumbnail from').last()).toBeInViewport();

await expect(page.getByLabel('Image Wrapper')).toBeVisible();
});
});
13 changes: 12 additions & 1 deletion e2e/tests/visual-a11y/planning-gantt.visual.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,25 @@ import fs from 'fs';
import { createDomainObjectWithDefaults, createPlanFromJSON } from '../../appActions.js';
import { scanForA11yViolations, test } from '../../avpFixtures.js';
import { VISUAL_FIXED_URL } from '../../constants.js';
import { setBoundsToSpanAllActivities, setDraftStatusForPlan } from '../../helper/planningUtils.js';
import {
getFirstActivity,
setBoundsToSpanAllActivities,
setDraftStatusForPlan
} from '../../helper/planningUtils.js';

const examplePlanSmall2 = JSON.parse(
fs.readFileSync(new URL('../../test-data/examplePlans/ExamplePlan_Small2.json', import.meta.url))
);

const FIRST_ACTIVITY_SMALL_2 = getFirstActivity(examplePlanSmall2);

test.describe('Visual - Gantt Chart @a11y', () => {
test.beforeEach(async ({ page }) => {
// Set the clock to the end of the first activity in the plan
// This is so we can see the "now" line in the plan view
await page.clock.install({ time: FIRST_ACTIVITY_SMALL_2.end + 10000 });
await page.clock.resume();

await page.goto(VISUAL_FIXED_URL, { waitUntil: 'domcontentloaded' });
});
test('Gantt Chart View', async ({ page, theme }) => {
Expand Down
9 changes: 8 additions & 1 deletion e2e/tests/visual-a11y/planning-timestrip.visual.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,21 @@ import { createDomainObjectWithDefaults, createPlanFromJSON } from '../../appAct
import { scanForA11yViolations, test } from '../../avpFixtures.js';
import { waitForAnimations } from '../../baseFixtures.js';
import { VISUAL_FIXED_URL } from '../../constants.js';
import { setBoundsToSpanAllActivities } from '../../helper/planningUtils.js';
import { getFirstActivity, setBoundsToSpanAllActivities } from '../../helper/planningUtils.js';

const examplePlanSmall2 = JSON.parse(
fs.readFileSync(new URL('../../test-data/examplePlans/ExamplePlan_Small2.json', import.meta.url))
);

const FIRST_ACTIVITY_SMALL_2 = getFirstActivity(examplePlanSmall2);

test.describe('Visual - Time Strip @a11y', () => {
test.beforeEach(async ({ page }) => {
// Set the clock to the end of the first activity in the plan
// This is so we can see the "now" line in the plan view
await page.clock.install({ time: FIRST_ACTIVITY_SMALL_2.end + 10000 });
await page.clock.resume();

await page.goto(VISUAL_FIXED_URL, { waitUntil: 'domcontentloaded' });
});
test('Time Strip View', async ({ page, theme }) => {
Expand Down
6 changes: 6 additions & 0 deletions e2e/tests/visual-a11y/planning-view.visual.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const examplePlanSmall2 = JSON.parse(
);

const FIRST_ACTIVITY_SMALL_1 = getFirstActivity(examplePlanSmall1);
const FIRST_ACTIVITY_SMALL_2 = getFirstActivity(examplePlanSmall2);

test.describe('Visual - Timelist progress bar @clock @a11y', () => {
test.beforeEach(async ({ page }) => {
Expand All @@ -59,6 +60,11 @@ test.describe('Visual - Timelist progress bar @clock @a11y', () => {

test.describe('Visual - Plan View @a11y', () => {
test.beforeEach(async ({ page }) => {
// Set the clock to the end of the first activity in the plan
// This is so we can see the "now" line in the plan view
await page.clock.install({ time: FIRST_ACTIVITY_SMALL_2.end + 10000 });
await page.clock.resume();

await page.goto(VISUAL_FIXED_URL, { waitUntil: 'domcontentloaded' });
});

Expand Down
Loading

0 comments on commit dc13592

Please sign in to comment.