Compare commits

...

1 Commits

Author SHA1 Message Date
John Hill
ea68664a58 init push 2022-09-20 16:02:40 -07:00
5 changed files with 191 additions and 15 deletions

View File

@@ -2,7 +2,8 @@
module.exports = { module.exports = {
"extends": ["plugin:playwright/playwright-test"], "extends": ["plugin:playwright/playwright-test"],
"rules": { "rules": {
"playwright/max-nested-describe": ["error", { "max": 1 }] "playwright/max-nested-describe": ["error", { "max": 1 }],
"object-property-newline": "off"
}, },
"overrides": [ "overrides": [
{ {

View File

@@ -0,0 +1,75 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2022, 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.
*****************************************************************************/
const { test, expect } = require('../../../../baseFixtures');
const { createDomainObjectWithDefaults } = require('../../../../appActions');
test.describe('Compass Rose Verification', () => {
// Top-level declaration of the Timer object created in beforeEach().
// We can then use this throughout the entire test suite.
let timer;
test.beforeEach(async ({ page }) => {
// Open a browser, navigate to the main page, and wait until all network events to resolve
await page.goto('./', { waitUntil: 'networkidle' });
// We provide some helper functions in appActions like `createDomainObjectWithDefaults()`.
// This example will create a Timer object with default properties, under the root folder:
timer = await createDomainObjectWithDefaults(page, { type: 'Timer' });
// Assert the object to be created and check its name in the title
await expect(page.locator('.l-browse-bar__object-name')).toContainText(timer.name);
});
test.fixme('When locked and unlocked, Compass rose will fix North to be up and back to original position @gds', async ({ page }) => {
//Detect orientation of compass rose in default position
//Click on Compass Rose
//Verify that North is up
//Click on Compass Rose
//Verify that North returns to original position
});
test.fixme('Compass Rose is visible on images which contain necessary telemetry @gds', async ({ page }) => {
//Rover Heading
//Camera Field of Vue
//North
});
test.fixme('Compass Rose is not visible on images which do not contain necessary telemetry', async ({ page }) => {
//TODO Understand this scenario
});
});
test.describe('Compass HUD Verification', () => {
let timer;
test.beforeEach(async ({ page }) => {
// Open a browser, navigate to the main page, and wait until all network events to resolve
await page.goto('./', { waitUntil: 'networkidle' });
// We provide some helper functions in appActions like `createDomainObjectWithDefaults()`.
// This example will create a Timer object with default properties, under the root folder:
timer = await createDomainObjectWithDefaults(page, { type: 'Timer' });
// Assert the object to be created and check its name in the title
await expect(page.locator('.l-browse-bar__object-name')).toContainText(timer.name);
});
test.fixme('Compass HUD is displayed ontop of imagery @gds', async ({ page }) => {
//Compass HUD appears over imagery
});
});

View File

@@ -34,7 +34,7 @@ const panHotkey = process.platform === 'linux' ? ['Control', 'Alt'] : ['Alt'];
const expectedAltText = process.platform === 'linux' ? 'Ctrl+Alt drag to pan' : 'Alt drag to pan'; const expectedAltText = process.platform === 'linux' ? 'Ctrl+Alt drag to pan' : 'Alt drag to pan';
//The following block of tests verifies the basic functionality of example imagery and serves as a template for Imagery objects embedded in other objects. //The following block of tests verifies the basic functionality of example imagery and serves as a template for Imagery objects embedded in other objects.
test.describe('Example Imagery Object', () => { test.describe('Imagery View Controls', () => {
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
//Go to baseURL //Go to baseURL
await page.goto('./', { waitUntil: 'networkidle' }); await page.goto('./', { waitUntil: 'networkidle' });
@@ -167,14 +167,27 @@ test.describe('Example Imagery Object', () => {
await zoomIntoImageryByButton(page); await zoomIntoImageryByButton(page);
await expect(pausePlayButton).not.toHaveClass(/is-paused/); await expect(pausePlayButton).not.toHaveClass(/is-paused/);
}); });
});
test.describe('Imagery View Attributes', () => {
test.beforeEach(async ({ page }) => {
//Go to baseURL
await page.goto('./', { waitUntil: 'networkidle' });
// Create a default 'Example Imagery' object
await createDomainObjectWithDefaults(page, { type: 'Example Imagery' });
// Verify that the created object is focused
await expect(page.locator('.l-browse-bar__object-name')).toContainText('Unnamed Example Imagery');
await page.locator(backgroundImageSelector).hover({trial: true});
});
test('Uses low fetch priority', async ({ page }) => { test('Uses low fetch priority', async ({ page }) => {
const priority = await page.locator('.js-imageryView-image').getAttribute('fetchpriority'); const priority = await page.locator('.js-imageryView-image').getAttribute('fetchpriority');
await expect(priority).toBe('low'); await expect(priority).toBe('low');
}); });
}); });
test.describe('Example Imagery in Display Layout', () => { test.describe('Imagery in Display Layout', () => {
let displayLayout; let displayLayout;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
// Go to baseURL // Go to baseURL
@@ -208,10 +221,7 @@ test.describe('Example Imagery in Display Layout', () => {
}); });
test('Imagery View operations @unstable', async ({ page }) => { test('Imagery View operations @unstable', async ({ page }) => {
test.info().annotations.push({ test.info().annotations.push({type: 'issue', description: 'https://github.com/nasa/openmct/issues/5265'});
type: 'issue',
description: 'https://github.com/nasa/openmct/issues/5265'
});
// Edit mode // Edit mode
await page.click('button[title="Edit"]'); await page.click('button[title="Edit"]');
@@ -260,9 +270,14 @@ test.describe('Example Imagery in Display Layout', () => {
expect(thumbsWrapperLocator.isVisible()).toBeTruthy(); expect(thumbsWrapperLocator.isVisible()).toBeTruthy();
await expect(thumbsWrapperLocator).not.toHaveClass(/is-small-thumbs/); await expect(thumbsWrapperLocator).not.toHaveClass(/is-small-thumbs/);
}); });
test('Uses low fetch priority', async ({ page }) => {
const priority = await page.locator('.js-imageryView-image').getAttribute('fetchpriority');
await expect(priority).toBe('low');
});
}); });
test.describe('Example Imagery in Flexible layout', () => { test.describe('Imagery in Flexible layout', () => {
let flexibleLayout; let flexibleLayout;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
await page.goto('./', { waitUntil: 'networkidle' }); await page.goto('./', { waitUntil: 'networkidle' });
@@ -302,9 +317,14 @@ test.describe('Example Imagery in Flexible layout', () => {
await performImageryViewOperationsAndAssert(page); await performImageryViewOperationsAndAssert(page);
}); });
test('Uses low fetch priority', async ({ page }) => {
const priority = await page.locator('.js-imageryView-image').getAttribute('fetchpriority');
await expect(priority).toBe('low');
});
}); });
test.describe('Example Imagery in Tabs View', () => { test.describe('Imagery in Tabs View', () => {
let tabsView; let tabsView;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
await page.goto('./', { waitUntil: 'networkidle' }); await page.goto('./', { waitUntil: 'networkidle' });
@@ -338,9 +358,13 @@ test.describe('Example Imagery in Tabs View', () => {
test('Imagery View operations @unstable', async ({ page }) => { test('Imagery View operations @unstable', async ({ page }) => {
await performImageryViewOperationsAndAssert(page); await performImageryViewOperationsAndAssert(page);
}); });
test('Uses low fetch priority', async ({ page }) => {
const priority = await page.locator('.js-imageryView-image').getAttribute('fetchpriority');
await expect(priority).toBe('low');
});
}); });
test.describe('Example Imagery in Time Strip', () => { test.describe('Imagery in Time Strip', () => {
let timeStripObject; let timeStripObject;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
await page.goto('./', { waitUntil: 'networkidle' }); await page.goto('./', { waitUntil: 'networkidle' });
@@ -374,6 +398,11 @@ test.describe('Example Imagery in Time Strip', () => {
expect(viewLargeImgSrc).toBeTruthy(); expect(viewLargeImgSrc).toBeTruthy();
expect(viewLargeImgSrc).toEqual(hoveredImgSrc); expect(viewLargeImgSrc).toEqual(hoveredImgSrc);
}); });
test('Uses low fetch priority', async ({ page }) => {
const priority = await page.locator('.js-imageryView-image').getAttribute('fetchpriority');
await expect(priority).toBe('low');
});
}); });
/** /**

View File

@@ -0,0 +1,68 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2022, 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 template is to be used when creating new test suites. It will be kept up to date with the latest improvements
* made by the Open MCT team. It will also follow our best pratices as those evolve. Please use this structure as a _reference_ and clear
* or update any references when creating a new test suite!
*
* To illustrate current best practices, we've included a mocked up test suite for Renaming a Timer domain object.
*
* Demonstrated:
* - Using appActions to leverage existing functions
* - Structure
* - @unstable annotation
* - await, expect, test, describe syntax
* - Writing a custom function for a test suite
* - Test stub for unfinished test coverage (test.fixme)
*
* The structure should follow
* 1. imports
* 2. test.describe()
* 3. -> test1
* -> test2
* -> test3(stub)
* 4. Any custom functions
*/
// Structure: Some standard Imports. Please update the required pathing.
const { test, expect } = require('../../baseFixtures');
const { createDomainObjectWithDefaults } = require('../../appActions');
test.describe('Imagery Thumbnail', () => {
// Top-level declaration of the Timer object created in beforeEach().
// We can then use this throughout the entire test suite.
let timer;
test.beforeEach(async ({ page }) => {
// Open a browser, navigate to the main page, and wait until all network events to resolve
await page.goto('./', { waitUntil: 'networkidle' });
// We provide some helper functions in appActions like `createDomainObjectWithDefaults()`.
// This example will create a Timer object with default properties, under the root folder:
timer = await createDomainObjectWithDefaults(page, { type: 'Timer' });
// Assert the object to be created and check its name in the title
await expect(page.locator('.l-browse-bar__object-name')).toContainText(timer.name);
});
test.fixme('Images the initial, default timebounds appear in the main view as well as thumbnails', async ({ page }) => {});
test.fixme('Images', async ({ page }) => {});
});

View File

@@ -23,12 +23,9 @@
const { createDomainObjectWithDefaults } = require('../../../../appActions'); const { createDomainObjectWithDefaults } = require('../../../../appActions');
const { test, expect } = require('../../../../pluginFixtures'); const { test, expect } = require('../../../../pluginFixtures');
test.describe('Telemetry Table', () => { test.describe('Telemetry Table Interaction', () => {
test('unpauses and filters data when paused by button and user changes bounds', async ({ page }) => { test('unpauses and filters data when paused by button and user changes bounds', async ({ page }) => {
test.info().annotations.push({ test.info().annotations.push({type: 'issue', description: 'https://github.com/nasa/openmct/issues/5113'});
type: 'issue',
description: 'https://github.com/nasa/openmct/issues/5113'
});
await page.goto('./', { waitUntil: 'networkidle' }); await page.goto('./', { waitUntil: 'networkidle' });
@@ -73,3 +70,9 @@ test.describe('Telemetry Table', () => {
expect(latestMilliseconds).toBeLessThanOrEqual(endBoundMilliseconds); expect(latestMilliseconds).toBeLessThanOrEqual(endBoundMilliseconds);
}); });
}); });
test.describe('Telemetry Type', () => {
test.fixme('Imagery Telemetry Table Data is correct @gds', async ({ page }) => {
//Telemetry Metadata is displayed in a table format
});
});