openmct/e2e/tests/functional/forms.e2e.spec.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

300 lines
11 KiB
JavaScript
Raw Normal View History

/*****************************************************************************
* 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 is dedicated to tests which verify form functionality in isolation
*/
import { fileURLToPath } from 'url';
import { v4 as genUuid } from 'uuid';
import { createDomainObjectWithDefaults } from '../../appActions.js';
import { expect, test } from '../../pluginFixtures.js';
const TEST_FOLDER = 'test folder';
const jsonFilePath = 'test-data/ExampleLayouts.json';
const imageFilePath = 'test-data/rick.jpg';
test.describe('Form Validation Behavior', () => {
test('Required Field indicators appear if title is empty and can be corrected', async ({
page
}) => {
//Go to baseURL
await page.goto('./', { waitUntil: 'domcontentloaded' });
await page.getByRole('button', { name: 'Create' }).click();
await page.getByRole('menuitem', { name: 'Folder' }).click();
// Fill in empty string into title and trigger validation with 'Tab'
test(e2e): Major refactor and stabilization of e2e tests (#7581) * fix: update broken locator * update eslint package * first pass of lint fixes * update package * change ruleset * update component tests to match linting rules * driveby * start to factor out bad locators * update gauge component * update notebook snapshot drop area * Update plot aria * add draggable true to tree items * update package * driveby to remove dead code * unneeded * unneeded * tells a screenreader that this is a row and a cell * adds an id for dragondrops * this should be a button * first pass at fixing tooltip selectors * review comments * Updating more tests * update to remove expect expect given our use of check functions * add expand component * move role around * update more locators * force * new local storage * remove choochoo steps * test: do `lint:fix` and also add back accidentally removed code * test: add back more removed code * test: remove `unstable` annotation from tests which are not unstable * test: remove invalid test-- the "new" time conductor doesn't allow for millisecond changes in fixed time * test: fix unstable gauge test * test: remove useless asserts-- this was secretly non-functional. now that we've fixed it, it makes no sense and just fails * test: add back accidentally removed changes * test: revert changes that break test * test: more fixes * Remove all notion of the unstable/stable e2e tests * test: eviscerate the flake with FACTS and LOGIC * test: fix anotha one * lint fixes * test: no need to wait for save dialog * test: fix more tests * lint: fix more warnings * test: fix anotha one * test: use `toHaveLength` instead of `.length).toBe()` * test: stabilize tabs view example imagery test * fix: more tests be fixed * test: more `toHaveCount()`s please * test: revert more accidentally removed fixes * test: fix selector * test: fix anotha one * update lint rules to clean up bad locators in shared fixtures * update and remove bad appActions * test: fix some restricted notebook tests * test: mass find/replace to enforce `toHaveCount()` instead of `.count()).toBe()` * Remove some bad appActions and update text * test: fix da tree tests * test: await not await await * test: fix upload plan appAction and add a11y * Updating externalFixtures with best practice locators and add missing appAction framework tests * test: fix test * test: fix appAction test for plans * test: yum yum fix'em up and get rid of some dragon drops * fix: alas, a `.only()` got my hopes up that i was done fixing tests * test: add `setTimeConductorMode` test "suite" which covers most TC related appActions * test: fix arg * test(couchdb): fix some network tests via expect polling * Stabalize visual test * getCanasPixels * test: stabilize tooltip telemetry table test, better a11y for tooltips * chore: update to use `docker compose` instead of `docker-compose` * New rules, new tests, new me * fix sort order * test: add `waitForPlotsToRender` framework test, passthru timeout override * test: remove `clockOptions` test as we have `page.clock` now * test: refactor out `overrideClock` * test: use `clock.install` instead * test: use `clock.install` instead * time clock fix * test: fix timer tests * remove ever reference to old base fixture * test: stabilize restricted notebook test * lint fixes * test: use clock.install * update timelist * test: update visual tests to use `page.clock()`, update snapshots * test: stabilize tree renaming/reordering test * a11y: add aria-label and role=region to object view * refactor: use `dragTo` * refactor: use `dragTo`, other small fixes * test: use `page.clock()` to stabilize tooltip telemetry table test * test: use web-first assertion to stabilize staleness test * test: knock out a few more `page.click`s * test: destroy all `page.click()`s * refactor: consistently use `'Ok'` instead of `'OK'` and `'Ok'` mixed * test: remove gauge aria label * test: more test fixes * test: more fixes and refactors * docs: add comment * test: refactor all instances of `dragAndDrop` * test: remove redundant test (covered in previous test steps) * test: stabilize imagery operations tests for display layout * chore: remove bad unicorn rule * chore(lint): remove unused disable directives --------- Co-authored-by: Jesse Mazzella <jesse.d.mazzella@nasa.gov>
2024-08-07 21:36:14 +00:00
await page.getByLabel('Title', { exact: true }).fill('');
await page.getByLabel('Title', { exact: true }).press('Tab');
//Required Field Form Validation
test(e2e): Major refactor and stabilization of e2e tests (#7581) * fix: update broken locator * update eslint package * first pass of lint fixes * update package * change ruleset * update component tests to match linting rules * driveby * start to factor out bad locators * update gauge component * update notebook snapshot drop area * Update plot aria * add draggable true to tree items * update package * driveby to remove dead code * unneeded * unneeded * tells a screenreader that this is a row and a cell * adds an id for dragondrops * this should be a button * first pass at fixing tooltip selectors * review comments * Updating more tests * update to remove expect expect given our use of check functions * add expand component * move role around * update more locators * force * new local storage * remove choochoo steps * test: do `lint:fix` and also add back accidentally removed code * test: add back more removed code * test: remove `unstable` annotation from tests which are not unstable * test: remove invalid test-- the "new" time conductor doesn't allow for millisecond changes in fixed time * test: fix unstable gauge test * test: remove useless asserts-- this was secretly non-functional. now that we've fixed it, it makes no sense and just fails * test: add back accidentally removed changes * test: revert changes that break test * test: more fixes * Remove all notion of the unstable/stable e2e tests * test: eviscerate the flake with FACTS and LOGIC * test: fix anotha one * lint fixes * test: no need to wait for save dialog * test: fix more tests * lint: fix more warnings * test: fix anotha one * test: use `toHaveLength` instead of `.length).toBe()` * test: stabilize tabs view example imagery test * fix: more tests be fixed * test: more `toHaveCount()`s please * test: revert more accidentally removed fixes * test: fix selector * test: fix anotha one * update lint rules to clean up bad locators in shared fixtures * update and remove bad appActions * test: fix some restricted notebook tests * test: mass find/replace to enforce `toHaveCount()` instead of `.count()).toBe()` * Remove some bad appActions and update text * test: fix da tree tests * test: await not await await * test: fix upload plan appAction and add a11y * Updating externalFixtures with best practice locators and add missing appAction framework tests * test: fix test * test: fix appAction test for plans * test: yum yum fix'em up and get rid of some dragon drops * fix: alas, a `.only()` got my hopes up that i was done fixing tests * test: add `setTimeConductorMode` test "suite" which covers most TC related appActions * test: fix arg * test(couchdb): fix some network tests via expect polling * Stabalize visual test * getCanasPixels * test: stabilize tooltip telemetry table test, better a11y for tooltips * chore: update to use `docker compose` instead of `docker-compose` * New rules, new tests, new me * fix sort order * test: add `waitForPlotsToRender` framework test, passthru timeout override * test: remove `clockOptions` test as we have `page.clock` now * test: refactor out `overrideClock` * test: use `clock.install` instead * test: use `clock.install` instead * time clock fix * test: fix timer tests * remove ever reference to old base fixture * test: stabilize restricted notebook test * lint fixes * test: use clock.install * update timelist * test: update visual tests to use `page.clock()`, update snapshots * test: stabilize tree renaming/reordering test * a11y: add aria-label and role=region to object view * refactor: use `dragTo` * refactor: use `dragTo`, other small fixes * test: use `page.clock()` to stabilize tooltip telemetry table test * test: use web-first assertion to stabilize staleness test * test: knock out a few more `page.click`s * test: destroy all `page.click()`s * refactor: consistently use `'Ok'` instead of `'OK'` and `'Ok'` mixed * test: remove gauge aria label * test: more test fixes * test: more fixes and refactors * docs: add comment * test: refactor all instances of `dragAndDrop` * test: remove redundant test (covered in previous test steps) * test: stabilize imagery operations tests for display layout * chore: remove bad unicorn rule * chore(lint): remove unused disable directives --------- Co-authored-by: Jesse Mazzella <jesse.d.mazzella@nasa.gov>
2024-08-07 21:36:14 +00:00
await expect(page.getByLabel('Save')).toBeDisabled();
await expect(page.locator('.c-form-row__state-indicator').first()).toHaveClass(/invalid/);
//Correct Form Validation for missing title and trigger validation with 'Tab'
test(e2e): Major refactor and stabilization of e2e tests (#7581) * fix: update broken locator * update eslint package * first pass of lint fixes * update package * change ruleset * update component tests to match linting rules * driveby * start to factor out bad locators * update gauge component * update notebook snapshot drop area * Update plot aria * add draggable true to tree items * update package * driveby to remove dead code * unneeded * unneeded * tells a screenreader that this is a row and a cell * adds an id for dragondrops * this should be a button * first pass at fixing tooltip selectors * review comments * Updating more tests * update to remove expect expect given our use of check functions * add expand component * move role around * update more locators * force * new local storage * remove choochoo steps * test: do `lint:fix` and also add back accidentally removed code * test: add back more removed code * test: remove `unstable` annotation from tests which are not unstable * test: remove invalid test-- the "new" time conductor doesn't allow for millisecond changes in fixed time * test: fix unstable gauge test * test: remove useless asserts-- this was secretly non-functional. now that we've fixed it, it makes no sense and just fails * test: add back accidentally removed changes * test: revert changes that break test * test: more fixes * Remove all notion of the unstable/stable e2e tests * test: eviscerate the flake with FACTS and LOGIC * test: fix anotha one * lint fixes * test: no need to wait for save dialog * test: fix more tests * lint: fix more warnings * test: fix anotha one * test: use `toHaveLength` instead of `.length).toBe()` * test: stabilize tabs view example imagery test * fix: more tests be fixed * test: more `toHaveCount()`s please * test: revert more accidentally removed fixes * test: fix selector * test: fix anotha one * update lint rules to clean up bad locators in shared fixtures * update and remove bad appActions * test: fix some restricted notebook tests * test: mass find/replace to enforce `toHaveCount()` instead of `.count()).toBe()` * Remove some bad appActions and update text * test: fix da tree tests * test: await not await await * test: fix upload plan appAction and add a11y * Updating externalFixtures with best practice locators and add missing appAction framework tests * test: fix test * test: fix appAction test for plans * test: yum yum fix'em up and get rid of some dragon drops * fix: alas, a `.only()` got my hopes up that i was done fixing tests * test: add `setTimeConductorMode` test "suite" which covers most TC related appActions * test: fix arg * test(couchdb): fix some network tests via expect polling * Stabalize visual test * getCanasPixels * test: stabilize tooltip telemetry table test, better a11y for tooltips * chore: update to use `docker compose` instead of `docker-compose` * New rules, new tests, new me * fix sort order * test: add `waitForPlotsToRender` framework test, passthru timeout override * test: remove `clockOptions` test as we have `page.clock` now * test: refactor out `overrideClock` * test: use `clock.install` instead * test: use `clock.install` instead * time clock fix * test: fix timer tests * remove ever reference to old base fixture * test: stabilize restricted notebook test * lint fixes * test: use clock.install * update timelist * test: update visual tests to use `page.clock()`, update snapshots * test: stabilize tree renaming/reordering test * a11y: add aria-label and role=region to object view * refactor: use `dragTo` * refactor: use `dragTo`, other small fixes * test: use `page.clock()` to stabilize tooltip telemetry table test * test: use web-first assertion to stabilize staleness test * test: knock out a few more `page.click`s * test: destroy all `page.click()`s * refactor: consistently use `'Ok'` instead of `'OK'` and `'Ok'` mixed * test: remove gauge aria label * test: more test fixes * test: more fixes and refactors * docs: add comment * test: refactor all instances of `dragAndDrop` * test: remove redundant test (covered in previous test steps) * test: stabilize imagery operations tests for display layout * chore: remove bad unicorn rule * chore(lint): remove unused disable directives --------- Co-authored-by: Jesse Mazzella <jesse.d.mazzella@nasa.gov>
2024-08-07 21:36:14 +00:00
await page.getByLabel('Title', { exact: true }).fill(TEST_FOLDER);
await page.getByLabel('Title', { exact: true }).press('Tab');
//Required Field Form Validation is corrected
test(e2e): Major refactor and stabilization of e2e tests (#7581) * fix: update broken locator * update eslint package * first pass of lint fixes * update package * change ruleset * update component tests to match linting rules * driveby * start to factor out bad locators * update gauge component * update notebook snapshot drop area * Update plot aria * add draggable true to tree items * update package * driveby to remove dead code * unneeded * unneeded * tells a screenreader that this is a row and a cell * adds an id for dragondrops * this should be a button * first pass at fixing tooltip selectors * review comments * Updating more tests * update to remove expect expect given our use of check functions * add expand component * move role around * update more locators * force * new local storage * remove choochoo steps * test: do `lint:fix` and also add back accidentally removed code * test: add back more removed code * test: remove `unstable` annotation from tests which are not unstable * test: remove invalid test-- the "new" time conductor doesn't allow for millisecond changes in fixed time * test: fix unstable gauge test * test: remove useless asserts-- this was secretly non-functional. now that we've fixed it, it makes no sense and just fails * test: add back accidentally removed changes * test: revert changes that break test * test: more fixes * Remove all notion of the unstable/stable e2e tests * test: eviscerate the flake with FACTS and LOGIC * test: fix anotha one * lint fixes * test: no need to wait for save dialog * test: fix more tests * lint: fix more warnings * test: fix anotha one * test: use `toHaveLength` instead of `.length).toBe()` * test: stabilize tabs view example imagery test * fix: more tests be fixed * test: more `toHaveCount()`s please * test: revert more accidentally removed fixes * test: fix selector * test: fix anotha one * update lint rules to clean up bad locators in shared fixtures * update and remove bad appActions * test: fix some restricted notebook tests * test: mass find/replace to enforce `toHaveCount()` instead of `.count()).toBe()` * Remove some bad appActions and update text * test: fix da tree tests * test: await not await await * test: fix upload plan appAction and add a11y * Updating externalFixtures with best practice locators and add missing appAction framework tests * test: fix test * test: fix appAction test for plans * test: yum yum fix'em up and get rid of some dragon drops * fix: alas, a `.only()` got my hopes up that i was done fixing tests * test: add `setTimeConductorMode` test "suite" which covers most TC related appActions * test: fix arg * test(couchdb): fix some network tests via expect polling * Stabalize visual test * getCanasPixels * test: stabilize tooltip telemetry table test, better a11y for tooltips * chore: update to use `docker compose` instead of `docker-compose` * New rules, new tests, new me * fix sort order * test: add `waitForPlotsToRender` framework test, passthru timeout override * test: remove `clockOptions` test as we have `page.clock` now * test: refactor out `overrideClock` * test: use `clock.install` instead * test: use `clock.install` instead * time clock fix * test: fix timer tests * remove ever reference to old base fixture * test: stabilize restricted notebook test * lint fixes * test: use clock.install * update timelist * test: update visual tests to use `page.clock()`, update snapshots * test: stabilize tree renaming/reordering test * a11y: add aria-label and role=region to object view * refactor: use `dragTo` * refactor: use `dragTo`, other small fixes * test: use `page.clock()` to stabilize tooltip telemetry table test * test: use web-first assertion to stabilize staleness test * test: knock out a few more `page.click`s * test: destroy all `page.click()`s * refactor: consistently use `'Ok'` instead of `'OK'` and `'Ok'` mixed * test: remove gauge aria label * test: more test fixes * test: more fixes and refactors * docs: add comment * test: refactor all instances of `dragAndDrop` * test: remove redundant test (covered in previous test steps) * test: stabilize imagery operations tests for display layout * chore: remove bad unicorn rule * chore(lint): remove unused disable directives --------- Co-authored-by: Jesse Mazzella <jesse.d.mazzella@nasa.gov>
2024-08-07 21:36:14 +00:00
await expect(page.getByLabel('Save')).toBeEnabled();
await expect(page.locator('.c-form-row__state-indicator').first()).not.toHaveClass(/invalid/);
//Finish Creating Domain Object
test(e2e): Major refactor and stabilization of e2e tests (#7581) * fix: update broken locator * update eslint package * first pass of lint fixes * update package * change ruleset * update component tests to match linting rules * driveby * start to factor out bad locators * update gauge component * update notebook snapshot drop area * Update plot aria * add draggable true to tree items * update package * driveby to remove dead code * unneeded * unneeded * tells a screenreader that this is a row and a cell * adds an id for dragondrops * this should be a button * first pass at fixing tooltip selectors * review comments * Updating more tests * update to remove expect expect given our use of check functions * add expand component * move role around * update more locators * force * new local storage * remove choochoo steps * test: do `lint:fix` and also add back accidentally removed code * test: add back more removed code * test: remove `unstable` annotation from tests which are not unstable * test: remove invalid test-- the "new" time conductor doesn't allow for millisecond changes in fixed time * test: fix unstable gauge test * test: remove useless asserts-- this was secretly non-functional. now that we've fixed it, it makes no sense and just fails * test: add back accidentally removed changes * test: revert changes that break test * test: more fixes * Remove all notion of the unstable/stable e2e tests * test: eviscerate the flake with FACTS and LOGIC * test: fix anotha one * lint fixes * test: no need to wait for save dialog * test: fix more tests * lint: fix more warnings * test: fix anotha one * test: use `toHaveLength` instead of `.length).toBe()` * test: stabilize tabs view example imagery test * fix: more tests be fixed * test: more `toHaveCount()`s please * test: revert more accidentally removed fixes * test: fix selector * test: fix anotha one * update lint rules to clean up bad locators in shared fixtures * update and remove bad appActions * test: fix some restricted notebook tests * test: mass find/replace to enforce `toHaveCount()` instead of `.count()).toBe()` * Remove some bad appActions and update text * test: fix da tree tests * test: await not await await * test: fix upload plan appAction and add a11y * Updating externalFixtures with best practice locators and add missing appAction framework tests * test: fix test * test: fix appAction test for plans * test: yum yum fix'em up and get rid of some dragon drops * fix: alas, a `.only()` got my hopes up that i was done fixing tests * test: add `setTimeConductorMode` test "suite" which covers most TC related appActions * test: fix arg * test(couchdb): fix some network tests via expect polling * Stabalize visual test * getCanasPixels * test: stabilize tooltip telemetry table test, better a11y for tooltips * chore: update to use `docker compose` instead of `docker-compose` * New rules, new tests, new me * fix sort order * test: add `waitForPlotsToRender` framework test, passthru timeout override * test: remove `clockOptions` test as we have `page.clock` now * test: refactor out `overrideClock` * test: use `clock.install` instead * test: use `clock.install` instead * time clock fix * test: fix timer tests * remove ever reference to old base fixture * test: stabilize restricted notebook test * lint fixes * test: use clock.install * update timelist * test: update visual tests to use `page.clock()`, update snapshots * test: stabilize tree renaming/reordering test * a11y: add aria-label and role=region to object view * refactor: use `dragTo` * refactor: use `dragTo`, other small fixes * test: use `page.clock()` to stabilize tooltip telemetry table test * test: use web-first assertion to stabilize staleness test * test: knock out a few more `page.click`s * test: destroy all `page.click()`s * refactor: consistently use `'Ok'` instead of `'OK'` and `'Ok'` mixed * test: remove gauge aria label * test: more test fixes * test: more fixes and refactors * docs: add comment * test: refactor all instances of `dragAndDrop` * test: remove redundant test (covered in previous test steps) * test: stabilize imagery operations tests for display layout * chore: remove bad unicorn rule * chore(lint): remove unused disable directives --------- Co-authored-by: Jesse Mazzella <jesse.d.mazzella@nasa.gov>
2024-08-07 21:36:14 +00:00
await page.getByLabel('Save').click();
//Verify that the Domain Object has been created with the corrected title property
await expect(page.locator('.l-browse-bar__object-name')).toContainText(TEST_FOLDER);
});
});
test.describe('Form File Input Behavior', () => {
test.beforeEach(async ({ page }) => {
await page.addInitScript({
path: fileURLToPath(new URL('../../helper/addInitFileInputObject.js', import.meta.url))
});
});
test('Can select a JSON file type', async ({ page }) => {
await page.goto('./', { waitUntil: 'domcontentloaded' });
await page.getByRole('button', { name: 'Create' }).click();
await page.getByRole('menuitem', { name: 'JSON File Input Object' }).click();
await page.setInputFiles('#fileElem', jsonFilePath);
await page.getByRole('button', { name: 'Save' }).click();
test(e2e): Major refactor and stabilization of e2e tests (#7581) * fix: update broken locator * update eslint package * first pass of lint fixes * update package * change ruleset * update component tests to match linting rules * driveby * start to factor out bad locators * update gauge component * update notebook snapshot drop area * Update plot aria * add draggable true to tree items * update package * driveby to remove dead code * unneeded * unneeded * tells a screenreader that this is a row and a cell * adds an id for dragondrops * this should be a button * first pass at fixing tooltip selectors * review comments * Updating more tests * update to remove expect expect given our use of check functions * add expand component * move role around * update more locators * force * new local storage * remove choochoo steps * test: do `lint:fix` and also add back accidentally removed code * test: add back more removed code * test: remove `unstable` annotation from tests which are not unstable * test: remove invalid test-- the "new" time conductor doesn't allow for millisecond changes in fixed time * test: fix unstable gauge test * test: remove useless asserts-- this was secretly non-functional. now that we've fixed it, it makes no sense and just fails * test: add back accidentally removed changes * test: revert changes that break test * test: more fixes * Remove all notion of the unstable/stable e2e tests * test: eviscerate the flake with FACTS and LOGIC * test: fix anotha one * lint fixes * test: no need to wait for save dialog * test: fix more tests * lint: fix more warnings * test: fix anotha one * test: use `toHaveLength` instead of `.length).toBe()` * test: stabilize tabs view example imagery test * fix: more tests be fixed * test: more `toHaveCount()`s please * test: revert more accidentally removed fixes * test: fix selector * test: fix anotha one * update lint rules to clean up bad locators in shared fixtures * update and remove bad appActions * test: fix some restricted notebook tests * test: mass find/replace to enforce `toHaveCount()` instead of `.count()).toBe()` * Remove some bad appActions and update text * test: fix da tree tests * test: await not await await * test: fix upload plan appAction and add a11y * Updating externalFixtures with best practice locators and add missing appAction framework tests * test: fix test * test: fix appAction test for plans * test: yum yum fix'em up and get rid of some dragon drops * fix: alas, a `.only()` got my hopes up that i was done fixing tests * test: add `setTimeConductorMode` test "suite" which covers most TC related appActions * test: fix arg * test(couchdb): fix some network tests via expect polling * Stabalize visual test * getCanasPixels * test: stabilize tooltip telemetry table test, better a11y for tooltips * chore: update to use `docker compose` instead of `docker-compose` * New rules, new tests, new me * fix sort order * test: add `waitForPlotsToRender` framework test, passthru timeout override * test: remove `clockOptions` test as we have `page.clock` now * test: refactor out `overrideClock` * test: use `clock.install` instead * test: use `clock.install` instead * time clock fix * test: fix timer tests * remove ever reference to old base fixture * test: stabilize restricted notebook test * lint fixes * test: use clock.install * update timelist * test: update visual tests to use `page.clock()`, update snapshots * test: stabilize tree renaming/reordering test * a11y: add aria-label and role=region to object view * refactor: use `dragTo` * refactor: use `dragTo`, other small fixes * test: use `page.clock()` to stabilize tooltip telemetry table test * test: use web-first assertion to stabilize staleness test * test: knock out a few more `page.click`s * test: destroy all `page.click()`s * refactor: consistently use `'Ok'` instead of `'OK'` and `'Ok'` mixed * test: remove gauge aria label * test: more test fixes * test: more fixes and refactors * docs: add comment * test: refactor all instances of `dragAndDrop` * test: remove redundant test (covered in previous test steps) * test: stabilize imagery operations tests for display layout * chore: remove bad unicorn rule * chore(lint): remove unused disable directives --------- Co-authored-by: Jesse Mazzella <jesse.d.mazzella@nasa.gov>
2024-08-07 21:36:14 +00:00
const type = page.locator('#file-input-type');
await expect(type).toHaveText(`"string"`);
});
test('Can select an image file type', async ({ page }) => {
await page.goto('./', { waitUntil: 'domcontentloaded' });
await page.getByRole('button', { name: 'Create' }).click();
await page.getByRole('menuitem', { name: 'Image File Input Object' }).click();
await page.setInputFiles('#fileElem', imageFilePath);
await page.getByRole('button', { name: 'Save' }).click();
test(e2e): Major refactor and stabilization of e2e tests (#7581) * fix: update broken locator * update eslint package * first pass of lint fixes * update package * change ruleset * update component tests to match linting rules * driveby * start to factor out bad locators * update gauge component * update notebook snapshot drop area * Update plot aria * add draggable true to tree items * update package * driveby to remove dead code * unneeded * unneeded * tells a screenreader that this is a row and a cell * adds an id for dragondrops * this should be a button * first pass at fixing tooltip selectors * review comments * Updating more tests * update to remove expect expect given our use of check functions * add expand component * move role around * update more locators * force * new local storage * remove choochoo steps * test: do `lint:fix` and also add back accidentally removed code * test: add back more removed code * test: remove `unstable` annotation from tests which are not unstable * test: remove invalid test-- the "new" time conductor doesn't allow for millisecond changes in fixed time * test: fix unstable gauge test * test: remove useless asserts-- this was secretly non-functional. now that we've fixed it, it makes no sense and just fails * test: add back accidentally removed changes * test: revert changes that break test * test: more fixes * Remove all notion of the unstable/stable e2e tests * test: eviscerate the flake with FACTS and LOGIC * test: fix anotha one * lint fixes * test: no need to wait for save dialog * test: fix more tests * lint: fix more warnings * test: fix anotha one * test: use `toHaveLength` instead of `.length).toBe()` * test: stabilize tabs view example imagery test * fix: more tests be fixed * test: more `toHaveCount()`s please * test: revert more accidentally removed fixes * test: fix selector * test: fix anotha one * update lint rules to clean up bad locators in shared fixtures * update and remove bad appActions * test: fix some restricted notebook tests * test: mass find/replace to enforce `toHaveCount()` instead of `.count()).toBe()` * Remove some bad appActions and update text * test: fix da tree tests * test: await not await await * test: fix upload plan appAction and add a11y * Updating externalFixtures with best practice locators and add missing appAction framework tests * test: fix test * test: fix appAction test for plans * test: yum yum fix'em up and get rid of some dragon drops * fix: alas, a `.only()` got my hopes up that i was done fixing tests * test: add `setTimeConductorMode` test "suite" which covers most TC related appActions * test: fix arg * test(couchdb): fix some network tests via expect polling * Stabalize visual test * getCanasPixels * test: stabilize tooltip telemetry table test, better a11y for tooltips * chore: update to use `docker compose` instead of `docker-compose` * New rules, new tests, new me * fix sort order * test: add `waitForPlotsToRender` framework test, passthru timeout override * test: remove `clockOptions` test as we have `page.clock` now * test: refactor out `overrideClock` * test: use `clock.install` instead * test: use `clock.install` instead * time clock fix * test: fix timer tests * remove ever reference to old base fixture * test: stabilize restricted notebook test * lint fixes * test: use clock.install * update timelist * test: update visual tests to use `page.clock()`, update snapshots * test: stabilize tree renaming/reordering test * a11y: add aria-label and role=region to object view * refactor: use `dragTo` * refactor: use `dragTo`, other small fixes * test: use `page.clock()` to stabilize tooltip telemetry table test * test: use web-first assertion to stabilize staleness test * test: knock out a few more `page.click`s * test: destroy all `page.click()`s * refactor: consistently use `'Ok'` instead of `'OK'` and `'Ok'` mixed * test: remove gauge aria label * test: more test fixes * test: more fixes and refactors * docs: add comment * test: refactor all instances of `dragAndDrop` * test: remove redundant test (covered in previous test steps) * test: stabilize imagery operations tests for display layout * chore: remove bad unicorn rule * chore(lint): remove unused disable directives --------- Co-authored-by: Jesse Mazzella <jesse.d.mazzella@nasa.gov>
2024-08-07 21:36:14 +00:00
const type = page.locator('#file-input-type');
await expect(type).toHaveText(`"object"`);
});
});
test.describe('Persistence operations @addInit', () => {
// add non persistable root item
test.beforeEach(async ({ page }) => {
await page.addInitScript({
path: fileURLToPath(new URL('../../helper/addNoneditableObject.js', import.meta.url))
});
});
test('Persistability should be respected in the create form location field', async ({ page }) => {
test.info().annotations.push({
type: 'issue',
description: 'https://github.com/nasa/openmct/issues/4323'
});
await page.goto('./', { waitUntil: 'domcontentloaded' });
await page.getByRole('button', { name: 'Create' }).click();
test(e2e): Major refactor and stabilization of e2e tests (#7581) * fix: update broken locator * update eslint package * first pass of lint fixes * update package * change ruleset * update component tests to match linting rules * driveby * start to factor out bad locators * update gauge component * update notebook snapshot drop area * Update plot aria * add draggable true to tree items * update package * driveby to remove dead code * unneeded * unneeded * tells a screenreader that this is a row and a cell * adds an id for dragondrops * this should be a button * first pass at fixing tooltip selectors * review comments * Updating more tests * update to remove expect expect given our use of check functions * add expand component * move role around * update more locators * force * new local storage * remove choochoo steps * test: do `lint:fix` and also add back accidentally removed code * test: add back more removed code * test: remove `unstable` annotation from tests which are not unstable * test: remove invalid test-- the "new" time conductor doesn't allow for millisecond changes in fixed time * test: fix unstable gauge test * test: remove useless asserts-- this was secretly non-functional. now that we've fixed it, it makes no sense and just fails * test: add back accidentally removed changes * test: revert changes that break test * test: more fixes * Remove all notion of the unstable/stable e2e tests * test: eviscerate the flake with FACTS and LOGIC * test: fix anotha one * lint fixes * test: no need to wait for save dialog * test: fix more tests * lint: fix more warnings * test: fix anotha one * test: use `toHaveLength` instead of `.length).toBe()` * test: stabilize tabs view example imagery test * fix: more tests be fixed * test: more `toHaveCount()`s please * test: revert more accidentally removed fixes * test: fix selector * test: fix anotha one * update lint rules to clean up bad locators in shared fixtures * update and remove bad appActions * test: fix some restricted notebook tests * test: mass find/replace to enforce `toHaveCount()` instead of `.count()).toBe()` * Remove some bad appActions and update text * test: fix da tree tests * test: await not await await * test: fix upload plan appAction and add a11y * Updating externalFixtures with best practice locators and add missing appAction framework tests * test: fix test * test: fix appAction test for plans * test: yum yum fix'em up and get rid of some dragon drops * fix: alas, a `.only()` got my hopes up that i was done fixing tests * test: add `setTimeConductorMode` test "suite" which covers most TC related appActions * test: fix arg * test(couchdb): fix some network tests via expect polling * Stabalize visual test * getCanasPixels * test: stabilize tooltip telemetry table test, better a11y for tooltips * chore: update to use `docker compose` instead of `docker-compose` * New rules, new tests, new me * fix sort order * test: add `waitForPlotsToRender` framework test, passthru timeout override * test: remove `clockOptions` test as we have `page.clock` now * test: refactor out `overrideClock` * test: use `clock.install` instead * test: use `clock.install` instead * time clock fix * test: fix timer tests * remove ever reference to old base fixture * test: stabilize restricted notebook test * lint fixes * test: use clock.install * update timelist * test: update visual tests to use `page.clock()`, update snapshots * test: stabilize tree renaming/reordering test * a11y: add aria-label and role=region to object view * refactor: use `dragTo` * refactor: use `dragTo`, other small fixes * test: use `page.clock()` to stabilize tooltip telemetry table test * test: use web-first assertion to stabilize staleness test * test: knock out a few more `page.click`s * test: destroy all `page.click()`s * refactor: consistently use `'Ok'` instead of `'OK'` and `'Ok'` mixed * test: remove gauge aria label * test: more test fixes * test: more fixes and refactors * docs: add comment * test: refactor all instances of `dragAndDrop` * test: remove redundant test (covered in previous test steps) * test: stabilize imagery operations tests for display layout * chore: remove bad unicorn rule * chore(lint): remove unused disable directives --------- Co-authored-by: Jesse Mazzella <jesse.d.mazzella@nasa.gov>
2024-08-07 21:36:14 +00:00
await page.getByRole('menuitem', { name: 'Condition Set' }).click();
await page.locator('form[name="mctForm"] >> text=Persistence Testing').click();
test(e2e): Major refactor and stabilization of e2e tests (#7581) * fix: update broken locator * update eslint package * first pass of lint fixes * update package * change ruleset * update component tests to match linting rules * driveby * start to factor out bad locators * update gauge component * update notebook snapshot drop area * Update plot aria * add draggable true to tree items * update package * driveby to remove dead code * unneeded * unneeded * tells a screenreader that this is a row and a cell * adds an id for dragondrops * this should be a button * first pass at fixing tooltip selectors * review comments * Updating more tests * update to remove expect expect given our use of check functions * add expand component * move role around * update more locators * force * new local storage * remove choochoo steps * test: do `lint:fix` and also add back accidentally removed code * test: add back more removed code * test: remove `unstable` annotation from tests which are not unstable * test: remove invalid test-- the "new" time conductor doesn't allow for millisecond changes in fixed time * test: fix unstable gauge test * test: remove useless asserts-- this was secretly non-functional. now that we've fixed it, it makes no sense and just fails * test: add back accidentally removed changes * test: revert changes that break test * test: more fixes * Remove all notion of the unstable/stable e2e tests * test: eviscerate the flake with FACTS and LOGIC * test: fix anotha one * lint fixes * test: no need to wait for save dialog * test: fix more tests * lint: fix more warnings * test: fix anotha one * test: use `toHaveLength` instead of `.length).toBe()` * test: stabilize tabs view example imagery test * fix: more tests be fixed * test: more `toHaveCount()`s please * test: revert more accidentally removed fixes * test: fix selector * test: fix anotha one * update lint rules to clean up bad locators in shared fixtures * update and remove bad appActions * test: fix some restricted notebook tests * test: mass find/replace to enforce `toHaveCount()` instead of `.count()).toBe()` * Remove some bad appActions and update text * test: fix da tree tests * test: await not await await * test: fix upload plan appAction and add a11y * Updating externalFixtures with best practice locators and add missing appAction framework tests * test: fix test * test: fix appAction test for plans * test: yum yum fix'em up and get rid of some dragon drops * fix: alas, a `.only()` got my hopes up that i was done fixing tests * test: add `setTimeConductorMode` test "suite" which covers most TC related appActions * test: fix arg * test(couchdb): fix some network tests via expect polling * Stabalize visual test * getCanasPixels * test: stabilize tooltip telemetry table test, better a11y for tooltips * chore: update to use `docker compose` instead of `docker-compose` * New rules, new tests, new me * fix sort order * test: add `waitForPlotsToRender` framework test, passthru timeout override * test: remove `clockOptions` test as we have `page.clock` now * test: refactor out `overrideClock` * test: use `clock.install` instead * test: use `clock.install` instead * time clock fix * test: fix timer tests * remove ever reference to old base fixture * test: stabilize restricted notebook test * lint fixes * test: use clock.install * update timelist * test: update visual tests to use `page.clock()`, update snapshots * test: stabilize tree renaming/reordering test * a11y: add aria-label and role=region to object view * refactor: use `dragTo` * refactor: use `dragTo`, other small fixes * test: use `page.clock()` to stabilize tooltip telemetry table test * test: use web-first assertion to stabilize staleness test * test: knock out a few more `page.click`s * test: destroy all `page.click()`s * refactor: consistently use `'Ok'` instead of `'OK'` and `'Ok'` mixed * test: remove gauge aria label * test: more test fixes * test: more fixes and refactors * docs: add comment * test: refactor all instances of `dragAndDrop` * test: remove redundant test (covered in previous test steps) * test: stabilize imagery operations tests for display layout * chore: remove bad unicorn rule * chore(lint): remove unused disable directives --------- Co-authored-by: Jesse Mazzella <jesse.d.mazzella@nasa.gov>
2024-08-07 21:36:14 +00:00
const okButton = page.getByLabel('Save');
await expect(okButton).toBeDisabled();
});
});
test.describe('Persistence operations @couchdb @network', () => {
test.use({ failOnConsoleError: false });
test('Editing object properties should generate a single persistence operation', async ({
page
}) => {
test.info().annotations.push({
type: 'issue',
description: 'https://github.com/nasa/openmct/issues/5616'
});
await page.goto('./', { waitUntil: 'domcontentloaded' });
Mutables for the Tree 🎄 + clean up TreeItem observers and mutables properly (#6032) * fix: refresh object after conflict error * fix: recover from error thrown during create - Ensure that the "Saving" modal dialog is closed - Notify user of the error, and also print to console to catch in e2e * fix: default selector tree item to 'mine' folder - If create fails due to a conflict or otherwise, and the user immediately tries to "Create" again, default the selector tree's selected item to the "mine" folder (which we know exists). * fix: don't listen to composition if Selector Tree * refactor: remove dead code * fix: use MutableDomainObjects in the tree - Only use mutables and observers if NOT a SelectorTree - Properly clean up observers and mutables when a parent item is removed from the tree * test: verify conflicts don't break object creation * test: verify dialog closes and object is created * refactor(e2e): update test - Error notification on 'My Items' folder missing was removed, so don't check for it * test: increase timeout * refactor(e2e): use Promise.any() * refactor(e2e): use Promise instead of polling * test: add 2p annotation * test: use `waitForRequest` instead of promise - tidy up test, add comments describing our pattern * docs(e2e): add best practices for network tests * refactor(e2e): avoid using Promise.any * fix: de-reactify observer and mutable maps * fix: destroy by path on treeItem close * fix: don't refresh for synchronized objects * docs: fix a typo 🔥 * fix: remove existing mutable before adding * fix: fail fast if these aren't functions - Remove check for typeof 'function' to not hide any potential coding errors * fix: walk up navigationPath if item not found * chore: fix lint errors * fix: parse conflicted object name correctly * fix: re-throw conflict error * fix: Cancel edit mode on conflict
2022-12-20 21:27:51 +00:00
// Create a new 'Clock' object with default settings
const clock = await createDomainObjectWithDefaults(page, {
type: 'Clock'
});
// Count all persistence operations (PUT requests) for this specific object
let putRequestCount = 0;
page.on('request', (req) => {
if (req.method() === 'PUT' && req.url().endsWith(clock.uuid)) {
putRequestCount += 1;
}
});
// Open the edit form for the clock object
test(e2e): Major refactor and stabilization of e2e tests (#7581) * fix: update broken locator * update eslint package * first pass of lint fixes * update package * change ruleset * update component tests to match linting rules * driveby * start to factor out bad locators * update gauge component * update notebook snapshot drop area * Update plot aria * add draggable true to tree items * update package * driveby to remove dead code * unneeded * unneeded * tells a screenreader that this is a row and a cell * adds an id for dragondrops * this should be a button * first pass at fixing tooltip selectors * review comments * Updating more tests * update to remove expect expect given our use of check functions * add expand component * move role around * update more locators * force * new local storage * remove choochoo steps * test: do `lint:fix` and also add back accidentally removed code * test: add back more removed code * test: remove `unstable` annotation from tests which are not unstable * test: remove invalid test-- the "new" time conductor doesn't allow for millisecond changes in fixed time * test: fix unstable gauge test * test: remove useless asserts-- this was secretly non-functional. now that we've fixed it, it makes no sense and just fails * test: add back accidentally removed changes * test: revert changes that break test * test: more fixes * Remove all notion of the unstable/stable e2e tests * test: eviscerate the flake with FACTS and LOGIC * test: fix anotha one * lint fixes * test: no need to wait for save dialog * test: fix more tests * lint: fix more warnings * test: fix anotha one * test: use `toHaveLength` instead of `.length).toBe()` * test: stabilize tabs view example imagery test * fix: more tests be fixed * test: more `toHaveCount()`s please * test: revert more accidentally removed fixes * test: fix selector * test: fix anotha one * update lint rules to clean up bad locators in shared fixtures * update and remove bad appActions * test: fix some restricted notebook tests * test: mass find/replace to enforce `toHaveCount()` instead of `.count()).toBe()` * Remove some bad appActions and update text * test: fix da tree tests * test: await not await await * test: fix upload plan appAction and add a11y * Updating externalFixtures with best practice locators and add missing appAction framework tests * test: fix test * test: fix appAction test for plans * test: yum yum fix'em up and get rid of some dragon drops * fix: alas, a `.only()` got my hopes up that i was done fixing tests * test: add `setTimeConductorMode` test "suite" which covers most TC related appActions * test: fix arg * test(couchdb): fix some network tests via expect polling * Stabalize visual test * getCanasPixels * test: stabilize tooltip telemetry table test, better a11y for tooltips * chore: update to use `docker compose` instead of `docker-compose` * New rules, new tests, new me * fix sort order * test: add `waitForPlotsToRender` framework test, passthru timeout override * test: remove `clockOptions` test as we have `page.clock` now * test: refactor out `overrideClock` * test: use `clock.install` instead * test: use `clock.install` instead * time clock fix * test: fix timer tests * remove ever reference to old base fixture * test: stabilize restricted notebook test * lint fixes * test: use clock.install * update timelist * test: update visual tests to use `page.clock()`, update snapshots * test: stabilize tree renaming/reordering test * a11y: add aria-label and role=region to object view * refactor: use `dragTo` * refactor: use `dragTo`, other small fixes * test: use `page.clock()` to stabilize tooltip telemetry table test * test: use web-first assertion to stabilize staleness test * test: knock out a few more `page.click`s * test: destroy all `page.click()`s * refactor: consistently use `'Ok'` instead of `'OK'` and `'Ok'` mixed * test: remove gauge aria label * test: more test fixes * test: more fixes and refactors * docs: add comment * test: refactor all instances of `dragAndDrop` * test: remove redundant test (covered in previous test steps) * test: stabilize imagery operations tests for display layout * chore: remove bad unicorn rule * chore(lint): remove unused disable directives --------- Co-authored-by: Jesse Mazzella <jesse.d.mazzella@nasa.gov>
2024-08-07 21:36:14 +00:00
await page.getByLabel('More actions').click();
await page.getByLabel('Edit Properties...').click();
// Modify the display format from default 12hr -> 24hr and click 'Save'
test(e2e): Major refactor and stabilization of e2e tests (#7581) * fix: update broken locator * update eslint package * first pass of lint fixes * update package * change ruleset * update component tests to match linting rules * driveby * start to factor out bad locators * update gauge component * update notebook snapshot drop area * Update plot aria * add draggable true to tree items * update package * driveby to remove dead code * unneeded * unneeded * tells a screenreader that this is a row and a cell * adds an id for dragondrops * this should be a button * first pass at fixing tooltip selectors * review comments * Updating more tests * update to remove expect expect given our use of check functions * add expand component * move role around * update more locators * force * new local storage * remove choochoo steps * test: do `lint:fix` and also add back accidentally removed code * test: add back more removed code * test: remove `unstable` annotation from tests which are not unstable * test: remove invalid test-- the "new" time conductor doesn't allow for millisecond changes in fixed time * test: fix unstable gauge test * test: remove useless asserts-- this was secretly non-functional. now that we've fixed it, it makes no sense and just fails * test: add back accidentally removed changes * test: revert changes that break test * test: more fixes * Remove all notion of the unstable/stable e2e tests * test: eviscerate the flake with FACTS and LOGIC * test: fix anotha one * lint fixes * test: no need to wait for save dialog * test: fix more tests * lint: fix more warnings * test: fix anotha one * test: use `toHaveLength` instead of `.length).toBe()` * test: stabilize tabs view example imagery test * fix: more tests be fixed * test: more `toHaveCount()`s please * test: revert more accidentally removed fixes * test: fix selector * test: fix anotha one * update lint rules to clean up bad locators in shared fixtures * update and remove bad appActions * test: fix some restricted notebook tests * test: mass find/replace to enforce `toHaveCount()` instead of `.count()).toBe()` * Remove some bad appActions and update text * test: fix da tree tests * test: await not await await * test: fix upload plan appAction and add a11y * Updating externalFixtures with best practice locators and add missing appAction framework tests * test: fix test * test: fix appAction test for plans * test: yum yum fix'em up and get rid of some dragon drops * fix: alas, a `.only()` got my hopes up that i was done fixing tests * test: add `setTimeConductorMode` test "suite" which covers most TC related appActions * test: fix arg * test(couchdb): fix some network tests via expect polling * Stabalize visual test * getCanasPixels * test: stabilize tooltip telemetry table test, better a11y for tooltips * chore: update to use `docker compose` instead of `docker-compose` * New rules, new tests, new me * fix sort order * test: add `waitForPlotsToRender` framework test, passthru timeout override * test: remove `clockOptions` test as we have `page.clock` now * test: refactor out `overrideClock` * test: use `clock.install` instead * test: use `clock.install` instead * time clock fix * test: fix timer tests * remove ever reference to old base fixture * test: stabilize restricted notebook test * lint fixes * test: use clock.install * update timelist * test: update visual tests to use `page.clock()`, update snapshots * test: stabilize tree renaming/reordering test * a11y: add aria-label and role=region to object view * refactor: use `dragTo` * refactor: use `dragTo`, other small fixes * test: use `page.clock()` to stabilize tooltip telemetry table test * test: use web-first assertion to stabilize staleness test * test: knock out a few more `page.click`s * test: destroy all `page.click()`s * refactor: consistently use `'Ok'` instead of `'OK'` and `'Ok'` mixed * test: remove gauge aria label * test: more test fixes * test: more fixes and refactors * docs: add comment * test: refactor all instances of `dragAndDrop` * test: remove redundant test (covered in previous test steps) * test: stabilize imagery operations tests for display layout * chore: remove bad unicorn rule * chore(lint): remove unused disable directives --------- Co-authored-by: Jesse Mazzella <jesse.d.mazzella@nasa.gov>
2024-08-07 21:36:14 +00:00
await page.getByLabel('12 or 24 hour clock').selectOption({ value: 'clock24' });
await page.getByLabel('Save').click();
await expect
.poll(() => putRequestCount, {
message: 'Verify a single PUT request was made to persist the object',
timeout: 1000
})
.toEqual(1);
});
test('Can create an object after a conflict error @couchdb @network @2p', async ({
page,
openmctConfig
}) => {
Mutables for the Tree 🎄 + clean up TreeItem observers and mutables properly (#6032) * fix: refresh object after conflict error * fix: recover from error thrown during create - Ensure that the "Saving" modal dialog is closed - Notify user of the error, and also print to console to catch in e2e * fix: default selector tree item to 'mine' folder - If create fails due to a conflict or otherwise, and the user immediately tries to "Create" again, default the selector tree's selected item to the "mine" folder (which we know exists). * fix: don't listen to composition if Selector Tree * refactor: remove dead code * fix: use MutableDomainObjects in the tree - Only use mutables and observers if NOT a SelectorTree - Properly clean up observers and mutables when a parent item is removed from the tree * test: verify conflicts don't break object creation * test: verify dialog closes and object is created * refactor(e2e): update test - Error notification on 'My Items' folder missing was removed, so don't check for it * test: increase timeout * refactor(e2e): use Promise.any() * refactor(e2e): use Promise instead of polling * test: add 2p annotation * test: use `waitForRequest` instead of promise - tidy up test, add comments describing our pattern * docs(e2e): add best practices for network tests * refactor(e2e): avoid using Promise.any * fix: de-reactify observer and mutable maps * fix: destroy by path on treeItem close * fix: don't refresh for synchronized objects * docs: fix a typo 🔥 * fix: remove existing mutable before adding * fix: fail fast if these aren't functions - Remove check for typeof 'function' to not hide any potential coding errors * fix: walk up navigationPath if item not found * chore: fix lint errors * fix: parse conflicted object name correctly * fix: re-throw conflict error * fix: Cancel edit mode on conflict
2022-12-20 21:27:51 +00:00
test.info().annotations.push({
type: 'issue',
description: 'https://github.com/nasa/openmct/issues/5982'
});
const { myItemsFolderName } = openmctConfig;
// Instantiate a second page/tab
Mutables for the Tree 🎄 + clean up TreeItem observers and mutables properly (#6032) * fix: refresh object after conflict error * fix: recover from error thrown during create - Ensure that the "Saving" modal dialog is closed - Notify user of the error, and also print to console to catch in e2e * fix: default selector tree item to 'mine' folder - If create fails due to a conflict or otherwise, and the user immediately tries to "Create" again, default the selector tree's selected item to the "mine" folder (which we know exists). * fix: don't listen to composition if Selector Tree * refactor: remove dead code * fix: use MutableDomainObjects in the tree - Only use mutables and observers if NOT a SelectorTree - Properly clean up observers and mutables when a parent item is removed from the tree * test: verify conflicts don't break object creation * test: verify dialog closes and object is created * refactor(e2e): update test - Error notification on 'My Items' folder missing was removed, so don't check for it * test: increase timeout * refactor(e2e): use Promise.any() * refactor(e2e): use Promise instead of polling * test: add 2p annotation * test: use `waitForRequest` instead of promise - tidy up test, add comments describing our pattern * docs(e2e): add best practices for network tests * refactor(e2e): avoid using Promise.any * fix: de-reactify observer and mutable maps * fix: destroy by path on treeItem close * fix: don't refresh for synchronized objects * docs: fix a typo 🔥 * fix: remove existing mutable before adding * fix: fail fast if these aren't functions - Remove check for typeof 'function' to not hide any potential coding errors * fix: walk up navigationPath if item not found * chore: fix lint errors * fix: parse conflicted object name correctly * fix: re-throw conflict error * fix: Cancel edit mode on conflict
2022-12-20 21:27:51 +00:00
const page2 = await page.context().newPage();
Mutables for the Tree 🎄 + clean up TreeItem observers and mutables properly (#6032) * fix: refresh object after conflict error * fix: recover from error thrown during create - Ensure that the "Saving" modal dialog is closed - Notify user of the error, and also print to console to catch in e2e * fix: default selector tree item to 'mine' folder - If create fails due to a conflict or otherwise, and the user immediately tries to "Create" again, default the selector tree's selected item to the "mine" folder (which we know exists). * fix: don't listen to composition if Selector Tree * refactor: remove dead code * fix: use MutableDomainObjects in the tree - Only use mutables and observers if NOT a SelectorTree - Properly clean up observers and mutables when a parent item is removed from the tree * test: verify conflicts don't break object creation * test: verify dialog closes and object is created * refactor(e2e): update test - Error notification on 'My Items' folder missing was removed, so don't check for it * test: increase timeout * refactor(e2e): use Promise.any() * refactor(e2e): use Promise instead of polling * test: add 2p annotation * test: use `waitForRequest` instead of promise - tidy up test, add comments describing our pattern * docs(e2e): add best practices for network tests * refactor(e2e): avoid using Promise.any * fix: de-reactify observer and mutable maps * fix: destroy by path on treeItem close * fix: don't refresh for synchronized objects * docs: fix a typo 🔥 * fix: remove existing mutable before adding * fix: fail fast if these aren't functions - Remove check for typeof 'function' to not hide any potential coding errors * fix: walk up navigationPath if item not found * chore: fix lint errors * fix: parse conflicted object name correctly * fix: re-throw conflict error * fix: Cancel edit mode on conflict
2022-12-20 21:27:51 +00:00
// Both pages: Go to baseURL
await Promise.all([
test(e2e): Major refactor and stabilization of e2e tests (#7581) * fix: update broken locator * update eslint package * first pass of lint fixes * update package * change ruleset * update component tests to match linting rules * driveby * start to factor out bad locators * update gauge component * update notebook snapshot drop area * Update plot aria * add draggable true to tree items * update package * driveby to remove dead code * unneeded * unneeded * tells a screenreader that this is a row and a cell * adds an id for dragondrops * this should be a button * first pass at fixing tooltip selectors * review comments * Updating more tests * update to remove expect expect given our use of check functions * add expand component * move role around * update more locators * force * new local storage * remove choochoo steps * test: do `lint:fix` and also add back accidentally removed code * test: add back more removed code * test: remove `unstable` annotation from tests which are not unstable * test: remove invalid test-- the "new" time conductor doesn't allow for millisecond changes in fixed time * test: fix unstable gauge test * test: remove useless asserts-- this was secretly non-functional. now that we've fixed it, it makes no sense and just fails * test: add back accidentally removed changes * test: revert changes that break test * test: more fixes * Remove all notion of the unstable/stable e2e tests * test: eviscerate the flake with FACTS and LOGIC * test: fix anotha one * lint fixes * test: no need to wait for save dialog * test: fix more tests * lint: fix more warnings * test: fix anotha one * test: use `toHaveLength` instead of `.length).toBe()` * test: stabilize tabs view example imagery test * fix: more tests be fixed * test: more `toHaveCount()`s please * test: revert more accidentally removed fixes * test: fix selector * test: fix anotha one * update lint rules to clean up bad locators in shared fixtures * update and remove bad appActions * test: fix some restricted notebook tests * test: mass find/replace to enforce `toHaveCount()` instead of `.count()).toBe()` * Remove some bad appActions and update text * test: fix da tree tests * test: await not await await * test: fix upload plan appAction and add a11y * Updating externalFixtures with best practice locators and add missing appAction framework tests * test: fix test * test: fix appAction test for plans * test: yum yum fix'em up and get rid of some dragon drops * fix: alas, a `.only()` got my hopes up that i was done fixing tests * test: add `setTimeConductorMode` test "suite" which covers most TC related appActions * test: fix arg * test(couchdb): fix some network tests via expect polling * Stabalize visual test * getCanasPixels * test: stabilize tooltip telemetry table test, better a11y for tooltips * chore: update to use `docker compose` instead of `docker-compose` * New rules, new tests, new me * fix sort order * test: add `waitForPlotsToRender` framework test, passthru timeout override * test: remove `clockOptions` test as we have `page.clock` now * test: refactor out `overrideClock` * test: use `clock.install` instead * test: use `clock.install` instead * time clock fix * test: fix timer tests * remove ever reference to old base fixture * test: stabilize restricted notebook test * lint fixes * test: use clock.install * update timelist * test: update visual tests to use `page.clock()`, update snapshots * test: stabilize tree renaming/reordering test * a11y: add aria-label and role=region to object view * refactor: use `dragTo` * refactor: use `dragTo`, other small fixes * test: use `page.clock()` to stabilize tooltip telemetry table test * test: use web-first assertion to stabilize staleness test * test: knock out a few more `page.click`s * test: destroy all `page.click()`s * refactor: consistently use `'Ok'` instead of `'OK'` and `'Ok'` mixed * test: remove gauge aria label * test: more test fixes * test: more fixes and refactors * docs: add comment * test: refactor all instances of `dragAndDrop` * test: remove redundant test (covered in previous test steps) * test: stabilize imagery operations tests for display layout * chore: remove bad unicorn rule * chore(lint): remove unused disable directives --------- Co-authored-by: Jesse Mazzella <jesse.d.mazzella@nasa.gov>
2024-08-07 21:36:14 +00:00
page.goto('./', { waitUntil: 'domcontentloaded' }),
page2.goto('./', { waitUntil: 'domcontentloaded' })
]);
//Slow down the test a bit
await expect(
page.getByRole('button', { name: `Expand ${myItemsFolderName} folder` })
).toBeVisible();
await expect(
page2.getByRole('button', { name: `Expand ${myItemsFolderName} folder` })
).toBeVisible();
Mutables for the Tree 🎄 + clean up TreeItem observers and mutables properly (#6032) * fix: refresh object after conflict error * fix: recover from error thrown during create - Ensure that the "Saving" modal dialog is closed - Notify user of the error, and also print to console to catch in e2e * fix: default selector tree item to 'mine' folder - If create fails due to a conflict or otherwise, and the user immediately tries to "Create" again, default the selector tree's selected item to the "mine" folder (which we know exists). * fix: don't listen to composition if Selector Tree * refactor: remove dead code * fix: use MutableDomainObjects in the tree - Only use mutables and observers if NOT a SelectorTree - Properly clean up observers and mutables when a parent item is removed from the tree * test: verify conflicts don't break object creation * test: verify dialog closes and object is created * refactor(e2e): update test - Error notification on 'My Items' folder missing was removed, so don't check for it * test: increase timeout * refactor(e2e): use Promise.any() * refactor(e2e): use Promise instead of polling * test: add 2p annotation * test: use `waitForRequest` instead of promise - tidy up test, add comments describing our pattern * docs(e2e): add best practices for network tests * refactor(e2e): avoid using Promise.any * fix: de-reactify observer and mutable maps * fix: destroy by path on treeItem close * fix: don't refresh for synchronized objects * docs: fix a typo 🔥 * fix: remove existing mutable before adding * fix: fail fast if these aren't functions - Remove check for typeof 'function' to not hide any potential coding errors * fix: walk up navigationPath if item not found * chore: fix lint errors * fix: parse conflicted object name correctly * fix: re-throw conflict error * fix: Cancel edit mode on conflict
2022-12-20 21:27:51 +00:00
// Both pages: Click the Create button
await Promise.all([
test(e2e): Major refactor and stabilization of e2e tests (#7581) * fix: update broken locator * update eslint package * first pass of lint fixes * update package * change ruleset * update component tests to match linting rules * driveby * start to factor out bad locators * update gauge component * update notebook snapshot drop area * Update plot aria * add draggable true to tree items * update package * driveby to remove dead code * unneeded * unneeded * tells a screenreader that this is a row and a cell * adds an id for dragondrops * this should be a button * first pass at fixing tooltip selectors * review comments * Updating more tests * update to remove expect expect given our use of check functions * add expand component * move role around * update more locators * force * new local storage * remove choochoo steps * test: do `lint:fix` and also add back accidentally removed code * test: add back more removed code * test: remove `unstable` annotation from tests which are not unstable * test: remove invalid test-- the "new" time conductor doesn't allow for millisecond changes in fixed time * test: fix unstable gauge test * test: remove useless asserts-- this was secretly non-functional. now that we've fixed it, it makes no sense and just fails * test: add back accidentally removed changes * test: revert changes that break test * test: more fixes * Remove all notion of the unstable/stable e2e tests * test: eviscerate the flake with FACTS and LOGIC * test: fix anotha one * lint fixes * test: no need to wait for save dialog * test: fix more tests * lint: fix more warnings * test: fix anotha one * test: use `toHaveLength` instead of `.length).toBe()` * test: stabilize tabs view example imagery test * fix: more tests be fixed * test: more `toHaveCount()`s please * test: revert more accidentally removed fixes * test: fix selector * test: fix anotha one * update lint rules to clean up bad locators in shared fixtures * update and remove bad appActions * test: fix some restricted notebook tests * test: mass find/replace to enforce `toHaveCount()` instead of `.count()).toBe()` * Remove some bad appActions and update text * test: fix da tree tests * test: await not await await * test: fix upload plan appAction and add a11y * Updating externalFixtures with best practice locators and add missing appAction framework tests * test: fix test * test: fix appAction test for plans * test: yum yum fix'em up and get rid of some dragon drops * fix: alas, a `.only()` got my hopes up that i was done fixing tests * test: add `setTimeConductorMode` test "suite" which covers most TC related appActions * test: fix arg * test(couchdb): fix some network tests via expect polling * Stabalize visual test * getCanasPixels * test: stabilize tooltip telemetry table test, better a11y for tooltips * chore: update to use `docker compose` instead of `docker-compose` * New rules, new tests, new me * fix sort order * test: add `waitForPlotsToRender` framework test, passthru timeout override * test: remove `clockOptions` test as we have `page.clock` now * test: refactor out `overrideClock` * test: use `clock.install` instead * test: use `clock.install` instead * time clock fix * test: fix timer tests * remove ever reference to old base fixture * test: stabilize restricted notebook test * lint fixes * test: use clock.install * update timelist * test: update visual tests to use `page.clock()`, update snapshots * test: stabilize tree renaming/reordering test * a11y: add aria-label and role=region to object view * refactor: use `dragTo` * refactor: use `dragTo`, other small fixes * test: use `page.clock()` to stabilize tooltip telemetry table test * test: use web-first assertion to stabilize staleness test * test: knock out a few more `page.click`s * test: destroy all `page.click()`s * refactor: consistently use `'Ok'` instead of `'OK'` and `'Ok'` mixed * test: remove gauge aria label * test: more test fixes * test: more fixes and refactors * docs: add comment * test: refactor all instances of `dragAndDrop` * test: remove redundant test (covered in previous test steps) * test: stabilize imagery operations tests for display layout * chore: remove bad unicorn rule * chore(lint): remove unused disable directives --------- Co-authored-by: Jesse Mazzella <jesse.d.mazzella@nasa.gov>
2024-08-07 21:36:14 +00:00
page.getByRole('button', { name: 'Create' }).click(),
page2.getByRole('button', { name: 'Create' }).click()
]);
Mutables for the Tree 🎄 + clean up TreeItem observers and mutables properly (#6032) * fix: refresh object after conflict error * fix: recover from error thrown during create - Ensure that the "Saving" modal dialog is closed - Notify user of the error, and also print to console to catch in e2e * fix: default selector tree item to 'mine' folder - If create fails due to a conflict or otherwise, and the user immediately tries to "Create" again, default the selector tree's selected item to the "mine" folder (which we know exists). * fix: don't listen to composition if Selector Tree * refactor: remove dead code * fix: use MutableDomainObjects in the tree - Only use mutables and observers if NOT a SelectorTree - Properly clean up observers and mutables when a parent item is removed from the tree * test: verify conflicts don't break object creation * test: verify dialog closes and object is created * refactor(e2e): update test - Error notification on 'My Items' folder missing was removed, so don't check for it * test: increase timeout * refactor(e2e): use Promise.any() * refactor(e2e): use Promise instead of polling * test: add 2p annotation * test: use `waitForRequest` instead of promise - tidy up test, add comments describing our pattern * docs(e2e): add best practices for network tests * refactor(e2e): avoid using Promise.any * fix: de-reactify observer and mutable maps * fix: destroy by path on treeItem close * fix: don't refresh for synchronized objects * docs: fix a typo 🔥 * fix: remove existing mutable before adding * fix: fail fast if these aren't functions - Remove check for typeof 'function' to not hide any potential coding errors * fix: walk up navigationPath if item not found * chore: fix lint errors * fix: parse conflicted object name correctly * fix: re-throw conflict error * fix: Cancel edit mode on conflict
2022-12-20 21:27:51 +00:00
// Both pages: Click "Clock" in the Create menu
await Promise.all([
test(e2e): Major refactor and stabilization of e2e tests (#7581) * fix: update broken locator * update eslint package * first pass of lint fixes * update package * change ruleset * update component tests to match linting rules * driveby * start to factor out bad locators * update gauge component * update notebook snapshot drop area * Update plot aria * add draggable true to tree items * update package * driveby to remove dead code * unneeded * unneeded * tells a screenreader that this is a row and a cell * adds an id for dragondrops * this should be a button * first pass at fixing tooltip selectors * review comments * Updating more tests * update to remove expect expect given our use of check functions * add expand component * move role around * update more locators * force * new local storage * remove choochoo steps * test: do `lint:fix` and also add back accidentally removed code * test: add back more removed code * test: remove `unstable` annotation from tests which are not unstable * test: remove invalid test-- the "new" time conductor doesn't allow for millisecond changes in fixed time * test: fix unstable gauge test * test: remove useless asserts-- this was secretly non-functional. now that we've fixed it, it makes no sense and just fails * test: add back accidentally removed changes * test: revert changes that break test * test: more fixes * Remove all notion of the unstable/stable e2e tests * test: eviscerate the flake with FACTS and LOGIC * test: fix anotha one * lint fixes * test: no need to wait for save dialog * test: fix more tests * lint: fix more warnings * test: fix anotha one * test: use `toHaveLength` instead of `.length).toBe()` * test: stabilize tabs view example imagery test * fix: more tests be fixed * test: more `toHaveCount()`s please * test: revert more accidentally removed fixes * test: fix selector * test: fix anotha one * update lint rules to clean up bad locators in shared fixtures * update and remove bad appActions * test: fix some restricted notebook tests * test: mass find/replace to enforce `toHaveCount()` instead of `.count()).toBe()` * Remove some bad appActions and update text * test: fix da tree tests * test: await not await await * test: fix upload plan appAction and add a11y * Updating externalFixtures with best practice locators and add missing appAction framework tests * test: fix test * test: fix appAction test for plans * test: yum yum fix'em up and get rid of some dragon drops * fix: alas, a `.only()` got my hopes up that i was done fixing tests * test: add `setTimeConductorMode` test "suite" which covers most TC related appActions * test: fix arg * test(couchdb): fix some network tests via expect polling * Stabalize visual test * getCanasPixels * test: stabilize tooltip telemetry table test, better a11y for tooltips * chore: update to use `docker compose` instead of `docker-compose` * New rules, new tests, new me * fix sort order * test: add `waitForPlotsToRender` framework test, passthru timeout override * test: remove `clockOptions` test as we have `page.clock` now * test: refactor out `overrideClock` * test: use `clock.install` instead * test: use `clock.install` instead * time clock fix * test: fix timer tests * remove ever reference to old base fixture * test: stabilize restricted notebook test * lint fixes * test: use clock.install * update timelist * test: update visual tests to use `page.clock()`, update snapshots * test: stabilize tree renaming/reordering test * a11y: add aria-label and role=region to object view * refactor: use `dragTo` * refactor: use `dragTo`, other small fixes * test: use `page.clock()` to stabilize tooltip telemetry table test * test: use web-first assertion to stabilize staleness test * test: knock out a few more `page.click`s * test: destroy all `page.click()`s * refactor: consistently use `'Ok'` instead of `'OK'` and `'Ok'` mixed * test: remove gauge aria label * test: more test fixes * test: more fixes and refactors * docs: add comment * test: refactor all instances of `dragAndDrop` * test: remove redundant test (covered in previous test steps) * test: stabilize imagery operations tests for display layout * chore: remove bad unicorn rule * chore(lint): remove unused disable directives --------- Co-authored-by: Jesse Mazzella <jesse.d.mazzella@nasa.gov>
2024-08-07 21:36:14 +00:00
page.getByRole('menuitem', { name: 'Clock' }).click(),
page2.getByRole('menuitem', { name: 'Clock' }).click()
]);
Mutables for the Tree 🎄 + clean up TreeItem observers and mutables properly (#6032) * fix: refresh object after conflict error * fix: recover from error thrown during create - Ensure that the "Saving" modal dialog is closed - Notify user of the error, and also print to console to catch in e2e * fix: default selector tree item to 'mine' folder - If create fails due to a conflict or otherwise, and the user immediately tries to "Create" again, default the selector tree's selected item to the "mine" folder (which we know exists). * fix: don't listen to composition if Selector Tree * refactor: remove dead code * fix: use MutableDomainObjects in the tree - Only use mutables and observers if NOT a SelectorTree - Properly clean up observers and mutables when a parent item is removed from the tree * test: verify conflicts don't break object creation * test: verify dialog closes and object is created * refactor(e2e): update test - Error notification on 'My Items' folder missing was removed, so don't check for it * test: increase timeout * refactor(e2e): use Promise.any() * refactor(e2e): use Promise instead of polling * test: add 2p annotation * test: use `waitForRequest` instead of promise - tidy up test, add comments describing our pattern * docs(e2e): add best practices for network tests * refactor(e2e): avoid using Promise.any * fix: de-reactify observer and mutable maps * fix: destroy by path on treeItem close * fix: don't refresh for synchronized objects * docs: fix a typo 🔥 * fix: remove existing mutable before adding * fix: fail fast if these aren't functions - Remove check for typeof 'function' to not hide any potential coding errors * fix: walk up navigationPath if item not found * chore: fix lint errors * fix: parse conflicted object name correctly * fix: re-throw conflict error * fix: Cancel edit mode on conflict
2022-12-20 21:27:51 +00:00
// Generate unique names for both objects
const nameInput = page.locator('form[name="mctForm"] .first input[type="text"]');
const nameInput2 = page2.locator('form[name="mctForm"] .first input[type="text"]');
Mutables for the Tree 🎄 + clean up TreeItem observers and mutables properly (#6032) * fix: refresh object after conflict error * fix: recover from error thrown during create - Ensure that the "Saving" modal dialog is closed - Notify user of the error, and also print to console to catch in e2e * fix: default selector tree item to 'mine' folder - If create fails due to a conflict or otherwise, and the user immediately tries to "Create" again, default the selector tree's selected item to the "mine" folder (which we know exists). * fix: don't listen to composition if Selector Tree * refactor: remove dead code * fix: use MutableDomainObjects in the tree - Only use mutables and observers if NOT a SelectorTree - Properly clean up observers and mutables when a parent item is removed from the tree * test: verify conflicts don't break object creation * test: verify dialog closes and object is created * refactor(e2e): update test - Error notification on 'My Items' folder missing was removed, so don't check for it * test: increase timeout * refactor(e2e): use Promise.any() * refactor(e2e): use Promise instead of polling * test: add 2p annotation * test: use `waitForRequest` instead of promise - tidy up test, add comments describing our pattern * docs(e2e): add best practices for network tests * refactor(e2e): avoid using Promise.any * fix: de-reactify observer and mutable maps * fix: destroy by path on treeItem close * fix: don't refresh for synchronized objects * docs: fix a typo 🔥 * fix: remove existing mutable before adding * fix: fail fast if these aren't functions - Remove check for typeof 'function' to not hide any potential coding errors * fix: walk up navigationPath if item not found * chore: fix lint errors * fix: parse conflicted object name correctly * fix: re-throw conflict error * fix: Cancel edit mode on conflict
2022-12-20 21:27:51 +00:00
// Both pages: Fill in the 'Name' form field.
await Promise.all([
nameInput.fill(''),
nameInput.fill(`Clock:${genUuid()}`),
nameInput2.fill(''),
nameInput2.fill(`Clock:${genUuid()}`)
]);
Mutables for the Tree 🎄 + clean up TreeItem observers and mutables properly (#6032) * fix: refresh object after conflict error * fix: recover from error thrown during create - Ensure that the "Saving" modal dialog is closed - Notify user of the error, and also print to console to catch in e2e * fix: default selector tree item to 'mine' folder - If create fails due to a conflict or otherwise, and the user immediately tries to "Create" again, default the selector tree's selected item to the "mine" folder (which we know exists). * fix: don't listen to composition if Selector Tree * refactor: remove dead code * fix: use MutableDomainObjects in the tree - Only use mutables and observers if NOT a SelectorTree - Properly clean up observers and mutables when a parent item is removed from the tree * test: verify conflicts don't break object creation * test: verify dialog closes and object is created * refactor(e2e): update test - Error notification on 'My Items' folder missing was removed, so don't check for it * test: increase timeout * refactor(e2e): use Promise.any() * refactor(e2e): use Promise instead of polling * test: add 2p annotation * test: use `waitForRequest` instead of promise - tidy up test, add comments describing our pattern * docs(e2e): add best practices for network tests * refactor(e2e): avoid using Promise.any * fix: de-reactify observer and mutable maps * fix: destroy by path on treeItem close * fix: don't refresh for synchronized objects * docs: fix a typo 🔥 * fix: remove existing mutable before adding * fix: fail fast if these aren't functions - Remove check for typeof 'function' to not hide any potential coding errors * fix: walk up navigationPath if item not found * chore: fix lint errors * fix: parse conflicted object name correctly * fix: re-throw conflict error * fix: Cancel edit mode on conflict
2022-12-20 21:27:51 +00:00
// Both pages: Fill the "Notes" section with information about the
// currently running test and its project.
const testNotes = page.testNotes;
const notesInput = page.locator('form[name="mctForm"] #notes-textarea');
const notesInput2 = page2.locator('form[name="mctForm"] #notes-textarea');
await Promise.all([notesInput.fill(testNotes), notesInput2.fill(testNotes)]);
Mutables for the Tree 🎄 + clean up TreeItem observers and mutables properly (#6032) * fix: refresh object after conflict error * fix: recover from error thrown during create - Ensure that the "Saving" modal dialog is closed - Notify user of the error, and also print to console to catch in e2e * fix: default selector tree item to 'mine' folder - If create fails due to a conflict or otherwise, and the user immediately tries to "Create" again, default the selector tree's selected item to the "mine" folder (which we know exists). * fix: don't listen to composition if Selector Tree * refactor: remove dead code * fix: use MutableDomainObjects in the tree - Only use mutables and observers if NOT a SelectorTree - Properly clean up observers and mutables when a parent item is removed from the tree * test: verify conflicts don't break object creation * test: verify dialog closes and object is created * refactor(e2e): update test - Error notification on 'My Items' folder missing was removed, so don't check for it * test: increase timeout * refactor(e2e): use Promise.any() * refactor(e2e): use Promise instead of polling * test: add 2p annotation * test: use `waitForRequest` instead of promise - tidy up test, add comments describing our pattern * docs(e2e): add best practices for network tests * refactor(e2e): avoid using Promise.any * fix: de-reactify observer and mutable maps * fix: destroy by path on treeItem close * fix: don't refresh for synchronized objects * docs: fix a typo 🔥 * fix: remove existing mutable before adding * fix: fail fast if these aren't functions - Remove check for typeof 'function' to not hide any potential coding errors * fix: walk up navigationPath if item not found * chore: fix lint errors * fix: parse conflicted object name correctly * fix: re-throw conflict error * fix: Cancel edit mode on conflict
2022-12-20 21:27:51 +00:00
// Page 2: Click "OK" to create the domain object and wait for navigation.
// This will update the composition of the parent folder, setting the
// conditions for a conflict error from the first page.
await Promise.all([
page2.waitForLoadState(),
test(e2e): Major refactor and stabilization of e2e tests (#7581) * fix: update broken locator * update eslint package * first pass of lint fixes * update package * change ruleset * update component tests to match linting rules * driveby * start to factor out bad locators * update gauge component * update notebook snapshot drop area * Update plot aria * add draggable true to tree items * update package * driveby to remove dead code * unneeded * unneeded * tells a screenreader that this is a row and a cell * adds an id for dragondrops * this should be a button * first pass at fixing tooltip selectors * review comments * Updating more tests * update to remove expect expect given our use of check functions * add expand component * move role around * update more locators * force * new local storage * remove choochoo steps * test: do `lint:fix` and also add back accidentally removed code * test: add back more removed code * test: remove `unstable` annotation from tests which are not unstable * test: remove invalid test-- the "new" time conductor doesn't allow for millisecond changes in fixed time * test: fix unstable gauge test * test: remove useless asserts-- this was secretly non-functional. now that we've fixed it, it makes no sense and just fails * test: add back accidentally removed changes * test: revert changes that break test * test: more fixes * Remove all notion of the unstable/stable e2e tests * test: eviscerate the flake with FACTS and LOGIC * test: fix anotha one * lint fixes * test: no need to wait for save dialog * test: fix more tests * lint: fix more warnings * test: fix anotha one * test: use `toHaveLength` instead of `.length).toBe()` * test: stabilize tabs view example imagery test * fix: more tests be fixed * test: more `toHaveCount()`s please * test: revert more accidentally removed fixes * test: fix selector * test: fix anotha one * update lint rules to clean up bad locators in shared fixtures * update and remove bad appActions * test: fix some restricted notebook tests * test: mass find/replace to enforce `toHaveCount()` instead of `.count()).toBe()` * Remove some bad appActions and update text * test: fix da tree tests * test: await not await await * test: fix upload plan appAction and add a11y * Updating externalFixtures with best practice locators and add missing appAction framework tests * test: fix test * test: fix appAction test for plans * test: yum yum fix'em up and get rid of some dragon drops * fix: alas, a `.only()` got my hopes up that i was done fixing tests * test: add `setTimeConductorMode` test "suite" which covers most TC related appActions * test: fix arg * test(couchdb): fix some network tests via expect polling * Stabalize visual test * getCanasPixels * test: stabilize tooltip telemetry table test, better a11y for tooltips * chore: update to use `docker compose` instead of `docker-compose` * New rules, new tests, new me * fix sort order * test: add `waitForPlotsToRender` framework test, passthru timeout override * test: remove `clockOptions` test as we have `page.clock` now * test: refactor out `overrideClock` * test: use `clock.install` instead * test: use `clock.install` instead * time clock fix * test: fix timer tests * remove ever reference to old base fixture * test: stabilize restricted notebook test * lint fixes * test: use clock.install * update timelist * test: update visual tests to use `page.clock()`, update snapshots * test: stabilize tree renaming/reordering test * a11y: add aria-label and role=region to object view * refactor: use `dragTo` * refactor: use `dragTo`, other small fixes * test: use `page.clock()` to stabilize tooltip telemetry table test * test: use web-first assertion to stabilize staleness test * test: knock out a few more `page.click`s * test: destroy all `page.click()`s * refactor: consistently use `'Ok'` instead of `'OK'` and `'Ok'` mixed * test: remove gauge aria label * test: more test fixes * test: more fixes and refactors * docs: add comment * test: refactor all instances of `dragAndDrop` * test: remove redundant test (covered in previous test steps) * test: stabilize imagery operations tests for display layout * chore: remove bad unicorn rule * chore(lint): remove unused disable directives --------- Co-authored-by: Jesse Mazzella <jesse.d.mazzella@nasa.gov>
2024-08-07 21:36:14 +00:00
page2.getByLabel('Save').click(),
Mutables for the Tree 🎄 + clean up TreeItem observers and mutables properly (#6032) * fix: refresh object after conflict error * fix: recover from error thrown during create - Ensure that the "Saving" modal dialog is closed - Notify user of the error, and also print to console to catch in e2e * fix: default selector tree item to 'mine' folder - If create fails due to a conflict or otherwise, and the user immediately tries to "Create" again, default the selector tree's selected item to the "mine" folder (which we know exists). * fix: don't listen to composition if Selector Tree * refactor: remove dead code * fix: use MutableDomainObjects in the tree - Only use mutables and observers if NOT a SelectorTree - Properly clean up observers and mutables when a parent item is removed from the tree * test: verify conflicts don't break object creation * test: verify dialog closes and object is created * refactor(e2e): update test - Error notification on 'My Items' folder missing was removed, so don't check for it * test: increase timeout * refactor(e2e): use Promise.any() * refactor(e2e): use Promise instead of polling * test: add 2p annotation * test: use `waitForRequest` instead of promise - tidy up test, add comments describing our pattern * docs(e2e): add best practices for network tests * refactor(e2e): avoid using Promise.any * fix: de-reactify observer and mutable maps * fix: destroy by path on treeItem close * fix: don't refresh for synchronized objects * docs: fix a typo 🔥 * fix: remove existing mutable before adding * fix: fail fast if these aren't functions - Remove check for typeof 'function' to not hide any potential coding errors * fix: walk up navigationPath if item not found * chore: fix lint errors * fix: parse conflicted object name correctly * fix: re-throw conflict error * fix: Cancel edit mode on conflict
2022-12-20 21:27:51 +00:00
// Wait for Save Banner to appear
test(e2e): Major refactor and stabilization of e2e tests (#7581) * fix: update broken locator * update eslint package * first pass of lint fixes * update package * change ruleset * update component tests to match linting rules * driveby * start to factor out bad locators * update gauge component * update notebook snapshot drop area * Update plot aria * add draggable true to tree items * update package * driveby to remove dead code * unneeded * unneeded * tells a screenreader that this is a row and a cell * adds an id for dragondrops * this should be a button * first pass at fixing tooltip selectors * review comments * Updating more tests * update to remove expect expect given our use of check functions * add expand component * move role around * update more locators * force * new local storage * remove choochoo steps * test: do `lint:fix` and also add back accidentally removed code * test: add back more removed code * test: remove `unstable` annotation from tests which are not unstable * test: remove invalid test-- the "new" time conductor doesn't allow for millisecond changes in fixed time * test: fix unstable gauge test * test: remove useless asserts-- this was secretly non-functional. now that we've fixed it, it makes no sense and just fails * test: add back accidentally removed changes * test: revert changes that break test * test: more fixes * Remove all notion of the unstable/stable e2e tests * test: eviscerate the flake with FACTS and LOGIC * test: fix anotha one * lint fixes * test: no need to wait for save dialog * test: fix more tests * lint: fix more warnings * test: fix anotha one * test: use `toHaveLength` instead of `.length).toBe()` * test: stabilize tabs view example imagery test * fix: more tests be fixed * test: more `toHaveCount()`s please * test: revert more accidentally removed fixes * test: fix selector * test: fix anotha one * update lint rules to clean up bad locators in shared fixtures * update and remove bad appActions * test: fix some restricted notebook tests * test: mass find/replace to enforce `toHaveCount()` instead of `.count()).toBe()` * Remove some bad appActions and update text * test: fix da tree tests * test: await not await await * test: fix upload plan appAction and add a11y * Updating externalFixtures with best practice locators and add missing appAction framework tests * test: fix test * test: fix appAction test for plans * test: yum yum fix'em up and get rid of some dragon drops * fix: alas, a `.only()` got my hopes up that i was done fixing tests * test: add `setTimeConductorMode` test "suite" which covers most TC related appActions * test: fix arg * test(couchdb): fix some network tests via expect polling * Stabalize visual test * getCanasPixels * test: stabilize tooltip telemetry table test, better a11y for tooltips * chore: update to use `docker compose` instead of `docker-compose` * New rules, new tests, new me * fix sort order * test: add `waitForPlotsToRender` framework test, passthru timeout override * test: remove `clockOptions` test as we have `page.clock` now * test: refactor out `overrideClock` * test: use `clock.install` instead * test: use `clock.install` instead * time clock fix * test: fix timer tests * remove ever reference to old base fixture * test: stabilize restricted notebook test * lint fixes * test: use clock.install * update timelist * test: update visual tests to use `page.clock()`, update snapshots * test: stabilize tree renaming/reordering test * a11y: add aria-label and role=region to object view * refactor: use `dragTo` * refactor: use `dragTo`, other small fixes * test: use `page.clock()` to stabilize tooltip telemetry table test * test: use web-first assertion to stabilize staleness test * test: knock out a few more `page.click`s * test: destroy all `page.click()`s * refactor: consistently use `'Ok'` instead of `'OK'` and `'Ok'` mixed * test: remove gauge aria label * test: more test fixes * test: more fixes and refactors * docs: add comment * test: refactor all instances of `dragAndDrop` * test: remove redundant test (covered in previous test steps) * test: stabilize imagery operations tests for display layout * chore: remove bad unicorn rule * chore(lint): remove unused disable directives --------- Co-authored-by: Jesse Mazzella <jesse.d.mazzella@nasa.gov>
2024-08-07 21:36:14 +00:00
page2.locator('.c-message-banner__message').hover({ trial: true })
]);
Mutables for the Tree 🎄 + clean up TreeItem observers and mutables properly (#6032) * fix: refresh object after conflict error * fix: recover from error thrown during create - Ensure that the "Saving" modal dialog is closed - Notify user of the error, and also print to console to catch in e2e * fix: default selector tree item to 'mine' folder - If create fails due to a conflict or otherwise, and the user immediately tries to "Create" again, default the selector tree's selected item to the "mine" folder (which we know exists). * fix: don't listen to composition if Selector Tree * refactor: remove dead code * fix: use MutableDomainObjects in the tree - Only use mutables and observers if NOT a SelectorTree - Properly clean up observers and mutables when a parent item is removed from the tree * test: verify conflicts don't break object creation * test: verify dialog closes and object is created * refactor(e2e): update test - Error notification on 'My Items' folder missing was removed, so don't check for it * test: increase timeout * refactor(e2e): use Promise.any() * refactor(e2e): use Promise instead of polling * test: add 2p annotation * test: use `waitForRequest` instead of promise - tidy up test, add comments describing our pattern * docs(e2e): add best practices for network tests * refactor(e2e): avoid using Promise.any * fix: de-reactify observer and mutable maps * fix: destroy by path on treeItem close * fix: don't refresh for synchronized objects * docs: fix a typo 🔥 * fix: remove existing mutable before adding * fix: fail fast if these aren't functions - Remove check for typeof 'function' to not hide any potential coding errors * fix: walk up navigationPath if item not found * chore: fix lint errors * fix: parse conflicted object name correctly * fix: re-throw conflict error * fix: Cancel edit mode on conflict
2022-12-20 21:27:51 +00:00
// Close Page 2, we're done with it.
await page2.close();
Mutables for the Tree 🎄 + clean up TreeItem observers and mutables properly (#6032) * fix: refresh object after conflict error * fix: recover from error thrown during create - Ensure that the "Saving" modal dialog is closed - Notify user of the error, and also print to console to catch in e2e * fix: default selector tree item to 'mine' folder - If create fails due to a conflict or otherwise, and the user immediately tries to "Create" again, default the selector tree's selected item to the "mine" folder (which we know exists). * fix: don't listen to composition if Selector Tree * refactor: remove dead code * fix: use MutableDomainObjects in the tree - Only use mutables and observers if NOT a SelectorTree - Properly clean up observers and mutables when a parent item is removed from the tree * test: verify conflicts don't break object creation * test: verify dialog closes and object is created * refactor(e2e): update test - Error notification on 'My Items' folder missing was removed, so don't check for it * test: increase timeout * refactor(e2e): use Promise.any() * refactor(e2e): use Promise instead of polling * test: add 2p annotation * test: use `waitForRequest` instead of promise - tidy up test, add comments describing our pattern * docs(e2e): add best practices for network tests * refactor(e2e): avoid using Promise.any * fix: de-reactify observer and mutable maps * fix: destroy by path on treeItem close * fix: don't refresh for synchronized objects * docs: fix a typo 🔥 * fix: remove existing mutable before adding * fix: fail fast if these aren't functions - Remove check for typeof 'function' to not hide any potential coding errors * fix: walk up navigationPath if item not found * chore: fix lint errors * fix: parse conflicted object name correctly * fix: re-throw conflict error * fix: Cancel edit mode on conflict
2022-12-20 21:27:51 +00:00
// Page 1: Click "OK" to create the domain object and wait for navigation.
// This will trigger a conflict error upon attempting to update
// the composition of the parent folder.
await Promise.all([
page.waitForLoadState(),
test(e2e): Major refactor and stabilization of e2e tests (#7581) * fix: update broken locator * update eslint package * first pass of lint fixes * update package * change ruleset * update component tests to match linting rules * driveby * start to factor out bad locators * update gauge component * update notebook snapshot drop area * Update plot aria * add draggable true to tree items * update package * driveby to remove dead code * unneeded * unneeded * tells a screenreader that this is a row and a cell * adds an id for dragondrops * this should be a button * first pass at fixing tooltip selectors * review comments * Updating more tests * update to remove expect expect given our use of check functions * add expand component * move role around * update more locators * force * new local storage * remove choochoo steps * test: do `lint:fix` and also add back accidentally removed code * test: add back more removed code * test: remove `unstable` annotation from tests which are not unstable * test: remove invalid test-- the "new" time conductor doesn't allow for millisecond changes in fixed time * test: fix unstable gauge test * test: remove useless asserts-- this was secretly non-functional. now that we've fixed it, it makes no sense and just fails * test: add back accidentally removed changes * test: revert changes that break test * test: more fixes * Remove all notion of the unstable/stable e2e tests * test: eviscerate the flake with FACTS and LOGIC * test: fix anotha one * lint fixes * test: no need to wait for save dialog * test: fix more tests * lint: fix more warnings * test: fix anotha one * test: use `toHaveLength` instead of `.length).toBe()` * test: stabilize tabs view example imagery test * fix: more tests be fixed * test: more `toHaveCount()`s please * test: revert more accidentally removed fixes * test: fix selector * test: fix anotha one * update lint rules to clean up bad locators in shared fixtures * update and remove bad appActions * test: fix some restricted notebook tests * test: mass find/replace to enforce `toHaveCount()` instead of `.count()).toBe()` * Remove some bad appActions and update text * test: fix da tree tests * test: await not await await * test: fix upload plan appAction and add a11y * Updating externalFixtures with best practice locators and add missing appAction framework tests * test: fix test * test: fix appAction test for plans * test: yum yum fix'em up and get rid of some dragon drops * fix: alas, a `.only()` got my hopes up that i was done fixing tests * test: add `setTimeConductorMode` test "suite" which covers most TC related appActions * test: fix arg * test(couchdb): fix some network tests via expect polling * Stabalize visual test * getCanasPixels * test: stabilize tooltip telemetry table test, better a11y for tooltips * chore: update to use `docker compose` instead of `docker-compose` * New rules, new tests, new me * fix sort order * test: add `waitForPlotsToRender` framework test, passthru timeout override * test: remove `clockOptions` test as we have `page.clock` now * test: refactor out `overrideClock` * test: use `clock.install` instead * test: use `clock.install` instead * time clock fix * test: fix timer tests * remove ever reference to old base fixture * test: stabilize restricted notebook test * lint fixes * test: use clock.install * update timelist * test: update visual tests to use `page.clock()`, update snapshots * test: stabilize tree renaming/reordering test * a11y: add aria-label and role=region to object view * refactor: use `dragTo` * refactor: use `dragTo`, other small fixes * test: use `page.clock()` to stabilize tooltip telemetry table test * test: use web-first assertion to stabilize staleness test * test: knock out a few more `page.click`s * test: destroy all `page.click()`s * refactor: consistently use `'Ok'` instead of `'OK'` and `'Ok'` mixed * test: remove gauge aria label * test: more test fixes * test: more fixes and refactors * docs: add comment * test: refactor all instances of `dragAndDrop` * test: remove redundant test (covered in previous test steps) * test: stabilize imagery operations tests for display layout * chore: remove bad unicorn rule * chore(lint): remove unused disable directives --------- Co-authored-by: Jesse Mazzella <jesse.d.mazzella@nasa.gov>
2024-08-07 21:36:14 +00:00
page.getByLabel('Save').click(),
Mutables for the Tree 🎄 + clean up TreeItem observers and mutables properly (#6032) * fix: refresh object after conflict error * fix: recover from error thrown during create - Ensure that the "Saving" modal dialog is closed - Notify user of the error, and also print to console to catch in e2e * fix: default selector tree item to 'mine' folder - If create fails due to a conflict or otherwise, and the user immediately tries to "Create" again, default the selector tree's selected item to the "mine" folder (which we know exists). * fix: don't listen to composition if Selector Tree * refactor: remove dead code * fix: use MutableDomainObjects in the tree - Only use mutables and observers if NOT a SelectorTree - Properly clean up observers and mutables when a parent item is removed from the tree * test: verify conflicts don't break object creation * test: verify dialog closes and object is created * refactor(e2e): update test - Error notification on 'My Items' folder missing was removed, so don't check for it * test: increase timeout * refactor(e2e): use Promise.any() * refactor(e2e): use Promise instead of polling * test: add 2p annotation * test: use `waitForRequest` instead of promise - tidy up test, add comments describing our pattern * docs(e2e): add best practices for network tests * refactor(e2e): avoid using Promise.any * fix: de-reactify observer and mutable maps * fix: destroy by path on treeItem close * fix: don't refresh for synchronized objects * docs: fix a typo 🔥 * fix: remove existing mutable before adding * fix: fail fast if these aren't functions - Remove check for typeof 'function' to not hide any potential coding errors * fix: walk up navigationPath if item not found * chore: fix lint errors * fix: parse conflicted object name correctly * fix: re-throw conflict error * fix: Cancel edit mode on conflict
2022-12-20 21:27:51 +00:00
// Wait for Save Banner to appear
test(e2e): Major refactor and stabilization of e2e tests (#7581) * fix: update broken locator * update eslint package * first pass of lint fixes * update package * change ruleset * update component tests to match linting rules * driveby * start to factor out bad locators * update gauge component * update notebook snapshot drop area * Update plot aria * add draggable true to tree items * update package * driveby to remove dead code * unneeded * unneeded * tells a screenreader that this is a row and a cell * adds an id for dragondrops * this should be a button * first pass at fixing tooltip selectors * review comments * Updating more tests * update to remove expect expect given our use of check functions * add expand component * move role around * update more locators * force * new local storage * remove choochoo steps * test: do `lint:fix` and also add back accidentally removed code * test: add back more removed code * test: remove `unstable` annotation from tests which are not unstable * test: remove invalid test-- the "new" time conductor doesn't allow for millisecond changes in fixed time * test: fix unstable gauge test * test: remove useless asserts-- this was secretly non-functional. now that we've fixed it, it makes no sense and just fails * test: add back accidentally removed changes * test: revert changes that break test * test: more fixes * Remove all notion of the unstable/stable e2e tests * test: eviscerate the flake with FACTS and LOGIC * test: fix anotha one * lint fixes * test: no need to wait for save dialog * test: fix more tests * lint: fix more warnings * test: fix anotha one * test: use `toHaveLength` instead of `.length).toBe()` * test: stabilize tabs view example imagery test * fix: more tests be fixed * test: more `toHaveCount()`s please * test: revert more accidentally removed fixes * test: fix selector * test: fix anotha one * update lint rules to clean up bad locators in shared fixtures * update and remove bad appActions * test: fix some restricted notebook tests * test: mass find/replace to enforce `toHaveCount()` instead of `.count()).toBe()` * Remove some bad appActions and update text * test: fix da tree tests * test: await not await await * test: fix upload plan appAction and add a11y * Updating externalFixtures with best practice locators and add missing appAction framework tests * test: fix test * test: fix appAction test for plans * test: yum yum fix'em up and get rid of some dragon drops * fix: alas, a `.only()` got my hopes up that i was done fixing tests * test: add `setTimeConductorMode` test "suite" which covers most TC related appActions * test: fix arg * test(couchdb): fix some network tests via expect polling * Stabalize visual test * getCanasPixels * test: stabilize tooltip telemetry table test, better a11y for tooltips * chore: update to use `docker compose` instead of `docker-compose` * New rules, new tests, new me * fix sort order * test: add `waitForPlotsToRender` framework test, passthru timeout override * test: remove `clockOptions` test as we have `page.clock` now * test: refactor out `overrideClock` * test: use `clock.install` instead * test: use `clock.install` instead * time clock fix * test: fix timer tests * remove ever reference to old base fixture * test: stabilize restricted notebook test * lint fixes * test: use clock.install * update timelist * test: update visual tests to use `page.clock()`, update snapshots * test: stabilize tree renaming/reordering test * a11y: add aria-label and role=region to object view * refactor: use `dragTo` * refactor: use `dragTo`, other small fixes * test: use `page.clock()` to stabilize tooltip telemetry table test * test: use web-first assertion to stabilize staleness test * test: knock out a few more `page.click`s * test: destroy all `page.click()`s * refactor: consistently use `'Ok'` instead of `'OK'` and `'Ok'` mixed * test: remove gauge aria label * test: more test fixes * test: more fixes and refactors * docs: add comment * test: refactor all instances of `dragAndDrop` * test: remove redundant test (covered in previous test steps) * test: stabilize imagery operations tests for display layout * chore: remove bad unicorn rule * chore(lint): remove unused disable directives --------- Co-authored-by: Jesse Mazzella <jesse.d.mazzella@nasa.gov>
2024-08-07 21:36:14 +00:00
page.locator('.c-message-banner__message').hover({ trial: true })
]);
Mutables for the Tree 🎄 + clean up TreeItem observers and mutables properly (#6032) * fix: refresh object after conflict error * fix: recover from error thrown during create - Ensure that the "Saving" modal dialog is closed - Notify user of the error, and also print to console to catch in e2e * fix: default selector tree item to 'mine' folder - If create fails due to a conflict or otherwise, and the user immediately tries to "Create" again, default the selector tree's selected item to the "mine" folder (which we know exists). * fix: don't listen to composition if Selector Tree * refactor: remove dead code * fix: use MutableDomainObjects in the tree - Only use mutables and observers if NOT a SelectorTree - Properly clean up observers and mutables when a parent item is removed from the tree * test: verify conflicts don't break object creation * test: verify dialog closes and object is created * refactor(e2e): update test - Error notification on 'My Items' folder missing was removed, so don't check for it * test: increase timeout * refactor(e2e): use Promise.any() * refactor(e2e): use Promise instead of polling * test: add 2p annotation * test: use `waitForRequest` instead of promise - tidy up test, add comments describing our pattern * docs(e2e): add best practices for network tests * refactor(e2e): avoid using Promise.any * fix: de-reactify observer and mutable maps * fix: destroy by path on treeItem close * fix: don't refresh for synchronized objects * docs: fix a typo 🔥 * fix: remove existing mutable before adding * fix: fail fast if these aren't functions - Remove check for typeof 'function' to not hide any potential coding errors * fix: walk up navigationPath if item not found * chore: fix lint errors * fix: parse conflicted object name correctly * fix: re-throw conflict error * fix: Cancel edit mode on conflict
2022-12-20 21:27:51 +00:00
// Page 1: Verify that the conflict has occurred and an error notification is displayed.
await expect(
page.locator('.c-message-banner__message', {
hasText: 'Conflict detected while saving mine'
})
Mutables for the Tree 🎄 + clean up TreeItem observers and mutables properly (#6032) * fix: refresh object after conflict error * fix: recover from error thrown during create - Ensure that the "Saving" modal dialog is closed - Notify user of the error, and also print to console to catch in e2e * fix: default selector tree item to 'mine' folder - If create fails due to a conflict or otherwise, and the user immediately tries to "Create" again, default the selector tree's selected item to the "mine" folder (which we know exists). * fix: don't listen to composition if Selector Tree * refactor: remove dead code * fix: use MutableDomainObjects in the tree - Only use mutables and observers if NOT a SelectorTree - Properly clean up observers and mutables when a parent item is removed from the tree * test: verify conflicts don't break object creation * test: verify dialog closes and object is created * refactor(e2e): update test - Error notification on 'My Items' folder missing was removed, so don't check for it * test: increase timeout * refactor(e2e): use Promise.any() * refactor(e2e): use Promise instead of polling * test: add 2p annotation * test: use `waitForRequest` instead of promise - tidy up test, add comments describing our pattern * docs(e2e): add best practices for network tests * refactor(e2e): avoid using Promise.any * fix: de-reactify observer and mutable maps * fix: destroy by path on treeItem close * fix: don't refresh for synchronized objects * docs: fix a typo 🔥 * fix: remove existing mutable before adding * fix: fail fast if these aren't functions - Remove check for typeof 'function' to not hide any potential coding errors * fix: walk up navigationPath if item not found * chore: fix lint errors * fix: parse conflicted object name correctly * fix: re-throw conflict error * fix: Cancel edit mode on conflict
2022-12-20 21:27:51 +00:00
).toBeVisible();
Mutables for the Tree 🎄 + clean up TreeItem observers and mutables properly (#6032) * fix: refresh object after conflict error * fix: recover from error thrown during create - Ensure that the "Saving" modal dialog is closed - Notify user of the error, and also print to console to catch in e2e * fix: default selector tree item to 'mine' folder - If create fails due to a conflict or otherwise, and the user immediately tries to "Create" again, default the selector tree's selected item to the "mine" folder (which we know exists). * fix: don't listen to composition if Selector Tree * refactor: remove dead code * fix: use MutableDomainObjects in the tree - Only use mutables and observers if NOT a SelectorTree - Properly clean up observers and mutables when a parent item is removed from the tree * test: verify conflicts don't break object creation * test: verify dialog closes and object is created * refactor(e2e): update test - Error notification on 'My Items' folder missing was removed, so don't check for it * test: increase timeout * refactor(e2e): use Promise.any() * refactor(e2e): use Promise instead of polling * test: add 2p annotation * test: use `waitForRequest` instead of promise - tidy up test, add comments describing our pattern * docs(e2e): add best practices for network tests * refactor(e2e): avoid using Promise.any * fix: de-reactify observer and mutable maps * fix: destroy by path on treeItem close * fix: don't refresh for synchronized objects * docs: fix a typo 🔥 * fix: remove existing mutable before adding * fix: fail fast if these aren't functions - Remove check for typeof 'function' to not hide any potential coding errors * fix: walk up navigationPath if item not found * chore: fix lint errors * fix: parse conflicted object name correctly * fix: re-throw conflict error * fix: Cancel edit mode on conflict
2022-12-20 21:27:51 +00:00
// Page 1: Start logging console errors from this point on
let errors = [];
page.on('console', (msg) => {
if (msg.type() === 'error') {
errors.push(msg.text());
}
});
Mutables for the Tree 🎄 + clean up TreeItem observers and mutables properly (#6032) * fix: refresh object after conflict error * fix: recover from error thrown during create - Ensure that the "Saving" modal dialog is closed - Notify user of the error, and also print to console to catch in e2e * fix: default selector tree item to 'mine' folder - If create fails due to a conflict or otherwise, and the user immediately tries to "Create" again, default the selector tree's selected item to the "mine" folder (which we know exists). * fix: don't listen to composition if Selector Tree * refactor: remove dead code * fix: use MutableDomainObjects in the tree - Only use mutables and observers if NOT a SelectorTree - Properly clean up observers and mutables when a parent item is removed from the tree * test: verify conflicts don't break object creation * test: verify dialog closes and object is created * refactor(e2e): update test - Error notification on 'My Items' folder missing was removed, so don't check for it * test: increase timeout * refactor(e2e): use Promise.any() * refactor(e2e): use Promise instead of polling * test: add 2p annotation * test: use `waitForRequest` instead of promise - tidy up test, add comments describing our pattern * docs(e2e): add best practices for network tests * refactor(e2e): avoid using Promise.any * fix: de-reactify observer and mutable maps * fix: destroy by path on treeItem close * fix: don't refresh for synchronized objects * docs: fix a typo 🔥 * fix: remove existing mutable before adding * fix: fail fast if these aren't functions - Remove check for typeof 'function' to not hide any potential coding errors * fix: walk up navigationPath if item not found * chore: fix lint errors * fix: parse conflicted object name correctly * fix: re-throw conflict error * fix: Cancel edit mode on conflict
2022-12-20 21:27:51 +00:00
// Page 1: Try to create a clock with the page that received the conflict.
const clockAfterConflict = await createDomainObjectWithDefaults(page, {
type: 'Clock'
});
Mutables for the Tree 🎄 + clean up TreeItem observers and mutables properly (#6032) * fix: refresh object after conflict error * fix: recover from error thrown during create - Ensure that the "Saving" modal dialog is closed - Notify user of the error, and also print to console to catch in e2e * fix: default selector tree item to 'mine' folder - If create fails due to a conflict or otherwise, and the user immediately tries to "Create" again, default the selector tree's selected item to the "mine" folder (which we know exists). * fix: don't listen to composition if Selector Tree * refactor: remove dead code * fix: use MutableDomainObjects in the tree - Only use mutables and observers if NOT a SelectorTree - Properly clean up observers and mutables when a parent item is removed from the tree * test: verify conflicts don't break object creation * test: verify dialog closes and object is created * refactor(e2e): update test - Error notification on 'My Items' folder missing was removed, so don't check for it * test: increase timeout * refactor(e2e): use Promise.any() * refactor(e2e): use Promise instead of polling * test: add 2p annotation * test: use `waitForRequest` instead of promise - tidy up test, add comments describing our pattern * docs(e2e): add best practices for network tests * refactor(e2e): avoid using Promise.any * fix: de-reactify observer and mutable maps * fix: destroy by path on treeItem close * fix: don't refresh for synchronized objects * docs: fix a typo 🔥 * fix: remove existing mutable before adding * fix: fail fast if these aren't functions - Remove check for typeof 'function' to not hide any potential coding errors * fix: walk up navigationPath if item not found * chore: fix lint errors * fix: parse conflicted object name correctly * fix: re-throw conflict error * fix: Cancel edit mode on conflict
2022-12-20 21:27:51 +00:00
// Page 1: Wait for save progress dialog to appear/disappear
await page
Mutables for the Tree 🎄 + clean up TreeItem observers and mutables properly (#6032) * fix: refresh object after conflict error * fix: recover from error thrown during create - Ensure that the "Saving" modal dialog is closed - Notify user of the error, and also print to console to catch in e2e * fix: default selector tree item to 'mine' folder - If create fails due to a conflict or otherwise, and the user immediately tries to "Create" again, default the selector tree's selected item to the "mine" folder (which we know exists). * fix: don't listen to composition if Selector Tree * refactor: remove dead code * fix: use MutableDomainObjects in the tree - Only use mutables and observers if NOT a SelectorTree - Properly clean up observers and mutables when a parent item is removed from the tree * test: verify conflicts don't break object creation * test: verify dialog closes and object is created * refactor(e2e): update test - Error notification on 'My Items' folder missing was removed, so don't check for it * test: increase timeout * refactor(e2e): use Promise.any() * refactor(e2e): use Promise instead of polling * test: add 2p annotation * test: use `waitForRequest` instead of promise - tidy up test, add comments describing our pattern * docs(e2e): add best practices for network tests * refactor(e2e): avoid using Promise.any * fix: de-reactify observer and mutable maps * fix: destroy by path on treeItem close * fix: don't refresh for synchronized objects * docs: fix a typo 🔥 * fix: remove existing mutable before adding * fix: fail fast if these aren't functions - Remove check for typeof 'function' to not hide any potential coding errors * fix: walk up navigationPath if item not found * chore: fix lint errors * fix: parse conflicted object name correctly * fix: re-throw conflict error * fix: Cancel edit mode on conflict
2022-12-20 21:27:51 +00:00
.locator('.c-message-banner__message', {
hasText:
Mutables for the Tree 🎄 + clean up TreeItem observers and mutables properly (#6032) * fix: refresh object after conflict error * fix: recover from error thrown during create - Ensure that the "Saving" modal dialog is closed - Notify user of the error, and also print to console to catch in e2e * fix: default selector tree item to 'mine' folder - If create fails due to a conflict or otherwise, and the user immediately tries to "Create" again, default the selector tree's selected item to the "mine" folder (which we know exists). * fix: don't listen to composition if Selector Tree * refactor: remove dead code * fix: use MutableDomainObjects in the tree - Only use mutables and observers if NOT a SelectorTree - Properly clean up observers and mutables when a parent item is removed from the tree * test: verify conflicts don't break object creation * test: verify dialog closes and object is created * refactor(e2e): update test - Error notification on 'My Items' folder missing was removed, so don't check for it * test: increase timeout * refactor(e2e): use Promise.any() * refactor(e2e): use Promise instead of polling * test: add 2p annotation * test: use `waitForRequest` instead of promise - tidy up test, add comments describing our pattern * docs(e2e): add best practices for network tests * refactor(e2e): avoid using Promise.any * fix: de-reactify observer and mutable maps * fix: destroy by path on treeItem close * fix: don't refresh for synchronized objects * docs: fix a typo 🔥 * fix: remove existing mutable before adding * fix: fail fast if these aren't functions - Remove check for typeof 'function' to not hide any potential coding errors * fix: walk up navigationPath if item not found * chore: fix lint errors * fix: parse conflicted object name correctly * fix: re-throw conflict error * fix: Cancel edit mode on conflict
2022-12-20 21:27:51 +00:00
'Do not navigate away from this page or close this browser tab while this message is displayed.',
state: 'visible'
})
Mutables for the Tree 🎄 + clean up TreeItem observers and mutables properly (#6032) * fix: refresh object after conflict error * fix: recover from error thrown during create - Ensure that the "Saving" modal dialog is closed - Notify user of the error, and also print to console to catch in e2e * fix: default selector tree item to 'mine' folder - If create fails due to a conflict or otherwise, and the user immediately tries to "Create" again, default the selector tree's selected item to the "mine" folder (which we know exists). * fix: don't listen to composition if Selector Tree * refactor: remove dead code * fix: use MutableDomainObjects in the tree - Only use mutables and observers if NOT a SelectorTree - Properly clean up observers and mutables when a parent item is removed from the tree * test: verify conflicts don't break object creation * test: verify dialog closes and object is created * refactor(e2e): update test - Error notification on 'My Items' folder missing was removed, so don't check for it * test: increase timeout * refactor(e2e): use Promise.any() * refactor(e2e): use Promise instead of polling * test: add 2p annotation * test: use `waitForRequest` instead of promise - tidy up test, add comments describing our pattern * docs(e2e): add best practices for network tests * refactor(e2e): avoid using Promise.any * fix: de-reactify observer and mutable maps * fix: destroy by path on treeItem close * fix: don't refresh for synchronized objects * docs: fix a typo 🔥 * fix: remove existing mutable before adding * fix: fail fast if these aren't functions - Remove check for typeof 'function' to not hide any potential coding errors * fix: walk up navigationPath if item not found * chore: fix lint errors * fix: parse conflicted object name correctly * fix: re-throw conflict error * fix: Cancel edit mode on conflict
2022-12-20 21:27:51 +00:00
.waitFor({ state: 'hidden' });
Mutables for the Tree 🎄 + clean up TreeItem observers and mutables properly (#6032) * fix: refresh object after conflict error * fix: recover from error thrown during create - Ensure that the "Saving" modal dialog is closed - Notify user of the error, and also print to console to catch in e2e * fix: default selector tree item to 'mine' folder - If create fails due to a conflict or otherwise, and the user immediately tries to "Create" again, default the selector tree's selected item to the "mine" folder (which we know exists). * fix: don't listen to composition if Selector Tree * refactor: remove dead code * fix: use MutableDomainObjects in the tree - Only use mutables and observers if NOT a SelectorTree - Properly clean up observers and mutables when a parent item is removed from the tree * test: verify conflicts don't break object creation * test: verify dialog closes and object is created * refactor(e2e): update test - Error notification on 'My Items' folder missing was removed, so don't check for it * test: increase timeout * refactor(e2e): use Promise.any() * refactor(e2e): use Promise instead of polling * test: add 2p annotation * test: use `waitForRequest` instead of promise - tidy up test, add comments describing our pattern * docs(e2e): add best practices for network tests * refactor(e2e): avoid using Promise.any * fix: de-reactify observer and mutable maps * fix: destroy by path on treeItem close * fix: don't refresh for synchronized objects * docs: fix a typo 🔥 * fix: remove existing mutable before adding * fix: fail fast if these aren't functions - Remove check for typeof 'function' to not hide any potential coding errors * fix: walk up navigationPath if item not found * chore: fix lint errors * fix: parse conflicted object name correctly * fix: re-throw conflict error * fix: Cancel edit mode on conflict
2022-12-20 21:27:51 +00:00
// Page 1: Navigate to 'My Items' and verify that the second clock was created
await page.goto('./#/browse/mine');
await expect(
page.locator(`.c-grid-item__name[title="${clockAfterConflict.name}"]`)
).toBeVisible();
Mutables for the Tree 🎄 + clean up TreeItem observers and mutables properly (#6032) * fix: refresh object after conflict error * fix: recover from error thrown during create - Ensure that the "Saving" modal dialog is closed - Notify user of the error, and also print to console to catch in e2e * fix: default selector tree item to 'mine' folder - If create fails due to a conflict or otherwise, and the user immediately tries to "Create" again, default the selector tree's selected item to the "mine" folder (which we know exists). * fix: don't listen to composition if Selector Tree * refactor: remove dead code * fix: use MutableDomainObjects in the tree - Only use mutables and observers if NOT a SelectorTree - Properly clean up observers and mutables when a parent item is removed from the tree * test: verify conflicts don't break object creation * test: verify dialog closes and object is created * refactor(e2e): update test - Error notification on 'My Items' folder missing was removed, so don't check for it * test: increase timeout * refactor(e2e): use Promise.any() * refactor(e2e): use Promise instead of polling * test: add 2p annotation * test: use `waitForRequest` instead of promise - tidy up test, add comments describing our pattern * docs(e2e): add best practices for network tests * refactor(e2e): avoid using Promise.any * fix: de-reactify observer and mutable maps * fix: destroy by path on treeItem close * fix: don't refresh for synchronized objects * docs: fix a typo 🔥 * fix: remove existing mutable before adding * fix: fail fast if these aren't functions - Remove check for typeof 'function' to not hide any potential coding errors * fix: walk up navigationPath if item not found * chore: fix lint errors * fix: parse conflicted object name correctly * fix: re-throw conflict error * fix: Cancel edit mode on conflict
2022-12-20 21:27:51 +00:00
// Verify no console errors occurred
expect(errors).toHaveLength(0);
});
});
test.describe('Form Correctness by Object Type', () => {
test.fixme('Verify correct behavior of number object (SWG)', async ({ page }) => {});
test.fixme('Verify correct behavior of number object Timer', async ({ page }) => {});
test.fixme('Verify correct behavior of number object Plan View', async ({ page }) => {});
test.fixme('Verify correct behavior of number object Clock', async ({ page }) => {});
test.fixme('Verify correct behavior of number object Hyperlink', async ({ page }) => {});
});