Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for e2e tests following the Vue 3 compat upgrade #6837

Merged
merged 84 commits into from
Jul 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
72c432f
clock, timeConductor and appActions fixes
shefalijoshi Jul 19, 2023
f9c5e12
Ensure realtime uses upstream context when available
shefalijoshi Jul 19, 2023
34229d3
Remove log statement
shefalijoshi Jul 19, 2023
6769fb4
Fix log plot e2e tests
shefalijoshi Jul 19, 2023
9b4410d
Fix displayLayout e2e tests
shefalijoshi Jul 19, 2023
c400c7c
Specify global time conductor to fix issues with duplicate selectors …
khalidadil Jul 19, 2023
2d16e91
a11y: ARIA for conductor and independent time conductor
ozyx Jul 19, 2023
3dab216
a11y: more accessibility for TC
ozyx Jul 20, 2023
c6ff7f2
a11y: fix label collisions, specify 'Menu' in label
ozyx Jul 20, 2023
6d68512
Add watch mode
unlikelyzero Jul 20, 2023
e94cf27
fix(e2e): update appActions and tests to use a11y locators for ITC
ozyx Jul 20, 2023
f48afeb
add fixmes to e2e tests failing due to regressions
davetsay Jul 20, 2023
7db9805
Don't remove the itc popup from the DOM. Just show/hide it once it's …
shefalijoshi Jul 20, 2023
99cb909
test(e2e): disable one imagery test due to known bug
ozyx Jul 20, 2023
dc0f461
test(e2e): fix ITC imagery test
ozyx Jul 20, 2023
43fa104
Add fixme to tagging tests, issue described in 6822
khalidadil Jul 20, 2023
625bdc0
Fix locator for time conductor popups
shefalijoshi Jul 20, 2023
8d5219c
Improve how time bounds are set in independent time conductor.
shefalijoshi Jul 21, 2023
771158d
Fix some tests for itc for display layouts
shefalijoshi Jul 21, 2023
cb93d17
Fix Inspector tabs remounting on change
shefalijoshi Jul 21, 2023
05a1d53
fix autoscale test and snapshot
shefalijoshi Jul 21, 2023
c77bbc1
Fix telemetry table test
shefalijoshi Jul 21, 2023
a1d9842
Fix timestrip test
shefalijoshi Jul 21, 2023
2719a28
e2e: move test info annotations to within test
ozyx Jul 21, 2023
bdf8601
6826: Fixes padStart error due to using it on a number rather than a …
shefalijoshi Jul 21, 2023
9f77c03
fix(e2e): update snapshots
ozyx Jul 21, 2023
9a946bc
fix(e2e): fix restricted notebook locator
ozyx Jul 21, 2023
e0fc2ae
fix(restrictedNotebook): fix issue causing sections not to update on …
ozyx Jul 21, 2023
c1d1b03
Merge branch 'e2e-test-fixes' of https://github.com/nasa/openmct into…
shefalijoshi Jul 21, 2023
76c37ff
fix(restrictedNotebook): fix issue causing snapshots to not be able t…
ozyx Jul 21, 2023
b41c98d
fix: replace all instances of `$delete` with `Array.splice()` or `del…
ozyx Jul 21, 2023
724ec42
fix(e2e): fix grand search test
ozyx Jul 21, 2023
23a0ddb
fix(#3117): can remove item from displayLayout via tree context menu …
ozyx Jul 24, 2023
eeff0a7
fix: remove typo
ozyx Jul 24, 2023
fdae0ce
Wait for background image to load
khalidadil Jul 24, 2023
e92b8f9
fix(#6832): timelist events can tick down
ozyx Jul 24, 2023
df93905
fix: ensure that menuitems have the raw objects so emits work
ozyx Jul 24, 2023
4daf88c
fix: assign new arrays instead of editing state in-place
ozyx Jul 24, 2023
d888553
refactor(timelist): use `getClock()` instead of `clock()`
ozyx Jul 24, 2023
4243b88
refactor: `lint:fix`
ozyx Jul 24, 2023
ba2662a
Revert "refactor(timelist): use `getClock()` instead of `clock()`"
ozyx Jul 25, 2023
e305a9b
refactor(timelist): use new timeAPI
ozyx Jul 25, 2023
f451593
Stop ticking when the independent time context is disabled (#6833)
shefalijoshi Jul 25, 2023
e63a941
test: update couchdb notebook test
ozyx Jul 25, 2023
e9b2d71
fix: codeQL warnings
ozyx Jul 25, 2023
ee3a1cc
fix(tree-item): infinite spinner issue
ozyx Jul 26, 2023
3b6f5c9
[Timer] Remove "refresh" call, it is not needed (#6841)
jvigliotta Jul 26, 2023
6629454
fix(mct-tree): maintain reactivity of all tree items
ozyx Jul 26, 2023
fffc218
Hide change role button in the indicator in cases where there is only…
khalidadil Jul 26, 2023
222da49
Fix ITC issues and one imagery issue
shefalijoshi Jul 26, 2023
f846e6c
Closes #6829
charlesh88 Jul 26, 2023
19ff98b
Fix menuAPI unit tests
shefalijoshi Jul 26, 2023
b670999
Merge branch 'e2e-test-fixes' of https://github.com/nasa/openmct into…
shefalijoshi Jul 26, 2023
c1ed7b4
fix(DisplayLayout): Edit Marquee updates correctly on multiselect
ozyx Jul 26, 2023
6aa7597
Fix ObjectAPI tests
shefalijoshi Jul 26, 2023
a66967e
Merge branch 'e2e-test-fixes' of https://github.com/nasa/openmct into…
shefalijoshi Jul 26, 2023
4c9601a
Add missing method for mock user providers
shefalijoshi Jul 26, 2023
a9aa227
Fix typo
shefalijoshi Jul 26, 2023
c3a7e86
Remove unused props
shefalijoshi Jul 26, 2023
34d37e6
Fix clock and ladTable tests
shefalijoshi Jul 27, 2023
fc17bba
Fix condition widget test
shefalijoshi Jul 27, 2023
3588b4c
Fix display layout tests
shefalijoshi Jul 27, 2023
fab5426
Fix flex layout tests
shefalijoshi Jul 27, 2023
b4b02d0
Fix imagery tests
shefalijoshi Jul 27, 2023
858330a
Remove focused test
shefalijoshi Jul 27, 2023
b222ce0
Fix notebook tests
shefalijoshi Jul 27, 2023
c3fa764
Fix notification tests
shefalijoshi Jul 27, 2023
c24d61c
Remove event listeners on unmount for notifications
shefalijoshi Jul 27, 2023
26c47ec
Adds null checks for memory search, ensure array objects are spliced …
shefalijoshi Jul 27, 2023
ee9ee5b
Do not allow openmct to be reactive with Vue
shefalijoshi Jul 27, 2023
9623d9a
Ensure calls to the view provider methods have correct parameters (ob…
shefalijoshi Jul 27, 2023
44ca7a6
Fix bar graph tests
shefalijoshi Jul 27, 2023
3eef220
Remove xdescribe and only comment out one test for bar graph
shefalijoshi Jul 27, 2023
1889955
Fix scatter plots tests, comment out one test
shefalijoshi Jul 27, 2023
5221288
exclude timeline tests
shefalijoshi Jul 27, 2023
fbefd77
Fix time conductor tests
shefalijoshi Jul 27, 2023
fb055d8
excluding layout and inspector styles tests
shefalijoshi Jul 27, 2023
c24558e
Add missing parameters for view api
shefalijoshi Jul 27, 2023
fa0ead4
Disable plot tests
shefalijoshi Jul 27, 2023
8eefd52
Disable tests for URLTimeSettingsSynchronizer
shefalijoshi Jul 27, 2023
40520e2
Fix linting issues
shefalijoshi Jul 27, 2023
5a38066
test: fix autoscale test and update snapshots
ozyx Jul 28, 2023
9b879da
fix: remove `.only` 😅
ozyx Jul 28, 2023
f05a52e
LINT!!!!!!!!!!!!!!!
ozyx Jul 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 78 additions & 21 deletions e2e/appActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,15 +314,13 @@ async function _isInEditMode(page, identifier) {
*/
async function setTimeConductorMode(page, isFixedTimespan = true) {
// Click 'mode' button
const timeConductorMode = await page.locator('.c-compact-tc');
await timeConductorMode.click();
await timeConductorMode.locator('.js-mode-button').click();

await page.getByRole('button', { name: 'Time Conductor Mode', exact: true }).click();
await page.getByRole('button', { name: 'Time Conductor Mode Menu' }).click();
// Switch time conductor mode
if (isFixedTimespan) {
await page.locator('data-testid=conductor-modeOption-fixed').click();
await page.getByRole('menuitem', { name: /Fixed Timespan/ }).click();
} else {
await page.locator('data-testid=conductor-modeOption-realtime').click();
await page.getByRole('menuitem', { name: /Real-Time/ }).click();
}
}

Expand All @@ -344,9 +342,12 @@ async function setRealTimeMode(page) {

/**
* @typedef {Object} OffsetValues
* @property {string | undefined} hours
* @property {string | undefined} mins
* @property {string | undefined} secs
* @property {string | undefined} startHours
* @property {string | undefined} startMins
* @property {string | undefined} startSecs
* @property {string | undefined} endHours
* @property {string | undefined} endMins
* @property {string | undefined} endSecs
*/

/**
Expand All @@ -355,19 +356,32 @@ async function setRealTimeMode(page) {
* @param {OffsetValues} offset
* @param {import('@playwright/test').Locator} offsetButton
*/
async function setTimeConductorOffset(page, { hours, mins, secs }) {
// await offsetButton.click();
async function setTimeConductorOffset(
page,
{ startHours, startMins, startSecs, endHours, endMins, endSecs }
) {
if (startHours) {
await page.getByRole('spinbutton', { name: 'Start offset hours' }).fill(startHours);
}

if (startMins) {
await page.getByRole('spinbutton', { name: 'Start offset minutes' }).fill(startMins);
}

if (startSecs) {
await page.getByRole('spinbutton', { name: 'Start offset seconds' }).fill(startSecs);
}

if (hours) {
await page.fill('.pr-time-input__hrs', hours);
if (endHours) {
await page.getByRole('spinbutton', { name: 'End offset hours' }).fill(endHours);
}

if (mins) {
await page.fill('.pr-time-input__mins', mins);
if (endMins) {
await page.getByRole('spinbutton', { name: 'End offset minutes' }).fill(endMins);
}

if (secs) {
await page.fill('.pr-time-input__secs', secs);
if (endSecs) {
await page.getByRole('spinbutton', { name: 'End offset seconds' }).fill(endSecs);
}

// Click the check button
Expand All @@ -381,8 +395,7 @@ async function setTimeConductorOffset(page, { hours, mins, secs }) {
*/
async function setStartOffset(page, offset) {
// Click 'mode' button
const timeConductorMode = await page.locator('.c-compact-tc');
await timeConductorMode.click();
await page.getByRole('button', { name: 'Time Conductor Mode', exact: true }).click();
await setTimeConductorOffset(page, offset);
}

Expand All @@ -393,11 +406,53 @@ async function setStartOffset(page, offset) {
*/
async function setEndOffset(page, offset) {
// Click 'mode' button
const timeConductorMode = await page.locator('.c-compact-tc');
await timeConductorMode.click();
await page.getByRole('button', { name: 'Time Conductor Mode', exact: true }).click();
await setTimeConductorOffset(page, offset);
}

async function setTimeConductorBounds(page, startDate, endDate) {
// Bring up the time conductor popup
await page.click('.l-shell__time-conductor.c-compact-tc');

await setTimeBounds(page, startDate, endDate);

await page.keyboard.press('Enter');
}

async function setIndependentTimeConductorBounds(page, startDate, endDate) {
// Activate Independent Time Conductor in Fixed Time Mode
await page.getByRole('switch').click();

// Bring up the time conductor popup
await page.click('.c-conductor-holder--compact .c-compact-tc');

await expect(page.locator('.itc-popout')).toBeVisible();

await setTimeBounds(page, startDate, endDate);

await page.keyboard.press('Enter');
}

async function setTimeBounds(page, startDate, endDate) {
if (startDate) {
// Fill start time
await page
.getByRole('textbox', { name: 'Start date' })
.fill(startDate.toString().substring(0, 10));
await page
.getByRole('textbox', { name: 'Start time' })
.fill(startDate.toString().substring(11, 19));
}

if (endDate) {
// Fill end time
await page.getByRole('textbox', { name: 'End date' }).fill(endDate.toString().substring(0, 10));
await page
.getByRole('textbox', { name: 'End time' })
.fill(endDate.toString().substring(11, 19));
}
}

/**
* Selects an inspector tab based on the provided tab name
*
Expand Down Expand Up @@ -509,6 +564,8 @@ module.exports = {
setRealTimeMode,
setStartOffset,
setEndOffset,
setTimeConductorBounds,
setIndependentTimeConductorBounds,
selectInspectorTab,
waitForPlotsToRender
};
4 changes: 2 additions & 2 deletions e2e/tests/functional/notification.e2e.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ const { createDomainObjectWithDefaults, createNotification } = require('../../ap
const { test, expect } = require('../../pluginFixtures');

test.describe('Notifications List', () => {
test('Notifications can be dismissed individually', async ({ page }) => {
test.fixme('Notifications can be dismissed individually', async ({ page }) => {
test.info().annotations.push({
type: 'issue',
description: 'https://github.com/nasa/openmct/issues/6122'
description: 'https://github.com/nasa/openmct/issues/6820'
});

// Go to baseURL
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/functional/planning/timelist.e2e.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ test.describe('Time List', () => {

await test.step('Does not show milliseconds in times', async () => {
// Get the first activity
const row = await page.locator('.js-list-item').first();
const row = page.locator('.js-list-item').first();
// Verify that none fo the times have milliseconds displayed.
// Example: 2024-11-17T16:00:00Z is correct and 2024-11-17T16:00:00.000Z is wrong

Expand Down
30 changes: 8 additions & 22 deletions e2e/tests/functional/planning/timestrip.e2e.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
*****************************************************************************/

const { test, expect } = require('../../../pluginFixtures');
const { createDomainObjectWithDefaults, createPlanFromJSON } = require('../../../appActions');
const {
createDomainObjectWithDefaults,
createPlanFromJSON,
setIndependentTimeConductorBounds
} = require('../../../appActions');

const testPlan = {
TEST_GROUP: [
Expand Down Expand Up @@ -78,9 +82,6 @@ test.describe('Time Strip', () => {
});

// Constant locators
const independentTimeConductorInputs = page.locator(
'.l-shell__main-independent-time-conductor .c-input--datetime'
);
const activityBounds = page.locator('.activity-bounds');

// Goto baseURL
Expand Down Expand Up @@ -122,22 +123,15 @@ test.describe('Time Strip', () => {
});

await test.step('TimeStrip can use the Independent Time Conductor', async () => {
// Activate Independent Time Conductor in Fixed Time Mode
await page.click('.c-toggle-switch__slider');
expect(await activityBounds.count()).toEqual(0);
expect(await activityBounds.count()).toEqual(5);

// Set the independent time bounds so that only one event is shown
const startBound = testPlan.TEST_GROUP[0].start;
const endBound = testPlan.TEST_GROUP[0].end;
const startBoundString = new Date(startBound).toISOString().replace('T', ' ');
const endBoundString = new Date(endBound).toISOString().replace('T', ' ');

await independentTimeConductorInputs.nth(0).fill('');
await independentTimeConductorInputs.nth(0).fill(startBoundString);
await page.keyboard.press('Enter');
await independentTimeConductorInputs.nth(1).fill('');
await independentTimeConductorInputs.nth(1).fill(endBoundString);
await page.keyboard.press('Enter');
await setIndependentTimeConductorBounds(page, startBoundString, endBoundString);
expect(await activityBounds.count()).toEqual(1);
});

Expand All @@ -156,9 +150,6 @@ test.describe('Time Strip', () => {
await page.click("button[title='Save']");
await page.click("li[title='Save and Finish Editing']");

// Activate Independent Time Conductor in Fixed Time Mode
await page.click('.c-toggle-switch__slider');

// All events should be displayed at this point because the
// initial independent context bounds will match the global bounds
expect(await activityBounds.count()).toEqual(5);
Expand All @@ -169,12 +160,7 @@ test.describe('Time Strip', () => {
const startBoundString = new Date(startBound).toISOString().replace('T', ' ');
const endBoundString = new Date(endBound).toISOString().replace('T', ' ');

await independentTimeConductorInputs.nth(0).fill('');
await independentTimeConductorInputs.nth(0).fill(startBoundString);
await page.keyboard.press('Enter');
await independentTimeConductorInputs.nth(1).fill('');
await independentTimeConductorInputs.nth(1).fill(endBoundString);
await page.keyboard.press('Enter');
await setIndependentTimeConductorBounds(page, startBoundString, endBoundString);

// Verify that two events are displayed
expect(await activityBounds.count()).toEqual(2);
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/functional/plugins/clocks/clock.e2e.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ test.describe('Clock Generator CRUD Operations', () => {
await page.click('button:has-text("Create")');

// Click Clock
await page.click('text=Clock');
await page.getByRole('menuitem').first().click();

// Click .icon-arrow-down
await page.locator('.icon-arrow-down').click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ const {
createDomainObjectWithDefaults,
setStartOffset,
setFixedTimeMode,
setRealTimeMode
setRealTimeMode,
setIndependentTimeConductorBounds
} = require('../../../../appActions');

test.describe('Display Layout', () => {
Expand Down Expand Up @@ -231,20 +232,27 @@ test.describe('Display Layout', () => {
let layoutGridHolder = page.locator('.l-layout__grid-holder');
await exampleImageryTreeItem.dragTo(layoutGridHolder);

//adjust so that we can see the independent time conductor toggle
// Adjust object height
await page.locator('div[title="Resize object height"] > input').click();
await page.locator('div[title="Resize object height"] > input').fill('70');

// Adjust object width
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.locator('text=Save and Finish Editing').click();

// flip on independent time conductor
await page.getByTitle('Enable independent Time Conductor').first().locator('label').click();
await page.getByRole('textbox').nth(1).fill('2021-12-30 01:11:00.000Z');
await page.getByRole('textbox').nth(0).fill('2021-12-30 01:01:00.000Z');
await page.getByRole('textbox').nth(1).click();
const startDate = '2021-12-30 01:01:00.000Z';
const endDate = '2021-12-30 01:11:00.000Z';
await setIndependentTimeConductorBounds(page, startDate, endDate);

// check image date
await expect(page.getByText('2021-12-30 01:11:00.000Z').first()).toBeVisible();

// flip it off
await page.getByTitle('Disable independent Time Conductor').first().locator('label').click();
await page.getByRole('switch').click();
// timestamp shouldn't be in the past anymore
await expect(page.getByText('2021-12-30 01:11:00.000Z')).toBeHidden();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
*****************************************************************************/

const { test, expect } = require('../../../../pluginFixtures');
const { createDomainObjectWithDefaults } = require('../../../../appActions');
const {
createDomainObjectWithDefaults,
setIndependentTimeConductorBounds
} = require('../../../../appActions');

test.describe('Flexible Layout', () => {
let sineWaveObject;
Expand Down Expand Up @@ -187,16 +190,17 @@ test.describe('Flexible Layout', () => {
await page.locator('text=Save and Finish Editing').click();

// flip on independent time conductor
await page.getByTitle('Enable independent Time Conductor').first().locator('label').click();
await page.getByRole('textbox').nth(1).fill('2021-12-30 01:11:00.000Z');
await page.getByRole('textbox').nth(0).fill('2021-12-30 01:01:00.000Z');
await page.getByRole('textbox').nth(1).click();
await setIndependentTimeConductorBounds(
page,
'2021-12-30 01:01:00.000Z',
'2021-12-30 01:11:00.000Z'
);

// check image date
await expect(page.getByText('2021-12-30 01:11:00.000Z').first()).toBeVisible();

// flip it off
await page.getByTitle('Disable independent Time Conductor').first().locator('label').click();
await page.getByRole('switch').click();
// timestamp shouldn't be in the past anymore
await expect(page.getByText('2021-12-30 01:11:00.000Z')).toBeHidden();
});
Expand Down
Loading