diff --git a/.circleci/config.yml b/.circleci/config.yml index 557ed0cb50..994555277d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,11 +5,11 @@ orbs: executors: pw-focal-development: docker: - - image: mcr.microsoft.com/playwright:v1.42.1-focal + - image: mcr.microsoft.com/playwright:v1.45.2-focal environment: NODE_ENV: development # Needed to ensure 'dist' folder created and devDependencies installed - PERCY_POSTINSTALL_BROWSER: 'true' # Needed to store the percy browser in cache deps - PERCY_LOGLEVEL: 'debug' # Enable DEBUG level logging for Percy (Issue: https://github.com/nasa/openmct/issues/5742) + PERCY_POSTINSTALL_BROWSER: "true" # Needed to store the percy browser in cache deps + PERCY_LOGLEVEL: "debug" # Enable DEBUG level logging for Percy (Issue: https://github.com/nasa/openmct/issues/5742) PERCY_PARALLEL_TOTAL: 2 ubuntu: machine: @@ -17,7 +17,7 @@ executors: docker_layer_caching: true commands: build_and_install: - description: 'All steps used to build and install.' + description: "All steps used to build and install." parameters: node-version: type: string @@ -27,7 +27,7 @@ commands: node-version: << parameters.node-version >> - node/install-packages generate_and_store_version_and_filesystem_artifacts: - description: 'Track important packages and files' + description: "Track important packages and files" steps: - run: | [[ $EUID -ne 0 ]] && (sudo mkdir -p /tmp/artifacts && sudo chmod 777 /tmp/artifacts) || (mkdir -p /tmp/artifacts && chmod 777 /tmp/artifacts) @@ -38,7 +38,7 @@ commands: - store_artifacts: path: /tmp/artifacts/ generate_e2e_code_cov_report: - description: 'Generate e2e code coverage artifacts and publish to codecov.io. Needed to that we can ignore the exit code status of the npm run test' + description: "Generate e2e code coverage artifacts and publish to codecov.io. Needed to that we can ignore the exit code status of the npm run test" parameters: suite: type: string @@ -93,7 +93,7 @@ jobs: - generate_and_store_version_and_filesystem_artifacts e2e-test: parameters: - suite: #stable or full + suite: #ci or full type: string executor: pw-focal-development parallelism: 7 @@ -102,7 +102,7 @@ jobs: node-version: lts/hydrogen - when: #Only install chrome-beta when running the 'full' suite to save $$$ condition: - equal: ['full', <>] + equal: ["full", <>] steps: - run: npx playwright install chrome-beta - run: @@ -159,10 +159,10 @@ jobs: steps: - build_and_install: node-version: lts/hydrogen - - run: npx playwright@1.42.1 install #Necessary for bare ubuntu machine + - run: npx playwright@1.45.2 install #Necessary for bare ubuntu machine - run: | export $(cat src/plugins/persistence/couch/.env.ci | xargs) - docker-compose -f src/plugins/persistence/couch/couchdb-compose.yaml up --detach + docker compose -f src/plugins/persistence/couch/couchdb-compose.yaml up --detach sleep 3 bash src/plugins/persistence/couch/setup-couchdb.sh - run: sh src/plugins/persistence/couch/replace-localstorage-with-couchdb-indexhtml.sh #Replace LocalStorage Plugin with CouchDB @@ -230,7 +230,7 @@ jobs: steps: - build_and_install: node-version: lts/iron - - run: npm run test:e2e:visual:<> + - run: SHARD="$((${CIRCLE_NODE_INDEX}+1))"; npm run test:e2e:visual:<> -- --shard=${SHARD}/${CIRCLE_NODE_TOTAL} - store_test_results: path: test-results/results.xml - store_artifacts: @@ -253,12 +253,14 @@ workflows: name: node18-chrome node-version: lts/hydrogen - e2e-test: - name: e2e-stable - suite: stable + name: e2e-ci + suite: ci - e2e-mobile - visual-a11y: name: visual-a11y-ci suite: ci + - perf-test + - mem-test the-nightly: #These jobs do not run on PRs, but against master at night jobs: @@ -282,7 +284,7 @@ workflows: - e2e-couchdb triggers: - schedule: - cron: '0 0 * * *' + cron: "0 0 * * *" filters: branches: only: diff --git a/.cspell.json b/.cspell.json index 9afde5db7c..3ba2caaac6 100644 --- a/.cspell.json +++ b/.cspell.json @@ -7,24 +7,18 @@ "minmax", "openmct", "datasources", - "recieved", - "evalute", "Sinewave", "deregistration", "unregisters", - "configutation", - "configuation", "codecov", "carryforward", "Chacon", "Straub", "OWASP", "Testathon", - "exploratorily", "Testathons", "testathon", "npmjs", - "publishj", "treeitem", "timespan", "Timespan", @@ -41,14 +35,10 @@ "faultname", "gantt", "sharded", - "perfromance", "MMOC", "codegen", - "Unfortuantely", "viewports", "updatesnapshots", - "excercised", - "Circel", "browsercontexts", "miminum", "testcase", @@ -135,9 +125,7 @@ "tortor", "faucibus", "euismod", - "pratices", "pathing", - "pases", "testcases", "Noneditable", "listitem", @@ -206,16 +194,12 @@ "unlisten", "symbolsfont", "ellipsize", - "dismissable", "TIMESYSTEM", "Metadatas", - "stalenes", - "receieves", "unsub", "callbacktwo", "unsubscribetwo", "telem", - "Telemetery", "unemitted", "granually", "timesystem", @@ -457,7 +441,6 @@ "Userand", "Userbefore", "brdr", - "pushs", "ALPH", "Recents", "Qbert", @@ -497,7 +480,10 @@ "checksnapshots", "specced", "composables", - "countup" + "countup", + "darkmatter", + "Undeletes", + "SSSZ" ], "dictionaries": ["npm", "softwareTerms", "node", "html", "css", "bash", "en_US", "en-gb", "misc"], "ignorePaths": [ diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 6df907f782..6607a1c553 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -5,12 +5,16 @@ const config = { browser: true, es2024: true, jasmine: true, - node: true, - worker: true, - serviceworker: true + amd: true, + node: true }, globals: { - _: 'readonly' + _: 'readonly', + __webpack_public_path__: 'writeable', + __OPENMCT_VERSION__: 'readonly', + __OPENMCT_BUILD_DATE__: 'readonly', + __OPENMCT_REVISION__: 'readonly', + __OPENMCT_BUILD_BRANCH__: 'readonly' }, plugins: ['prettier', 'unicorn', 'simple-import-sort'], extends: [ @@ -39,6 +43,7 @@ const config = { 'vue/no-deprecated-events-api': 'warn', 'vue/no-v-for-template-key': 'off', 'vue/no-v-for-template-key-on-child': 'error', + 'vue/component-name-in-template-casing': ['error', 'PascalCase'], 'prettier/prettier': 'error', 'you-dont-need-lodash-underscore/omit': 'off', 'you-dont-need-lodash-underscore/throttle': 'off', diff --git a/.github/codeql/codeql-config.yml b/.github/codeql/codeql-config.yml index 98f45f4da8..ab0dddd782 100644 --- a/.github/codeql/codeql-config.yml +++ b/.github/codeql/codeql-config.yml @@ -1 +1,5 @@ name: 'Custom CodeQL config' + +paths-ignore: + # Ignore e2e tests and framework + - e2e diff --git a/.github/workflows/e2e-couchdb.yml b/.github/workflows/e2e-couchdb.yml index 996ebf179e..48ba6f352a 100644 --- a/.github/workflows/e2e-couchdb.yml +++ b/.github/workflows/e2e-couchdb.yml @@ -37,12 +37,12 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - run: npx playwright@1.42.1 install + - run: npx playwright@1.45.2 install - name: Start CouchDB Docker Container and Init with Setup Scripts run: | export $(cat src/plugins/persistence/couch/.env.ci | xargs) - docker-compose -f src/plugins/persistence/couch/couchdb-compose.yaml up --detach + docker compose -f src/plugins/persistence/couch/couchdb-compose.yaml up --detach sleep 3 bash src/plugins/persistence/couch/setup-couchdb.sh bash src/plugins/persistence/couch/replace-localstorage-with-couchdb-indexhtml.sh diff --git a/.github/workflows/e2e-flakefinder.yml b/.github/workflows/e2e-flakefinder.yml index fc0cdc8dc6..c7eccf222d 100644 --- a/.github/workflows/e2e-flakefinder.yml +++ b/.github/workflows/e2e-flakefinder.yml @@ -30,11 +30,11 @@ jobs: restore-keys: | ${{ runner.os }}-node- - - run: npx playwright@1.42.1 install + - run: npx playwright@1.45.2 install - run: npm ci --no-audit --progress=false - name: Run E2E Tests (Repeated 10 Times) - run: npm run test:e2e:stable -- --retries=0 --repeat-each=10 --max-failures=50 + run: npm run test:e2e:ci -- --retries=0 --repeat-each=10 --max-failures=50 - name: Archive test results if: success() || failure() diff --git a/.github/workflows/e2e-perf.yml b/.github/workflows/e2e-perf.yml index e2e19faad1..27bfad23cb 100644 --- a/.github/workflows/e2e-perf.yml +++ b/.github/workflows/e2e-perf.yml @@ -28,7 +28,7 @@ jobs: restore-keys: | ${{ runner.os }}-node- - - run: npx playwright@1.42.1 install + - run: npx playwright@1.45.2 install - run: npm ci --no-audit --progress=false - run: npm run test:perf:localhost - run: npm run test:perf:contract diff --git a/.github/workflows/e2e-pr.yml b/.github/workflows/e2e-pr.yml index 0cb462d4cb..9c0724f645 100644 --- a/.github/workflows/e2e-pr.yml +++ b/.github/workflows/e2e-pr.yml @@ -33,7 +33,7 @@ jobs: restore-keys: | ${{ runner.os }}-node- - - run: npx playwright@1.42.1 install + - run: npx playwright@1.45.2 install - run: npx playwright install chrome-beta - run: npm ci --no-audit --progress=false - run: npm run test:e2e:full -- --max-failures=40 diff --git a/.npmignore b/.npmignore index c26dbd4b3c..7da014b864 100644 --- a/.npmignore +++ b/.npmignore @@ -22,3 +22,6 @@ !index.html !openmct.js !SECURITY.md + +# Dont include the example html +dist/index.html \ No newline at end of file diff --git a/.webpack/webpack.common.mjs b/.webpack/webpack.common.mjs index 7a7a3a2023..7290ce999e 100644 --- a/.webpack/webpack.common.mjs +++ b/.webpack/webpack.common.mjs @@ -19,7 +19,7 @@ import { merge } from 'webpack-merge'; let gitRevision = 'error-retrieving-revision'; let gitBranch = 'error-retrieving-branch'; -const packageDefinition = JSON.parse(fs.readFileSync(new URL('../package.json', import.meta.url))); +const { version } = JSON.parse(fs.readFileSync(new URL('../package.json', import.meta.url))); try { gitRevision = execSync('git rev-parse HEAD').toString().trim(); @@ -49,7 +49,8 @@ const config = { couchDBChangesFeed: './src/plugins/persistence/couch/CouchChangesFeed.js', inMemorySearchWorker: './src/api/objects/InMemorySearchWorker.js', espressoTheme: './src/plugins/themes/espresso-theme.scss', - snowTheme: './src/plugins/themes/snow-theme.scss' + snowTheme: './src/plugins/themes/snow-theme.scss', + darkmatterTheme: './src/plugins/themes/darkmatter-theme.scss' }, output: { globalObject: 'this', @@ -69,7 +70,6 @@ const config = { '@': path.join(projectRootDir, 'src'), legacyRegistry: path.join(projectRootDir, 'src/legacyRegistry'), csv: 'comma-separated-values', - EventEmitter: 'eventemitter3', bourbon: 'bourbon.scss', 'plotly-basic': 'plotly.js-basic-dist-min', 'plotly-gl2d': 'plotly.js-gl2d-dist-min', @@ -84,7 +84,7 @@ const config = { }, plugins: [ new webpack.DefinePlugin({ - __OPENMCT_VERSION__: `'${packageDefinition.version}'`, + __OPENMCT_VERSION__: `'${version}'`, __OPENMCT_BUILD_DATE__: `'${new Date()}'`, __OPENMCT_REVISION__: `'${gitRevision}'`, __OPENMCT_BUILD_BRANCH__: `'${gitBranch}'`, diff --git a/.webpack/webpack.coverage.mjs b/.webpack/webpack.coverage.mjs index 2a527612bb..a4f7894eda 100644 --- a/.webpack/webpack.coverage.mjs +++ b/.webpack/webpack.coverage.mjs @@ -6,7 +6,7 @@ information to pull requests. import config from './webpack.dev.mjs'; -config.devtool = 'source-map'; +config.devtool = 'inline-source-map'; config.devServer.hot = false; config.module.rules.push({ diff --git a/.webpack/webpack.dev.mjs b/.webpack/webpack.dev.mjs index 46170f08f7..9260a6c623 100644 --- a/.webpack/webpack.dev.mjs +++ b/.webpack/webpack.dev.mjs @@ -39,7 +39,7 @@ export default merge(common, { return shouldWrite; } }, - watchFiles: ['**/*.css'], + watchFiles: ['src/**/*.css', 'example/**/*.css'], static: { directory: fileURLToPath(new URL('../dist', import.meta.url)), publicPath: '/dist', diff --git a/API.md b/API.md index 6de26c55d1..40d8b7a178 100644 --- a/API.md +++ b/API.md @@ -381,6 +381,7 @@ openmct.composition.addProvider({ The `addProvider` function accepts a Composition Provider object as its sole argument. A Composition Provider is a javascript object exposing two functions: + - `appliesTo`: A `function` that accepts a `domainObject` argument, and returns a `boolean` value indicating whether this composition provider applies to the given object. @@ -618,9 +619,10 @@ interface Formatter { Open MCT on its own defines a handful of built-in formats: -###### **Number Format (default):** +###### **Number Format (default):** Applied to data with `format: 'number'` + ```js valueMetadata = { format: 'number' @@ -635,15 +637,18 @@ interface NumberFormatter extends Formatter { validate: (value: any) => boolean; } ``` -###### **String Format**: + +###### **String Format** Applied to data with `format: 'string'` + ```js valueMetadata = { format: 'string' // ... }; ``` + ```ts interface StringFormatter extends Formatter { parse: (value: any) => string; @@ -652,8 +657,10 @@ interface StringFormatter extends Formatter { } ``` -###### **Enum Format**: +###### **Enum Format** + Applied to data with `format: 'enum'` + ```js valueMetadata = { format: 'enum', @@ -676,6 +683,7 @@ valueMetadata = { Creates a two-way mapping between enum string and value to be used in the `parse` and `format` methods. Ex: + - `formatter.parse('APPLE') === 1;` - `formatter.format(1) === 'APPLE';` @@ -691,7 +699,6 @@ interface EnumFormatter extends Formatter { Formats implement the following interface (provided here as TypeScript for simplicity): - Formats are registered with the Telemetry API using the `addFormat` function. eg. ```javascript @@ -713,7 +720,7 @@ openmct.telemetry.addFormat({ A single telemetry point is considered a Datum, and is represented by a standard javascript object. Realtime subscriptions (obtained via **subscribe**) will -invoke the supplied callback once for each telemetry datum recieved. Telemetry +invoke the supplied callback once for each telemetry datum received. Telemetry requests (obtained via **request**) will return a promise for an array of telemetry datums. @@ -738,7 +745,7 @@ section. Limit evaluators allow a telemetry integrator to define which limits exist for a telemetry endpoint and how limits should be applied to telemetry from a given domain object. -A limit evaluator can implement the `evalute` method which is used to define how limits +A limit evaluator can implement the `evaluate` method which is used to define how limits should be applied to telemetry and the `getLimits` method which is used to specify what the limit values are for different limit levels. @@ -763,8 +770,8 @@ state of the application, and emits events to inform listeners when the state ch Because the data displayed tends to be time domain data, Open MCT must always have at least one time system installed and activated. When you download Open -MCT, it will be pre-configured to use the UTC time system, which is installed and activated, -along with other default plugins, in `index.html`. Installing and activating a time system +MCT, it will be pre-configured to use the UTC time system, which is installed and activated, +along with other default plugins, in `index.html`. Installing and activating a time system is simple, and is covered [in the next section](#defining-and-registering-time-systems). ### Time Systems and Bounds @@ -817,7 +824,7 @@ numbers in UTC terrestrial time. #### Getting and Setting the Active Time System Once registered, a time system can be activated by calling `setTimeSystem` with -the timeSystem `key` or an instance of the time system. You can also specify +the timeSystem `key` or an instance of the time system. You can also specify valid [bounds](#time-bounds) for the timeSystem. ```javascript @@ -841,10 +848,9 @@ Setting the active time system will trigger a [`'timeSystemChanged'`](#time-even event. If you supplied bounds, a [`'boundsChanged'`](#time-events) event will be triggered afterwards with your newly supplied bounds. > ⚠️ **Deprecated** +> > - The method `timeSystem()` is deprecated. Please use `getTimeSystem()` and `setTimeSystem()` as a replacement. - - #### Time Bounds The TimeAPI provides a getter and setter for querying and setting time bounds. Time @@ -875,15 +881,16 @@ To respond to bounds change events, listen for the [`'boundsChanged'`](#time-eve event. > ⚠️ **Deprecated** +> > - The method `bounds()` is deprecated and will be removed in a future release. Please use `getBounds()` and `setBounds()` as a replacement. ### Clocks -The Time API requires a clock source which will cause the bounds to be updated -automatically whenever the clock source "ticks". A clock is simply an object that -supports registration of listeners and periodically invokes its listeners with a -number. Open MCT supports registration of new clock sources that tick on almost -anything. A tick occurs when the clock invokes callback functions registered by its +The Time API requires a clock source which will cause the bounds to be updated +automatically whenever the clock source "ticks". A clock is simply an object that +supports registration of listeners and periodically invokes its listeners with a +number. Open MCT supports registration of new clock sources that tick on almost +anything. A tick occurs when the clock invokes callback functions registered by its listeners with a new time value. An example of a clock source is the [LocalClock](https://github.com/nasa/openmct/blob/master/src/plugins/utcTimeSystem/LocalClock.js) @@ -972,6 +979,7 @@ openmct.time.getClock(); ``` > ⚠️ **Deprecated** +> > - The method `clock()` is deprecated and will be removed in a future release. Please use `getClock()` and `setClock()` as a replacement. #### ⚠️ [DEPRECATED] Stopping an active clock @@ -986,12 +994,13 @@ openmct.time.stopClock(); ``` > ⚠️ **Deprecated** +> > - The method `stopClock()` is deprecated and will be removed in a future release. #### Clock Offsets -When in Real-time [mode](#time-modes), the time bounds of the application will be updated automatically each time the -clock "ticks". The bounds are calculated based on the current value provided by +When in Real-time [mode](#time-modes), the time bounds of the application will be updated automatically each time the +clock "ticks". The bounds are calculated based on the current value provided by the active clock (via its `tick` event, or its `currentValue()` method). Unlike bounds, which represent absolute time values, clock offsets represent @@ -1026,13 +1035,14 @@ new bounds will be calculated based on the `currentValue()` of the active clock. Clock offsets are only relevant when in Real-time [mode](#time-modes). > ⚠️ **Deprecated** +> > - The method `clockOffsets()` is deprecated and will be removed in a future release. Please use `getClockOffsets()` and `setClockOffsets()` as a replacement. ### Time Modes -There are two time modes in Open MCT, "Fixed" and "Real-time". In Real-time mode the +There are two time modes in Open MCT, "Fixed" and "Real-time". In Real-time mode the time bounds of the application will be updated automatically each time the clock "ticks". -The bounds are calculated based on the current value provided by the active clock. In +The bounds are calculated based on the current value provided by the active clock. In Fixed mode, the time bounds are set for a specified time range. When Open MCT is first initialized, it will be in Real-time mode. @@ -1120,6 +1130,7 @@ The events emitted by the Time API are: - `mode`: A string representation of the current time mode, either `'realtime'` or `'fixed'`. > ⚠️ **Deprecated Events** (These will be removed in a future release): +> > - `bounds` → `boundsChanged` > - `timeSystem` → `timeSystemChanged` > - `clock` → `clockChanged` @@ -1180,7 +1191,7 @@ An example time conductor configuration is provided below. It sets up some default options for the [UTCTimeSystem](https://github.com/nasa/openmct/blob/master/src/plugins/utcTimeSystem/UTCTimeSystem.js) and [LocalTimeSystem](https://github.com/nasa/openmct/blob/master/src/plugins/localTimeSystem/LocalTimeSystem.js), in both fixed mode, and for the [LocalClock](https://github.com/nasa/openmct/blob/master/src/plugins/utcTimeSystem/LocalClock.js) -source. In this configutation, the local clock supports both the UTCTimeSystem +source. In this configuration, the local clock supports both the UTCTimeSystem and LocalTimeSystem. Configuration for fixed bounds mode is specified by omitting a clock key. @@ -1190,7 +1201,7 @@ const ONE_MINUTE = 60 * 1000; openmct.install(openmct.plugins.Conductor({ menuOptions: [ - // 'Fixed' bounds mode configuation for the UTCTimeSystem + // 'Fixed' bounds mode configuration for the UTCTimeSystem { timeSystem: 'utc', bounds: {start: Date.now() - 30 * ONE_MINUTE, end: Date.now()}, @@ -1262,7 +1273,7 @@ Returns the currently set text as a `string`. [the built-in glyphs](https://nasa.github.io/openmct/style-guide/#/browse/styleguide:home/glyphs?view=styleguide.glyphs) may be used here, or a custom CSS class can be provided. Returns the currently defined CSS class as a `string`. -- `.statusClass([className])`: Gets or sets the CSS class used to determine status. Accepts an __optional__ +- `.statusClass([className])`: Gets or sets the CSS class used to determine status. Accepts an **optional** `string` parameter to be used to set a status class applied to the indicator. May be used to apply different colors to indicate status. @@ -1312,7 +1323,7 @@ can be used to manage user information and roles. ### Example -Open MCT provides an example [user](example/exampleUser/exampleUserCreator.js) and [user provider](example/exampleUser/ExampleUserProvider.js) which +Open MCT provides an example [user](example/exampleUser/exampleUserCreator.js) and [user provider](example/exampleUser/ExampleUserProvider.js) which can be used as a starting point for creating a custom user provider. ## Visibility-Based Rendering in View Providers @@ -1335,10 +1346,10 @@ Here’s the signature for the show function: `show(element, isEditing, viewOptions)` - * `element` (HTMLElement) - The DOM element where the view should be rendered. - * `isEditing` (boolean) - Indicates whether the view is in editing mode. - * `viewOptions` (Object) - An object with configuration options for the view, including: - * `renderWhenVisible` (Function) - This function wraps the `requestAnimationFrame` and only triggers the provided render logic when the view is visible in the viewport. +- `element` (HTMLElement) - The DOM element where the view should be rendered. +- `isEditing` (boolean) - Indicates whether the view is in editing mode. +- `viewOptions` (Object) - An object with configuration options for the view, including: + - `renderWhenVisible` (Function) - This function wraps the `requestAnimationFrame` and only triggers the provided render logic when the view is visible in the viewport. ### Example @@ -1367,8 +1378,6 @@ const myViewProvider = { }; ``` - Note that `renderWhenVisible` defers rendering while the view is not visible and caters to the latest execution call. This provides responsiveness for dynamic content while ensuring performance optimizations. Ensure your view logic is prepared to handle potentially multiple deferrals if using this API, as only the last call to renderWhenVisible will be queued for execution upon the view becoming visible. - diff --git a/README.md b/README.md index 78335fbb99..af09dbf132 100644 --- a/README.md +++ b/README.md @@ -5,12 +5,10 @@ Open MCT (Open Mission Control Technologies) is a next-generation mission contro > [!NOTE] > Please visit our [Official Site](https://nasa.github.io/openmct/) and [Getting Started Guide](https://nasa.github.io/openmct/getting-started/) - Once you've created something amazing with Open MCT, showcase your work in our GitHub Discussions [Show and Tell](https://github.com/nasa/openmct/discussions/categories/show-and-tell) section. We love seeing unique and wonderful implementations of Open MCT! ![Screen Shot 2022-11-23 at 9 51 36 AM](https://user-images.githubusercontent.com/4215777/203617422-4d912bfc-766f-4074-8324-409d9bbe7c05.png) - ## Building and Running Open MCT Locally Building and running Open MCT in your local dev environment is very easy. Be sure you have [Git](https://git-scm.com/downloads) and [Node.js](https://nodejs.org/) installed, then follow the directions below. Need additional information? Check out the [Getting Started](https://nasa.github.io/openmct/getting-started/) page on our website. @@ -18,19 +16,19 @@ Building and running Open MCT in your local dev environment is very easy. Be sur 1. Clone the source code: -``` +```sh git clone https://github.com/nasa/openmct.git ``` 2. (Optional) Install the correct node version using [nvm](https://github.com/nvm-sh/nvm): -``` +```sh nvm install ``` -3. Install development dependencies (Note: Check the `package.json` engine for our tested and supported node versions): +3. Install development dependencies (Note: Check the `package.json` engine for our tested and supported node versions): -``` +```sh npm install ``` @@ -57,9 +55,9 @@ our documentation. > [!NOTE] > We want Open MCT to be as easy to use, install, run, and develop for as -> possible, and your feedback will help us get there! -> Feedback can be provided via [GitHub issues](https://github.com/nasa/openmct/issues/new/choose), -> [Starting a GitHub Discussion](https://github.com/nasa/openmct/discussions), +> possible, and your feedback will help us get there! +> Feedback can be provided via [GitHub issues](https://github.com/nasa/openmct/issues/new/choose), +> [Starting a GitHub Discussion](https://github.com/nasa/openmct/discussions), > or by emailing us at [arc-dl-openmct@mail.nasa.gov](mailto:arc-dl-openmct@mail.nasa.gov). ## Developing Applications With Open MCT @@ -68,28 +66,29 @@ For more on developing with Open MCT, see our documentation for a guide on [Deve ## Compatibility -This is a fast moving project and we do our best to test and support the widest possible range of browsers, operating systems, and nodejs APIs. We have a published list of support available in our package.json's `browserslist` key. +This is a fast moving project and we do our best to test and support the widest possible range of browsers, operating systems, and NodeJS APIs. We have a published list of support available in our package.json's `browserslist` key. -The project uses `nvm` to ensure the node and npm version used, is coherent in all projects. Install nvm (non-windows), [here](https://github.com/nvm-sh/nvm) or the windows equivalent [here](https://github.com/coreybutler/nvm-windows) +The project utilizes `nvm` to maintain consistent node and npm versions across all projects. For UNIX, MacOS, Windows WSL, and other POSIX-compliant shell environments, click [here](https://github.com/nvm-sh/nvm). For Windows, check out [nvm-windows](https://github.com/coreybutler/nvm-windows). -If you encounter an issue with a particular browser, OS, or nodejs API, please file a [GitHub issue](https://github.com/nasa/openmct/issues/new/choose) +If you encounter an issue with a particular browser, OS, or NodeJS API, please [file an issue](https://github.com/nasa/openmct/issues/new/choose). ## Plugins -Open MCT can be extended via plugins that make calls to the Open MCT API. A plugin is a group +Open MCT can be extended via plugins that make calls to the Open MCT API. A plugin is a group of software components (including source code and resources such as images and HTML templates) that is intended to be added or removed as a single unit. -As well as providing an extension mechanism, most of the core Open MCT codebase is also +As well as providing an extension mechanism, most of the core Open MCT codebase is also written as plugins. For information on writing plugins, please see [our API documentation](./API.md#plugins). ## Tests -Our automated test coverage comes in the form of unit, e2e, visual, performance, and security tests. +Our automated test coverage comes in the form of unit, e2e, visual, performance, and security tests. ### Unit Tests + Unit Tests are written for [Jasmine](https://jasmine.github.io/api/edge/global) and run by [Karma](http://karma-runner.github.io). To run: @@ -101,24 +100,34 @@ in the `src` hierarchy. Full configuration details are found in alongside the units that they test; for example, `src/foo/Bar.js` would be tested by `src/foo/BarSpec.js`. -### e2e, Visual, and Performance tests -The e2e, Visual, and Performance tests are written for playwright and run by playwright's new test runner [@playwright/test](https://playwright.dev/). +### e2e, Visual, and Performance Testing -To run the e2e tests which are part of every commit: +Our e2e (end-to-end), Visual, and Performance tests leverage the Playwright framework and are executed using Playwright's test runner, [@playwright/test](https://playwright.dev/). -`npm run test:e2e:stable` +#### How to Run Tests -To run the visual test suite: +- **e2e Tests**: These tests are run on every commit. To run the tests locally, use: -`npm run test:e2e:visual` + ```sh + npm run test:e2e:ci + ``` -To run the performance tests: +- **Visual Tests**: For running the visual test suite, use: -`npm run test:perf` + ```sh + npm run test:e2e:visual + ``` -The test suite is configured to all tests located in `e2e/tests/` ending in `*.e2e.spec.js`. For more about the e2e test suite, please see the [README](./e2e/README.md) +- **Performance Tests**: To initiate the performance tests, enter: + + ```sh + npm run test:perf + ``` + +All tests are located within the `e2e/tests/` directory and are identified by the `*.e2e.spec.js` filename pattern. For more information about the e2e test suite, refer to the [README](./e2e/README.md). ### Security Tests + Each commit is analyzed for known security vulnerabilities using [CodeQL](https://codeql.github.com/docs/codeql-language-guides/codeql-library-for-javascript/). The list of CWE coverage items is available in the [CodeQL docs](https://codeql.github.com/codeql-query-help/javascript-cwe/). The CodeQL workflow is specified in the [CodeQL analysis file](./.github/workflows/codeql-analysis.yml) and the custom [CodeQL config](./.github/codeql/codeql-config.yml). ### Test Reporting and Code Coverage @@ -129,60 +138,41 @@ Our code coverage is generated during the runtime of our unit, e2e, and visual t For more on the specifics of our code coverage setup, [see](TESTING.md#code-coverage) -# Glossary +## Glossary Certain terms are used throughout Open MCT with consistent meanings or conventions. Any deviations from the below are issues and should be addressed (either by updating this glossary or changing code to reflect correct usage.) Other developer documentation, particularly in-line documentation, may presume an understanding of these terms. - -* _plugin_: A plugin is a removable, reusable grouping of software elements. - The application is composed of plugins. -* _composition_: In the context of a domain object, this refers to the set of - other domain objects that compose or are contained by that object. A domain - object's composition is the set of domain objects that should appear - immediately beneath it in a tree hierarchy. A domain object's composition is - described in its model as an array of id's; its composition capability - provides a means to retrieve the actual domain object instances associated - with these identifiers asynchronously. -* _description_: When used as an object property, this refers to the human-readable - description of a thing; usually a single sentence or short paragraph. - (Most often used in the context of extensions, domain - object models, or other similar application-specific objects.) -* _domain object_: A meaningful object to the user; a distinct thing in - the work support by Open MCT. Anything that appears in the left-hand - tree is a domain object. -* _identifier_: A tuple consisting of a namespace and a key, which together uniquely - identifies a domain object. -* _model_: The persistent state associated with a domain object. A domain - object's model is a JavaScript object which can be converted to JSON - without losing information (that is, it contains no methods.) -* _name_: When used as an object property, this refers to the human-readable - name for a thing. (Most often used in the context of extensions, domain - object models, or other similar application-specific objects.) -* _navigation_: Refers to the current state of the application with respect - to the user's expressed interest in a specific domain object; e.g. when - a user clicks on a domain object in the tree, they are _navigating_ to - it, and it is thereafter considered the _navigated_ object (until the - user makes another such choice.) -* _namespace_: A name used to identify a persistence store. A running open MCT -application could potentially use multiple persistence stores, with the +| Term | Definition | +|---------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| _plugin_ | A removable, reusable grouping of software elements. The application is composed of plugins. | +| _composition_ | In the context of a domain object, this term refers to the set of other domain objects that compose or are contained by that object. A domain object's composition is the set of domain objects that should appear immediately beneath it in a tree hierarchy. It is described in its model as an array of ids, providing a means to asynchronously retrieve the actual domain object instances associated with these identifiers. | +| _description_ | When used as an object property, this term refers to the human-readable description of a thing, usually a single sentence or short paragraph. It is most often used in the context of extensions, domain object models, or other similar application-specific objects. | +| _domain object_ | A meaningful object to the user and a distinct thing in the work supported by Open MCT. Anything that appears in the left-hand tree is a domain object. | +| _identifier_ | A tuple consisting of a namespace and a key, which together uniquely identifies a domain object. | +| _model_ | The persistent state associated with a domain object. A domain object's model is a JavaScript object that can be converted to JSON without losing information, meaning it contains no methods. | +| _name_ | When used as an object property, this term refers to the human-readable name for a thing. It is most often used in the context of extensions, domain object models, or other similar application-specific objects. | +| _navigation_ | This term refers to the current state of the application with respect to the user's expressed interest in a specific domain object. For example, when a user clicks on a domain object in the tree, they are navigating to it, and it is thereafter considered the navigated object until the user makes another such choice. | +| _namespace_ | A name used to identify a persistence store. A running Open MCT application could potentially use multiple persistence stores. | ## Open MCT v2.0.0 + Support for our legacy bundle-based API, and the libraries that it was built on (like Angular 1.x), have now been removed entirely from this repository. For now if you have an Open MCT application that makes use of the legacy API, [a plugin](https://github.com/nasa/openmct-legacy-plugin) is provided that bootstraps the legacy bundling mechanism and API. This plugin will not be maintained over the long term however, and the legacy support plugin will not be tested for compatibility with future versions of Open MCT. It is provided for convenience only. ### How do I know if I am using legacy API? + You might still be using legacy API if your source code -* Contains files named bundle.js, or bundle.json, -* Makes calls to `openmct.$injector()`, or `openmct.$angular`, -* Makes calls to `openmct.legacyRegistry`, `openmct.legacyExtension`, or `openmct.legacyBundle`. - +- Contains files named bundle.js, or bundle.json, +- Makes calls to `openmct.$injector()`, or `openmct.$angular`, +- Makes calls to `openmct.legacyRegistry`, `openmct.legacyExtension`, or `openmct.legacyBundle`. ### What should I do if I am using legacy API? + Please refer to [the modern Open MCT API](https://nasa.github.io/openmct/documentation/). Post any questions to the [Discussions section](https://github.com/nasa/openmct/discussions) of the Open MCT GitHub repository. ## Related Repos diff --git a/TESTING.md b/TESTING.md index ba8f9cc8a3..24358c6ae3 100644 --- a/TESTING.md +++ b/TESTING.md @@ -66,8 +66,8 @@ The e2e line coverage is a bit more complex than the karma implementation. This 1. Each e2e suite will start webpack with the ```npm run start:coverage``` command with config `webpack.coverage.mjs` and the `babel-plugin-istanbul` plugin to generate code coverage during e2e test execution using our custom [baseFixture](./baseFixtures.js). 1. During testcase execution, each e2e shard will generate its piece of the larger coverage suite. **This coverage file is not merged**. The raw coverage file is stored in a `.nyc_report` directory. 1. [nyc](https://github.com/istanbuljs/nyc) converts this directory into a `lcov` file with the following command `npm run cov:e2e:report` -1. Most of the tests are run in the '@stable' configuration and focus on chrome/ubuntu at a single resolution. This coverage is published to codecov with `npm run cov:e2e:stable:publish`. -1. The rest of our coverage only appears when run against `@unstable` tests, persistent datastore (couchdb), non-ubuntu machines, and non-chrome browsers with the `npm run cov:e2e:full:publish` flag. Since this happens about once a day, we have leveraged codecov.io's carryforward flag to report on lines covered outside of each commit on an individual PR. +1. Most of the tests focus on chrome/ubuntu at a single resolution. This coverage is published to codecov with `npm run cov:e2e:ci:publish`. +1. The rest of our coverage only appears when run against persistent datastore (couchdb), non-ubuntu machines, and non-chrome browsers with the `npm run cov:e2e:full:publish` flag. Since this happens about once a day, we have leveraged codecov.io's carryforward flag to report on lines covered outside of each commit on an individual PR. ### Limitations in our code coverage reporting diff --git a/codecov.yml b/codecov.yml index 07da9fa4c3..aab53fc30c 100644 --- a/codecov.yml +++ b/codecov.yml @@ -11,18 +11,18 @@ coverage: informational: true precision: 2 round: down - range: '66...100' + range: "66...100" flags: unit: carryforward: false - e2e-stable: + e2e-ci: carryforward: false e2e-full: carryforward: true comment: - layout: 'diff,flags,files,footer' + layout: "diff,flags,files,footer" behavior: default require_changes: false show_carryforward_flags: true diff --git a/docs/src/index.md b/docs/src/index.md index 52781a3739..0e21453734 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -14,13 +14,13 @@ extend the platform are provided in the following documentation. ## Sections - - * The [API](api/) uses inline documentation + +* The [API](api/) uses inline documentation. using [TypeScript](https://www.typescriptlang.org) and some legacy [JSDoc](https://jsdoc.app/). It describes the JavaScript objects and functions that make up the software platform. - * The [Development Process](process/) document describes the +* The [Development Process](process/) document describes the Open MCT software development cycle. - * The [Tutorials](https://github.com/nasa/openmct-tutorial) give examples of extending the platform to add - functionality, and integrate with data sources. +* The [tutorial](https://github.com/nasa/openmct-tutorial) and [plugin template](https://github.com/nasa/openmct-hello) give examples of extending the platform to add + functionality and integrate with data sources. diff --git a/docs/src/process/cycle.md b/docs/src/process/cycle.md index 564576beb3..85a8412e84 100644 --- a/docs/src/process/cycle.md +++ b/docs/src/process/cycle.md @@ -133,7 +133,7 @@ emphasis on testing. Multi-user testing, involving as many users as is feasible, plus development team. Open-ended; should verify completed work from this sprint using the sprint branch, test - exploratorily for regressions, et cetera. + exploratory for regressions, et cetera. * [__Long-Duration Test.__](testing/plan.md#long-duration-testing) A test to verify that the software remains stable after running for longer durations. May include some diff --git a/docs/src/process/version.md b/docs/src/process/version.md index 91d57e1638..8fb307a5a1 100644 --- a/docs/src/process/version.md +++ b/docs/src/process/version.md @@ -132,7 +132,7 @@ numbers by the following process: 4. Test the package before publishing by doing `npm publish --dry-run` if necessary. 5. Publish the package to the npmjs registry (e.g. `npm publish --access public`) - NOTE: Use the `--tag unstable` flag to the npm publishj if this is a prerelease. + NOTE: Use the `--tag unstable` flag to the npm publish if this is a prerelease. 6. Confirm the package has been published (e.g. `https://www.npmjs.com/package/openmct`) 5. Update snapshot status in `package.json` 1. Create a new branch off the `master` branch. diff --git a/e2e/.eslintrc.cjs b/e2e/.eslintrc.cjs index 9d378f77c0..e044757b41 100644 --- a/e2e/.eslintrc.cjs +++ b/e2e/.eslintrc.cjs @@ -1,14 +1,31 @@ /* eslint-disable no-undef */ module.exports = { - extends: ['plugin:playwright/playwright-test'], + extends: ['plugin:playwright/recommended'], rules: { - 'playwright/max-nested-describe': ['error', { max: 1 }] + 'playwright/max-nested-describe': ['error', { max: 1 }], + 'playwright/expect-expect': 'off' }, overrides: [ { - files: ['tests/visual/*.spec.js'], + //Apply Best Practices to externalFixtures and exampleTemplate.e2e.spec.js + files: [ + 'appActions.js', + 'baseFixtures.js', + 'pluginFixtures.js', + '**/exampleTemplate.e2e.spec.js' + ], rules: { - 'playwright/no-wait-for-timeout': 'off' + 'playwright/no-raw-locators': 'error', + 'playwright/no-nth-methods': 'error', + 'playwright/no-get-by-title': 'error', + 'playwright/prefer-comparison-matcher': 'error' + } + }, + { + // Disable no-raw-locators for .contract.perf.spec.js files until https://github.com/grafana/xk6-browser/issues/1226 + files: ['**/*.contract.perf.spec.js'], + rules: { + 'playwright/no-raw-locators': 'off' } } ] diff --git a/e2e/.percy.ci.yml b/e2e/.percy.ci.yml index bccb093fc9..8ee51ec4e1 100644 --- a/e2e/.percy.ci.yml +++ b/e2e/.percy.ci.yml @@ -30,4 +30,15 @@ snapshot: .gl-plot-chart-area{ opacity: 0 !important; } - \ No newline at end of file + /* SWG Time values on plot */ + .gl-plot-x{ + opacity: 0 !important; + } + /* Notification Time in modal */ + .c-ne__time{ + opacity: 0 !important; + } + /* Snapshot name with embedded time */ + .l-browse-bar__snapshot-datetime{ + opacity: 0 !important; + } diff --git a/e2e/.percy.nightly.yml b/e2e/.percy.nightly.yml index b5b3d7ecfa..e713fce566 100644 --- a/e2e/.percy.nightly.yml +++ b/e2e/.percy.nightly.yml @@ -29,4 +29,16 @@ snapshot: /* Chart Area for Plots */ .gl-plot-chart-area{ opacity: 0 !important; - } \ No newline at end of file + } + /* SWG Time values on plot */ + .gl-plot-x{ + opacity: 0 !important; + } + /* Notification Time in modal */ + .c-ne__time{ + opacity: 0 !important; + } + /* Snapshot name with embedded time */ + .l-browse-bar__snapshot-datetime{ + opacity: 0 !important; + } diff --git a/e2e/README.md b/e2e/README.md index e9f351a64e..b10956ba44 100644 --- a/e2e/README.md +++ b/e2e/README.md @@ -181,7 +181,7 @@ In addition to the explicit definition of performance tests, we also ensure that ### File Structure -Our file structure follows the type of type of testing being excercised at the e2e layer and files containing test suites which matcher application behavior or our `src` and `example` layout. This area is not well refined as we figure out what works best for closed source and downstream projects. This may change altogether if we move `e2e` to it's own npm package. +Our file structure follows the type of type of testing being exercised at the e2e layer and files containing test suites which matcher application behavior or our `src` and `example` layout. This area is not well refined as we figure out what works best for closed source and downstream projects. This may change altogether if we move `e2e` to it's own npm package. |File Path|Description| |:-:|-| @@ -225,18 +225,17 @@ Current list of test tags: |:-:|-| |`@mobile` | Test case or test suite is compatible with Playwright's iPad support and Open MCT's read-only mobile view (i.e. no create button).| |`@a11y` | Test case or test suite to execute playwright-axe accessibility checks and generate a11y reports.| -|`@gds` | Denotes a GDS Test Case used in the VIPER Mission.| |`@addInit` | Initializes the browser with an injected and artificial state. Useful for loading non-default plugins. Likely will not work outside of `npm start`.| |`@localStorage` | Captures or generates session storage to manipulate browser state. Useful for excluding in tests which require a persistent backend (i.e. CouchDB). See [note](#utilizing-localstorage)| |`@snapshot` | Uses Playwright's snapshot functionality to record a copy of the DOM for direct comparison. Must be run inside of the playwright container.| -|`@unstable` | A new test or test which is known to be flaky.| |`@2p` | Indicates that multiple users are involved, or multiple tabs/pages are used. Useful for testing multi-user interactivity.| |`@generatedata` | Indicates that a test is used to generate testdata or test the generated test data. Usually to be associated with localstorage, but this may grow over time.| |`@clock` | A test which modifies the clock. These have expanded out of the visual tests and into the functional tests. +|`@framework` | A test for open mct e2e capabilities. This is primarily to ensure we don't break projects which depend on sourcing this project's fixtures like appActions.js. ### Continuous Integration -The cheapest time to catch a bug is pre-merge. Unfortuantely, this is the most expensive time to run all of the tests since each merge event can consist of hundreds of commits. For this reason, we're selective in _what we run_ as much as _when we run it_. +The cheapest time to catch a bug is pre-merge. Unfortunately, this is the most expensive time to run all of the tests since each merge event can consist of hundreds of commits. For this reason, we're selective in _what we run_ as much as _when we run it_. We leverage CircleCI to run tests against each commit and inject the Test Reports which are generated by Playwright so that they team can keep track of flaky and [historical test trends](https://app.circleci.com/insights/github/nasa/openmct/workflows/overall-circleci-commit-status/tests?branch=master&reporting-window=last-30-days) @@ -248,7 +247,7 @@ Our CI environment consists of 3 main modes of operation: CircleCI -- Stable e2e tests against ubuntu and chrome +- e2e tests against ubuntu and chrome - Performance tests against ubuntu and chrome - e2e tests are linted - Visual and a11y tests are run in a single resolution on the default `espresso` theme @@ -281,24 +280,12 @@ Playwright has native support for semi-intelligent sharding. Read about it [here We will be adjusting the parallelization of the Per-Commit tests to keep below the 5 minute total runtime threshold. -In addition to the Parallelization of Test Runners (Sharding), we're also running two concurrent threads on every Shard. This is the functional limit of what CircelCI Agents can support from a memory and CPU resource constraint. +In addition to the Parallelization of Test Runners (Sharding), we're also running two concurrent threads on every Shard. This is the functional limit of what CircleCI Agents can support from a memory and CPU resource constraint. So for every commit, Playwright is effectively running 4 x 2 concurrent browsercontexts to keep the overall runtime to a miminum. At the same time, we don't want to waste CI resources on parallel runs, so we've configured each shard to fail after 5 test failures. Test failure logs are recorded and stored to allow fast triage. -#### Test Promotion - -In order to maintain fast and reliable feedback, tests go through a promotion process. All new test cases or test suites must be labeled with the `@unstable` annotation. The Open MCT dev team runs these unstable tests in our private repos to ensure they work downstream and are reliable. - -- To run the stable tests, use the `npm run test:e2e:stable` command. -- To run the new and flaky tests, use the `npm run test:e2e:unstable` command. - -A testcase and testsuite are to be unmarked as @unstable when: - -1. They run as part of "full" run 5 times without failure. -2. They've been by a Open MCT Developer 5 times in the closed source repo without failure. - ### Cross-browser and Cross-operating system #### **What's supported:** @@ -380,8 +367,7 @@ By adhering to this principle, we can create tests that are both robust and refl 1. Avoid creating locator aliases. This likely means that you're compensating for a bad locator. Improve the application instead. 1. Leverage `await page.goto('./', { waitUntil: 'domcontentloaded' });` instead of `{ waitUntil: 'networkidle' }`. Tests run against deployments with websockets often have issues with the networkidle detection. -#### How to make tests faster and more resilient - +#### How to make tests faster and more resilient to application changes 1. Avoid app interaction when possible. The best way of doing this is to navigate directly by URL: ```js @@ -396,6 +382,16 @@ By adhering to this principle, we can create tests that are both robust and refl - Initial navigation should _almost_ always use the `{ waitUntil: 'domcontentloaded' }` option. 1. Avoid repeated setup to test a single assertion. Write longer tests with multiple soft assertions. This ensures that your changes will be picked up with large refactors. + 1. Use [user-facing locators](https://playwright.dev/docs/best-practices#use-locators) (Now a eslint rule!) + + ```js + page.getByRole('button', { name: 'Create' } ) + ``` + Instead of + ```js + page.locator('.c-create-button') + ``` + Note: `page.locator()` can be used in performance tests as xk6-browser does not yet support the new `page.getBy` pattern and css lookups can be [1.5x faster](https://serpapi.com/blog/css-selectors-faster-than-getbyrole-playwright/) ##### Utilizing LocalStorage @@ -448,6 +444,7 @@ By adhering to this principle, we can create tests that are both robust and refl - Use Open MCT's fixed-time mode unless explicitly testing realtime clock - Employ the `createExampleTelemetryObject` appAction to source telemetry and specify a `name` to avoid autogenerated names. - Avoid creating objects with a time component like timers and clocks. +- Utilize the playwright clock() API. See @clock Annotations for examples. 5. **Hide the Tree and Inspector**: Generally, your test will not require comparisons involving the tree and inspector. These aspects are covered in component-specific tests (explained below). To exclude them from the comparison by default, navigate to the root of the main view with the tree and inspector hidden: - `await page.goto('./#/browse/mine?hideTree=true&hideInspector=true')` @@ -493,29 +490,25 @@ For best practices with regards to mocking network responses, see our [couchdb.e The following contains a list of tips and tricks which don't exactly fit into a FAQ or Best Practices doc. - (Advanced) Overriding the Browser's Clock -It is possible to override the browser's clock in order to control time-based elements. Since this can cause unwanted behavior (i.e. Tree not rendering), only use this sparingly. To do this, use the `overrideClock` fixture as such: +It is possible to override the browser's clock in order to control time-based elements. Since this can cause unwanted behavior -- i.e. Tree not rendering -- only use this sparingly. Use the `page.clock()` API as such: ```js import { test, expect } from '../../pluginFixtures.js'; -test.describe('foo test suite', () => { - - // All subsequent tests in this suite will override the clock - test.use({ - clockOptions: { - now: 1732413600000, // A timestamp given as milliseconds since the epoch - shouldAdvanceTime: true // Should the clock tick? - } +test.describe('foo test suite @clock', () => { + test.beforeEach(async ({ page }) => { + //Set clock time + await page.clock.install({ time: MISSION_TIME }); + await page.clock.resume(); + //Navigate to page with new clock + await page.goto('./', { waitUntil: 'domcontentloaded' }); }); - test('bar test', async ({ page }) => { - // ... + test('bar here', async ({ page }) => { + /// ... }); -}); ``` - More info and options for `overrideClock` can be found in [baseFixtures.js](baseFixtures.js) - - Working with multiple pages There are instances where multiple browser pages will needed to verify multi-page or multi-tab application behavior. Make sure to use the `@2p` annotation as well as name each page appropriately: i.e. `page1` and `page2` or `tab1` and `tab2` depending on the intended use case. Generally pages should be used unless testing `sharedWorker` code, specifically. diff --git a/e2e/appActions.js b/e2e/appActions.js index c8c27934fd..f1602bc3cd 100644 --- a/e2e/appActions.js +++ b/e2e/appActions.js @@ -35,7 +35,6 @@ * @property {string} type the type of domain object to create (e.g.: "Sine Wave Generator"). * @property {string} [name] the desired name of the created domain object. * @property {string | import('../src/api/objects/ObjectAPI').Identifier} [parent] the Identifier or uuid of the parent object. - * @property {Object} [customParameters] any additional parameters to be passed to the domain object's form. E.g. '[aria-label="Data Rate (hz)"]': {'0.1'} */ /** @@ -62,14 +61,14 @@ import { v4 as genUuid } from 'uuid'; * This common function creates a domain object with the default options. It is the preferred way of creating objects * in the e2e suite when uninterested in properties of the objects themselves. * - * @param {import('@playwright/test').Page} page - * @param {CreateObjectOptions} options + * @param {import('@playwright/test').Page} page - The Playwright page object. + * @param {Object} options - Options for creating the domain object. + * @param {string} options.type - The type of domain object to create (e.g., "Sine Wave Generator"). + * @param {string} [options.name] - The desired name of the created domain object. + * @param {string | import('../src/api/objects/ObjectAPI').Identifier} [options.parent='mine'] - The Identifier or uuid of the parent object. Defaults to 'mine' folder * @returns {Promise} An object containing information about the newly created domain object. */ -async function createDomainObjectWithDefaults( - page, - { type, name, parent = 'mine', customParameters = {} } -) { +async function createDomainObjectWithDefaults(page, { type, name, parent = 'mine' }) { if (!name) { name = `${type}:${genUuid()}`; } @@ -78,40 +77,26 @@ async function createDomainObjectWithDefaults( // Navigate to the parent object. This is necessary to create the object // in the correct location, such as a folder, layout, or plot. - await page.goto(`${parentUrl}`); + await page.goto(parentUrl); - //Click the Create button - await page.getByRole('button', { name: 'Create' }).click(); + // Click the Create button + await page.getByRole('button', { name: 'Create', exact: true }).click(); - // Click the object specified by 'type' - await page.click(`li[role='menuitem']:text("${type}")`); + // Click the object specified by 'type'-- case insensitive + await page.getByRole('menuitem', { name: new RegExp(`^${type}$`, 'i') }).click(); - // Modify the name input field of the domain object to accept 'name' - const nameInput = page.locator('form[name="mctForm"] .first input[type="text"]'); - await nameInput.fill(''); - await nameInput.fill(name); + // Fill in the name of the object + await page.getByLabel('Title', { exact: true }).fill(''); + await page.getByLabel('Title', { exact: true }).fill(name); if (page.testNotes) { // Fill the "Notes" section with information about the // currently running test and its project. - const notesInput = page.locator('form[name="mctForm"] #notes-textarea'); - await notesInput.fill(page.testNotes); + // eslint-disable-next-line playwright/no-raw-locators + await page.locator('#notes-textarea').fill(page.testNotes); } - // If there are any further parameters, fill them in - for (const [key, value] of Object.entries(customParameters)) { - const input = page.locator(`form[name="mctForm"] ${key}`); - await input.fill(''); - await input.fill(value); - } - - // Click OK button and wait for Navigate event - await Promise.all([ - page.waitForLoadState(), - await page.getByRole('button', { name: 'Save' }).click(), - // Wait for Save Banner to appear - page.waitForSelector('.c-message-banner__message') - ]); + await page.getByRole('button', { name: 'Save' }).click(); // Wait until the URL is updated await page.waitForURL(`**/${parent}/*`); @@ -151,61 +136,41 @@ async function createNotification(page, createNotificationOptions) { } /** - * Expand an item in the tree by a given object name. + * Create a Plan object from JSON with the provided options. Must be used with a json based plan. + * Please check appActions.e2e.spec.js for an example of how to use this function. + * * @param {import('@playwright/test').Page} page * @param {string} name - */ -async function expandTreePaneItemByName(page, name) { - const treePane = page.getByRole('tree', { - name: 'Main Tree' - }); - const treeItem = treePane.locator(`role=treeitem[expanded=false][name=/${name}/]`); - const expandTriangle = treeItem.locator('.c-disclosure-triangle'); - await expandTriangle.click(); -} - -/** - * Create a Plan object from JSON with the provided options. - * @param {import('@playwright/test').Page} page - * @param {*} options + * @param {Object} json + * @param {string | import('../src/api/objects/ObjectAPI').Identifier} [parent] the uuid or identifier of the parent object. Defaults to 'mine' * @returns {Promise} An object containing information about the newly created domain object. */ async function createPlanFromJSON(page, { name, json, parent = 'mine' }) { - if (!name) { - name = `Plan:${genUuid()}`; - } - const parentUrl = await getHashUrlToDomainObject(page, parent); // Navigate to the parent object. This is necessary to create the object // in the correct location, such as a folder, layout, or plot. await page.goto(`${parentUrl}`); - // Click the Create button await page.getByRole('button', { name: 'Create' }).click(); - // Click 'Plan' menu option - await page.click(`li:text("Plan")`); + await page.getByRole('menuitem', { name: 'Plan' }).click(); - // Modify the name input field of the domain object to accept 'name' - const nameInput = page.getByLabel('Title', { exact: true }); - await nameInput.fill(''); - await nameInput.fill(name); + // Fill in the name of the object or generate a random one + if (!name) { + name = `Plan:${genUuid()}`; + } + await page.getByLabel('Title', { exact: true }).fill(''); + await page.getByLabel('Title', { exact: true }).fill(name); // Upload buffer from memory - await page.locator('input#fileElem').setInputFiles({ + await page.getByLabel('Select File...').setInputFiles({ name: 'plan.txt', mimeType: 'text/plain', buffer: Buffer.from(JSON.stringify(json)) }); - // Click OK button and wait for Navigate event - await Promise.all([ - page.waitForLoadState(), - page.click('[aria-label="Save"]'), - // Wait for Save Banner to appear - page.waitForSelector('.c-message-banner__message') - ]); + await page.getByLabel('Save').click(); // Wait until the URL is updated await page.waitForURL(`**/${parent}/*`); @@ -233,10 +198,10 @@ async function createExampleTelemetryObject(page, parent = 'mine') { await page.getByRole('button', { name: 'Create' }).click(); - await page.locator('li:has-text("Sine Wave Generator")').click(); + await page.getByRole('menuitem', { name: 'Sine Wave Generator' }).click(); const name = 'VIPER Rover Heading'; - await page.getByRole('dialog').locator('input[type="text"]').fill(name); + await page.getByLabel('Title', { exact: true }).fill(name); // Fill out the fields with default values await page.getByRole('spinbutton', { name: 'Period' }).fill('10'); @@ -263,7 +228,9 @@ async function createExampleTelemetryObject(page, parent = 'mine') { } /** - * Navigates directly to a given object url, in fixed time mode, with the given start and end bounds. + * Navigates directly to a given object url, in fixed time mode, with the given start and end bounds. Note: does not set + * default view type. + * * @param {import('@playwright/test').Page} page * @param {string} url The url to the domainObject * @param {string | number} start The starting time bound in milliseconds since epoch @@ -276,22 +243,25 @@ async function navigateToObjectWithFixedTimeBounds(page, url, start, end) { } /** - * Open the given `domainObject`'s context menu from the object tree. - * Expands the path to the object and scrolls to it if necessary. + * Navigates directly to a given object url, in real-time mode. Note: does not set + * default view type. * * @param {import('@playwright/test').Page} page - * @param {string} url the url to the object + * @param {string} url The url to the domainObject + * @param {string | number} start The start offset in milliseconds + * @param {string | number} end The end offset in milliseconds */ -async function openObjectTreeContextMenu(page, url) { - await page.goto(url); - await page.getByLabel('Show selected item in tree').click(); - await page.locator('.is-navigated-object').click({ - button: 'right' - }); +async function navigateToObjectWithRealTime(page, url, start = '1800000', end = '30000') { + await page.goto( + `${url}?tc.mode=local&tc.startDelta=${start}&tc.endDelta=${end}&tc.timeSystem=utc` + ); } /** - * Expands the entire object tree (every expandable tree item). + * Expands the entire object tree (every expandable tree item). Can be used to + * ensure that the tree is fully expanded before performing actions on objects. + * Can be applied to either the main tree or the create modal tree. + * * @param {import('@playwright/test').Page} page * @param {"Main Tree" | "Create Modal Tree"} [treeName="Main Tree"] */ @@ -303,9 +273,10 @@ async function expandEntireTree(page, treeName = 'Main Tree') { .getByRole('treeitem', { expanded: false }) - .locator('span.c-disclosure-triangle.is-enabled'); + .getByLabel(/Expand/); while ((await collapsedTreeItems.count()) > 0) { + //eslint-disable-next-line playwright/no-nth-methods await collapsedTreeItems.nth(0).click(); // FIXME: Replace hard wait with something event-driven. @@ -342,7 +313,7 @@ async function getFocusedObjectUuid(page) { * @returns {Promise} the url of the object */ async function getHashUrlToDomainObject(page, identifier) { - await page.waitForLoadState('load'); + await page.waitForLoadState('domcontentloaded'); const hashUrl = await page.evaluate(async (objectIdentifier) => { const path = await window.openmct.objects.getOriginalPath(objectIdentifier); let url = @@ -377,10 +348,11 @@ async function _isInEditMode(page, identifier) { /** * Set the time conductor mode to either fixed timespan or realtime mode. + * @private * @param {import('@playwright/test').Page} page * @param {boolean} [isFixedTimespan=true] true for fixed timespan mode, false for realtime mode; default is true */ -async function setTimeConductorMode(page, isFixedTimespan = true) { +async function _setTimeConductorMode(page, isFixedTimespan = true) { // Click 'mode' button await page.getByRole('button', { name: 'Time Conductor Mode', exact: true }).click(); await page.getByRole('button', { name: 'Time Conductor Mode Menu' }).click(); @@ -401,7 +373,7 @@ async function setTimeConductorMode(page, isFixedTimespan = true) { * @param {import('@playwright/test').Page} page */ async function setFixedTimeMode(page) { - await setTimeConductorMode(page, true); + await _setTimeConductorMode(page, true); } /** @@ -409,7 +381,7 @@ async function setFixedTimeMode(page) { * @param {import('@playwright/test').Page} page */ async function setRealTimeMode(page) { - await setTimeConductorMode(page, false); + await _setTimeConductorMode(page, false); } /** @@ -425,61 +397,67 @@ async function setRealTimeMode(page) { /** * Set the values (hours, mins, secs) for the TimeConductor offsets when in realtime mode * @param {import('@playwright/test').Page} page - * @param {OffsetValues} offset - * @param {import('@playwright/test').Locator} offsetButton + * @param {OffsetValues} offset - Object containing offset values + * @param {boolean} [offset.submitChanges=true] - If true, submit the offset changes; otherwise, discard them */ async function setTimeConductorOffset( page, - { startHours, startMins, startSecs, endHours, endMins, endSecs } + { startHours, startMins, startSecs, endHours, endMins, endSecs, submitChanges = true } ) { if (startHours) { - await page.getByRole('spinbutton', { name: 'Start offset hours' }).fill(startHours); + await page.getByLabel('Start offset hours').fill(startHours); } if (startMins) { - await page.getByRole('spinbutton', { name: 'Start offset minutes' }).fill(startMins); + await page.getByLabel('Start offset minutes').fill(startMins); } if (startSecs) { - await page.getByRole('spinbutton', { name: 'Start offset seconds' }).fill(startSecs); + await page.getByLabel('Start offset seconds').fill(startSecs); } if (endHours) { - await page.getByRole('spinbutton', { name: 'End offset hours' }).fill(endHours); + await page.getByLabel('End offset hours').fill(endHours); } if (endMins) { - await page.getByRole('spinbutton', { name: 'End offset minutes' }).fill(endMins); + await page.getByLabel('End offset minutes').fill(endMins); } if (endSecs) { - await page.getByRole('spinbutton', { name: 'End offset seconds' }).fill(endSecs); + await page.getByLabel('End offset seconds').fill(endSecs); } // Click the check button - await page.locator('.pr-time-input--buttons .icon-check').click(); + if (submitChanges) { + await page.getByLabel('Submit time offsets').click(); + } else { + await page.getByLabel('Discard changes and close time popup').click(); + } } /** * Set the values (hours, mins, secs) for the start time offset when in realtime mode * @param {import('@playwright/test').Page} page * @param {OffsetValues} offset + * @param {boolean} [submit=true] If true, submit the offset changes; otherwise, discard them */ -async function setStartOffset(page, offset) { +async function setStartOffset(page, { submitChanges = true, ...offset }) { // Click 'mode' button await page.getByRole('button', { name: 'Time Conductor Mode', exact: true }).click(); - await setTimeConductorOffset(page, offset); + await setTimeConductorOffset(page, { submitChanges, ...offset }); } /** * Set the values (hours, mins, secs) for the end time offset when in realtime mode * @param {import('@playwright/test').Page} page * @param {OffsetValues} offset + * @param {boolean} [submit=true] If true, submit the offset changes; otherwise, discard them */ -async function setEndOffset(page, offset) { +async function setEndOffset(page, { submitChanges = true, ...offset }) { // Click 'mode' button await page.getByRole('button', { name: 'Time Conductor Mode', exact: true }).click(); - await setTimeConductorOffset(page, offset); + await setTimeConductorOffset(page, { submitChanges, ...offset }); } /** @@ -488,33 +466,57 @@ async function setEndOffset(page, offset) { * NOTE: Unless explicitly testing the Time Conductor itself, it is advised to instead * navigate directly to the object with the desired time bounds using `navigateToObjectWithFixedTimeBounds()`. * @param {import('@playwright/test').Page} page - * @param {string} startDate - * @param {string} endDate + * @param {Object} bounds - The time conductor bounds + * @param {string} [bounds.startDate] - The start date in YYYY-MM-DD format + * @param {string} [bounds.startTime] - The start time in HH:mm:ss format + * @param {string} [bounds.endDate] - The end date in YYYY-MM-DD format + * @param {string} [bounds.endTime] - The end time in HH:mm:ss format + * @param {boolean} [bounds.submitChanges=true] - If true, submit the changes; otherwise, discard them. */ -async function setTimeConductorBounds(page, startDate, endDate) { - // Bring up the time conductor popup - expect(await page.locator('.l-shell__time-conductor.c-compact-tc').count()).toBe(1); - await page.click('.l-shell__time-conductor.c-compact-tc'); +async function setTimeConductorBounds(page, { submitChanges = true, ...bounds }) { + const { startDate, endDate, startTime, endTime } = bounds; - await setTimeBounds(page, startDate, endDate); + // Open the time conductor popup + await page.getByRole('button', { name: 'Time Conductor Mode', exact: true }).click(); - await page.keyboard.press('Enter'); + if (startDate) { + await page.getByLabel('Start date').fill(startDate); + } + + if (startTime) { + await page.getByLabel('Start time').fill(startTime); + } + + if (endDate) { + await page.getByLabel('End date').fill(endDate); + } + + if (endTime) { + await page.getByLabel('End time').fill(endTime); + } + + if (submitChanges) { + await page.getByLabel('Submit time bounds').click(); + } else { + await page.getByLabel('Discard changes and close time popup').click(); + } } /** - * Set the independent time conductor bounds in fixed time mode + * Set the bounds of the visible conductor in fixed time mode. + * Requires that page already has an independent time conductor in view. * @param {import('@playwright/test').Page} page - * @param {string} startDate - * @param {string} endDate + * @param {string} start - The start date in 'YYYY-MM-DD HH:mm:ss.SSSZ' format + * @param {string} end - The end date in 'YYYY-MM-DD HH:mm:ss.SSSZ' format */ -async function setIndependentTimeConductorBounds(page, { start, end }) { +async function setFixedIndependentTimeConductorBounds(page, { start, end }) { // Activate Independent Time Conductor await page.getByLabel('Enable Independent Time Conductor').click(); // Bring up the time conductor popup await page.getByLabel('Independent Time Conductor Settings').click(); - await expect(page.locator('.itc-popout')).toBeInViewport(); - await setTimeBounds(page, start, end); + await expect(page.getByLabel('Time Conductor Options')).toBeInViewport(); + await _setTimeBounds(page, start, end); await page.keyboard.press('Enter'); } @@ -523,10 +525,10 @@ async function setIndependentTimeConductorBounds(page, { start, end }) { * Set the bounds of the visible conductor in fixed time mode * @private * @param {import('@playwright/test').Page} page - * @param {string} startDate - * @param {string} endDate + * @param {string} start - The start date in 'YYYY-MM-DD HH:mm:ss.SSSZ' format + * @param {string} end - The end date in 'YYYY-MM-DD HH:mm:ss.SSSZ' format */ -async function setTimeBounds(page, startDate, endDate) { +async function _setTimeBounds(page, startDate, endDate) { if (startDate) { // Fill start time await page @@ -556,11 +558,13 @@ async function setTimeBounds(page, startDate, endDate) { * all plots on the page and waits up to the default timeout for the class to be * attached to each plot. * @param {import('@playwright/test').Page} page + * @param {number} [timeout] Provide a custom timeout in milliseconds to override the default timeout */ -async function waitForPlotsToRender(page) { +async function waitForPlotsToRender(page, { timeout } = {}) { + //eslint-disable-next-line playwright/no-raw-locators const plotLocator = page.locator('.gl-plot'); for (const plot of await plotLocator.all()) { - await expect(plot).toHaveClass(/js-series-data-loaded/); + await expect(plot).toHaveClass(/js-series-data-loaded/, { timeout }); } } @@ -581,9 +585,6 @@ async function waitForPlotsToRender(page) { * @return {Promise} */ async function getCanvasPixels(page, canvasSelector) { - const getTelemValuePromise = new Promise((resolve) => - page.exposeFunction('getCanvasValue', resolve) - ); const canvasHandle = await page.evaluateHandle( (canvas) => document.querySelector(canvas), canvasSelector @@ -594,7 +595,7 @@ async function getCanvasPixels(page, canvasSelector) { ); await waitForPlotsToRender(page); - await page.evaluate( + return page.evaluate( ([canvas, ctx]) => { // The document canvas is where the plot points and lines are drawn. // The only way to access the canvas is using document (using page.evaluate) @@ -622,27 +623,10 @@ async function getCanvasPixels(page, canvasSelector) { i = i + 4; } - window.getCanvasValue(plotPixels); + return plotPixels; }, [canvasHandle, canvasContextHandle] ); - - return getTelemValuePromise; -} - -/** - * @param {import('@playwright/test').Page} page - * @param {string} myItemsFolderName - * @param {string} url - * @param {string} newName - */ -async function renameObjectFromContextMenu(page, url, newName) { - await openObjectTreeContextMenu(page, url); - await page.click('li:text("Edit Properties")'); - const nameInput = page.getByLabel('Title', { exact: true }); - await nameInput.fill(''); - await nameInput.fill(newName); - await page.click('[aria-label="Save"]'); } export { @@ -651,19 +635,14 @@ export { createNotification, createPlanFromJSON, expandEntireTree, - expandTreePaneItemByName, getCanvasPixels, - getFocusedObjectUuid, - getHashUrlToDomainObject, navigateToObjectWithFixedTimeBounds, - openObjectTreeContextMenu, - renameObjectFromContextMenu, + navigateToObjectWithRealTime, setEndOffset, + setFixedIndependentTimeConductorBounds, setFixedTimeMode, - setIndependentTimeConductorBounds, setRealTimeMode, setStartOffset, setTimeConductorBounds, - setTimeConductorMode, waitForPlotsToRender }; diff --git a/e2e/avpFixtures.js b/e2e/avpFixtures.js index 68c0f0df3d..6f8989aa0e 100644 --- a/e2e/avpFixtures.js +++ b/e2e/avpFixtures.js @@ -34,7 +34,7 @@ */ import AxeBuilder from '@axe-core/playwright'; -import fs from 'fs'; +import fs from 'fs/promises'; import path from 'path'; import { fileURLToPath } from 'url'; @@ -87,6 +87,27 @@ const extendedTest = test.extend({ } }); +/** + * Writes the accessibility report to the specified path. + * + * @param {string} reportPath - The path to write the report to. + * @param {Object} accessibilityScanResults - The results of the accessibility scan. + * @returns {Promise} The accessibility scan results. + * @throws Will throw an error if writing the report fails. + */ +async function writeAccessibilityReport(reportPath, accessibilityScanResults) { + try { + await fs.mkdir(path.dirname(reportPath), { recursive: true }); + const data = JSON.stringify(accessibilityScanResults, null, 2); + await fs.writeFile(reportPath, data); + console.log(`Accessibility report with violations saved successfully as ${reportPath}`); + return accessibilityScanResults; + } catch (err) { + console.error(`Error writing the accessibility report to file ${reportPath}:`, err); + throw err; + } +} + /** * Scans for accessibility violations on a page and writes a report to disk if violations are found. * Automatically asserts that no violations should be present. @@ -104,25 +125,29 @@ export async function scanForA11yViolations(page, testCaseName, options = {}) { const accessibilityScanResults = await builder.analyze(); // Assert that no violations should be present - expect( - accessibilityScanResults.violations, - `Accessibility violations found in test case: ${testCaseName}` - ).toEqual([]); + expect + .soft( + accessibilityScanResults.violations, + `Accessibility violations found in test case: ${testCaseName}` + ) + .toEqual([]); // Check if there are any violations if (accessibilityScanResults.violations.length > 0) { - let reportName = options.reportName || testCaseName; - let sanitizedReportName = reportName.replace(/\//g, '_'); - const reportPath = path.join(TEST_RESULTS_DIR, `${sanitizedReportName}.json`); + const reportName = options.reportName || testCaseName; + const sanitizedReportName = reportName.replace(/\//g, '_'); + const reportPath = path.join( + TEST_RESULTS_DIR, + 'a11y-json-reports', + `${sanitizedReportName}.json` + ); try { - if (!fs.existsSync(TEST_RESULTS_DIR)) { - fs.mkdirSync(TEST_RESULTS_DIR); - } + await page.screenshot({ + path: path.join(TEST_RESULTS_DIR, 'a11y-screenshots', `${sanitizedReportName}.png`) + }); - fs.writeFileSync(reportPath, JSON.stringify(accessibilityScanResults, null, 2)); - console.log(`Accessibility report with violations saved successfully as ${reportPath}`); - return accessibilityScanResults; + return await writeAccessibilityReport(reportPath, accessibilityScanResults); } catch (err) { console.error(`Error writing the accessibility report to file ${reportPath}:`, err); throw err; diff --git a/e2e/baseFixtures.js b/e2e/baseFixtures.js index 5cfb2678e4..6d0662a875 100644 --- a/e2e/baseFixtures.js +++ b/e2e/baseFixtures.js @@ -30,7 +30,6 @@ import { expect, request, test } from '@playwright/test'; import fs from 'fs'; import path from 'path'; -import sinon from 'sinon'; import { fileURLToPath } from 'url'; import { v4 as uuid } from 'uuid'; @@ -70,82 +69,6 @@ const extendedTest = test.extend({ */ coveragePath: [istanbulCLIOutput, { option: true }], - /** - * This allows the test to manipulate the browser clock. This is useful for Visual and Snapshot tests which need - * the Time Indicator Clock to be in a specific state. - * - * Warning: Has many limitations and secondary side effects in Open MCT. - * 1. The tree component does not render. - * 2. page.WaitForNavigation does not trigger. - * - * Usage: - * ```js - * test.use({ - * clockOptions: { - * now: MISSION_TIME, - * shouldAdvanceTime: true - * ``` - * If clockOptions are provided, will override the default clock with fake timers provided by SinonJS. - * - * Default: `undefined` - * - * @see {@link https://github.com/microsoft/playwright/issues/6347 Github RFE} - * @see {@link https://github.com/sinonjs/fake-timers/#var-clock--faketimersinstallconfig SinonJS FakeTimers Config} - * @type {import('@types/sinonjs__fake-timers').FakeTimerInstallOpts} - */ - clockOptions: [undefined, { option: true }], - overrideClock: [ - async ({ context, clockOptions }, use) => { - if (clockOptions !== undefined) { - await context.addInitScript({ - path: fileURLToPath(new URL('../node_modules/sinon/pkg/sinon.js', import.meta.url)) - }); - await context.addInitScript((options) => { - window.__clock = sinon.useFakeTimers(options); - }, clockOptions); - } - - await use(context); - }, - { - auto: true, - scope: 'test' - } - ], - /** - * Exposes a function to manually tick the clock. This is useful when overriding the clock to not - * tick (`shouldAdvanceTime: false`) for visual tests, as events such as re-renders and router params - * updates are clock-driven and must be manually ticked. - * - * Usage: - * ```js - * test.describe('Manual Clock Tick', () => { - * test.use({ - * clockOptions: { - * now: MISSION_TIME, // Set to the desired time - * shouldAdvanceTime: false // Clock overridden to no longer tick - * } - * }); - * test('Visual - Manual Clock Tick', async ({ page, tick }) => { - * // Tick the clock 2 seconds in the future - * await tick(2000); - * }); - * }); - * ``` - * - * @param {Object} param0 - * @param {import('@playwright/test').Page} param0.page - * @param {import('@playwright/test').Use} param0.use - */ - tick: async ({ page }, use) => { - // eslint-disable-next-line func-style - const tick = async (milliseconds) => { - await page.evaluate((_milliseconds) => { - window.__clock.tick(_milliseconds); - }, milliseconds); - }; - await use(tick); - }, /** * Extends the base context class to add codecoverage shim. * @see {@link https://github.com/mxschmitt/playwright-test-coverage Github Project} @@ -184,20 +107,7 @@ const extendedTest = test.extend({ * Extends the base page class to enable console log error detection. * @see {@link https://github.com/microsoft/playwright/discussions/11690 Github Discussion} */ - page: async ({ page, failOnConsoleError, clockOptions }, use) => { - // If overriding the clock, we must also override the Date.now() - // function in the generatorWorker context. This is necessary - // to ensure that example telemetry data is generated for the new clock time. - if (clockOptions?.now !== undefined) { - page.on('worker', (worker) => { - if (worker.url().includes('generatorWorker')) { - worker.evaluate((time) => { - self.Date.now = () => time; - }, clockOptions.now); - } - }); - } - + page: async ({ page, failOnConsoleError }, use) => { // Capture any console errors during test execution const messages = []; page.on('console', (msg) => messages.push(msg)); @@ -207,28 +117,12 @@ const extendedTest = test.extend({ // Assert against console errors during teardown if (failOnConsoleError) { messages.forEach((msg) => + // eslint-disable-next-line playwright/no-standalone-expect expect .soft(msg.type(), `Console error detected: ${_consoleMessageToString(msg)}`) .not.toEqual('error') ); } - }, - /** - * Extends the base browser class to enable CDP connection definition in playwright.config.js. Once - * that RFE is implemented, this function can be removed. - * @see {@link https://github.com/microsoft/playwright/issues/8379 Github RFE} - */ - browser: async ({ playwright, browser }, use, workerInfo) => { - // Use browserless if configured - if (workerInfo.project.name.match(/browserless/)) { - const vBrowser = await playwright.chromium.connectOverCDP({ - endpointURL: 'ws://localhost:3003' - }); - await use(vBrowser); - } else { - // Use Local Browser for testing. - await use(browser); - } } }); diff --git a/e2e/helper/faultUtils.js b/e2e/helper/faultUtils.js index 54c30e23c5..05c7df98db 100644 --- a/e2e/helper/faultUtils.js +++ b/e2e/helper/faultUtils.js @@ -59,8 +59,9 @@ export async function navigateToFaultManagementWithoutExample(page) { /** * @param {import('@playwright/test').Page} page */ -export async function navigateToFaultItemInTree(page) { - await page.goto('./', { waitUntil: 'networkidle' }); +async function navigateToFaultItemInTree(page) { + await page.goto('./', { waitUntil: 'domcontentloaded' }); + await page.waitForURL('**/#/browse/mine?**'); const faultManagementTreeItem = page .getByRole('tree', { diff --git a/e2e/helper/notebookUtils.js b/e2e/helper/notebookUtils.js index acf13b6ad2..07682c4ae5 100644 --- a/e2e/helper/notebookUtils.js +++ b/e2e/helper/notebookUtils.js @@ -63,7 +63,7 @@ async function dragAndDropEmbed(page, notebookObject) { // Expand the tree to reveal the notebook await page.getByLabel('Show selected item in tree').click(); // Drag and drop the SWG into the notebook - await page.dragAndDrop(`text=${swg.name}`, NOTEBOOK_DROP_AREA); + await page.getByLabel(`Navigate to ${swg.name}`).dragTo(page.locator(NOTEBOOK_DROP_AREA)); await commitEntry(page); } @@ -84,6 +84,7 @@ async function startAndAddRestrictedNotebookObject(page) { path: fileURLToPath(new URL('./addInitRestrictedNotebook.js', import.meta.url)) }); await page.goto('./', { waitUntil: 'domcontentloaded' }); + await page.waitForURL('**/browse/mine?**'); return createDomainObjectWithDefaults(page, { type: CUSTOM_NAME, @@ -95,10 +96,9 @@ async function startAndAddRestrictedNotebookObject(page) { * @param {import('@playwright/test').Page} page */ async function lockPage(page) { - const commitButton = page.locator('button:has-text("Commit Entries")'); - await commitButton.click(); - - //Wait until Lock Banner is visible + // Click the Commit Entries button + await page.getByLabel('Commit Entries').click(); + // Wait until Lock Banner is visible await page.locator('text=Lock Page').click(); } diff --git a/e2e/helper/planningUtils.js b/e2e/helper/planningUtils.js index 9150dd7565..43988532f3 100644 --- a/e2e/helper/planningUtils.js +++ b/e2e/helper/planningUtils.js @@ -30,9 +30,9 @@ import { expect } from '../pluginFixtures.js'; * start time as the start bound and the current activity's end time as the end bound. * @param {import('@playwright/test').Page} page the page * @param {Object} plan The raw plan json to assert against - * @param {string} objectUrl The URL of the object to assert against (plan or gantt chart) + * @param {string} planObjectUrl The URL of the object to assert against (plan or gantt chart) */ -export async function assertPlanActivities(page, plan, objectUrl) { +export async function assertPlanActivities(page, plan, planObjectUrl) { const groups = Object.keys(plan); for (const group of groups) { for (let i = 0; i < plan[group].length; i++) { @@ -48,13 +48,12 @@ export async function assertPlanActivities(page, plan, objectUrl) { // Switch to fixed time mode with all plan events within the bounds await page.goto( - `${objectUrl}?tc.mode=fixed&tc.startBound=${startBound}&tc.endBound=${endBound}&tc.timeSystem=utc&view=plan.view` + `${planObjectUrl}?tc.mode=fixed&tc.startBound=${startBound}&tc.endBound=${endBound}&tc.timeSystem=utc&view=plan.view` ); // Assert that the number of activities in the plan view matches the number of // activities in the plan data within the specified time bounds - const eventCount = await page.locator('.activity-bounds').count(); - expect(eventCount).toEqual( + await expect(page.locator('.activity-bounds')).toHaveCount( Object.values(plan) .flat() .filter((event) => @@ -101,8 +100,8 @@ export async function assertPlanOrderedSwimLanes(page, plan, objectUrl) { for (let i = 0; i < groups.length; i++) { // Assert that the order of groups in the plan view matches the order of // groups in the plan data - const groupName = await planGroups[i].innerText(); - expect(groupName).toEqual(groups[i].name); + const groupName = planGroups[i]; + await expect(groupName).toHaveText(groups[i].name); } } diff --git a/e2e/helper/useDarkmatterTheme.js b/e2e/helper/useDarkmatterTheme.js new file mode 100644 index 0000000000..6a6998266d --- /dev/null +++ b/e2e/helper/useDarkmatterTheme.js @@ -0,0 +1,29 @@ +/***************************************************************************** + * 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 should be used to install the Darkmatter theme for Open MCT. +// e.g. +// await page.addInitScript({ path: path.join(__dirname, 'useDarkmatterTheme.js') }); +document.addEventListener('DOMContentLoaded', () => { + const openmct = window.openmct; + openmct.install(openmct.plugins.DarkmatterTheme()); +}); diff --git a/e2e/package.json b/e2e/package.json index ede4211362..af4cbafafc 100644 --- a/e2e/package.json +++ b/e2e/package.json @@ -10,18 +10,18 @@ } }, "scripts": { - "pretest:visual": "npm install", "test": "npx playwright test", "test:visual": "percy exec" }, "devDependencies": { - "@types/sinonjs__fake-timers": "8.1.5", "@percy/cli": "1.27.4", "@percy/playwright": "1.0.4", - "@playwright/test": "1.42.1", - "@axe-core/playwright": "4.8.5", - "sinon": "17.0.0" + "@playwright/test": "1.45.2", + "@axe-core/playwright": "4.8.5" + }, + "author": { + "name": "National Aeronautics and Space Administration", + "url": "https://www.nasa.gov" }, - "author": "NASA Ames Research Center", "license": "Apache-2.0" -} \ No newline at end of file +} diff --git a/e2e/playwright-ci.config.js b/e2e/playwright-ci.config.js index affc39313b..f4d07ca651 100644 --- a/e2e/playwright-ci.config.js +++ b/e2e/playwright-ci.config.js @@ -12,7 +12,7 @@ const config = { retries: 2, //Retries 2 times for a total of 3 runs. When running sharded and with max-failures=5, this should ensure that flake is managed without failing the full suite testDir: 'tests', grepInvert: /@mobile/, //Ignore mobile tests - testIgnore: '**/*.perf.spec.js', //Ignore performance tests and define in playwright-perfromance.config.js + testIgnore: '**/*.perf.spec.js', //Ignore performance tests and define in playwright-performance.config.js timeout: 60 * 1000, webServer: { command: 'npm run start:coverage', diff --git a/e2e/playwright-mobile.config.js b/e2e/playwright-mobile.config.js index 036e858578..f8e31bfb8d 100644 --- a/e2e/playwright-mobile.config.js +++ b/e2e/playwright-mobile.config.js @@ -10,7 +10,7 @@ import { fileURLToPath } from 'url'; const config = { retries: 1, //Retries 2 times for a total of 3 runs. When running sharded and with max-failures=5, this should ensure that flake is managed without failing the full suite testDir: 'tests', - testIgnore: '**/*.perf.spec.js', //Ignore performance tests and define in playwright-perfromance.config.js + testIgnore: '**/*.perf.spec.js', //Ignore performance tests and define in playwright-performance.config.js timeout: 30 * 1000, webServer: { command: 'npm run start:coverage', diff --git a/e2e/playwright-visual-a11y.config.js b/e2e/playwright-visual-a11y.config.js index 0d95f9e397..81e7fadef7 100644 --- a/e2e/playwright-visual-a11y.config.js +++ b/e2e/playwright-visual-a11y.config.js @@ -13,7 +13,7 @@ const config = { cwd: fileURLToPath(new URL('../', import.meta.url)), // Provide cwd for the root of the project url: 'http://localhost:8080/#', timeout: 200 * 1000, - reuseExistingServer: !process.env.CI + reuseExistingServer: true //This was originally disabled to prevent differences in local debugging vs. CI. However, it significantly speeds up local debugging. }, use: { baseURL: 'http://localhost:8080/', @@ -36,6 +36,13 @@ const config = { browserName: 'chromium', theme: 'snow' } + }, + { + name: 'darkmatter-theme', //Runs the same visual tests but with darkmatter-theme + use: { + browserName: 'chromium', + theme: 'darkmatter' + } } ], reporter: [ diff --git a/e2e/pluginFixtures.js b/e2e/pluginFixtures.js index ea46a19b31..655e7087f7 100644 --- a/e2e/pluginFixtures.js +++ b/e2e/pluginFixtures.js @@ -127,6 +127,11 @@ const extendedTest = test.extend({ await page.addInitScript({ path: fileURLToPath(new URL('./helper/useSnowTheme.js', import.meta.url)) }); + } else if (theme === 'darkmatter') { + //inject darkmatter theme + await page.addInitScript({ + path: fileURLToPath(new URL('./helper/useDarkmatterTheme.js', import.meta.url)) + }); } // Attach info about the currently running test and its project. diff --git a/e2e/test-data/display_layout_with_child_layouts.json b/e2e/test-data/display_layout_with_child_layouts.json index 899a0e31b3..f19c38d484 100644 --- a/e2e/test-data/display_layout_with_child_layouts.json +++ b/e2e/test-data/display_layout_with_child_layouts.json @@ -6,15 +6,15 @@ "localStorage": [ { "name": "mct", - "value": "{\"mine\":{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"80d08d10-2f2b-4ebb-847c-2385016718e7\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413601880,\"created\":1732413600900,\"persisted\":1732413601880},\"80d08d10-2f2b-4ebb-847c-2385016718e7\":{\"identifier\":{\"key\":\"80d08d10-2f2b-4ebb-847c-2385016718e7\",\"namespace\":\"\"},\"name\":\"Parent Display Layout\",\"type\":\"layout\",\"composition\":[{\"key\":\"cdff8398-81e5-4a37-8c2d-8ec0a0ed7d16\",\"namespace\":\"\"},{\"key\":\"62ac54e8-e424-41b3-889c-83f36c13676d\",\"namespace\":\"\"}],\"configuration\":{\"items\":[{\"width\":32,\"height\":18,\"x\":1,\"y\":30,\"identifier\":{\"key\":\"cdff8398-81e5-4a37-8c2d-8ec0a0ed7d16\",\"namespace\":\"\"},\"hasFrame\":true,\"fontSize\":\"default\",\"font\":\"default\",\"type\":\"subobject-view\",\"id\":\"a71236dd-9178-4b96-88d9-b93ceee12f32\"},{\"width\":32,\"height\":18,\"x\":30,\"y\":1,\"identifier\":{\"key\":\"62ac54e8-e424-41b3-889c-83f36c13676d\",\"namespace\":\"\"},\"hasFrame\":true,\"fontSize\":\"default\",\"font\":\"default\",\"type\":\"subobject-view\",\"id\":\"b512cc87-9291-4b55-b9a5-4e5641bc8b83\"}],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate display layout with 2 child display layouts\\nchrome\",\"modified\":1732413605020,\"location\":\"mine\",\"created\":1732413601880,\"persisted\":1732413605020},\"cdff8398-81e5-4a37-8c2d-8ec0a0ed7d16\":{\"name\":\"Child Layout 1\",\"type\":\"layout\",\"identifier\":{\"key\":\"cdff8398-81e5-4a37-8c2d-8ec0a0ed7d16\",\"namespace\":\"\"},\"composition\":[],\"configuration\":{\"items\":[],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate display layout with 2 child display layouts\\nchrome\",\"modified\":1732413602980,\"location\":\"80d08d10-2f2b-4ebb-847c-2385016718e7\",\"created\":1732413602980,\"persisted\":1732413602980},\"62ac54e8-e424-41b3-889c-83f36c13676d\":{\"name\":\"Child Layout 2\",\"type\":\"layout\",\"identifier\":{\"key\":\"62ac54e8-e424-41b3-889c-83f36c13676d\",\"namespace\":\"\"},\"composition\":[],\"configuration\":{\"items\":[],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate display layout with 2 child display layouts\\nchrome\",\"modified\":1732413604120,\"location\":\"80d08d10-2f2b-4ebb-847c-2385016718e7\",\"created\":1732413604120,\"persisted\":1732413604120}}" - }, - { - "name": "mct-recent-objects", - "value": "[{\"objectPath\":[{\"identifier\":{\"key\":\"80d08d10-2f2b-4ebb-847c-2385016718e7\",\"namespace\":\"\"},\"name\":\"Parent Display Layout\",\"type\":\"layout\",\"composition\":[{\"key\":\"cdff8398-81e5-4a37-8c2d-8ec0a0ed7d16\",\"namespace\":\"\"},{\"key\":\"62ac54e8-e424-41b3-889c-83f36c13676d\",\"namespace\":\"\"}],\"configuration\":{\"items\":[{\"width\":32,\"height\":18,\"x\":1,\"y\":1,\"identifier\":{\"key\":\"cdff8398-81e5-4a37-8c2d-8ec0a0ed7d16\",\"namespace\":\"\"},\"hasFrame\":true,\"fontSize\":\"default\",\"font\":\"default\",\"type\":\"subobject-view\",\"id\":\"a71236dd-9178-4b96-88d9-b93ceee12f32\"}],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate display layout with 2 child display layouts\\nchrome\",\"modified\":1732413604120,\"location\":\"mine\",\"created\":1732413601880,\"persisted\":1732413604120},{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"80d08d10-2f2b-4ebb-847c-2385016718e7\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413601880,\"created\":1732413600900,\"persisted\":1732413601880},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine/80d08d10-2f2b-4ebb-847c-2385016718e7\",\"domainObject\":{\"identifier\":{\"key\":\"80d08d10-2f2b-4ebb-847c-2385016718e7\",\"namespace\":\"\"},\"name\":\"Parent Display Layout\",\"type\":\"layout\",\"composition\":[{\"key\":\"cdff8398-81e5-4a37-8c2d-8ec0a0ed7d16\",\"namespace\":\"\"},{\"key\":\"62ac54e8-e424-41b3-889c-83f36c13676d\",\"namespace\":\"\"}],\"configuration\":{\"items\":[{\"width\":32,\"height\":18,\"x\":1,\"y\":1,\"identifier\":{\"key\":\"cdff8398-81e5-4a37-8c2d-8ec0a0ed7d16\",\"namespace\":\"\"},\"hasFrame\":true,\"fontSize\":\"default\",\"font\":\"default\",\"type\":\"subobject-view\",\"id\":\"a71236dd-9178-4b96-88d9-b93ceee12f32\"}],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate display layout with 2 child display layouts\\nchrome\",\"modified\":1732413604120,\"location\":\"mine\",\"created\":1732413601880,\"persisted\":1732413604120}},{\"objectPath\":[{\"identifier\":{\"key\":\"62ac54e8-e424-41b3-889c-83f36c13676d\",\"namespace\":\"\"},\"name\":\"Child Layout 2\",\"type\":\"layout\",\"composition\":[],\"configuration\":{\"items\":[],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate display layout with 2 child display layouts\\nchrome\",\"modified\":1732413604120,\"location\":\"80d08d10-2f2b-4ebb-847c-2385016718e7\",\"created\":1732413604120,\"persisted\":1732413604120},{\"identifier\":{\"key\":\"80d08d10-2f2b-4ebb-847c-2385016718e7\",\"namespace\":\"\"},\"name\":\"Parent Display Layout\",\"type\":\"layout\",\"composition\":[{\"key\":\"cdff8398-81e5-4a37-8c2d-8ec0a0ed7d16\",\"namespace\":\"\"},{\"key\":\"62ac54e8-e424-41b3-889c-83f36c13676d\",\"namespace\":\"\"}],\"configuration\":{\"items\":[{\"width\":32,\"height\":18,\"x\":1,\"y\":1,\"identifier\":{\"key\":\"cdff8398-81e5-4a37-8c2d-8ec0a0ed7d16\",\"namespace\":\"\"},\"hasFrame\":true,\"fontSize\":\"default\",\"font\":\"default\",\"type\":\"subobject-view\",\"id\":\"a71236dd-9178-4b96-88d9-b93ceee12f32\"}],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate display layout with 2 child display layouts\\nchrome\",\"modified\":1732413604120,\"location\":\"mine\",\"created\":1732413601880,\"persisted\":1732413604120},{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"80d08d10-2f2b-4ebb-847c-2385016718e7\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413601880,\"created\":1732413600900,\"persisted\":1732413601880},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine/80d08d10-2f2b-4ebb-847c-2385016718e7/62ac54e8-e424-41b3-889c-83f36c13676d\",\"domainObject\":{\"identifier\":{\"key\":\"62ac54e8-e424-41b3-889c-83f36c13676d\",\"namespace\":\"\"},\"name\":\"Child Layout 2\",\"type\":\"layout\",\"composition\":[],\"configuration\":{\"items\":[],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate display layout with 2 child display layouts\\nchrome\",\"modified\":1732413604120,\"location\":\"80d08d10-2f2b-4ebb-847c-2385016718e7\",\"created\":1732413604120,\"persisted\":1732413604120}},{\"objectPath\":[{\"identifier\":{\"key\":\"cdff8398-81e5-4a37-8c2d-8ec0a0ed7d16\",\"namespace\":\"\"},\"name\":\"Child Layout 1\",\"type\":\"layout\",\"composition\":[],\"configuration\":{\"items\":[],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate display layout with 2 child display layouts\\nchrome\",\"modified\":1732413602980,\"location\":\"80d08d10-2f2b-4ebb-847c-2385016718e7\",\"created\":1732413602980,\"persisted\":1732413602980},{\"identifier\":{\"key\":\"80d08d10-2f2b-4ebb-847c-2385016718e7\",\"namespace\":\"\"},\"name\":\"Parent Display Layout\",\"type\":\"layout\",\"composition\":[{\"key\":\"cdff8398-81e5-4a37-8c2d-8ec0a0ed7d16\",\"namespace\":\"\"},{\"key\":\"62ac54e8-e424-41b3-889c-83f36c13676d\",\"namespace\":\"\"}],\"configuration\":{\"items\":[{\"width\":32,\"height\":18,\"x\":1,\"y\":1,\"identifier\":{\"key\":\"cdff8398-81e5-4a37-8c2d-8ec0a0ed7d16\",\"namespace\":\"\"},\"hasFrame\":true,\"fontSize\":\"default\",\"font\":\"default\",\"type\":\"subobject-view\",\"id\":\"a71236dd-9178-4b96-88d9-b93ceee12f32\"}],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate display layout with 2 child display layouts\\nchrome\",\"modified\":1732413604120,\"location\":\"mine\",\"created\":1732413601880,\"persisted\":1732413604120},{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"80d08d10-2f2b-4ebb-847c-2385016718e7\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413601880,\"created\":1732413600900,\"persisted\":1732413601880},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine/80d08d10-2f2b-4ebb-847c-2385016718e7/cdff8398-81e5-4a37-8c2d-8ec0a0ed7d16\",\"domainObject\":{\"identifier\":{\"key\":\"cdff8398-81e5-4a37-8c2d-8ec0a0ed7d16\",\"namespace\":\"\"},\"name\":\"Child Layout 1\",\"type\":\"layout\",\"composition\":[],\"configuration\":{\"items\":[],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate display layout with 2 child display layouts\\nchrome\",\"modified\":1732413602980,\"location\":\"80d08d10-2f2b-4ebb-847c-2385016718e7\",\"created\":1732413602980,\"persisted\":1732413602980}},{\"objectPath\":[{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"80d08d10-2f2b-4ebb-847c-2385016718e7\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413601880,\"created\":1732413600900,\"persisted\":1732413601880},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine\",\"domainObject\":{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"80d08d10-2f2b-4ebb-847c-2385016718e7\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413601880,\"created\":1732413600900,\"persisted\":1732413601880}}]" + "value": "{\"mine\":{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"f11f93ab-8918-4732-b20c-617b7b2e16ad\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413604666,\"created\":1732413603039,\"persisted\":1732413604666},\"f11f93ab-8918-4732-b20c-617b7b2e16ad\":{\"identifier\":{\"key\":\"f11f93ab-8918-4732-b20c-617b7b2e16ad\",\"namespace\":\"\"},\"name\":\"Parent Display Layout\",\"type\":\"layout\",\"composition\":[{\"key\":\"034e9aab-8b24-493b-876f-80ed474b61fb\",\"namespace\":\"\"},{\"key\":\"ea2f53e0-3376-4ba7-8df7-349339e41d64\",\"namespace\":\"\"}],\"configuration\":{\"items\":[{\"width\":32,\"height\":18,\"x\":1,\"y\":30,\"identifier\":{\"key\":\"034e9aab-8b24-493b-876f-80ed474b61fb\",\"namespace\":\"\"},\"hasFrame\":true,\"fontSize\":\"default\",\"font\":\"default\",\"type\":\"subobject-view\",\"id\":\"94b55aa2-8f61-431a-9453-4bbfda9119fb\"},{\"width\":32,\"height\":18,\"x\":30,\"y\":1,\"identifier\":{\"key\":\"ea2f53e0-3376-4ba7-8df7-349339e41d64\",\"namespace\":\"\"},\"hasFrame\":true,\"fontSize\":\"default\",\"font\":\"default\",\"type\":\"subobject-view\",\"id\":\"97d028f7-ffa6-494b-96d6-d8526e399766\"}],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata @clock\\nGenerate display layout with 2 child display layouts\\nchrome\",\"modified\":1732413607743,\"location\":\"mine\",\"created\":1732413604666,\"persisted\":1732413607743},\"034e9aab-8b24-493b-876f-80ed474b61fb\":{\"name\":\"Child Layout 1\",\"type\":\"layout\",\"identifier\":{\"key\":\"034e9aab-8b24-493b-876f-80ed474b61fb\",\"namespace\":\"\"},\"composition\":[],\"configuration\":{\"items\":[],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata @clock\\nGenerate display layout with 2 child display layouts\\nchrome\",\"modified\":1732413605564,\"location\":\"f11f93ab-8918-4732-b20c-617b7b2e16ad\",\"created\":1732413605564,\"persisted\":1732413605564},\"ea2f53e0-3376-4ba7-8df7-349339e41d64\":{\"name\":\"Child Layout 2\",\"type\":\"layout\",\"identifier\":{\"key\":\"ea2f53e0-3376-4ba7-8df7-349339e41d64\",\"namespace\":\"\"},\"composition\":[],\"configuration\":{\"items\":[],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata @clock\\nGenerate display layout with 2 child display layouts\\nchrome\",\"modified\":1732413606944,\"location\":\"f11f93ab-8918-4732-b20c-617b7b2e16ad\",\"created\":1732413606944,\"persisted\":1732413606944}}" }, { "name": "mct-tree-expanded", "value": "[]" + }, + { + "name": "mct-recent-objects", + "value": "[{\"objectPath\":[{\"identifier\":{\"key\":\"f11f93ab-8918-4732-b20c-617b7b2e16ad\",\"namespace\":\"\"},\"name\":\"Parent Display Layout\",\"type\":\"layout\",\"composition\":[{\"key\":\"034e9aab-8b24-493b-876f-80ed474b61fb\",\"namespace\":\"\"},{\"key\":\"ea2f53e0-3376-4ba7-8df7-349339e41d64\",\"namespace\":\"\"}],\"configuration\":{\"items\":[{\"width\":32,\"height\":18,\"x\":1,\"y\":1,\"identifier\":{\"key\":\"034e9aab-8b24-493b-876f-80ed474b61fb\",\"namespace\":\"\"},\"hasFrame\":true,\"fontSize\":\"default\",\"font\":\"default\",\"type\":\"subobject-view\",\"id\":\"94b55aa2-8f61-431a-9453-4bbfda9119fb\"}],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata @clock\\nGenerate display layout with 2 child display layouts\\nchrome\",\"modified\":1732413606944,\"location\":\"mine\",\"created\":1732413604666,\"persisted\":1732413606944},{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"f11f93ab-8918-4732-b20c-617b7b2e16ad\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413604666,\"created\":1732413603039,\"persisted\":1732413604666},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine/f11f93ab-8918-4732-b20c-617b7b2e16ad\",\"domainObject\":{\"identifier\":{\"key\":\"f11f93ab-8918-4732-b20c-617b7b2e16ad\",\"namespace\":\"\"},\"name\":\"Parent Display Layout\",\"type\":\"layout\",\"composition\":[{\"key\":\"034e9aab-8b24-493b-876f-80ed474b61fb\",\"namespace\":\"\"},{\"key\":\"ea2f53e0-3376-4ba7-8df7-349339e41d64\",\"namespace\":\"\"}],\"configuration\":{\"items\":[{\"width\":32,\"height\":18,\"x\":1,\"y\":1,\"identifier\":{\"key\":\"034e9aab-8b24-493b-876f-80ed474b61fb\",\"namespace\":\"\"},\"hasFrame\":true,\"fontSize\":\"default\",\"font\":\"default\",\"type\":\"subobject-view\",\"id\":\"94b55aa2-8f61-431a-9453-4bbfda9119fb\"}],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata @clock\\nGenerate display layout with 2 child display layouts\\nchrome\",\"modified\":1732413606944,\"location\":\"mine\",\"created\":1732413604666,\"persisted\":1732413606944}},{\"objectPath\":[{\"identifier\":{\"key\":\"ea2f53e0-3376-4ba7-8df7-349339e41d64\",\"namespace\":\"\"},\"name\":\"Child Layout 2\",\"type\":\"layout\",\"composition\":[],\"configuration\":{\"items\":[],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata @clock\\nGenerate display layout with 2 child display layouts\\nchrome\",\"modified\":1732413606944,\"location\":\"f11f93ab-8918-4732-b20c-617b7b2e16ad\",\"created\":1732413606944,\"persisted\":1732413606944},{\"identifier\":{\"key\":\"f11f93ab-8918-4732-b20c-617b7b2e16ad\",\"namespace\":\"\"},\"name\":\"Parent Display Layout\",\"type\":\"layout\",\"composition\":[{\"key\":\"034e9aab-8b24-493b-876f-80ed474b61fb\",\"namespace\":\"\"},{\"key\":\"ea2f53e0-3376-4ba7-8df7-349339e41d64\",\"namespace\":\"\"}],\"configuration\":{\"items\":[{\"width\":32,\"height\":18,\"x\":1,\"y\":1,\"identifier\":{\"key\":\"034e9aab-8b24-493b-876f-80ed474b61fb\",\"namespace\":\"\"},\"hasFrame\":true,\"fontSize\":\"default\",\"font\":\"default\",\"type\":\"subobject-view\",\"id\":\"94b55aa2-8f61-431a-9453-4bbfda9119fb\"}],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata @clock\\nGenerate display layout with 2 child display layouts\\nchrome\",\"modified\":1732413606944,\"location\":\"mine\",\"created\":1732413604666,\"persisted\":1732413606944},{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"f11f93ab-8918-4732-b20c-617b7b2e16ad\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413604666,\"created\":1732413603039,\"persisted\":1732413604666},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine/f11f93ab-8918-4732-b20c-617b7b2e16ad/ea2f53e0-3376-4ba7-8df7-349339e41d64\",\"domainObject\":{\"identifier\":{\"key\":\"ea2f53e0-3376-4ba7-8df7-349339e41d64\",\"namespace\":\"\"},\"name\":\"Child Layout 2\",\"type\":\"layout\",\"composition\":[],\"configuration\":{\"items\":[],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata @clock\\nGenerate display layout with 2 child display layouts\\nchrome\",\"modified\":1732413606944,\"location\":\"f11f93ab-8918-4732-b20c-617b7b2e16ad\",\"created\":1732413606944,\"persisted\":1732413606944}},{\"objectPath\":[{\"identifier\":{\"key\":\"034e9aab-8b24-493b-876f-80ed474b61fb\",\"namespace\":\"\"},\"name\":\"Child Layout 1\",\"type\":\"layout\",\"composition\":[],\"configuration\":{\"items\":[],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata @clock\\nGenerate display layout with 2 child display layouts\\nchrome\",\"modified\":1732413605564,\"location\":\"f11f93ab-8918-4732-b20c-617b7b2e16ad\",\"created\":1732413605564,\"persisted\":1732413605564},{\"identifier\":{\"key\":\"f11f93ab-8918-4732-b20c-617b7b2e16ad\",\"namespace\":\"\"},\"name\":\"Parent Display Layout\",\"type\":\"layout\",\"composition\":[{\"key\":\"034e9aab-8b24-493b-876f-80ed474b61fb\",\"namespace\":\"\"},{\"key\":\"ea2f53e0-3376-4ba7-8df7-349339e41d64\",\"namespace\":\"\"}],\"configuration\":{\"items\":[{\"width\":32,\"height\":18,\"x\":1,\"y\":1,\"identifier\":{\"key\":\"034e9aab-8b24-493b-876f-80ed474b61fb\",\"namespace\":\"\"},\"hasFrame\":true,\"fontSize\":\"default\",\"font\":\"default\",\"type\":\"subobject-view\",\"id\":\"94b55aa2-8f61-431a-9453-4bbfda9119fb\"}],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata @clock\\nGenerate display layout with 2 child display layouts\\nchrome\",\"modified\":1732413606944,\"location\":\"mine\",\"created\":1732413604666,\"persisted\":1732413606944},{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"f11f93ab-8918-4732-b20c-617b7b2e16ad\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413604666,\"created\":1732413603039,\"persisted\":1732413604666},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine/f11f93ab-8918-4732-b20c-617b7b2e16ad/034e9aab-8b24-493b-876f-80ed474b61fb\",\"domainObject\":{\"identifier\":{\"key\":\"034e9aab-8b24-493b-876f-80ed474b61fb\",\"namespace\":\"\"},\"name\":\"Child Layout 1\",\"type\":\"layout\",\"composition\":[],\"configuration\":{\"items\":[],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata @clock\\nGenerate display layout with 2 child display layouts\\nchrome\",\"modified\":1732413605564,\"location\":\"f11f93ab-8918-4732-b20c-617b7b2e16ad\",\"created\":1732413605564,\"persisted\":1732413605564}},{\"objectPath\":[{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"f11f93ab-8918-4732-b20c-617b7b2e16ad\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413604666,\"created\":1732413603039,\"persisted\":1732413604666},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine\",\"domainObject\":{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"f11f93ab-8918-4732-b20c-617b7b2e16ad\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413604666,\"created\":1732413603039,\"persisted\":1732413604666}}]" } ] } diff --git a/e2e/test-data/display_layout_with_child_overlay_plot.json b/e2e/test-data/display_layout_with_child_overlay_plot.json index b6854feba2..5bebeeeb84 100644 --- a/e2e/test-data/display_layout_with_child_overlay_plot.json +++ b/e2e/test-data/display_layout_with_child_overlay_plot.json @@ -6,7 +6,7 @@ "localStorage": [ { "name": "mct", - "value": "{\"mine\":{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"29836e66-111a-45f8-81ed-f662661be9f9\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413602140,\"created\":1732413600860,\"persisted\":1732413602140},\"29836e66-111a-45f8-81ed-f662661be9f9\":{\"identifier\":{\"key\":\"29836e66-111a-45f8-81ed-f662661be9f9\",\"namespace\":\"\"},\"name\":\"Parent Display Layout\",\"type\":\"layout\",\"composition\":[{\"key\":\"55cd0300-6e57-4992-b670-0c2880c0e6b2\",\"namespace\":\"\"}],\"configuration\":{\"items\":[{\"width\":32,\"height\":18,\"x\":1,\"y\":1,\"identifier\":{\"key\":\"55cd0300-6e57-4992-b670-0c2880c0e6b2\",\"namespace\":\"\"},\"hasFrame\":true,\"fontSize\":\"default\",\"font\":\"default\",\"type\":\"subobject-view\",\"id\":\"022720f7-a6b5-40c3-b051-75f5d10a9042\"}],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate display layout with 1 child overlay plot\\nchrome\",\"modified\":1732413604780,\"location\":\"mine\",\"created\":1732413602140,\"persisted\":1732413604780},\"55cd0300-6e57-4992-b670-0c2880c0e6b2\":{\"identifier\":{\"key\":\"55cd0300-6e57-4992-b670-0c2880c0e6b2\",\"namespace\":\"\"},\"name\":\"Child Overlay Plot 1\",\"type\":\"telemetry.plot.overlay\",\"composition\":[{\"key\":\"ec13f652-4636-4763-8e88-898144cbc6f2\",\"namespace\":\"\"}],\"configuration\":{\"series\":[{\"identifier\":{\"key\":\"ec13f652-4636-4763-8e88-898144cbc6f2\",\"namespace\":\"\"}}],\"useIndependentTime\":true,\"timeOptions\":{\"clockOffsets\":{\"start\":-1800000,\"end\":30000},\"fixedOffsets\":{\"start\":1731438671000,\"end\":1731442271000},\"clock\":\"local\",\"mode\":\"fixed\"}},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate display layout with 1 child overlay plot\\nchrome\",\"modified\":1732413605500,\"location\":\"29836e66-111a-45f8-81ed-f662661be9f9\",\"created\":1732413603280,\"persisted\":1732413605500},\"ec13f652-4636-4763-8e88-898144cbc6f2\":{\"name\":\"Child SWG 1\",\"type\":\"generator\",\"identifier\":{\"key\":\"ec13f652-4636-4763-8e88-898144cbc6f2\",\"namespace\":\"\"},\"telemetry\":{\"period\":10,\"amplitude\":1,\"offset\":0,\"dataRateInHz\":1,\"phase\":0,\"randomness\":0,\"loadDelay\":0,\"infinityValues\":false,\"exceedFloat32\":false,\"staleness\":false},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate display layout with 1 child overlay plot\\nchrome\",\"modified\":1732413604440,\"location\":\"55cd0300-6e57-4992-b670-0c2880c0e6b2\",\"created\":1732413604440,\"persisted\":1732413604440}}" + "value": "{\"mine\":{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"712d07f1-3585-465a-a6db-3c40a9edcde7\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413604993,\"created\":1732413603983,\"persisted\":1732413604993},\"712d07f1-3585-465a-a6db-3c40a9edcde7\":{\"identifier\":{\"key\":\"712d07f1-3585-465a-a6db-3c40a9edcde7\",\"namespace\":\"\"},\"name\":\"Parent Display Layout\",\"type\":\"layout\",\"composition\":[{\"key\":\"6731f693-b09e-46de-a0cb-9331f1fb2e6d\",\"namespace\":\"\"}],\"configuration\":{\"items\":[{\"width\":32,\"height\":18,\"x\":1,\"y\":1,\"identifier\":{\"key\":\"6731f693-b09e-46de-a0cb-9331f1fb2e6d\",\"namespace\":\"\"},\"hasFrame\":true,\"fontSize\":\"default\",\"font\":\"default\",\"type\":\"subobject-view\",\"id\":\"7aea18ca-1537-4f4f-98e4-a57b4cd8f9a7\"}],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata @clock\\nGenerate display layout with 1 child overlay plot\\nchrome\",\"modified\":1732413608088.7,\"location\":\"mine\",\"created\":1732413604993,\"persisted\":1732413608088.7},\"6731f693-b09e-46de-a0cb-9331f1fb2e6d\":{\"identifier\":{\"key\":\"6731f693-b09e-46de-a0cb-9331f1fb2e6d\",\"namespace\":\"\"},\"name\":\"Child Overlay Plot 1\",\"type\":\"telemetry.plot.overlay\",\"composition\":[{\"key\":\"fa050882-fcec-49c0-aa78-236a595accaf\",\"namespace\":\"\"}],\"configuration\":{\"series\":[{\"identifier\":{\"key\":\"fa050882-fcec-49c0-aa78-236a595accaf\",\"namespace\":\"\"}}],\"useIndependentTime\":true,\"timeOptions\":{\"clockOffsets\":{\"start\":-1800000,\"end\":30000},\"fixedOffsets\":{\"start\":1731438671000,\"end\":1731442271000},\"clock\":\"local\",\"mode\":\"fixed\"}},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata @clock\\nGenerate display layout with 1 child overlay plot\\nchrome\",\"modified\":1732413608703.7,\"location\":\"712d07f1-3585-465a-a6db-3c40a9edcde7\",\"created\":1732413606392.7,\"persisted\":1732413608703.7},\"fa050882-fcec-49c0-aa78-236a595accaf\":{\"name\":\"Child SWG 1\",\"type\":\"generator\",\"identifier\":{\"key\":\"fa050882-fcec-49c0-aa78-236a595accaf\",\"namespace\":\"\"},\"telemetry\":{\"period\":10,\"amplitude\":1,\"offset\":0,\"dataRateInHz\":1,\"phase\":0,\"randomness\":0,\"loadDelay\":0,\"infinityValues\":false,\"exceedFloat32\":false,\"staleness\":false},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata @clock\\nGenerate display layout with 1 child overlay plot\\nchrome\",\"modified\":1732413607788,\"location\":\"6731f693-b09e-46de-a0cb-9331f1fb2e6d\",\"created\":1732413607788,\"persisted\":1732413607788}}" }, { "name": "mct-tree-expanded", @@ -18,7 +18,7 @@ }, { "name": "mct-recent-objects", - "value": "[{\"objectPath\":[{\"identifier\":{\"key\":\"29836e66-111a-45f8-81ed-f662661be9f9\",\"namespace\":\"\"},\"name\":\"Parent Display Layout\",\"type\":\"layout\",\"composition\":[{\"key\":\"55cd0300-6e57-4992-b670-0c2880c0e6b2\",\"namespace\":\"\"}],\"configuration\":{\"items\":[],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate display layout with 1 child overlay plot\\nchrome\",\"modified\":1732413603280,\"location\":\"mine\",\"created\":1732413602140,\"persisted\":1732413603280},{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"29836e66-111a-45f8-81ed-f662661be9f9\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413602140,\"created\":1732413600860,\"persisted\":1732413602140},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine/29836e66-111a-45f8-81ed-f662661be9f9\",\"domainObject\":{\"identifier\":{\"key\":\"29836e66-111a-45f8-81ed-f662661be9f9\",\"namespace\":\"\"},\"name\":\"Parent Display Layout\",\"type\":\"layout\",\"composition\":[{\"key\":\"55cd0300-6e57-4992-b670-0c2880c0e6b2\",\"namespace\":\"\"}],\"configuration\":{\"items\":[],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate display layout with 1 child overlay plot\\nchrome\",\"modified\":1732413603280,\"location\":\"mine\",\"created\":1732413602140,\"persisted\":1732413603280}},{\"objectPath\":[{\"identifier\":{\"key\":\"ec13f652-4636-4763-8e88-898144cbc6f2\",\"namespace\":\"\"},\"name\":\"Child SWG 1\",\"type\":\"generator\",\"telemetry\":{\"period\":10,\"amplitude\":1,\"offset\":0,\"dataRateInHz\":1,\"phase\":0,\"randomness\":0,\"loadDelay\":0,\"infinityValues\":false,\"exceedFloat32\":false,\"staleness\":false},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate display layout with 1 child overlay plot\\nchrome\",\"modified\":1732413604440,\"location\":\"55cd0300-6e57-4992-b670-0c2880c0e6b2\",\"created\":1732413604440,\"persisted\":1732413604440},{\"identifier\":{\"key\":\"55cd0300-6e57-4992-b670-0c2880c0e6b2\",\"namespace\":\"\"},\"name\":\"Child Overlay Plot 1\",\"type\":\"telemetry.plot.overlay\",\"composition\":[{\"key\":\"ec13f652-4636-4763-8e88-898144cbc6f2\",\"namespace\":\"\"}],\"configuration\":{\"series\":[]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate display layout with 1 child overlay plot\\nchrome\",\"modified\":1732413604440,\"location\":\"29836e66-111a-45f8-81ed-f662661be9f9\",\"created\":1732413603280,\"persisted\":1732413604440},{\"identifier\":{\"key\":\"29836e66-111a-45f8-81ed-f662661be9f9\",\"namespace\":\"\"},\"name\":\"Parent Display Layout\",\"type\":\"layout\",\"composition\":[{\"key\":\"55cd0300-6e57-4992-b670-0c2880c0e6b2\",\"namespace\":\"\"}],\"configuration\":{\"items\":[],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate display layout with 1 child overlay plot\\nchrome\",\"modified\":1732413603280,\"location\":\"mine\",\"created\":1732413602140,\"persisted\":1732413603280},{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"29836e66-111a-45f8-81ed-f662661be9f9\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413602140,\"created\":1732413600860,\"persisted\":1732413602140},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine/29836e66-111a-45f8-81ed-f662661be9f9/55cd0300-6e57-4992-b670-0c2880c0e6b2/ec13f652-4636-4763-8e88-898144cbc6f2\",\"domainObject\":{\"identifier\":{\"key\":\"ec13f652-4636-4763-8e88-898144cbc6f2\",\"namespace\":\"\"},\"name\":\"Child SWG 1\",\"type\":\"generator\",\"telemetry\":{\"period\":10,\"amplitude\":1,\"offset\":0,\"dataRateInHz\":1,\"phase\":0,\"randomness\":0,\"loadDelay\":0,\"infinityValues\":false,\"exceedFloat32\":false,\"staleness\":false},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate display layout with 1 child overlay plot\\nchrome\",\"modified\":1732413604440,\"location\":\"55cd0300-6e57-4992-b670-0c2880c0e6b2\",\"created\":1732413604440,\"persisted\":1732413604440}},{\"objectPath\":[{\"identifier\":{\"key\":\"55cd0300-6e57-4992-b670-0c2880c0e6b2\",\"namespace\":\"\"},\"name\":\"Child Overlay Plot 1\",\"type\":\"telemetry.plot.overlay\",\"composition\":[{\"key\":\"ec13f652-4636-4763-8e88-898144cbc6f2\",\"namespace\":\"\"}],\"configuration\":{\"series\":[]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate display layout with 1 child overlay plot\\nchrome\",\"modified\":1732413604440,\"location\":\"29836e66-111a-45f8-81ed-f662661be9f9\",\"created\":1732413603280,\"persisted\":1732413604440},{\"identifier\":{\"key\":\"29836e66-111a-45f8-81ed-f662661be9f9\",\"namespace\":\"\"},\"name\":\"Parent Display Layout\",\"type\":\"layout\",\"composition\":[{\"key\":\"55cd0300-6e57-4992-b670-0c2880c0e6b2\",\"namespace\":\"\"}],\"configuration\":{\"items\":[],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate display layout with 1 child overlay plot\\nchrome\",\"modified\":1732413603280,\"location\":\"mine\",\"created\":1732413602140,\"persisted\":1732413603280},{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"29836e66-111a-45f8-81ed-f662661be9f9\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413602140,\"created\":1732413600860,\"persisted\":1732413602140},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine/29836e66-111a-45f8-81ed-f662661be9f9/55cd0300-6e57-4992-b670-0c2880c0e6b2\",\"domainObject\":{\"identifier\":{\"key\":\"55cd0300-6e57-4992-b670-0c2880c0e6b2\",\"namespace\":\"\"},\"name\":\"Child Overlay Plot 1\",\"type\":\"telemetry.plot.overlay\",\"composition\":[{\"key\":\"ec13f652-4636-4763-8e88-898144cbc6f2\",\"namespace\":\"\"}],\"configuration\":{\"series\":[]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate display layout with 1 child overlay plot\\nchrome\",\"modified\":1732413604440,\"location\":\"29836e66-111a-45f8-81ed-f662661be9f9\",\"created\":1732413603280,\"persisted\":1732413604440}},{\"objectPath\":[{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"29836e66-111a-45f8-81ed-f662661be9f9\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413602140,\"created\":1732413600860,\"persisted\":1732413602140},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine\",\"domainObject\":{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"29836e66-111a-45f8-81ed-f662661be9f9\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413602140,\"created\":1732413600860,\"persisted\":1732413602140}}]" + "value": "[{\"objectPath\":[{\"identifier\":{\"key\":\"712d07f1-3585-465a-a6db-3c40a9edcde7\",\"namespace\":\"\"},\"name\":\"Parent Display Layout\",\"type\":\"layout\",\"composition\":[{\"key\":\"6731f693-b09e-46de-a0cb-9331f1fb2e6d\",\"namespace\":\"\"}],\"configuration\":{\"items\":[],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata @clock\\nGenerate display layout with 1 child overlay plot\\nchrome\",\"modified\":1732413606392.7,\"location\":\"mine\",\"created\":1732413604993,\"persisted\":1732413606392.7},{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"712d07f1-3585-465a-a6db-3c40a9edcde7\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413604993,\"created\":1732413603983,\"persisted\":1732413604993},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine/712d07f1-3585-465a-a6db-3c40a9edcde7\",\"domainObject\":{\"identifier\":{\"key\":\"712d07f1-3585-465a-a6db-3c40a9edcde7\",\"namespace\":\"\"},\"name\":\"Parent Display Layout\",\"type\":\"layout\",\"composition\":[{\"key\":\"6731f693-b09e-46de-a0cb-9331f1fb2e6d\",\"namespace\":\"\"}],\"configuration\":{\"items\":[],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata @clock\\nGenerate display layout with 1 child overlay plot\\nchrome\",\"modified\":1732413606392.7,\"location\":\"mine\",\"created\":1732413604993,\"persisted\":1732413606392.7}},{\"objectPath\":[{\"identifier\":{\"key\":\"fa050882-fcec-49c0-aa78-236a595accaf\",\"namespace\":\"\"},\"name\":\"Child SWG 1\",\"type\":\"generator\",\"telemetry\":{\"period\":10,\"amplitude\":1,\"offset\":0,\"dataRateInHz\":1,\"phase\":0,\"randomness\":0,\"loadDelay\":0,\"infinityValues\":false,\"exceedFloat32\":false,\"staleness\":false},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata @clock\\nGenerate display layout with 1 child overlay plot\\nchrome\",\"modified\":1732413607788,\"location\":\"6731f693-b09e-46de-a0cb-9331f1fb2e6d\",\"created\":1732413607788,\"persisted\":1732413607788},{\"identifier\":{\"key\":\"6731f693-b09e-46de-a0cb-9331f1fb2e6d\",\"namespace\":\"\"},\"name\":\"Child Overlay Plot 1\",\"type\":\"telemetry.plot.overlay\",\"composition\":[{\"key\":\"fa050882-fcec-49c0-aa78-236a595accaf\",\"namespace\":\"\"}],\"configuration\":{\"series\":[]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata @clock\\nGenerate display layout with 1 child overlay plot\\nchrome\",\"modified\":1732413607788,\"location\":\"712d07f1-3585-465a-a6db-3c40a9edcde7\",\"created\":1732413606392.7,\"persisted\":1732413607788},{\"identifier\":{\"key\":\"712d07f1-3585-465a-a6db-3c40a9edcde7\",\"namespace\":\"\"},\"name\":\"Parent Display Layout\",\"type\":\"layout\",\"composition\":[{\"key\":\"6731f693-b09e-46de-a0cb-9331f1fb2e6d\",\"namespace\":\"\"}],\"configuration\":{\"items\":[],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata @clock\\nGenerate display layout with 1 child overlay plot\\nchrome\",\"modified\":1732413606392.7,\"location\":\"mine\",\"created\":1732413604993,\"persisted\":1732413606392.7},{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"712d07f1-3585-465a-a6db-3c40a9edcde7\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413604993,\"created\":1732413603983,\"persisted\":1732413604993},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine/712d07f1-3585-465a-a6db-3c40a9edcde7/6731f693-b09e-46de-a0cb-9331f1fb2e6d/fa050882-fcec-49c0-aa78-236a595accaf\",\"domainObject\":{\"identifier\":{\"key\":\"fa050882-fcec-49c0-aa78-236a595accaf\",\"namespace\":\"\"},\"name\":\"Child SWG 1\",\"type\":\"generator\",\"telemetry\":{\"period\":10,\"amplitude\":1,\"offset\":0,\"dataRateInHz\":1,\"phase\":0,\"randomness\":0,\"loadDelay\":0,\"infinityValues\":false,\"exceedFloat32\":false,\"staleness\":false},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata @clock\\nGenerate display layout with 1 child overlay plot\\nchrome\",\"modified\":1732413607788,\"location\":\"6731f693-b09e-46de-a0cb-9331f1fb2e6d\",\"created\":1732413607788,\"persisted\":1732413607788}},{\"objectPath\":[{\"identifier\":{\"key\":\"6731f693-b09e-46de-a0cb-9331f1fb2e6d\",\"namespace\":\"\"},\"name\":\"Child Overlay Plot 1\",\"type\":\"telemetry.plot.overlay\",\"composition\":[{\"key\":\"fa050882-fcec-49c0-aa78-236a595accaf\",\"namespace\":\"\"}],\"configuration\":{\"series\":[]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata @clock\\nGenerate display layout with 1 child overlay plot\\nchrome\",\"modified\":1732413607788,\"location\":\"712d07f1-3585-465a-a6db-3c40a9edcde7\",\"created\":1732413606392.7,\"persisted\":1732413607788},{\"identifier\":{\"key\":\"712d07f1-3585-465a-a6db-3c40a9edcde7\",\"namespace\":\"\"},\"name\":\"Parent Display Layout\",\"type\":\"layout\",\"composition\":[{\"key\":\"6731f693-b09e-46de-a0cb-9331f1fb2e6d\",\"namespace\":\"\"}],\"configuration\":{\"items\":[],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata @clock\\nGenerate display layout with 1 child overlay plot\\nchrome\",\"modified\":1732413606392.7,\"location\":\"mine\",\"created\":1732413604993,\"persisted\":1732413606392.7},{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"712d07f1-3585-465a-a6db-3c40a9edcde7\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413604993,\"created\":1732413603983,\"persisted\":1732413604993},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine/712d07f1-3585-465a-a6db-3c40a9edcde7/6731f693-b09e-46de-a0cb-9331f1fb2e6d\",\"domainObject\":{\"identifier\":{\"key\":\"6731f693-b09e-46de-a0cb-9331f1fb2e6d\",\"namespace\":\"\"},\"name\":\"Child Overlay Plot 1\",\"type\":\"telemetry.plot.overlay\",\"composition\":[{\"key\":\"fa050882-fcec-49c0-aa78-236a595accaf\",\"namespace\":\"\"}],\"configuration\":{\"series\":[]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata @clock\\nGenerate display layout with 1 child overlay plot\\nchrome\",\"modified\":1732413607788,\"location\":\"712d07f1-3585-465a-a6db-3c40a9edcde7\",\"created\":1732413606392.7,\"persisted\":1732413607788}},{\"objectPath\":[{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"712d07f1-3585-465a-a6db-3c40a9edcde7\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413604993,\"created\":1732413603983,\"persisted\":1732413604993},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine\",\"domainObject\":{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"712d07f1-3585-465a-a6db-3c40a9edcde7\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413604993,\"created\":1732413603983,\"persisted\":1732413604993}}]" } ] } diff --git a/e2e/test-data/flexible_layout_with_child_layouts.json b/e2e/test-data/flexible_layout_with_child_layouts.json index 696f2f7f37..0f3a18a8b8 100644 --- a/e2e/test-data/flexible_layout_with_child_layouts.json +++ b/e2e/test-data/flexible_layout_with_child_layouts.json @@ -6,15 +6,15 @@ "localStorage": [ { "name": "mct", - "value": "{\"mine\":{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"a9ea2ec4-c456-4b73-8ed5-c4da07d40732\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413601660,\"created\":1732413600900,\"persisted\":1732413601660},\"a9ea2ec4-c456-4b73-8ed5-c4da07d40732\":{\"identifier\":{\"key\":\"a9ea2ec4-c456-4b73-8ed5-c4da07d40732\",\"namespace\":\"\"},\"name\":\"Parent Flexible Layout\",\"type\":\"flexible-layout\",\"configuration\":{\"containers\":[{\"id\":\"f7154ceb-c37b-40ee-af98-6b9cb8a3ec62\",\"frames\":[{\"id\":\"885b1828-fbf1-4f59-8c57-c5db7ad625b1\",\"domainObjectIdentifier\":{\"key\":\"bd6c95a1-31b2-4eaf-b962-f1b3da3de21a\",\"namespace\":\"\"},\"size\":100,\"noFrame\":false}],\"size\":50},{\"id\":\"f73ad0b3-c719-45e8-8056-a93eb7fea00f\",\"frames\":[],\"size\":50}],\"rowsLayout\":false},\"composition\":[{\"key\":\"bd6c95a1-31b2-4eaf-b962-f1b3da3de21a\",\"namespace\":\"\"},{\"key\":\"a0294124-ac2f-442b-9e6e-2086c6b0c2bd\",\"namespace\":\"\"}],\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate flexible layout with 2 child display layouts\\nchrome\",\"modified\":1732413603920,\"location\":\"mine\",\"created\":1732413601660,\"persisted\":1732413603920},\"bd6c95a1-31b2-4eaf-b962-f1b3da3de21a\":{\"name\":\"Child Layout 1\",\"type\":\"layout\",\"identifier\":{\"key\":\"bd6c95a1-31b2-4eaf-b962-f1b3da3de21a\",\"namespace\":\"\"},\"composition\":[],\"configuration\":{\"items\":[],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate flexible layout with 2 child display layouts\\nchrome\",\"modified\":1732413602800,\"location\":\"a9ea2ec4-c456-4b73-8ed5-c4da07d40732\",\"created\":1732413602800,\"persisted\":1732413602800},\"a0294124-ac2f-442b-9e6e-2086c6b0c2bd\":{\"name\":\"Child Layout 2\",\"type\":\"layout\",\"identifier\":{\"key\":\"a0294124-ac2f-442b-9e6e-2086c6b0c2bd\",\"namespace\":\"\"},\"composition\":[],\"configuration\":{\"items\":[],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate flexible layout with 2 child display layouts\\nchrome\",\"modified\":1732413603920,\"location\":\"a9ea2ec4-c456-4b73-8ed5-c4da07d40732\",\"created\":1732413603920,\"persisted\":1732413603920}}" - }, - { - "name": "mct-recent-objects", - "value": "[{\"objectPath\":[{\"identifier\":{\"key\":\"a9ea2ec4-c456-4b73-8ed5-c4da07d40732\",\"namespace\":\"\"},\"name\":\"Parent Flexible Layout\",\"type\":\"flexible-layout\",\"configuration\":{\"containers\":[{\"id\":\"f7154ceb-c37b-40ee-af98-6b9cb8a3ec62\",\"frames\":[{\"id\":\"885b1828-fbf1-4f59-8c57-c5db7ad625b1\",\"domainObjectIdentifier\":{\"key\":\"bd6c95a1-31b2-4eaf-b962-f1b3da3de21a\",\"namespace\":\"\"},\"size\":100,\"noFrame\":false}],\"size\":50},{\"id\":\"f73ad0b3-c719-45e8-8056-a93eb7fea00f\",\"frames\":[],\"size\":50}],\"rowsLayout\":false},\"composition\":[{\"key\":\"bd6c95a1-31b2-4eaf-b962-f1b3da3de21a\",\"namespace\":\"\"},{\"key\":\"a0294124-ac2f-442b-9e6e-2086c6b0c2bd\",\"namespace\":\"\"}],\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate flexible layout with 2 child display layouts\\nchrome\",\"modified\":1732413603920,\"location\":\"mine\",\"created\":1732413601660,\"persisted\":1732413603920},{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"a9ea2ec4-c456-4b73-8ed5-c4da07d40732\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413601660,\"created\":1732413600900,\"persisted\":1732413601660},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine/a9ea2ec4-c456-4b73-8ed5-c4da07d40732\",\"domainObject\":{\"identifier\":{\"key\":\"a9ea2ec4-c456-4b73-8ed5-c4da07d40732\",\"namespace\":\"\"},\"name\":\"Parent Flexible Layout\",\"type\":\"flexible-layout\",\"configuration\":{\"containers\":[{\"id\":\"f7154ceb-c37b-40ee-af98-6b9cb8a3ec62\",\"frames\":[{\"id\":\"885b1828-fbf1-4f59-8c57-c5db7ad625b1\",\"domainObjectIdentifier\":{\"key\":\"bd6c95a1-31b2-4eaf-b962-f1b3da3de21a\",\"namespace\":\"\"},\"size\":100,\"noFrame\":false}],\"size\":50},{\"id\":\"f73ad0b3-c719-45e8-8056-a93eb7fea00f\",\"frames\":[],\"size\":50}],\"rowsLayout\":false},\"composition\":[{\"key\":\"bd6c95a1-31b2-4eaf-b962-f1b3da3de21a\",\"namespace\":\"\"},{\"key\":\"a0294124-ac2f-442b-9e6e-2086c6b0c2bd\",\"namespace\":\"\"}],\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate flexible layout with 2 child display layouts\\nchrome\",\"modified\":1732413603920,\"location\":\"mine\",\"created\":1732413601660,\"persisted\":1732413603920}},{\"objectPath\":[{\"identifier\":{\"key\":\"a0294124-ac2f-442b-9e6e-2086c6b0c2bd\",\"namespace\":\"\"},\"name\":\"Child Layout 2\",\"type\":\"layout\",\"composition\":[],\"configuration\":{\"items\":[],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate flexible layout with 2 child display layouts\\nchrome\",\"modified\":1732413603920,\"location\":\"a9ea2ec4-c456-4b73-8ed5-c4da07d40732\",\"created\":1732413603920,\"persisted\":1732413603920},{\"identifier\":{\"key\":\"a9ea2ec4-c456-4b73-8ed5-c4da07d40732\",\"namespace\":\"\"},\"name\":\"Parent Flexible Layout\",\"type\":\"flexible-layout\",\"configuration\":{\"containers\":[{\"id\":\"f7154ceb-c37b-40ee-af98-6b9cb8a3ec62\",\"frames\":[{\"id\":\"885b1828-fbf1-4f59-8c57-c5db7ad625b1\",\"domainObjectIdentifier\":{\"key\":\"bd6c95a1-31b2-4eaf-b962-f1b3da3de21a\",\"namespace\":\"\"},\"size\":100,\"noFrame\":false}],\"size\":50},{\"id\":\"f73ad0b3-c719-45e8-8056-a93eb7fea00f\",\"frames\":[],\"size\":50}],\"rowsLayout\":false},\"composition\":[{\"key\":\"bd6c95a1-31b2-4eaf-b962-f1b3da3de21a\",\"namespace\":\"\"},{\"key\":\"a0294124-ac2f-442b-9e6e-2086c6b0c2bd\",\"namespace\":\"\"}],\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate flexible layout with 2 child display layouts\\nchrome\",\"modified\":1732413603920,\"location\":\"mine\",\"created\":1732413601660,\"persisted\":1732413603920},{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"a9ea2ec4-c456-4b73-8ed5-c4da07d40732\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413601660,\"created\":1732413600900,\"persisted\":1732413601660},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine/a9ea2ec4-c456-4b73-8ed5-c4da07d40732/a0294124-ac2f-442b-9e6e-2086c6b0c2bd\",\"domainObject\":{\"identifier\":{\"key\":\"a0294124-ac2f-442b-9e6e-2086c6b0c2bd\",\"namespace\":\"\"},\"name\":\"Child Layout 2\",\"type\":\"layout\",\"composition\":[],\"configuration\":{\"items\":[],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate flexible layout with 2 child display layouts\\nchrome\",\"modified\":1732413603920,\"location\":\"a9ea2ec4-c456-4b73-8ed5-c4da07d40732\",\"created\":1732413603920,\"persisted\":1732413603920}},{\"objectPath\":[{\"identifier\":{\"key\":\"bd6c95a1-31b2-4eaf-b962-f1b3da3de21a\",\"namespace\":\"\"},\"name\":\"Child Layout 1\",\"type\":\"layout\",\"composition\":[],\"configuration\":{\"items\":[],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate flexible layout with 2 child display layouts\\nchrome\",\"modified\":1732413602800,\"location\":\"a9ea2ec4-c456-4b73-8ed5-c4da07d40732\",\"created\":1732413602800,\"persisted\":1732413602800},{\"identifier\":{\"key\":\"a9ea2ec4-c456-4b73-8ed5-c4da07d40732\",\"namespace\":\"\"},\"name\":\"Parent Flexible Layout\",\"type\":\"flexible-layout\",\"configuration\":{\"containers\":[{\"id\":\"f7154ceb-c37b-40ee-af98-6b9cb8a3ec62\",\"frames\":[{\"id\":\"885b1828-fbf1-4f59-8c57-c5db7ad625b1\",\"domainObjectIdentifier\":{\"key\":\"bd6c95a1-31b2-4eaf-b962-f1b3da3de21a\",\"namespace\":\"\"},\"size\":100,\"noFrame\":false}],\"size\":50},{\"id\":\"f73ad0b3-c719-45e8-8056-a93eb7fea00f\",\"frames\":[],\"size\":50}],\"rowsLayout\":false},\"composition\":[{\"key\":\"bd6c95a1-31b2-4eaf-b962-f1b3da3de21a\",\"namespace\":\"\"},{\"key\":\"a0294124-ac2f-442b-9e6e-2086c6b0c2bd\",\"namespace\":\"\"}],\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate flexible layout with 2 child display layouts\\nchrome\",\"modified\":1732413603920,\"location\":\"mine\",\"created\":1732413601660,\"persisted\":1732413603920},{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"a9ea2ec4-c456-4b73-8ed5-c4da07d40732\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413601660,\"created\":1732413600900,\"persisted\":1732413601660},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine/a9ea2ec4-c456-4b73-8ed5-c4da07d40732/bd6c95a1-31b2-4eaf-b962-f1b3da3de21a\",\"domainObject\":{\"identifier\":{\"key\":\"bd6c95a1-31b2-4eaf-b962-f1b3da3de21a\",\"namespace\":\"\"},\"name\":\"Child Layout 1\",\"type\":\"layout\",\"composition\":[],\"configuration\":{\"items\":[],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate flexible layout with 2 child display layouts\\nchrome\",\"modified\":1732413602800,\"location\":\"a9ea2ec4-c456-4b73-8ed5-c4da07d40732\",\"created\":1732413602800,\"persisted\":1732413602800}},{\"objectPath\":[{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"a9ea2ec4-c456-4b73-8ed5-c4da07d40732\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413601660,\"created\":1732413600900,\"persisted\":1732413601660},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine\",\"domainObject\":{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"a9ea2ec4-c456-4b73-8ed5-c4da07d40732\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413601660,\"created\":1732413600900,\"persisted\":1732413601660}}]" + "value": "{\"mine\":{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"3b2f155b-ec69-48d5-ac58-76af10187a35\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413605725.7,\"created\":1732413604014,\"persisted\":1732413605725.7},\"3b2f155b-ec69-48d5-ac58-76af10187a35\":{\"identifier\":{\"key\":\"3b2f155b-ec69-48d5-ac58-76af10187a35\",\"namespace\":\"\"},\"name\":\"Parent Flexible Layout\",\"type\":\"flexible-layout\",\"configuration\":{\"containers\":[{\"id\":\"344ecaa0-d7f6-45de-a5bc-74bc3575e529\",\"frames\":[{\"id\":\"928f4a48-d080-4983-b3b0-8089b925c702\",\"domainObjectIdentifier\":{\"key\":\"a6141275-b3a0-4768-8e4a-197f1cb809dd\",\"namespace\":\"\"},\"size\":100,\"noFrame\":false}],\"size\":50},{\"id\":\"de887070-1474-4ce6-8863-8002926d745e\",\"frames\":[],\"size\":50}],\"rowsLayout\":false},\"composition\":[{\"key\":\"a6141275-b3a0-4768-8e4a-197f1cb809dd\",\"namespace\":\"\"},{\"key\":\"20cad719-b961-457c-abcf-262944bdd1ce\",\"namespace\":\"\"}],\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata @clock\\nGenerate flexible layout with 2 child display layouts\\nchrome\",\"modified\":1732413607918,\"location\":\"mine\",\"created\":1732413605725.7,\"persisted\":1732413607918},\"a6141275-b3a0-4768-8e4a-197f1cb809dd\":{\"name\":\"Child Layout 1\",\"type\":\"layout\",\"identifier\":{\"key\":\"a6141275-b3a0-4768-8e4a-197f1cb809dd\",\"namespace\":\"\"},\"composition\":[],\"configuration\":{\"items\":[],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata @clock\\nGenerate flexible layout with 2 child display layouts\\nchrome\",\"modified\":1732413606530,\"location\":\"3b2f155b-ec69-48d5-ac58-76af10187a35\",\"created\":1732413606530,\"persisted\":1732413606530},\"20cad719-b961-457c-abcf-262944bdd1ce\":{\"name\":\"Child Layout 2\",\"type\":\"layout\",\"identifier\":{\"key\":\"20cad719-b961-457c-abcf-262944bdd1ce\",\"namespace\":\"\"},\"composition\":[],\"configuration\":{\"items\":[],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata @clock\\nGenerate flexible layout with 2 child display layouts\\nchrome\",\"modified\":1732413607918,\"location\":\"3b2f155b-ec69-48d5-ac58-76af10187a35\",\"created\":1732413607918,\"persisted\":1732413607918}}" }, { "name": "mct-tree-expanded", "value": "[]" + }, + { + "name": "mct-recent-objects", + "value": "[{\"objectPath\":[{\"identifier\":{\"key\":\"3b2f155b-ec69-48d5-ac58-76af10187a35\",\"namespace\":\"\"},\"name\":\"Parent Flexible Layout\",\"type\":\"flexible-layout\",\"configuration\":{\"containers\":[{\"id\":\"344ecaa0-d7f6-45de-a5bc-74bc3575e529\",\"frames\":[{\"id\":\"928f4a48-d080-4983-b3b0-8089b925c702\",\"domainObjectIdentifier\":{\"key\":\"a6141275-b3a0-4768-8e4a-197f1cb809dd\",\"namespace\":\"\"},\"size\":100,\"noFrame\":false}],\"size\":50},{\"id\":\"de887070-1474-4ce6-8863-8002926d745e\",\"frames\":[],\"size\":50}],\"rowsLayout\":false},\"composition\":[{\"key\":\"a6141275-b3a0-4768-8e4a-197f1cb809dd\",\"namespace\":\"\"},{\"key\":\"20cad719-b961-457c-abcf-262944bdd1ce\",\"namespace\":\"\"}],\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata @clock\\nGenerate flexible layout with 2 child display layouts\\nchrome\",\"modified\":1732413607918,\"location\":\"mine\",\"created\":1732413605725.7,\"persisted\":1732413607918},{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"3b2f155b-ec69-48d5-ac58-76af10187a35\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413605725.7,\"created\":1732413604014,\"persisted\":1732413605725.7},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine/3b2f155b-ec69-48d5-ac58-76af10187a35\",\"domainObject\":{\"identifier\":{\"key\":\"3b2f155b-ec69-48d5-ac58-76af10187a35\",\"namespace\":\"\"},\"name\":\"Parent Flexible Layout\",\"type\":\"flexible-layout\",\"configuration\":{\"containers\":[{\"id\":\"344ecaa0-d7f6-45de-a5bc-74bc3575e529\",\"frames\":[{\"id\":\"928f4a48-d080-4983-b3b0-8089b925c702\",\"domainObjectIdentifier\":{\"key\":\"a6141275-b3a0-4768-8e4a-197f1cb809dd\",\"namespace\":\"\"},\"size\":100,\"noFrame\":false}],\"size\":50},{\"id\":\"de887070-1474-4ce6-8863-8002926d745e\",\"frames\":[],\"size\":50}],\"rowsLayout\":false},\"composition\":[{\"key\":\"a6141275-b3a0-4768-8e4a-197f1cb809dd\",\"namespace\":\"\"},{\"key\":\"20cad719-b961-457c-abcf-262944bdd1ce\",\"namespace\":\"\"}],\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata @clock\\nGenerate flexible layout with 2 child display layouts\\nchrome\",\"modified\":1732413607918,\"location\":\"mine\",\"created\":1732413605725.7,\"persisted\":1732413607918}},{\"objectPath\":[{\"identifier\":{\"key\":\"20cad719-b961-457c-abcf-262944bdd1ce\",\"namespace\":\"\"},\"name\":\"Child Layout 2\",\"type\":\"layout\",\"composition\":[],\"configuration\":{\"items\":[],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata @clock\\nGenerate flexible layout with 2 child display layouts\\nchrome\",\"modified\":1732413607918,\"location\":\"3b2f155b-ec69-48d5-ac58-76af10187a35\",\"created\":1732413607918,\"persisted\":1732413607918},{\"identifier\":{\"key\":\"3b2f155b-ec69-48d5-ac58-76af10187a35\",\"namespace\":\"\"},\"name\":\"Parent Flexible Layout\",\"type\":\"flexible-layout\",\"configuration\":{\"containers\":[{\"id\":\"344ecaa0-d7f6-45de-a5bc-74bc3575e529\",\"frames\":[{\"id\":\"928f4a48-d080-4983-b3b0-8089b925c702\",\"domainObjectIdentifier\":{\"key\":\"a6141275-b3a0-4768-8e4a-197f1cb809dd\",\"namespace\":\"\"},\"size\":100,\"noFrame\":false}],\"size\":50},{\"id\":\"de887070-1474-4ce6-8863-8002926d745e\",\"frames\":[],\"size\":50}],\"rowsLayout\":false},\"composition\":[{\"key\":\"a6141275-b3a0-4768-8e4a-197f1cb809dd\",\"namespace\":\"\"},{\"key\":\"20cad719-b961-457c-abcf-262944bdd1ce\",\"namespace\":\"\"}],\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata @clock\\nGenerate flexible layout with 2 child display layouts\\nchrome\",\"modified\":1732413607918,\"location\":\"mine\",\"created\":1732413605725.7,\"persisted\":1732413607918},{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"3b2f155b-ec69-48d5-ac58-76af10187a35\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413605725.7,\"created\":1732413604014,\"persisted\":1732413605725.7},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine/3b2f155b-ec69-48d5-ac58-76af10187a35/20cad719-b961-457c-abcf-262944bdd1ce\",\"domainObject\":{\"identifier\":{\"key\":\"20cad719-b961-457c-abcf-262944bdd1ce\",\"namespace\":\"\"},\"name\":\"Child Layout 2\",\"type\":\"layout\",\"composition\":[],\"configuration\":{\"items\":[],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata @clock\\nGenerate flexible layout with 2 child display layouts\\nchrome\",\"modified\":1732413607918,\"location\":\"3b2f155b-ec69-48d5-ac58-76af10187a35\",\"created\":1732413607918,\"persisted\":1732413607918}},{\"objectPath\":[{\"identifier\":{\"key\":\"a6141275-b3a0-4768-8e4a-197f1cb809dd\",\"namespace\":\"\"},\"name\":\"Child Layout 1\",\"type\":\"layout\",\"composition\":[],\"configuration\":{\"items\":[],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata @clock\\nGenerate flexible layout with 2 child display layouts\\nchrome\",\"modified\":1732413606530,\"location\":\"3b2f155b-ec69-48d5-ac58-76af10187a35\",\"created\":1732413606530,\"persisted\":1732413606530},{\"identifier\":{\"key\":\"3b2f155b-ec69-48d5-ac58-76af10187a35\",\"namespace\":\"\"},\"name\":\"Parent Flexible Layout\",\"type\":\"flexible-layout\",\"configuration\":{\"containers\":[{\"id\":\"344ecaa0-d7f6-45de-a5bc-74bc3575e529\",\"frames\":[{\"id\":\"928f4a48-d080-4983-b3b0-8089b925c702\",\"domainObjectIdentifier\":{\"key\":\"a6141275-b3a0-4768-8e4a-197f1cb809dd\",\"namespace\":\"\"},\"size\":100,\"noFrame\":false}],\"size\":50},{\"id\":\"de887070-1474-4ce6-8863-8002926d745e\",\"frames\":[],\"size\":50}],\"rowsLayout\":false},\"composition\":[{\"key\":\"a6141275-b3a0-4768-8e4a-197f1cb809dd\",\"namespace\":\"\"},{\"key\":\"20cad719-b961-457c-abcf-262944bdd1ce\",\"namespace\":\"\"}],\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata @clock\\nGenerate flexible layout with 2 child display layouts\\nchrome\",\"modified\":1732413607918,\"location\":\"mine\",\"created\":1732413605725.7,\"persisted\":1732413607918},{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"3b2f155b-ec69-48d5-ac58-76af10187a35\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413605725.7,\"created\":1732413604014,\"persisted\":1732413605725.7},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine/3b2f155b-ec69-48d5-ac58-76af10187a35/a6141275-b3a0-4768-8e4a-197f1cb809dd\",\"domainObject\":{\"identifier\":{\"key\":\"a6141275-b3a0-4768-8e4a-197f1cb809dd\",\"namespace\":\"\"},\"name\":\"Child Layout 1\",\"type\":\"layout\",\"composition\":[],\"configuration\":{\"items\":[],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata @clock\\nGenerate flexible layout with 2 child display layouts\\nchrome\",\"modified\":1732413606530,\"location\":\"3b2f155b-ec69-48d5-ac58-76af10187a35\",\"created\":1732413606530,\"persisted\":1732413606530}},{\"objectPath\":[{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"3b2f155b-ec69-48d5-ac58-76af10187a35\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413605725.7,\"created\":1732413604014,\"persisted\":1732413605725.7},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine\",\"domainObject\":{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"3b2f155b-ec69-48d5-ac58-76af10187a35\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413605725.7,\"created\":1732413604014,\"persisted\":1732413605725.7}}]" } ] } diff --git a/e2e/test-data/overlay_plot_storage.json b/e2e/test-data/overlay_plot_storage.json index 310795dbc0..947c4119be 100644 --- a/e2e/test-data/overlay_plot_storage.json +++ b/e2e/test-data/overlay_plot_storage.json @@ -6,15 +6,15 @@ "localStorage": [ { "name": "mct", - "value": "{\"mine\":{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"e78ca721-fb5e-409b-bf6d-597c87cb716f\",\"namespace\":\"\"},{\"key\":\"c6100044-56be-44b3-acca-6b9fddfb3849\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413602460,\"created\":1732413600960,\"persisted\":1732413602460},\"e78ca721-fb5e-409b-bf6d-597c87cb716f\":{\"identifier\":{\"key\":\"e78ca721-fb5e-409b-bf6d-597c87cb716f\",\"namespace\":\"\"},\"name\":\"Overlay Plot with Telemetry Object\",\"type\":\"telemetry.plot.overlay\",\"composition\":[{\"key\":\"c6100044-56be-44b3-acca-6b9fddfb3849\",\"namespace\":\"\"}],\"configuration\":{\"series\":[{\"identifier\":{\"key\":\"c6100044-56be-44b3-acca-6b9fddfb3849\",\"namespace\":\"\"}}]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate Overlay Plot with Telemetry Object\\nchrome\",\"modified\":1732413603880,\"location\":\"mine\",\"created\":1732413601740,\"persisted\":1732413603880},\"c6100044-56be-44b3-acca-6b9fddfb3849\":{\"name\":\"VIPER Rover Heading\",\"type\":\"generator\",\"identifier\":{\"key\":\"c6100044-56be-44b3-acca-6b9fddfb3849\",\"namespace\":\"\"},\"telemetry\":{\"period\":10,\"amplitude\":1,\"offset\":0,\"dataRateInHz\":1,\"phase\":0,\"randomness\":0,\"loadDelay\":0,\"infinityValues\":false,\"exceedFloat32\":false,\"staleness\":false},\"modified\":1732413602460,\"location\":\"mine\",\"created\":1732413602460,\"persisted\":1732413602460}}" - }, - { - "name": "mct-recent-objects", - "value": "[{\"objectPath\":[{\"identifier\":{\"key\":\"c6100044-56be-44b3-acca-6b9fddfb3849\",\"namespace\":\"\"},\"name\":\"VIPER Rover Heading\",\"type\":\"generator\",\"telemetry\":{\"period\":10,\"amplitude\":1,\"offset\":0,\"dataRateInHz\":1,\"phase\":0,\"randomness\":0,\"loadDelay\":0,\"infinityValues\":false,\"exceedFloat32\":false,\"staleness\":false},\"modified\":1732413602460,\"location\":\"mine\",\"created\":1732413602460,\"persisted\":1732413602460},{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"e78ca721-fb5e-409b-bf6d-597c87cb716f\",\"namespace\":\"\"},{\"key\":\"c6100044-56be-44b3-acca-6b9fddfb3849\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413602460,\"created\":1732413600960,\"persisted\":1732413602460},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine/c6100044-56be-44b3-acca-6b9fddfb3849\",\"domainObject\":{\"identifier\":{\"key\":\"c6100044-56be-44b3-acca-6b9fddfb3849\",\"namespace\":\"\"},\"name\":\"VIPER Rover Heading\",\"type\":\"generator\",\"telemetry\":{\"period\":10,\"amplitude\":1,\"offset\":0,\"dataRateInHz\":1,\"phase\":0,\"randomness\":0,\"loadDelay\":0,\"infinityValues\":false,\"exceedFloat32\":false,\"staleness\":false},\"modified\":1732413602460,\"location\":\"mine\",\"created\":1732413602460,\"persisted\":1732413602460}},{\"objectPath\":[{\"identifier\":{\"key\":\"e78ca721-fb5e-409b-bf6d-597c87cb716f\",\"namespace\":\"\"},\"name\":\"Overlay Plot with Telemetry Object\",\"type\":\"telemetry.plot.overlay\",\"composition\":[{\"key\":\"c6100044-56be-44b3-acca-6b9fddfb3849\",\"namespace\":\"\"}],\"configuration\":{\"series\":[{\"identifier\":{\"key\":\"c6100044-56be-44b3-acca-6b9fddfb3849\",\"namespace\":\"\"}}]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate Overlay Plot with Telemetry Object\\nchrome\",\"modified\":1732413603880,\"location\":\"mine\",\"created\":1732413601740,\"persisted\":1732413603880},{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"e78ca721-fb5e-409b-bf6d-597c87cb716f\",\"namespace\":\"\"},{\"key\":\"c6100044-56be-44b3-acca-6b9fddfb3849\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413602460,\"created\":1732413600960,\"persisted\":1732413602460},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine/e78ca721-fb5e-409b-bf6d-597c87cb716f\",\"domainObject\":{\"identifier\":{\"key\":\"e78ca721-fb5e-409b-bf6d-597c87cb716f\",\"namespace\":\"\"},\"name\":\"Overlay Plot with Telemetry Object\",\"type\":\"telemetry.plot.overlay\",\"composition\":[{\"key\":\"c6100044-56be-44b3-acca-6b9fddfb3849\",\"namespace\":\"\"}],\"configuration\":{\"series\":[{\"identifier\":{\"key\":\"c6100044-56be-44b3-acca-6b9fddfb3849\",\"namespace\":\"\"}}]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate Overlay Plot with Telemetry Object\\nchrome\",\"modified\":1732413603880,\"location\":\"mine\",\"created\":1732413601740,\"persisted\":1732413603880}},{\"objectPath\":[{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"e78ca721-fb5e-409b-bf6d-597c87cb716f\",\"namespace\":\"\"},{\"key\":\"c6100044-56be-44b3-acca-6b9fddfb3849\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413602460,\"created\":1732413600960,\"persisted\":1732413602460},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine\",\"domainObject\":{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"e78ca721-fb5e-409b-bf6d-597c87cb716f\",\"namespace\":\"\"},{\"key\":\"c6100044-56be-44b3-acca-6b9fddfb3849\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413602460,\"created\":1732413600960,\"persisted\":1732413602460}}]" + "value": "{\"mine\":{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"d3014736-1182-4b70-8122-6d0c6ef540e1\",\"namespace\":\"\"},{\"key\":\"8c53d61f-b514-4535-be87-0fb20eb56576\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413605677,\"created\":1732413603298,\"persisted\":1732413605677},\"d3014736-1182-4b70-8122-6d0c6ef540e1\":{\"identifier\":{\"key\":\"d3014736-1182-4b70-8122-6d0c6ef540e1\",\"namespace\":\"\"},\"name\":\"Overlay Plot with Telemetry Object\",\"type\":\"telemetry.plot.overlay\",\"composition\":[{\"key\":\"8c53d61f-b514-4535-be87-0fb20eb56576\",\"namespace\":\"\"}],\"configuration\":{\"series\":[]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata @clock\\nGenerate Overlay Plot with Telemetry Object\\nchrome\",\"modified\":1732413607031,\"location\":\"mine\",\"created\":1732413605018,\"persisted\":1732413607031},\"8c53d61f-b514-4535-be87-0fb20eb56576\":{\"name\":\"VIPER Rover Heading\",\"type\":\"generator\",\"identifier\":{\"key\":\"8c53d61f-b514-4535-be87-0fb20eb56576\",\"namespace\":\"\"},\"telemetry\":{\"period\":10,\"amplitude\":1,\"offset\":0,\"dataRateInHz\":1,\"phase\":0,\"randomness\":0,\"loadDelay\":0,\"infinityValues\":false,\"exceedFloat32\":false,\"staleness\":false},\"modified\":1732413605677,\"location\":\"mine\",\"created\":1732413605677,\"persisted\":1732413605677}}" }, { "name": "mct-tree-expanded", "value": "[]" + }, + { + "name": "mct-recent-objects", + "value": "[{\"objectPath\":[{\"identifier\":{\"key\":\"8c53d61f-b514-4535-be87-0fb20eb56576\",\"namespace\":\"\"},\"name\":\"VIPER Rover Heading\",\"type\":\"generator\",\"telemetry\":{\"period\":10,\"amplitude\":1,\"offset\":0,\"dataRateInHz\":1,\"phase\":0,\"randomness\":0,\"loadDelay\":0,\"infinityValues\":false,\"exceedFloat32\":false,\"staleness\":false},\"modified\":1732413605677,\"location\":\"mine\",\"created\":1732413605677,\"persisted\":1732413605677},{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"d3014736-1182-4b70-8122-6d0c6ef540e1\",\"namespace\":\"\"},{\"key\":\"8c53d61f-b514-4535-be87-0fb20eb56576\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413605677,\"created\":1732413603298,\"persisted\":1732413605677},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine/8c53d61f-b514-4535-be87-0fb20eb56576\",\"domainObject\":{\"identifier\":{\"key\":\"8c53d61f-b514-4535-be87-0fb20eb56576\",\"namespace\":\"\"},\"name\":\"VIPER Rover Heading\",\"type\":\"generator\",\"telemetry\":{\"period\":10,\"amplitude\":1,\"offset\":0,\"dataRateInHz\":1,\"phase\":0,\"randomness\":0,\"loadDelay\":0,\"infinityValues\":false,\"exceedFloat32\":false,\"staleness\":false},\"modified\":1732413605677,\"location\":\"mine\",\"created\":1732413605677,\"persisted\":1732413605677}},{\"objectPath\":[{\"identifier\":{\"key\":\"d3014736-1182-4b70-8122-6d0c6ef540e1\",\"namespace\":\"\"},\"name\":\"Overlay Plot with Telemetry Object\",\"type\":\"telemetry.plot.overlay\",\"composition\":[{\"key\":\"8c53d61f-b514-4535-be87-0fb20eb56576\",\"namespace\":\"\"}],\"configuration\":{\"series\":[{\"identifier\":{\"key\":\"8c53d61f-b514-4535-be87-0fb20eb56576\",\"namespace\":\"\"}}]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata @clock\\nGenerate Overlay Plot with Telemetry Object\\nchrome\",\"modified\":1732413607031,\"location\":\"mine\",\"created\":1732413605018,\"persisted\":1732413607031},{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"d3014736-1182-4b70-8122-6d0c6ef540e1\",\"namespace\":\"\"},{\"key\":\"8c53d61f-b514-4535-be87-0fb20eb56576\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413605677,\"created\":1732413603298,\"persisted\":1732413605677},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine/d3014736-1182-4b70-8122-6d0c6ef540e1\",\"domainObject\":{\"identifier\":{\"key\":\"d3014736-1182-4b70-8122-6d0c6ef540e1\",\"namespace\":\"\"},\"name\":\"Overlay Plot with Telemetry Object\",\"type\":\"telemetry.plot.overlay\",\"composition\":[{\"key\":\"8c53d61f-b514-4535-be87-0fb20eb56576\",\"namespace\":\"\"}],\"configuration\":{\"series\":[{\"identifier\":{\"key\":\"8c53d61f-b514-4535-be87-0fb20eb56576\",\"namespace\":\"\"}}]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata @clock\\nGenerate Overlay Plot with Telemetry Object\\nchrome\",\"modified\":1732413607031,\"location\":\"mine\",\"created\":1732413605018,\"persisted\":1732413607031}},{\"objectPath\":[{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"d3014736-1182-4b70-8122-6d0c6ef540e1\",\"namespace\":\"\"},{\"key\":\"8c53d61f-b514-4535-be87-0fb20eb56576\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413605677,\"created\":1732413603298,\"persisted\":1732413605677},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine\",\"domainObject\":{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"d3014736-1182-4b70-8122-6d0c6ef540e1\",\"namespace\":\"\"},{\"key\":\"8c53d61f-b514-4535-be87-0fb20eb56576\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413605677,\"created\":1732413603298,\"persisted\":1732413605677}}]" } ] } diff --git a/e2e/test-data/overlay_plot_with_delay_storage.json b/e2e/test-data/overlay_plot_with_delay_storage.json index ac3aeb65f0..4f13a19cad 100644 --- a/e2e/test-data/overlay_plot_with_delay_storage.json +++ b/e2e/test-data/overlay_plot_with_delay_storage.json @@ -6,7 +6,7 @@ "localStorage": [ { "name": "mct", - "value": "{\"mine\":{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"67ca2e0a-b37e-4eda-86a4-ccdbb228bbc0\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413601720,\"created\":1732413600920,\"persisted\":1732413601720},\"67ca2e0a-b37e-4eda-86a4-ccdbb228bbc0\":{\"identifier\":{\"key\":\"67ca2e0a-b37e-4eda-86a4-ccdbb228bbc0\",\"namespace\":\"\"},\"name\":\"Overlay Plot with 5s Delay\",\"type\":\"telemetry.plot.overlay\",\"composition\":[{\"key\":\"8f524b49-ad06-47f9-98e0-087b31a2f3e0\",\"namespace\":\"\"}],\"configuration\":{\"series\":[{\"identifier\":{\"key\":\"8f524b49-ad06-47f9-98e0-087b31a2f3e0\",\"namespace\":\"\"}}]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate Overlay Plot with 5s Delay\\nchrome\",\"modified\":1732413603020,\"location\":\"mine\",\"created\":1732413601720,\"persisted\":1732413603020},\"8f524b49-ad06-47f9-98e0-087b31a2f3e0\":{\"identifier\":{\"key\":\"8f524b49-ad06-47f9-98e0-087b31a2f3e0\",\"namespace\":\"\"},\"name\":\"VIPER Rover Heading\",\"type\":\"generator\",\"telemetry\":{\"period\":10,\"amplitude\":1,\"offset\":0,\"dataRateInHz\":1,\"phase\":0,\"randomness\":0,\"loadDelay\":5000,\"infinityValues\":false,\"exceedFloat32\":false,\"staleness\":false},\"modified\":1732413602920,\"location\":\"67ca2e0a-b37e-4eda-86a4-ccdbb228bbc0\",\"created\":1732413602420,\"persisted\":1732413602920}}" + "value": "{\"mine\":{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"f34f457e-d7f4-4fc4-ba71-52e19e925646\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413605044,\"created\":1732413603140,\"persisted\":1732413605044},\"f34f457e-d7f4-4fc4-ba71-52e19e925646\":{\"identifier\":{\"key\":\"f34f457e-d7f4-4fc4-ba71-52e19e925646\",\"namespace\":\"\"},\"name\":\"Overlay Plot with 5s Delay\",\"type\":\"telemetry.plot.overlay\",\"composition\":[{\"key\":\"c568fa66-62e0-4eee-97eb-cdbc7421e556\",\"namespace\":\"\"}],\"configuration\":{\"series\":[{\"identifier\":{\"key\":\"c568fa66-62e0-4eee-97eb-cdbc7421e556\",\"namespace\":\"\"}}]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata @clock\\nGenerate Overlay Plot with 5s Delay\\nchrome\",\"modified\":1732413606208.9,\"location\":\"mine\",\"created\":1732413605044,\"persisted\":1732413606208.9},\"c568fa66-62e0-4eee-97eb-cdbc7421e556\":{\"identifier\":{\"key\":\"c568fa66-62e0-4eee-97eb-cdbc7421e556\",\"namespace\":\"\"},\"name\":\"VIPER Rover Heading\",\"type\":\"generator\",\"telemetry\":{\"period\":10,\"amplitude\":1,\"offset\":0,\"dataRateInHz\":1,\"phase\":0,\"randomness\":0,\"loadDelay\":5000,\"infinityValues\":false,\"exceedFloat32\":false,\"staleness\":false},\"modified\":1732413606049,\"location\":\"f34f457e-d7f4-4fc4-ba71-52e19e925646\",\"created\":1732413605554,\"persisted\":1732413606049}}" }, { "name": "mct-tree-expanded", diff --git a/e2e/test-data/recycled_local_storage.json b/e2e/test-data/recycled_local_storage.json index 7da5a89a39..2f9ee4db7e 100644 --- a/e2e/test-data/recycled_local_storage.json +++ b/e2e/test-data/recycled_local_storage.json @@ -6,7 +6,7 @@ "localStorage": [ { "name": "mct", - "value": "{\"mine\":{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"f64bea3b-58a7-4586-8c05-8b651e5f0bfd\",\"namespace\":\"\"},{\"key\":\"2d02a680-eb7e-4645-bba2-dd298f76efb8\",\"namespace\":\"\"},{\"key\":\"72a5f66b-39a7-4f62-8c40-4a99a33d6a8e\",\"namespace\":\"\"},{\"key\":\"8e4d20f1-9a04-4de5-8db5-c7e08d27f70d\",\"namespace\":\"\"},{\"key\":\"3e294eae-6124-409b-a870-554d1bdcdd6f\",\"namespace\":\"\"},{\"key\":\"ec24d05d-5df5-4c96-9241-b73636cd19a9\",\"namespace\":\"\"},{\"key\":\"0ec517e8-6c11-4d98-89b5-c300fe61b304\",\"namespace\":\"\"},{\"key\":\"ffb49de1-af27-4318-a22f-59899988f4e9\",\"namespace\":\"\"},{\"key\":\"c6c65ad5-5c09-43c2-8a12-fdeb64d3e1a4\",\"namespace\":\"\"},{\"key\":\"62c4ade7-85ce-45bd-8cdb-25f0c58c8a28\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"persisted\":1704955298732,\"modified\":1704955298732},\"f64bea3b-58a7-4586-8c05-8b651e5f0bfd\":{\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"identifier\":{\"key\":\"f64bea3b-58a7-4586-8c05-8b651e5f0bfd\",\"namespace\":\"\"},\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"73f2d9ae-d1f3-4561-b7fc-ecd5df557249\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1652303755999,\"location\":\"mine\",\"persisted\":1652303756002},\"2d02a680-eb7e-4645-bba2-dd298f76efb8\":{\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"identifier\":{\"key\":\"2d02a680-eb7e-4645-bba2-dd298f76efb8\",\"namespace\":\"\"},\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"4291d80c-303c-4d8d-85e1-10f012b864fb\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1654538965702,\"location\":\"mine\",\"persisted\":1654538965702},\"72a5f66b-39a7-4f62-8c40-4a99a33d6a8e\":{\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"identifier\":{\"key\":\"72a5f66b-39a7-4f62-8c40-4a99a33d6a8e\",\"namespace\":\"\"},\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"2b6bf89f-877b-42b8-acc1-a9a575efdbe1\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1658610682787,\"location\":\"mine\",\"persisted\":1658610682787},\"8e4d20f1-9a04-4de5-8db5-c7e08d27f70d\":{\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"identifier\":{\"key\":\"8e4d20f1-9a04-4de5-8db5-c7e08d27f70d\",\"namespace\":\"\"},\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"b9a9c413-4b94-401d-b0c7-5e404f182616\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1658618261112,\"location\":\"mine\",\"persisted\":1658618261112},\"3e294eae-6124-409b-a870-554d1bdcdd6f\":{\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"identifier\":{\"key\":\"3e294eae-6124-409b-a870-554d1bdcdd6f\",\"namespace\":\"\"},\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"108043b1-9c88-4e1d-8deb-fbf2cdb528f9\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1658618890910,\"location\":\"mine\",\"persisted\":1658618890910},\"ec24d05d-5df5-4c96-9241-b73636cd19a9\":{\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"identifier\":{\"key\":\"ec24d05d-5df5-4c96-9241-b73636cd19a9\",\"namespace\":\"\"},\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"4062bd9b-b788-43dd-ab0a-8fa10a78d4b3\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1658619295363,\"location\":\"mine\",\"persisted\":1658619295363},\"0ec517e8-6c11-4d98-89b5-c300fe61b304\":{\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"identifier\":{\"key\":\"0ec517e8-6c11-4d98-89b5-c300fe61b304\",\"namespace\":\"\"},\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"2f1585da-6f7e-4ccd-8a20-590fdf177b5d\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1689710689550,\"location\":\"mine\",\"created\":1689710689550,\"persisted\":1689710689550},\"ffb49de1-af27-4318-a22f-59899988f4e9\":{\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"identifier\":{\"key\":\"ffb49de1-af27-4318-a22f-59899988f4e9\",\"namespace\":\"\"},\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"0a04f110-e5c4-4503-9276-6e8f783d5bd5\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1694110416938,\"location\":\"mine\",\"created\":1694110416938,\"persisted\":1694110416938},\"c6c65ad5-5c09-43c2-8a12-fdeb64d3e1a4\":{\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"identifier\":{\"key\":\"c6c65ad5-5c09-43c2-8a12-fdeb64d3e1a4\",\"namespace\":\"\"},\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"6c8bdbec-41f5-4138-a88f-ae6ebdbc9a90\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1694112912985,\"location\":\"mine\",\"created\":1694112912985,\"persisted\":1694112912985},\"62c4ade7-85ce-45bd-8cdb-25f0c58c8a28\":{\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"identifier\":{\"key\":\"62c4ade7-85ce-45bd-8cdb-25f0c58c8a28\",\"namespace\":\"\"},\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"6776a2ec-fa49-4b06-80ed-a6eaf4f86f56\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1704955298729,\"location\":\"mine\",\"created\":1704955298729,\"persisted\":1704955298729}}" + "value": "{\"mine\":{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"f64bea3b-58a7-4586-8c05-8b651e5f0bfd\",\"namespace\":\"\"},{\"key\":\"2d02a680-eb7e-4645-bba2-dd298f76efb8\",\"namespace\":\"\"},{\"key\":\"72a5f66b-39a7-4f62-8c40-4a99a33d6a8e\",\"namespace\":\"\"},{\"key\":\"8e4d20f1-9a04-4de5-8db5-c7e08d27f70d\",\"namespace\":\"\"},{\"key\":\"3e294eae-6124-409b-a870-554d1bdcdd6f\",\"namespace\":\"\"},{\"key\":\"ec24d05d-5df5-4c96-9241-b73636cd19a9\",\"namespace\":\"\"},{\"key\":\"0ec517e8-6c11-4d98-89b5-c300fe61b304\",\"namespace\":\"\"},{\"key\":\"ffb49de1-af27-4318-a22f-59899988f4e9\",\"namespace\":\"\"},{\"key\":\"c6c65ad5-5c09-43c2-8a12-fdeb64d3e1a4\",\"namespace\":\"\"},{\"key\":\"62c4ade7-85ce-45bd-8cdb-25f0c58c8a28\",\"namespace\":\"\"},{\"key\":\"c1717964-ffed-47aa-9ed9-647ba5a3db67\",\"namespace\":\"\"},{\"key\":\"10581641-5de3-4606-95aa-04cd811f2f53\",\"namespace\":\"\"},{\"key\":\"d9d79500-916d-4ff2-a7ea-6cf300c85ce3\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"persisted\":1721850933441,\"modified\":1721850933441},\"f64bea3b-58a7-4586-8c05-8b651e5f0bfd\":{\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"identifier\":{\"key\":\"f64bea3b-58a7-4586-8c05-8b651e5f0bfd\",\"namespace\":\"\"},\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"73f2d9ae-d1f3-4561-b7fc-ecd5df557249\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1652303755999,\"location\":\"mine\",\"persisted\":1652303756002},\"2d02a680-eb7e-4645-bba2-dd298f76efb8\":{\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"identifier\":{\"key\":\"2d02a680-eb7e-4645-bba2-dd298f76efb8\",\"namespace\":\"\"},\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"4291d80c-303c-4d8d-85e1-10f012b864fb\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1654538965702,\"location\":\"mine\",\"persisted\":1654538965702},\"72a5f66b-39a7-4f62-8c40-4a99a33d6a8e\":{\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"identifier\":{\"key\":\"72a5f66b-39a7-4f62-8c40-4a99a33d6a8e\",\"namespace\":\"\"},\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"2b6bf89f-877b-42b8-acc1-a9a575efdbe1\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1658610682787,\"location\":\"mine\",\"persisted\":1658610682787},\"8e4d20f1-9a04-4de5-8db5-c7e08d27f70d\":{\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"identifier\":{\"key\":\"8e4d20f1-9a04-4de5-8db5-c7e08d27f70d\",\"namespace\":\"\"},\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"b9a9c413-4b94-401d-b0c7-5e404f182616\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1658618261112,\"location\":\"mine\",\"persisted\":1658618261112},\"3e294eae-6124-409b-a870-554d1bdcdd6f\":{\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"identifier\":{\"key\":\"3e294eae-6124-409b-a870-554d1bdcdd6f\",\"namespace\":\"\"},\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"108043b1-9c88-4e1d-8deb-fbf2cdb528f9\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1658618890910,\"location\":\"mine\",\"persisted\":1658618890910},\"ec24d05d-5df5-4c96-9241-b73636cd19a9\":{\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"identifier\":{\"key\":\"ec24d05d-5df5-4c96-9241-b73636cd19a9\",\"namespace\":\"\"},\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"4062bd9b-b788-43dd-ab0a-8fa10a78d4b3\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1658619295363,\"location\":\"mine\",\"persisted\":1658619295363},\"0ec517e8-6c11-4d98-89b5-c300fe61b304\":{\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"identifier\":{\"key\":\"0ec517e8-6c11-4d98-89b5-c300fe61b304\",\"namespace\":\"\"},\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"2f1585da-6f7e-4ccd-8a20-590fdf177b5d\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1689710689550,\"location\":\"mine\",\"created\":1689710689550,\"persisted\":1689710689550},\"ffb49de1-af27-4318-a22f-59899988f4e9\":{\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"identifier\":{\"key\":\"ffb49de1-af27-4318-a22f-59899988f4e9\",\"namespace\":\"\"},\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"0a04f110-e5c4-4503-9276-6e8f783d5bd5\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1694110416938,\"location\":\"mine\",\"created\":1694110416938,\"persisted\":1694110416938},\"c6c65ad5-5c09-43c2-8a12-fdeb64d3e1a4\":{\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"identifier\":{\"key\":\"c6c65ad5-5c09-43c2-8a12-fdeb64d3e1a4\",\"namespace\":\"\"},\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"6c8bdbec-41f5-4138-a88f-ae6ebdbc9a90\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1694112912985,\"location\":\"mine\",\"created\":1694112912985,\"persisted\":1694112912985},\"62c4ade7-85ce-45bd-8cdb-25f0c58c8a28\":{\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"identifier\":{\"key\":\"62c4ade7-85ce-45bd-8cdb-25f0c58c8a28\",\"namespace\":\"\"},\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"6776a2ec-fa49-4b06-80ed-a6eaf4f86f56\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1704955298729,\"location\":\"mine\",\"created\":1704955298729,\"persisted\":1704955298729},\"c1717964-ffed-47aa-9ed9-647ba5a3db67\":{\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"identifier\":{\"key\":\"c1717964-ffed-47aa-9ed9-647ba5a3db67\",\"namespace\":\"\"},\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"9a72ce62-012c-4a81-8f2c-51db5410de76\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1721850626897,\"location\":\"mine\",\"created\":1721850626897,\"persisted\":1721850626897},\"10581641-5de3-4606-95aa-04cd811f2f53\":{\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"identifier\":{\"key\":\"10581641-5de3-4606-95aa-04cd811f2f53\",\"namespace\":\"\"},\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"71e8050e-e063-4a35-b891-f38ddf63fa6d\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1721850725791,\"location\":\"mine\",\"created\":1721850725791,\"persisted\":1721850725791},\"d9d79500-916d-4ff2-a7ea-6cf300c85ce3\":{\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"identifier\":{\"key\":\"d9d79500-916d-4ff2-a7ea-6cf300c85ce3\",\"namespace\":\"\"},\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"91ebe1a1-dcac-49b0-9985-d3e32cef5260\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1721850933438,\"location\":\"mine\",\"created\":1721850933438,\"persisted\":1721850933439}}" }, { "name": "mct-tree-expanded", @@ -18,7 +18,7 @@ }, { "name": "mct-recent-objects", - "value": "[{\"objectPath\":[{\"identifier\":{\"key\":\"62c4ade7-85ce-45bd-8cdb-25f0c58c8a28\",\"namespace\":\"\"},\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"6776a2ec-fa49-4b06-80ed-a6eaf4f86f56\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1704955298729,\"location\":\"mine\",\"created\":1704955298729,\"persisted\":1704955298729},{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"f64bea3b-58a7-4586-8c05-8b651e5f0bfd\",\"namespace\":\"\"},{\"key\":\"2d02a680-eb7e-4645-bba2-dd298f76efb8\",\"namespace\":\"\"},{\"key\":\"72a5f66b-39a7-4f62-8c40-4a99a33d6a8e\",\"namespace\":\"\"},{\"key\":\"8e4d20f1-9a04-4de5-8db5-c7e08d27f70d\",\"namespace\":\"\"},{\"key\":\"3e294eae-6124-409b-a870-554d1bdcdd6f\",\"namespace\":\"\"},{\"key\":\"ec24d05d-5df5-4c96-9241-b73636cd19a9\",\"namespace\":\"\"},{\"key\":\"0ec517e8-6c11-4d98-89b5-c300fe61b304\",\"namespace\":\"\"},{\"key\":\"ffb49de1-af27-4318-a22f-59899988f4e9\",\"namespace\":\"\"},{\"key\":\"c6c65ad5-5c09-43c2-8a12-fdeb64d3e1a4\",\"namespace\":\"\"},{\"key\":\"62c4ade7-85ce-45bd-8cdb-25f0c58c8a28\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"persisted\":1704955298732,\"modified\":1704955298732},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine/62c4ade7-85ce-45bd-8cdb-25f0c58c8a28\",\"domainObject\":{\"identifier\":{\"key\":\"62c4ade7-85ce-45bd-8cdb-25f0c58c8a28\",\"namespace\":\"\"},\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"6776a2ec-fa49-4b06-80ed-a6eaf4f86f56\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1704955298729,\"location\":\"mine\",\"created\":1704955298729,\"persisted\":1704955298729}},{\"objectPath\":[{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"f64bea3b-58a7-4586-8c05-8b651e5f0bfd\",\"namespace\":\"\"},{\"key\":\"2d02a680-eb7e-4645-bba2-dd298f76efb8\",\"namespace\":\"\"},{\"key\":\"72a5f66b-39a7-4f62-8c40-4a99a33d6a8e\",\"namespace\":\"\"},{\"key\":\"8e4d20f1-9a04-4de5-8db5-c7e08d27f70d\",\"namespace\":\"\"},{\"key\":\"3e294eae-6124-409b-a870-554d1bdcdd6f\",\"namespace\":\"\"},{\"key\":\"ec24d05d-5df5-4c96-9241-b73636cd19a9\",\"namespace\":\"\"},{\"key\":\"0ec517e8-6c11-4d98-89b5-c300fe61b304\",\"namespace\":\"\"},{\"key\":\"ffb49de1-af27-4318-a22f-59899988f4e9\",\"namespace\":\"\"},{\"key\":\"c6c65ad5-5c09-43c2-8a12-fdeb64d3e1a4\",\"namespace\":\"\"},{\"key\":\"62c4ade7-85ce-45bd-8cdb-25f0c58c8a28\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"persisted\":1704955298732,\"modified\":1704955298732},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine\",\"domainObject\":{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"f64bea3b-58a7-4586-8c05-8b651e5f0bfd\",\"namespace\":\"\"},{\"key\":\"2d02a680-eb7e-4645-bba2-dd298f76efb8\",\"namespace\":\"\"},{\"key\":\"72a5f66b-39a7-4f62-8c40-4a99a33d6a8e\",\"namespace\":\"\"},{\"key\":\"8e4d20f1-9a04-4de5-8db5-c7e08d27f70d\",\"namespace\":\"\"},{\"key\":\"3e294eae-6124-409b-a870-554d1bdcdd6f\",\"namespace\":\"\"},{\"key\":\"ec24d05d-5df5-4c96-9241-b73636cd19a9\",\"namespace\":\"\"},{\"key\":\"0ec517e8-6c11-4d98-89b5-c300fe61b304\",\"namespace\":\"\"},{\"key\":\"ffb49de1-af27-4318-a22f-59899988f4e9\",\"namespace\":\"\"},{\"key\":\"c6c65ad5-5c09-43c2-8a12-fdeb64d3e1a4\",\"namespace\":\"\"},{\"key\":\"62c4ade7-85ce-45bd-8cdb-25f0c58c8a28\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"persisted\":1704955298732,\"modified\":1704955298732}},{\"objectPath\":[{\"identifier\":{\"key\":\"c6c65ad5-5c09-43c2-8a12-fdeb64d3e1a4\",\"namespace\":\"\"},\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"6c8bdbec-41f5-4138-a88f-ae6ebdbc9a90\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1694112912985,\"location\":\"mine\",\"created\":1694112912985,\"persisted\":1694112912985},{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"f64bea3b-58a7-4586-8c05-8b651e5f0bfd\",\"namespace\":\"\"},{\"key\":\"2d02a680-eb7e-4645-bba2-dd298f76efb8\",\"namespace\":\"\"},{\"key\":\"72a5f66b-39a7-4f62-8c40-4a99a33d6a8e\",\"namespace\":\"\"},{\"key\":\"8e4d20f1-9a04-4de5-8db5-c7e08d27f70d\",\"namespace\":\"\"},{\"key\":\"3e294eae-6124-409b-a870-554d1bdcdd6f\",\"namespace\":\"\"},{\"key\":\"ec24d05d-5df5-4c96-9241-b73636cd19a9\",\"namespace\":\"\"},{\"key\":\"0ec517e8-6c11-4d98-89b5-c300fe61b304\",\"namespace\":\"\"},{\"key\":\"ffb49de1-af27-4318-a22f-59899988f4e9\",\"namespace\":\"\"},{\"key\":\"c6c65ad5-5c09-43c2-8a12-fdeb64d3e1a4\",\"namespace\":\"\"},{\"key\":\"62c4ade7-85ce-45bd-8cdb-25f0c58c8a28\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"persisted\":1704955298732,\"modified\":1704955298732},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine/c6c65ad5-5c09-43c2-8a12-fdeb64d3e1a4\",\"domainObject\":{\"identifier\":{\"key\":\"c6c65ad5-5c09-43c2-8a12-fdeb64d3e1a4\",\"namespace\":\"\"},\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"6c8bdbec-41f5-4138-a88f-ae6ebdbc9a90\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1694112912985,\"location\":\"mine\",\"created\":1694112912985,\"persisted\":1694112912985}},{\"objectPath\":[{\"identifier\":{\"key\":\"ffb49de1-af27-4318-a22f-59899988f4e9\",\"namespace\":\"\"},\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"0a04f110-e5c4-4503-9276-6e8f783d5bd5\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1694110416938,\"location\":\"mine\",\"created\":1694110416938,\"persisted\":1694110416938},{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"f64bea3b-58a7-4586-8c05-8b651e5f0bfd\",\"namespace\":\"\"},{\"key\":\"2d02a680-eb7e-4645-bba2-dd298f76efb8\",\"namespace\":\"\"},{\"key\":\"72a5f66b-39a7-4f62-8c40-4a99a33d6a8e\",\"namespace\":\"\"},{\"key\":\"8e4d20f1-9a04-4de5-8db5-c7e08d27f70d\",\"namespace\":\"\"},{\"key\":\"3e294eae-6124-409b-a870-554d1bdcdd6f\",\"namespace\":\"\"},{\"key\":\"ec24d05d-5df5-4c96-9241-b73636cd19a9\",\"namespace\":\"\"},{\"key\":\"0ec517e8-6c11-4d98-89b5-c300fe61b304\",\"namespace\":\"\"},{\"key\":\"ffb49de1-af27-4318-a22f-59899988f4e9\",\"namespace\":\"\"},{\"key\":\"c6c65ad5-5c09-43c2-8a12-fdeb64d3e1a4\",\"namespace\":\"\"},{\"key\":\"62c4ade7-85ce-45bd-8cdb-25f0c58c8a28\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"persisted\":1704955298732,\"modified\":1704955298732},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine/ffb49de1-af27-4318-a22f-59899988f4e9\",\"domainObject\":{\"identifier\":{\"key\":\"ffb49de1-af27-4318-a22f-59899988f4e9\",\"namespace\":\"\"},\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"0a04f110-e5c4-4503-9276-6e8f783d5bd5\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1694110416938,\"location\":\"mine\",\"created\":1694110416938,\"persisted\":1694110416938}},{\"objectPath\":[{\"identifier\":{\"key\":\"0ec517e8-6c11-4d98-89b5-c300fe61b304\",\"namespace\":\"\"},\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"2f1585da-6f7e-4ccd-8a20-590fdf177b5d\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1689710689550,\"location\":\"mine\",\"created\":1689710689550,\"persisted\":1689710689550},{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"f64bea3b-58a7-4586-8c05-8b651e5f0bfd\",\"namespace\":\"\"},{\"key\":\"2d02a680-eb7e-4645-bba2-dd298f76efb8\",\"namespace\":\"\"},{\"key\":\"72a5f66b-39a7-4f62-8c40-4a99a33d6a8e\",\"namespace\":\"\"},{\"key\":\"8e4d20f1-9a04-4de5-8db5-c7e08d27f70d\",\"namespace\":\"\"},{\"key\":\"3e294eae-6124-409b-a870-554d1bdcdd6f\",\"namespace\":\"\"},{\"key\":\"ec24d05d-5df5-4c96-9241-b73636cd19a9\",\"namespace\":\"\"},{\"key\":\"0ec517e8-6c11-4d98-89b5-c300fe61b304\",\"namespace\":\"\"},{\"key\":\"ffb49de1-af27-4318-a22f-59899988f4e9\",\"namespace\":\"\"},{\"key\":\"c6c65ad5-5c09-43c2-8a12-fdeb64d3e1a4\",\"namespace\":\"\"},{\"key\":\"62c4ade7-85ce-45bd-8cdb-25f0c58c8a28\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"persisted\":1704955298732,\"modified\":1704955298732},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine/0ec517e8-6c11-4d98-89b5-c300fe61b304\",\"domainObject\":{\"identifier\":{\"key\":\"0ec517e8-6c11-4d98-89b5-c300fe61b304\",\"namespace\":\"\"},\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"2f1585da-6f7e-4ccd-8a20-590fdf177b5d\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1689710689550,\"location\":\"mine\",\"created\":1689710689550,\"persisted\":1689710689550}}]" + "value": "[{\"objectPath\":[{\"identifier\":{\"key\":\"d9d79500-916d-4ff2-a7ea-6cf300c85ce3\",\"namespace\":\"\"},\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"91ebe1a1-dcac-49b0-9985-d3e32cef5260\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1721850933438,\"location\":\"mine\",\"created\":1721850933438,\"persisted\":1721850933439},{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"f64bea3b-58a7-4586-8c05-8b651e5f0bfd\",\"namespace\":\"\"},{\"key\":\"2d02a680-eb7e-4645-bba2-dd298f76efb8\",\"namespace\":\"\"},{\"key\":\"72a5f66b-39a7-4f62-8c40-4a99a33d6a8e\",\"namespace\":\"\"},{\"key\":\"8e4d20f1-9a04-4de5-8db5-c7e08d27f70d\",\"namespace\":\"\"},{\"key\":\"3e294eae-6124-409b-a870-554d1bdcdd6f\",\"namespace\":\"\"},{\"key\":\"ec24d05d-5df5-4c96-9241-b73636cd19a9\",\"namespace\":\"\"},{\"key\":\"0ec517e8-6c11-4d98-89b5-c300fe61b304\",\"namespace\":\"\"},{\"key\":\"ffb49de1-af27-4318-a22f-59899988f4e9\",\"namespace\":\"\"},{\"key\":\"c6c65ad5-5c09-43c2-8a12-fdeb64d3e1a4\",\"namespace\":\"\"},{\"key\":\"62c4ade7-85ce-45bd-8cdb-25f0c58c8a28\",\"namespace\":\"\"},{\"key\":\"c1717964-ffed-47aa-9ed9-647ba5a3db67\",\"namespace\":\"\"},{\"key\":\"10581641-5de3-4606-95aa-04cd811f2f53\",\"namespace\":\"\"},{\"key\":\"d9d79500-916d-4ff2-a7ea-6cf300c85ce3\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"persisted\":1721850933441,\"modified\":1721850933441},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine/d9d79500-916d-4ff2-a7ea-6cf300c85ce3\",\"domainObject\":{\"identifier\":{\"key\":\"d9d79500-916d-4ff2-a7ea-6cf300c85ce3\",\"namespace\":\"\"},\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"91ebe1a1-dcac-49b0-9985-d3e32cef5260\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1721850933438,\"location\":\"mine\",\"created\":1721850933438,\"persisted\":1721850933439}},{\"objectPath\":[{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"f64bea3b-58a7-4586-8c05-8b651e5f0bfd\",\"namespace\":\"\"},{\"key\":\"2d02a680-eb7e-4645-bba2-dd298f76efb8\",\"namespace\":\"\"},{\"key\":\"72a5f66b-39a7-4f62-8c40-4a99a33d6a8e\",\"namespace\":\"\"},{\"key\":\"8e4d20f1-9a04-4de5-8db5-c7e08d27f70d\",\"namespace\":\"\"},{\"key\":\"3e294eae-6124-409b-a870-554d1bdcdd6f\",\"namespace\":\"\"},{\"key\":\"ec24d05d-5df5-4c96-9241-b73636cd19a9\",\"namespace\":\"\"},{\"key\":\"0ec517e8-6c11-4d98-89b5-c300fe61b304\",\"namespace\":\"\"},{\"key\":\"ffb49de1-af27-4318-a22f-59899988f4e9\",\"namespace\":\"\"},{\"key\":\"c6c65ad5-5c09-43c2-8a12-fdeb64d3e1a4\",\"namespace\":\"\"},{\"key\":\"62c4ade7-85ce-45bd-8cdb-25f0c58c8a28\",\"namespace\":\"\"},{\"key\":\"c1717964-ffed-47aa-9ed9-647ba5a3db67\",\"namespace\":\"\"},{\"key\":\"10581641-5de3-4606-95aa-04cd811f2f53\",\"namespace\":\"\"},{\"key\":\"d9d79500-916d-4ff2-a7ea-6cf300c85ce3\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"persisted\":1721850933441,\"modified\":1721850933441},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine\",\"domainObject\":{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"f64bea3b-58a7-4586-8c05-8b651e5f0bfd\",\"namespace\":\"\"},{\"key\":\"2d02a680-eb7e-4645-bba2-dd298f76efb8\",\"namespace\":\"\"},{\"key\":\"72a5f66b-39a7-4f62-8c40-4a99a33d6a8e\",\"namespace\":\"\"},{\"key\":\"8e4d20f1-9a04-4de5-8db5-c7e08d27f70d\",\"namespace\":\"\"},{\"key\":\"3e294eae-6124-409b-a870-554d1bdcdd6f\",\"namespace\":\"\"},{\"key\":\"ec24d05d-5df5-4c96-9241-b73636cd19a9\",\"namespace\":\"\"},{\"key\":\"0ec517e8-6c11-4d98-89b5-c300fe61b304\",\"namespace\":\"\"},{\"key\":\"ffb49de1-af27-4318-a22f-59899988f4e9\",\"namespace\":\"\"},{\"key\":\"c6c65ad5-5c09-43c2-8a12-fdeb64d3e1a4\",\"namespace\":\"\"},{\"key\":\"62c4ade7-85ce-45bd-8cdb-25f0c58c8a28\",\"namespace\":\"\"},{\"key\":\"c1717964-ffed-47aa-9ed9-647ba5a3db67\",\"namespace\":\"\"},{\"key\":\"10581641-5de3-4606-95aa-04cd811f2f53\",\"namespace\":\"\"},{\"key\":\"d9d79500-916d-4ff2-a7ea-6cf300c85ce3\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"persisted\":1721850933441,\"modified\":1721850933441}},{\"objectPath\":[{\"identifier\":{\"key\":\"10581641-5de3-4606-95aa-04cd811f2f53\",\"namespace\":\"\"},\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"71e8050e-e063-4a35-b891-f38ddf63fa6d\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1721850725791,\"location\":\"mine\",\"created\":1721850725791,\"persisted\":1721850725791},{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"f64bea3b-58a7-4586-8c05-8b651e5f0bfd\",\"namespace\":\"\"},{\"key\":\"2d02a680-eb7e-4645-bba2-dd298f76efb8\",\"namespace\":\"\"},{\"key\":\"72a5f66b-39a7-4f62-8c40-4a99a33d6a8e\",\"namespace\":\"\"},{\"key\":\"8e4d20f1-9a04-4de5-8db5-c7e08d27f70d\",\"namespace\":\"\"},{\"key\":\"3e294eae-6124-409b-a870-554d1bdcdd6f\",\"namespace\":\"\"},{\"key\":\"ec24d05d-5df5-4c96-9241-b73636cd19a9\",\"namespace\":\"\"},{\"key\":\"0ec517e8-6c11-4d98-89b5-c300fe61b304\",\"namespace\":\"\"},{\"key\":\"ffb49de1-af27-4318-a22f-59899988f4e9\",\"namespace\":\"\"},{\"key\":\"c6c65ad5-5c09-43c2-8a12-fdeb64d3e1a4\",\"namespace\":\"\"},{\"key\":\"62c4ade7-85ce-45bd-8cdb-25f0c58c8a28\",\"namespace\":\"\"},{\"key\":\"c1717964-ffed-47aa-9ed9-647ba5a3db67\",\"namespace\":\"\"},{\"key\":\"10581641-5de3-4606-95aa-04cd811f2f53\",\"namespace\":\"\"},{\"key\":\"d9d79500-916d-4ff2-a7ea-6cf300c85ce3\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"persisted\":1721850933441,\"modified\":1721850933441},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine/10581641-5de3-4606-95aa-04cd811f2f53\",\"domainObject\":{\"identifier\":{\"key\":\"10581641-5de3-4606-95aa-04cd811f2f53\",\"namespace\":\"\"},\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"71e8050e-e063-4a35-b891-f38ddf63fa6d\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1721850725791,\"location\":\"mine\",\"created\":1721850725791,\"persisted\":1721850725791}},{\"objectPath\":[{\"identifier\":{\"key\":\"c1717964-ffed-47aa-9ed9-647ba5a3db67\",\"namespace\":\"\"},\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"9a72ce62-012c-4a81-8f2c-51db5410de76\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1721850626897,\"location\":\"mine\",\"created\":1721850626897,\"persisted\":1721850626897},{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"f64bea3b-58a7-4586-8c05-8b651e5f0bfd\",\"namespace\":\"\"},{\"key\":\"2d02a680-eb7e-4645-bba2-dd298f76efb8\",\"namespace\":\"\"},{\"key\":\"72a5f66b-39a7-4f62-8c40-4a99a33d6a8e\",\"namespace\":\"\"},{\"key\":\"8e4d20f1-9a04-4de5-8db5-c7e08d27f70d\",\"namespace\":\"\"},{\"key\":\"3e294eae-6124-409b-a870-554d1bdcdd6f\",\"namespace\":\"\"},{\"key\":\"ec24d05d-5df5-4c96-9241-b73636cd19a9\",\"namespace\":\"\"},{\"key\":\"0ec517e8-6c11-4d98-89b5-c300fe61b304\",\"namespace\":\"\"},{\"key\":\"ffb49de1-af27-4318-a22f-59899988f4e9\",\"namespace\":\"\"},{\"key\":\"c6c65ad5-5c09-43c2-8a12-fdeb64d3e1a4\",\"namespace\":\"\"},{\"key\":\"62c4ade7-85ce-45bd-8cdb-25f0c58c8a28\",\"namespace\":\"\"},{\"key\":\"c1717964-ffed-47aa-9ed9-647ba5a3db67\",\"namespace\":\"\"},{\"key\":\"10581641-5de3-4606-95aa-04cd811f2f53\",\"namespace\":\"\"},{\"key\":\"d9d79500-916d-4ff2-a7ea-6cf300c85ce3\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"persisted\":1721850933441,\"modified\":1721850933441},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine/c1717964-ffed-47aa-9ed9-647ba5a3db67\",\"domainObject\":{\"identifier\":{\"key\":\"c1717964-ffed-47aa-9ed9-647ba5a3db67\",\"namespace\":\"\"},\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"9a72ce62-012c-4a81-8f2c-51db5410de76\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1721850626897,\"location\":\"mine\",\"created\":1721850626897,\"persisted\":1721850626897}},{\"objectPath\":[{\"identifier\":{\"key\":\"62c4ade7-85ce-45bd-8cdb-25f0c58c8a28\",\"namespace\":\"\"},\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"6776a2ec-fa49-4b06-80ed-a6eaf4f86f56\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1704955298729,\"location\":\"mine\",\"created\":1704955298729,\"persisted\":1704955298729},{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"f64bea3b-58a7-4586-8c05-8b651e5f0bfd\",\"namespace\":\"\"},{\"key\":\"2d02a680-eb7e-4645-bba2-dd298f76efb8\",\"namespace\":\"\"},{\"key\":\"72a5f66b-39a7-4f62-8c40-4a99a33d6a8e\",\"namespace\":\"\"},{\"key\":\"8e4d20f1-9a04-4de5-8db5-c7e08d27f70d\",\"namespace\":\"\"},{\"key\":\"3e294eae-6124-409b-a870-554d1bdcdd6f\",\"namespace\":\"\"},{\"key\":\"ec24d05d-5df5-4c96-9241-b73636cd19a9\",\"namespace\":\"\"},{\"key\":\"0ec517e8-6c11-4d98-89b5-c300fe61b304\",\"namespace\":\"\"},{\"key\":\"ffb49de1-af27-4318-a22f-59899988f4e9\",\"namespace\":\"\"},{\"key\":\"c6c65ad5-5c09-43c2-8a12-fdeb64d3e1a4\",\"namespace\":\"\"},{\"key\":\"62c4ade7-85ce-45bd-8cdb-25f0c58c8a28\",\"namespace\":\"\"},{\"key\":\"c1717964-ffed-47aa-9ed9-647ba5a3db67\",\"namespace\":\"\"},{\"key\":\"10581641-5de3-4606-95aa-04cd811f2f53\",\"namespace\":\"\"},{\"key\":\"d9d79500-916d-4ff2-a7ea-6cf300c85ce3\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"persisted\":1721850933441,\"modified\":1721850933441},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine/62c4ade7-85ce-45bd-8cdb-25f0c58c8a28\",\"domainObject\":{\"identifier\":{\"key\":\"62c4ade7-85ce-45bd-8cdb-25f0c58c8a28\",\"namespace\":\"\"},\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"6776a2ec-fa49-4b06-80ed-a6eaf4f86f56\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1704955298729,\"location\":\"mine\",\"created\":1704955298729,\"persisted\":1704955298729}},{\"objectPath\":[{\"identifier\":{\"key\":\"c6c65ad5-5c09-43c2-8a12-fdeb64d3e1a4\",\"namespace\":\"\"},\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"6c8bdbec-41f5-4138-a88f-ae6ebdbc9a90\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1694112912985,\"location\":\"mine\",\"created\":1694112912985,\"persisted\":1694112912985},{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"f64bea3b-58a7-4586-8c05-8b651e5f0bfd\",\"namespace\":\"\"},{\"key\":\"2d02a680-eb7e-4645-bba2-dd298f76efb8\",\"namespace\":\"\"},{\"key\":\"72a5f66b-39a7-4f62-8c40-4a99a33d6a8e\",\"namespace\":\"\"},{\"key\":\"8e4d20f1-9a04-4de5-8db5-c7e08d27f70d\",\"namespace\":\"\"},{\"key\":\"3e294eae-6124-409b-a870-554d1bdcdd6f\",\"namespace\":\"\"},{\"key\":\"ec24d05d-5df5-4c96-9241-b73636cd19a9\",\"namespace\":\"\"},{\"key\":\"0ec517e8-6c11-4d98-89b5-c300fe61b304\",\"namespace\":\"\"},{\"key\":\"ffb49de1-af27-4318-a22f-59899988f4e9\",\"namespace\":\"\"},{\"key\":\"c6c65ad5-5c09-43c2-8a12-fdeb64d3e1a4\",\"namespace\":\"\"},{\"key\":\"62c4ade7-85ce-45bd-8cdb-25f0c58c8a28\",\"namespace\":\"\"},{\"key\":\"c1717964-ffed-47aa-9ed9-647ba5a3db67\",\"namespace\":\"\"},{\"key\":\"10581641-5de3-4606-95aa-04cd811f2f53\",\"namespace\":\"\"},{\"key\":\"d9d79500-916d-4ff2-a7ea-6cf300c85ce3\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"persisted\":1721850933441,\"modified\":1721850933441},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine/c6c65ad5-5c09-43c2-8a12-fdeb64d3e1a4\",\"domainObject\":{\"identifier\":{\"key\":\"c6c65ad5-5c09-43c2-8a12-fdeb64d3e1a4\",\"namespace\":\"\"},\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"6c8bdbec-41f5-4138-a88f-ae6ebdbc9a90\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1694112912985,\"location\":\"mine\",\"created\":1694112912985,\"persisted\":1694112912985}},{\"objectPath\":[{\"identifier\":{\"key\":\"ffb49de1-af27-4318-a22f-59899988f4e9\",\"namespace\":\"\"},\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"0a04f110-e5c4-4503-9276-6e8f783d5bd5\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1694110416938,\"location\":\"mine\",\"created\":1694110416938,\"persisted\":1694110416938},{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"f64bea3b-58a7-4586-8c05-8b651e5f0bfd\",\"namespace\":\"\"},{\"key\":\"2d02a680-eb7e-4645-bba2-dd298f76efb8\",\"namespace\":\"\"},{\"key\":\"72a5f66b-39a7-4f62-8c40-4a99a33d6a8e\",\"namespace\":\"\"},{\"key\":\"8e4d20f1-9a04-4de5-8db5-c7e08d27f70d\",\"namespace\":\"\"},{\"key\":\"3e294eae-6124-409b-a870-554d1bdcdd6f\",\"namespace\":\"\"},{\"key\":\"ec24d05d-5df5-4c96-9241-b73636cd19a9\",\"namespace\":\"\"},{\"key\":\"0ec517e8-6c11-4d98-89b5-c300fe61b304\",\"namespace\":\"\"},{\"key\":\"ffb49de1-af27-4318-a22f-59899988f4e9\",\"namespace\":\"\"},{\"key\":\"c6c65ad5-5c09-43c2-8a12-fdeb64d3e1a4\",\"namespace\":\"\"},{\"key\":\"62c4ade7-85ce-45bd-8cdb-25f0c58c8a28\",\"namespace\":\"\"},{\"key\":\"c1717964-ffed-47aa-9ed9-647ba5a3db67\",\"namespace\":\"\"},{\"key\":\"10581641-5de3-4606-95aa-04cd811f2f53\",\"namespace\":\"\"},{\"key\":\"d9d79500-916d-4ff2-a7ea-6cf300c85ce3\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"persisted\":1721850933441,\"modified\":1721850933441},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine/ffb49de1-af27-4318-a22f-59899988f4e9\",\"domainObject\":{\"identifier\":{\"key\":\"ffb49de1-af27-4318-a22f-59899988f4e9\",\"namespace\":\"\"},\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"0a04f110-e5c4-4503-9276-6e8f783d5bd5\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1694110416938,\"location\":\"mine\",\"created\":1694110416938,\"persisted\":1694110416938}},{\"objectPath\":[{\"identifier\":{\"key\":\"0ec517e8-6c11-4d98-89b5-c300fe61b304\",\"namespace\":\"\"},\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"2f1585da-6f7e-4ccd-8a20-590fdf177b5d\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1689710689550,\"location\":\"mine\",\"created\":1689710689550,\"persisted\":1689710689550},{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"f64bea3b-58a7-4586-8c05-8b651e5f0bfd\",\"namespace\":\"\"},{\"key\":\"2d02a680-eb7e-4645-bba2-dd298f76efb8\",\"namespace\":\"\"},{\"key\":\"72a5f66b-39a7-4f62-8c40-4a99a33d6a8e\",\"namespace\":\"\"},{\"key\":\"8e4d20f1-9a04-4de5-8db5-c7e08d27f70d\",\"namespace\":\"\"},{\"key\":\"3e294eae-6124-409b-a870-554d1bdcdd6f\",\"namespace\":\"\"},{\"key\":\"ec24d05d-5df5-4c96-9241-b73636cd19a9\",\"namespace\":\"\"},{\"key\":\"0ec517e8-6c11-4d98-89b5-c300fe61b304\",\"namespace\":\"\"},{\"key\":\"ffb49de1-af27-4318-a22f-59899988f4e9\",\"namespace\":\"\"},{\"key\":\"c6c65ad5-5c09-43c2-8a12-fdeb64d3e1a4\",\"namespace\":\"\"},{\"key\":\"62c4ade7-85ce-45bd-8cdb-25f0c58c8a28\",\"namespace\":\"\"},{\"key\":\"c1717964-ffed-47aa-9ed9-647ba5a3db67\",\"namespace\":\"\"},{\"key\":\"10581641-5de3-4606-95aa-04cd811f2f53\",\"namespace\":\"\"},{\"key\":\"d9d79500-916d-4ff2-a7ea-6cf300c85ce3\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"persisted\":1721850933441,\"modified\":1721850933441},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine/0ec517e8-6c11-4d98-89b5-c300fe61b304\",\"domainObject\":{\"identifier\":{\"key\":\"0ec517e8-6c11-4d98-89b5-c300fe61b304\",\"namespace\":\"\"},\"name\":\"Unnamed Condition Set\",\"type\":\"conditionSet\",\"configuration\":{\"conditionTestData\":[],\"conditionCollection\":[{\"isDefault\":true,\"id\":\"2f1585da-6f7e-4ccd-8a20-590fdf177b5d\",\"configuration\":{\"name\":\"Default\",\"output\":\"Default\",\"trigger\":\"all\",\"criteria\":[]},\"summary\":\"Default condition\"}]},\"composition\":[],\"telemetry\":{},\"modified\":1689710689550,\"location\":\"mine\",\"created\":1689710689550,\"persisted\":1689710689550}}]" } ] } diff --git a/e2e/tests/framework/appActions.e2e.spec.js b/e2e/tests/framework/appActions.e2e.spec.js index cc93247951..280ef33f17 100644 --- a/e2e/tests/framework/appActions.e2e.spec.js +++ b/e2e/tests/framework/appActions.e2e.spec.js @@ -19,19 +19,33 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ +import fs from 'fs'; import { createDomainObjectWithDefaults, + createExampleTelemetryObject, createNotification, + createPlanFromJSON, expandEntireTree, - openObjectTreeContextMenu + getCanvasPixels, + navigateToObjectWithFixedTimeBounds, + navigateToObjectWithRealTime, + setEndOffset, + setFixedIndependentTimeConductorBounds, + setFixedTimeMode, + setRealTimeMode, + setStartOffset, + setTimeConductorBounds, + waitForPlotsToRender } from '../../appActions.js'; +import { assertPlanActivities, setBoundsToSpanAllActivities } from '../../helper/planningUtils.js'; import { expect, test } from '../../pluginFixtures.js'; -test.describe('AppActions', () => { - test('createDomainObjectsWithDefaults', async ({ page }) => { +test.describe('AppActions @framework', () => { + test.beforeEach(async ({ page }) => { await page.goto('./', { waitUntil: 'domcontentloaded' }); - + }); + test('createDomainObjectsWithDefaults', async ({ page }) => { const e2eFolder = await createDomainObjectWithDefaults(page, { type: 'Folder', name: 'e2e folder' @@ -90,8 +104,39 @@ test.describe('AppActions', () => { expect(folder3.url).toBe(`${e2eFolder.url}/${folder1.uuid}/${folder2.uuid}/${folder3.uuid}`); }); }); + test('createExampleTelemetryObject', async ({ page }) => { + const gauge = await createDomainObjectWithDefaults(page, { + type: 'Gauge', + name: 'Gauge with no data' + }); + + const swgWithParent = await createExampleTelemetryObject(page, gauge.uuid); + + await page.goto(swgWithParent.url); + await expect(page.locator('.l-browse-bar__object-name')).toHaveText(swgWithParent.name); + await page.getByLabel('More actions').click(); + await page.getByLabel('Edit Properties...').click(); + + // Check Default values of created object + await expect(page.getByLabel('Title', { exact: true })).toHaveValue('VIPER Rover Heading'); + await expect(page.getByRole('spinbutton', { name: 'Period' })).toHaveValue('10'); + await expect(page.getByRole('spinbutton', { name: 'Amplitude' })).toHaveValue('1'); + await expect(page.getByRole('spinbutton', { name: 'Offset' })).toHaveValue('0'); + await expect(page.getByRole('spinbutton', { name: 'Data Rate (hz)' })).toHaveValue('1'); + await expect(page.getByRole('spinbutton', { name: 'Phase (radians)' })).toHaveValue('0'); + await expect(page.getByRole('spinbutton', { name: 'Randomness' })).toHaveValue('0'); + await expect(page.getByRole('spinbutton', { name: 'Loading Delay (ms)' })).toHaveValue('0'); + + await page.getByLabel('Cancel').click(); + + const swgWithoutParent = await createExampleTelemetryObject(page); + + await page.getByLabel('Show selected item in tree').click(); + + expect(swgWithParent.url).toBe(`${gauge.url}/${swgWithParent.uuid}`); + expect(swgWithoutParent.url).toBe(`./#/browse/mine/${swgWithoutParent.uuid}`); + }); test('createNotification', async ({ page }) => { - await page.goto('./', { waitUntil: 'domcontentloaded' }); await createNotification(page, { message: 'Test info notification', severity: 'info' @@ -114,9 +159,20 @@ test.describe('AppActions', () => { await expect(page.locator('.c-message-banner')).toHaveClass(/error/); await page.locator('[aria-label="Dismiss"]').click(); }); + test('createPlanFromJSON', async ({ page }) => { + const examplePlanSmall1 = JSON.parse( + fs.readFileSync( + new URL('../../test-data/examplePlans/ExamplePlan_Small1.json', import.meta.url) + ) + ); + const plan = await createPlanFromJSON(page, { + name: 'Test Plan', + json: examplePlanSmall1 + }); + await setBoundsToSpanAllActivities(page, examplePlanSmall1, plan.url); + await assertPlanActivities(page, examplePlanSmall1, plan.url); + }); test('expandEntireTree', async ({ page }) => { - await page.goto('./', { waitUntil: 'domcontentloaded' }); - const rootFolder = await createDomainObjectWithDefaults(page, { type: 'Folder' }); @@ -152,28 +208,135 @@ test.describe('AppActions', () => { name: 'Main Tree' }); const treePaneCollapsedItems = treePane.getByRole('treeitem', { expanded: false }); - expect(await treePaneCollapsedItems.count()).toBe(0); + await expect(treePaneCollapsedItems).toHaveCount(0); await page.goto('./#/browse/mine'); //Click the Create button await page.getByRole('button', { name: 'Create' }).click(); // Click the object specified by 'type' - await page.click(`li[role='menuitem']:text("Clock")`); + await page.getByRole('menuitem', { name: 'Clock' }).click(); await expandEntireTree(page, 'Create Modal Tree'); const locatorTree = page.getByRole('tree', { name: 'Create Modal Tree' }); const locatorTreeCollapsedItems = locatorTree.locator('role=treeitem[expanded=false]'); - expect(await locatorTreeCollapsedItems.count()).toBe(0); + await expect(locatorTreeCollapsedItems).toHaveCount(0); }); - test('openObjectTreeContextMenu', async ({ page }) => { - await page.goto('./', { waitUntil: 'domcontentloaded' }); - - const folder = await createDomainObjectWithDefaults(page, { - type: 'Folder' + test('getCanvasPixels', async ({ page }) => { + let overlayPlot = await createDomainObjectWithDefaults(page, { + type: 'Overlay Plot' }); - await openObjectTreeContextMenu(page, folder.url); - await expect(page.getByLabel(`${folder.name} Context Menu`)).toBeVisible(); + + await createExampleTelemetryObject(page, overlayPlot.uuid); + + await page.goto(overlayPlot.url); + //Get pixel data from Canvas + const plotPixels = await getCanvasPixels(page, 'canvas'); + const plotPixelSize = plotPixels.length; + expect(plotPixelSize).toBeGreaterThan(0); + }); + test('navigateToObjectWithFixedTimeBounds', async ({ page }) => { + const exampleTelemetry = await createExampleTelemetryObject(page); + //Navigate without explicit bounds + await navigateToObjectWithFixedTimeBounds(page, exampleTelemetry.url); + await expect(page.getByLabel('Start bounds:')).toBeVisible(); + await expect(page.getByLabel('End bounds:')).toBeVisible(); + //Navigate with explicit bounds + await navigateToObjectWithFixedTimeBounds( + page, + exampleTelemetry.url, + 1693592063607, + 1693593893607 + ); + await expect(page.getByLabel('Start bounds: 2023-09-01 18:')).toBeVisible(); + await expect(page.getByLabel('End bounds: 2023-09-01 18:44:')).toBeVisible(); + }); + test('navigateToObjectWithRealTime', async ({ page }) => { + const exampleTelemetry = await createExampleTelemetryObject(page); + //Navigate without explicit bounds + await navigateToObjectWithRealTime(page, exampleTelemetry.url); + await expect(page.getByLabel('Start offset:')).toBeVisible(); + await expect(page.getByLabel('End offset: 00:00:')).toBeVisible(); + //Navigate with explicit bounds + await navigateToObjectWithRealTime(page, exampleTelemetry.url, 1693592063607, 1693593893607); + await expect(page.getByLabel('Start offset: 18:14:')).toBeVisible(); + await expect(page.getByLabel('End offset: 18:44:')).toBeVisible(); + }); + test('setTimeConductorMode', async ({ page }) => { + await test.step('setFixedTimeMode', async () => { + await setFixedTimeMode(page); + await expect(page.getByLabel('Start bounds:')).toBeVisible(); + await expect(page.getByLabel('End bounds:')).toBeVisible(); + }); + await test.step('setTimeConductorBounds', async () => { + await setTimeConductorBounds(page, { + startDate: '2024-01-01', + endDate: '2024-01-02', + startTime: '00:00:00', + endTime: '23:59:59' + }); + await expect(page.getByLabel('Start bounds: 2024-01-01 00:00:00')).toBeVisible(); + await expect(page.getByLabel('End bounds: 2024-01-02 23:59:59')).toBeVisible(); + }); + await test.step('setRealTimeMode', async () => { + await setRealTimeMode(page); + await expect(page.getByLabel('Start offset')).toBeVisible(); + await expect(page.getByLabel('End offset')).toBeVisible(); + }); + await test.step('setStartOffset', async () => { + await setStartOffset(page, { + startHours: '04', + startMins: '20', + startSecs: '22' + }); + await expect(page.getByLabel('Start offset: 04:20:22')).toBeVisible(); + }); + await test.step('setEndOffset', async () => { + await setEndOffset(page, { + endHours: '04', + endMins: '20', + endSecs: '22' + }); + await expect(page.getByLabel('End offset: 04:20:22')).toBeVisible(); + }); + }); + test('setFixedIndependentTimeConductorBounds', async ({ page }) => { + // Create a Display Layout + const displayLayout = await createDomainObjectWithDefaults(page, { + type: 'Display Layout' + }); + await createDomainObjectWithDefaults(page, { + type: 'Example Imagery', + parent: displayLayout.uuid + }); + + const startDate = '2021-12-30 01:01:00.000Z'; + const endDate = '2021-12-30 01:11:00.000Z'; + await setFixedIndependentTimeConductorBounds(page, { start: startDate, end: endDate }); + + // check image date + await expect(page.getByText('2021-12-30 01:11:00.000Z').first()).toBeVisible(); + + // flip it off + await page.getByRole('switch').click(); + // timestamp shouldn't be in the past anymore + await expect(page.getByText('2021-12-30 01:11:00.000Z')).toBeHidden(); + }); + test.fail('waitForPlotsToRender', async ({ page }) => { + // Create a SWG + await createDomainObjectWithDefaults(page, { + type: 'Sine Wave Generator' + }); + // Edit the SWG + await page.getByLabel('More actions').click(); + await page.getByLabel('Edit Properties...').click(); + // Set loading delay to 10 seconds + await page.getByLabel('Loading Delay (ms)', { exact: true }).fill('10000'); + await page.getByLabel('Save').click(); + // Reload the page + await page.reload(); + // Expect this step to fail + await waitForPlotsToRender(page, { timeout: 1000 }); }); }); diff --git a/e2e/tests/framework/baseFixtures.e2e.spec.js b/e2e/tests/framework/baseFixtures.e2e.spec.js index 133f5f5604..337a650ef5 100644 --- a/e2e/tests/framework/baseFixtures.e2e.spec.js +++ b/e2e/tests/framework/baseFixtures.e2e.spec.js @@ -26,7 +26,7 @@ relates to how we've extended it (i.e. ./e2e/baseFixtures.js) and assumptions ma (`npm start` and ./e2e/webpack-dev-middleware.js) */ -import { expect, test } from '../../baseFixtures.js'; +import { test } from '../../baseFixtures.js'; import { MISSION_TIME } from '../../constants.js'; test.describe('baseFixtures tests', () => { @@ -42,6 +42,21 @@ test.describe('baseFixtures tests', () => { page.waitForEvent('console') // always wait for the event to happen while triggering it! ]); }); + test('Verify that tests fail if console.error is thrown with clock override @clock', async ({ + page + }) => { + test.fail(); + //Set clock time + await page.clock.install({ time: MISSION_TIME }); + await page.clock.resume(); + await page.goto('./', { waitUntil: 'domcontentloaded' }); + + //Verify that ../fixtures.js detects console log errors + await Promise.all([ + page.evaluate(() => console.error('This should result in a failure')), + page.waitForEvent('console') // always wait for the event to happen while triggering it! + ]); + }); test('Verify that tests pass if console.warn is thrown', async ({ page }) => { //Go to baseURL await page.goto('./', { waitUntil: 'domcontentloaded' }); @@ -53,27 +68,3 @@ test.describe('baseFixtures tests', () => { ]); }); }); - -test.describe('baseFixtures tests @clock', () => { - test.use({ - clockOptions: { - now: MISSION_TIME, - shouldAdvanceTime: false - } - }); - - test.beforeEach(async ({ page }) => { - await page.goto('./', { waitUntil: 'domcontentloaded' }); - }); - - test('Can use clockOptions and tick fixtures to control the clock', async ({ page, tick }) => { - let time = await page.evaluate(() => new Date().getTime()); - expect(time).toBe(MISSION_TIME); - await tick(1000); - time = await page.evaluate(() => new Date().getTime()); - expect(time).toBe(MISSION_TIME + 1000 * 1); - await tick(1000); - time = await page.evaluate(() => new Date().getTime()); - expect(time).toBe(MISSION_TIME + 1000 * 2); - }); -}); diff --git a/e2e/tests/framework/exampleTemplate.e2e.spec.js b/e2e/tests/framework/exampleTemplate.e2e.spec.js index 3b245fa3c4..631be082b1 100644 --- a/e2e/tests/framework/exampleTemplate.e2e.spec.js +++ b/e2e/tests/framework/exampleTemplate.e2e.spec.js @@ -22,7 +22,7 @@ /* * This test suite template is to be used when creating new test suites. It will be kept up to date with the latest improvements - * made by the Open MCT team. It will also follow our best pratices as those evolve. Please use this structure as a _reference_ and clear + * made by the Open MCT team. It will also follow our best practices as those evolve. Please use this structure as a _reference_ and clear * or update any references when creating a new test suite! * * To illustrate current best practices, we've included a mocked up test suite for Renaming a Timer domain object. @@ -30,7 +30,6 @@ * Demonstrated: * - Using appActions to leverage existing functions * - Structure - * - @unstable annotation * - await, expect, test, describe syntax * - Writing a custom function for a test suite * - Test stub for unfinished test coverage (test.fixme) @@ -45,7 +44,7 @@ */ // Structure: Some standard Imports. Please update the required pathing. -import { createDomainObjectWithDefaults } from '../../appActions.js'; +import { createDomainObjectWithDefaults, createExampleTelemetryObject } from '../../appActions.js'; import { expect, test } from '../../pluginFixtures.js'; /** @@ -53,11 +52,8 @@ import { expect, test } from '../../pluginFixtures.js'; * Try to keep a single describe block per logical groups of tests. * If your test runtime exceeds 5 minutes or 500 lines, it's likely that it will need to be split. * - * Annotations: - * Please use the @unstable tag at the end of the test title so that our automation can pick it up - * as a part of our test promotion pipeline. */ -test.describe('Renaming Timer Object', () => { +test.describe('Example - Renaming Timer Object', () => { // Top-level declaration of the Timer object created in beforeEach(). // We can then use this throughout the entire test suite. let timer; @@ -70,7 +66,7 @@ test.describe('Renaming Timer Object', () => { timer = await createDomainObjectWithDefaults(page, { type: 'Timer' }); // Assert the object to be created and check its name in the title - await expect(page.locator('.l-browse-bar__object-name')).toContainText(timer.name); + await expect(page.getByRole('main')).toContainText(timer.name); }); /** @@ -81,11 +77,11 @@ test.describe('Renaming Timer Object', () => { test('An existing Timer object can be renamed via the 3dot actions menu', async ({ page }) => { const newObjectName = 'Renamed Timer'; - // We've created an example of a shared function which pases the page and newObjectName values + // We've created an example of a shared function which passes the page and newObjectName values await renameTimerFrom3DotMenu(page, timer.url, newObjectName); // Assert that the name has changed in the browser bar to the value we assigned above - await expect(page.locator('.l-browse-bar__object-name')).toContainText(newObjectName); + await expect(page.getByRole('main')).toContainText(newObjectName); }); test('An existing Timer object can be renamed twice', async ({ page }) => { @@ -95,13 +91,13 @@ test.describe('Renaming Timer Object', () => { await renameTimerFrom3DotMenu(page, timer.url, newObjectName); // Assert that the name has changed in the browser bar to the value we assigned above - await expect(page.locator('.l-browse-bar__object-name')).toContainText(newObjectName); + await expect(page.getByRole('main')).toContainText(newObjectName); // Rename the Timer object again await renameTimerFrom3DotMenu(page, timer.url, newObjectName2); // Assert that the name has changed in the browser bar to the second value - await expect(page.locator('.l-browse-bar__object-name')).toContainText(newObjectName2); + await expect(page.getByRole('main')).toContainText(newObjectName2); }); /** @@ -121,7 +117,7 @@ test.describe('Renaming Timer Object', () => { * The next most important concept in our testing is working with telemetry objects. Telemetry is at the core of Open MCT * and we have developed a great pattern for working with it. */ -test.describe('Advanced: Working with telemetry objects', () => { +test.describe('Advanced Example - Working with telemetry objects', () => { let displayLayout; test.beforeEach(async ({ page }) => { await page.goto('./', { waitUntil: 'domcontentloaded' }); @@ -132,17 +128,14 @@ test.describe('Advanced: Working with telemetry objects', () => { name: 'Display Layout with Embedded SWG' }); // Create Telemetry object within the parent object created above - await createDomainObjectWithDefaults(page, { - type: 'Sine Wave Generator', - name: 'Telemetry', - parent: displayLayout.uuid //reference the display layout in the creation process - }); + //reference the display layout in the creation process + await createExampleTelemetryObject(page, displayLayout.uuid); }); test('Can directly navigate to a Display Layout with embedded telemetry', async ({ page }) => { //Now you can directly navigate to the displayLayout created in the beforeEach with the embedded telemetry await page.goto(displayLayout.url); //Expect the created Telemetry Object to be visible when directly navigating to the displayLayout - await expect(page.getByTitle('Sine')).toBeVisible(); + await expect(page.getByLabel('Alpha-numeric telemetry name')).toBeVisible(); }); }); @@ -160,18 +153,14 @@ test.describe('Advanced: Working with telemetry objects', () => { * @param {string} newNameForTimer New name for object */ async function renameTimerFrom3DotMenu(page, timerUrl, newNameForTimer) { - // Navigate to the timer object + // Navigate to the timer object directly await page.goto(timerUrl); - // Click on 3 Dot Menu - await page.locator('button[title="More actions"]').click(); - - // Click text=Edit Properties... - await page.locator('text=Edit Properties...').click(); + await page.getByLabel('More actions').click(); + await page.getByLabel('Edit Properties...').click(); // Rename the timer object - await page.locator('text=Properties Title Notes >> input[type="text"]').fill(newNameForTimer); + await page.getByLabel('Title', { exact: true }).fill(newNameForTimer); - // Click Ok button to Save - await page.locator('button:has-text("OK")').click(); + await page.getByLabel('Save').click(); } diff --git a/e2e/tests/framework/generateLocalStorageData.e2e.spec.js b/e2e/tests/framework/generateLocalStorageData.e2e.spec.js index de8741cc88..544a04e25f 100644 --- a/e2e/tests/framework/generateLocalStorageData.e2e.spec.js +++ b/e2e/tests/framework/generateLocalStorageData.e2e.spec.js @@ -36,7 +36,7 @@ import { fileURLToPath } from 'url'; import { createDomainObjectWithDefaults, createExampleTelemetryObject, - setIndependentTimeConductorBounds, + setFixedIndependentTimeConductorBounds, setTimeConductorBounds } from '../../appActions.js'; import { MISSION_TIME } from '../../constants.js'; @@ -45,14 +45,10 @@ import { expect, test } from '../../pluginFixtures.js'; const overlayPlotName = 'Overlay Plot with Telemetry Object'; test.describe('Generate Visual Test Data @localStorage @generatedata @clock', () => { - test.use({ - clockOptions: { - now: MISSION_TIME, - shouldAdvanceTime: true - } - }); - test.beforeEach(async ({ page }) => { + // Override the clock + await page.clock.install({ time: MISSION_TIME }); + await page.clock.resume(); // Go to baseURL await page.goto('./', { waitUntil: 'domcontentloaded' }); }); @@ -112,23 +108,30 @@ test.describe('Generate Visual Test Data @localStorage @generatedata @clock', () await page.goto(parent.url, { waitUntil: 'domcontentloaded' }); - await setIndependentTimeConductorBounds(page, { + await setFixedIndependentTimeConductorBounds(page, { start: '2024-11-12 19:11:11.000Z', end: '2024-11-12 20:11:11.000Z' }); - const NEW_GLOBAL_START_BOUNDS = '2024-11-11 19:11:11.000Z'; - const NEW_GLOBAL_END_BOUNDS = '2024-11-11 20:11:11.000Z'; + const NEW_GLOBAL_START_DATE = '2024-11-11'; + const NEW_GLOBAL_START_TIME = '19:11:11'; + const NEW_GLOBAL_END_DATE = '2024-11-11'; + const NEW_GLOBAL_END_TIME = '20:11:11'; - await setTimeConductorBounds(page, NEW_GLOBAL_START_BOUNDS, NEW_GLOBAL_END_BOUNDS); + await setTimeConductorBounds(page, { + startDate: NEW_GLOBAL_START_DATE, + startTime: NEW_GLOBAL_START_TIME, + endDate: NEW_GLOBAL_END_DATE, + endTime: NEW_GLOBAL_END_TIME + }); // Verify that the global time conductor bounds have been updated - expect( - await page.getByLabel('Global Time Conductor').getByLabel('Start bounds').textContent() - ).toEqual(NEW_GLOBAL_START_BOUNDS); - expect( - await page.getByLabel('Global Time Conductor').getByLabel('End bounds').textContent() - ).toEqual(NEW_GLOBAL_END_BOUNDS); + await expect( + page.getByLabel(`Start bounds: ${NEW_GLOBAL_START_DATE} ${NEW_GLOBAL_START_TIME}.000Z`) + ).toBeVisible(); + await expect( + page.getByLabel(`End bounds: ${NEW_GLOBAL_END_DATE} ${NEW_GLOBAL_END_TIME}.000Z`) + ).toBeVisible(); //Save localStorage for future test execution await context.storageState({ @@ -204,11 +207,7 @@ test.describe('Generate Visual Test Data @localStorage @generatedata @clock', () // TODO: Flesh Out Assertions against created Objects await expect(page.locator('.l-browse-bar__object-name')).toContainText(overlayPlotName); await page.getByRole('tab', { name: 'Config' }).click(); - await page - .getByRole('list', { name: 'Plot Series Properties' }) - .locator('span') - .first() - .click(); + await page.getByLabel('Plot Series Items').getByLabel('Expand').click(); // TODO: Modify the Overlay Plot to use fixed Scaling // TODO: Verify Autoscaling. @@ -267,7 +266,7 @@ test.describe('Generate Visual Test Data @localStorage @generatedata @clock', () page.waitForNavigation(), page.locator('text=OK').click(), //Wait for Save Banner to appear - page.waitForSelector('.c-message-banner__message') + page.locator('.c-message-banner__message').hover({ trial: true }) ]); // focus the overlay plot @@ -277,7 +276,7 @@ test.describe('Generate Visual Test Data @localStorage @generatedata @clock', () // Clear Recently Viewed await page.getByRole('button', { name: 'Clear Recently Viewed' }).click(); - await page.getByRole('button', { name: 'OK', exact: true }).click(); + await page.getByRole('button', { name: 'Ok', exact: true }).click(); //Save localStorage for future test execution await context.storageState({ path: fileURLToPath( @@ -300,11 +299,7 @@ test.describe('Validate Overlay Plot with Telemetry Object @localStorage @genera // TODO: Flesh Out Assertions against created Objects await expect(page.locator('.l-browse-bar__object-name')).toContainText(overlayPlotName); await page.getByRole('tab', { name: 'Config' }).click(); - await page - .getByRole('list', { name: 'Plot Series Properties' }) - .locator('span') - .first() - .click(); + await page.getByLabel('Plot Series Items').getByLabel('Expand').click(); // TODO: Modify the Overlay Plot to use fixed Scaling // TODO: Verify Autoscaling. @@ -345,11 +340,7 @@ test.describe('Validate Overlay Plot with 5s Delay Telemetry Object @localStorag // TODO: Flesh Out Assertions against created Objects await expect(page.locator('.l-browse-bar__object-name')).toContainText(plotName); await page.getByRole('tab', { name: 'Config' }).click(); - await page - .getByRole('list', { name: 'Plot Series Properties' }) - .locator('span') - .first() - .click(); + await page.getByLabel('Plot Series Items').getByLabel('Expand').click(); // TODO: Modify the Overlay Plot to use fixed Scaling // TODO: Verify Autoscaling. diff --git a/e2e/tests/framework/pluginFixtures.e2e.spec.js b/e2e/tests/framework/pluginFixtures.e2e.spec.js index f9b0cb5a7b..e1eaa637d0 100644 --- a/e2e/tests/framework/pluginFixtures.e2e.spec.js +++ b/e2e/tests/framework/pluginFixtures.e2e.spec.js @@ -31,7 +31,7 @@ import { test } from '../../pluginFixtures.js'; test.describe.skip('pluginFixtures tests', () => { // test.use({ domainObjectName: 'Timer' }); // let timerUUID; - // test('Creates a timer object @framework @unstable', ({ domainObject }) => { + // test('Creates a timer object @framework', ({ domainObject }) => { // const { uuid } = domainObject; // const uuidRegexp = /[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/; // expect(uuid).toMatch(uuidRegexp); diff --git a/e2e/tests/functional/clearDataAction.e2e.spec.js b/e2e/tests/functional/clearDataAction.e2e.spec.js index 56e6b2f274..0e3165276b 100644 --- a/e2e/tests/functional/clearDataAction.e2e.spec.js +++ b/e2e/tests/functional/clearDataAction.e2e.spec.js @@ -59,6 +59,6 @@ test.describe('Clear Data Action', () => { // Verify that the background image is no longer visible await expect(page.locator(backgroundImageSelector)).toBeHidden(); - expect(await page.locator('.c-thumb__image').count()).toBe(0); + await expect(page.locator('.c-thumb__image')).toHaveCount(0); }); }); diff --git a/e2e/tests/functional/couchdb.e2e.spec.js b/e2e/tests/functional/couchdb.e2e.spec.js index b4042e8eaf..3afa9033e2 100644 --- a/e2e/tests/functional/couchdb.e2e.spec.js +++ b/e2e/tests/functional/couchdb.e2e.spec.js @@ -41,7 +41,7 @@ test.describe('CouchDB Status Indicator with mocked responses @couchdb', () => { //Go to baseURL await page.goto('./#/browse/mine?hideTree=true&hideInspector=true', { - waitUntil: 'networkidle' + waitUntil: 'domcontentloaded' }); await expect(page.locator('div:has-text("CouchDB is connected")').nth(3)).toBeVisible(); }); @@ -56,7 +56,7 @@ test.describe('CouchDB Status Indicator with mocked responses @couchdb', () => { //Go to baseURL await page.goto('./#/browse/mine?hideTree=true&hideInspector=true', { - waitUntil: 'networkidle' + waitUntil: 'domcontentloaded' }); await expect(page.locator('div:has-text("CouchDB is offline")').nth(3)).toBeVisible(); }); @@ -71,7 +71,7 @@ test.describe('CouchDB Status Indicator with mocked responses @couchdb', () => { //Go to baseURL await page.goto('./#/browse/mine?hideTree=true&hideInspector=true', { - waitUntil: 'networkidle' + waitUntil: 'domcontentloaded' }); await expect(page.locator('div:has-text("CouchDB connectivity unknown")').nth(3)).toBeVisible(); }); diff --git a/e2e/tests/functional/example/generator/sineWaveLimitProvider.e2e.spec.js b/e2e/tests/functional/example/generator/sineWaveLimitProvider.e2e.spec.js index a0c50055b4..ca50314164 100644 --- a/e2e/tests/functional/example/generator/sineWaveLimitProvider.e2e.spec.js +++ b/e2e/tests/functional/example/generator/sineWaveLimitProvider.e2e.spec.js @@ -41,7 +41,7 @@ test.describe('Sine Wave Generator', () => { await page.getByRole('button', { name: 'Create' }).click(); // Click Sine Wave Generator - await page.click('text=Sine Wave Generator'); + await page.getByRole('menuitem', { name: 'Sine Wave Generator' }).click(); // Verify that the each required field has required indicator // Title @@ -107,11 +107,11 @@ test.describe('Sine Wave Generator', () => { await page.locator('.field.control.l-input-sm input').first().press('ArrowUp'); await page.locator('.field.control.l-input-sm input').first().press('ArrowUp'); - const value = await page.locator('.field.control.l-input-sm input').first().inputValue(); - await expect(value).toBe('6'); + const value = page.locator('.field.control.l-input-sm input').first(); + await expect(value).toHaveValue('6'); - //Click text=OK - await Promise.all([page.waitForNavigation(), page.click('button:has-text("OK")')]); + //Click save button + await page.getByLabel('Save').click(); // Verify that the Sine Wave Generator is displayed and correct // Verify object properties diff --git a/e2e/tests/functional/forms.e2e.spec.js b/e2e/tests/functional/forms.e2e.spec.js index 7e3ba59221..bda12a4894 100644 --- a/e2e/tests/functional/forms.e2e.spec.js +++ b/e2e/tests/functional/forms.e2e.spec.js @@ -45,25 +45,23 @@ test.describe('Form Validation Behavior', () => { await page.getByRole('menuitem', { name: 'Folder' }).click(); // Fill in empty string into title and trigger validation with 'Tab' - await page.click('text=Properties Title Notes >> input[type="text"]'); - await page.fill('text=Properties Title Notes >> input[type="text"]', ''); - await page.press('text=Properties Title Notes >> input[type="text"]', 'Tab'); + await page.getByLabel('Title', { exact: true }).fill(''); + await page.getByLabel('Title', { exact: true }).press('Tab'); //Required Field Form Validation - await expect(page.locator('button:has-text("OK")')).toBeDisabled(); + 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' - await page.click('text=Properties Title Notes >> input[type="text"]'); - await page.fill('text=Properties Title Notes >> input[type="text"]', TEST_FOLDER); - await page.press('text=Properties Title Notes >> input[type="text"]', 'Tab'); + await page.getByLabel('Title', { exact: true }).fill(TEST_FOLDER); + await page.getByLabel('Title', { exact: true }).press('Tab'); //Required Field Form Validation is corrected - await expect(page.locator('button:has-text("OK")')).toBeEnabled(); + await expect(page.getByLabel('Save')).toBeEnabled(); await expect(page.locator('.c-form-row__state-indicator').first()).not.toHaveClass(/invalid/); //Finish Creating Domain Object - await Promise.all([page.waitForNavigation(), page.click('button:has-text("OK")')]); + 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); @@ -87,8 +85,8 @@ test.describe('Form File Input Behavior', () => { await page.getByRole('button', { name: 'Save' }).click(); - const type = await page.locator('#file-input-type').textContent(); - await expect(type).toBe(`"string"`); + const type = page.locator('#file-input-type'); + await expect(type).toHaveText(`"string"`); }); test('Can select an image file type', async ({ page }) => { @@ -101,8 +99,8 @@ test.describe('Form File Input Behavior', () => { await page.getByRole('button', { name: 'Save' }).click(); - const type = await page.locator('#file-input-type').textContent(); - await expect(type).toBe(`"object"`); + const type = page.locator('#file-input-type'); + await expect(type).toHaveText(`"object"`); }); }); @@ -123,16 +121,16 @@ test.describe('Persistence operations @addInit', () => { await page.getByRole('button', { name: 'Create' }).click(); - await page.click('text=Condition Set'); + await page.getByRole('menuitem', { name: 'Condition Set' }).click(); await page.locator('form[name="mctForm"] >> text=Persistence Testing').click(); - const okButton = page.locator('button:has-text("OK")'); + const okButton = page.getByLabel('Save'); await expect(okButton).toBeDisabled(); }); }); -test.describe('Persistence operations @couchdb', () => { +test.describe('Persistence operations @couchdb @network', () => { test.use({ failOnConsoleError: false }); test('Editing object properties should generate a single persistence operation', async ({ page @@ -158,14 +156,12 @@ test.describe('Persistence operations @couchdb', () => { }); // Open the edit form for the clock object - await page.click('button[title="More actions"]'); - await page.click('li[title="Edit properties of this object."]'); + await page.getByLabel('More actions').click(); + await page.getByLabel('Edit Properties...').click(); // Modify the display format from default 12hr -> 24hr and click 'Save' - await page - .locator('select[aria-label="12 or 24 hour clock"]') - .selectOption({ value: 'clock24' }); - await page.click('button[aria-label="Save"]'); + await page.getByLabel('12 or 24 hour clock').selectOption({ value: 'clock24' }); + await page.getByLabel('Save').click(); await expect .poll(() => putRequestCount, { @@ -174,7 +170,7 @@ test.describe('Persistence operations @couchdb', () => { }) .toEqual(1); }); - test('Can create an object after a conflict error @couchdb @2p', async ({ + test('Can create an object after a conflict error @couchdb @network @2p', async ({ page, openmctConfig }) => { @@ -188,8 +184,8 @@ test.describe('Persistence operations @couchdb', () => { // Both pages: Go to baseURL await Promise.all([ - page.goto('./', { waitUntil: 'networkidle' }), - page2.goto('./', { waitUntil: 'networkidle' }) + page.goto('./', { waitUntil: 'domcontentloaded' }), + page2.goto('./', { waitUntil: 'domcontentloaded' }) ]); //Slow down the test a bit @@ -202,14 +198,14 @@ test.describe('Persistence operations @couchdb', () => { // Both pages: Click the Create button await Promise.all([ - page.click('button:has-text("Create")'), - page2.click('button:has-text("Create")') + page.getByRole('button', { name: 'Create' }).click(), + page2.getByRole('button', { name: 'Create' }).click() ]); // Both pages: Click "Clock" in the Create menu await Promise.all([ - page.click(`li[role='menuitem']:text("Clock")`), - page2.click(`li[role='menuitem']:text("Clock")`) + page.getByRole('menuitem', { name: 'Clock' }).click(), + page2.getByRole('menuitem', { name: 'Clock' }).click() ]); // Generate unique names for both objects @@ -236,9 +232,9 @@ test.describe('Persistence operations @couchdb', () => { // conditions for a conflict error from the first page. await Promise.all([ page2.waitForLoadState(), - page2.click('[aria-label="Save"]'), + page2.getByLabel('Save').click(), // Wait for Save Banner to appear - page2.waitForSelector('.c-message-banner__message') + page2.locator('.c-message-banner__message').hover({ trial: true }) ]); // Close Page 2, we're done with it. @@ -249,9 +245,9 @@ test.describe('Persistence operations @couchdb', () => { // the composition of the parent folder. await Promise.all([ page.waitForLoadState(), - page.click('[aria-label="Save"]'), + page.getByLabel('Save').click(), // Wait for Save Banner to appear - page.waitForSelector('.c-message-banner__message') + page.locator('.c-message-banner__message').hover({ trial: true }) ]); // Page 1: Verify that the conflict has occurred and an error notification is displayed. diff --git a/e2e/tests/functional/notification.e2e.spec.js b/e2e/tests/functional/notification.e2e.spec.js index 02984225dc..daee85aaf5 100644 --- a/e2e/tests/functional/notification.e2e.spec.js +++ b/e2e/tests/functional/notification.e2e.spec.js @@ -50,13 +50,13 @@ test.describe('Notifications List', () => { }); // Verify that there is a button with aria-label "Review 2 Notifications" - expect(await page.locator('button[aria-label="Review 2 Notifications"]').count()).toBe(1); + await expect(page.locator('button[aria-label="Review 2 Notifications"]')).toHaveCount(1); // Click on button with aria-label "Review 2 Notifications" - await page.click('button[aria-label="Review 2 Notifications"]'); + await page.getByLabel('Review 2 Notifications').click(); // Click on button with aria-label="Dismiss notification of Error message" - await page.click('button[aria-label="Dismiss notification of Error message"]'); + await page.getByLabel('Dismiss notification of Error message').click(); // Verify there is no a notification (listitem) with the text "Error message" since it was dismissed expect(await page.locator('div[role="dialog"] div[role="listitem"]').innerText()).not.toContain( @@ -69,10 +69,10 @@ test.describe('Notifications List', () => { ); // Click on button with aria-label="Dismiss notification of Alert message" - await page.click('button[aria-label="Dismiss notification of Alert message"]'); + await page.getByLabel('Dismiss notification of Alert message').click(); // Verify that there is no dialog since the notification overlay was closed automatically after all notifications were dismissed - expect(await page.locator('div[role="dialog"]').count()).toBe(0); + await expect(page.locator('div[role="dialog"]')).toHaveCount(0); }); }); diff --git a/e2e/tests/functional/planning/plan.e2e.spec.js b/e2e/tests/functional/planning/plan.e2e.spec.js index 61784bfa9a..a34fe23732 100644 --- a/e2e/tests/functional/planning/plan.e2e.spec.js +++ b/e2e/tests/functional/planning/plan.e2e.spec.js @@ -21,7 +21,7 @@ *****************************************************************************/ import fs from 'fs'; -import { createPlanFromJSON } from '../../../appActions.js'; +import { createPlanFromJSON, navigateToObjectWithFixedTimeBounds } from '../../../appActions.js'; import { addPlanGetInterceptor, assertPlanActivities, @@ -81,9 +81,7 @@ test.describe('Plan', () => { } // Switch to fixed time mode with all plan events within the bounds - await page.goto( - `${plan.url}?tc.mode=fixed&tc.startBound=${startBound}&tc.endBound=${endBound}&tc.timeSystem=utc&view=plan.view` - ); + await navigateToObjectWithFixedTimeBounds(page, plan.url, startBound, endBound); // select the first activity in the list await page.getByText('Past event 1').click(); diff --git a/e2e/tests/functional/planning/timelist.e2e.spec.js b/e2e/tests/functional/planning/timelist.e2e.spec.js index a0e600d63f..abfef4a584 100644 --- a/e2e/tests/functional/planning/timelist.e2e.spec.js +++ b/e2e/tests/functional/planning/timelist.e2e.spec.js @@ -21,7 +21,11 @@ *****************************************************************************/ import fs from 'fs'; -import { createDomainObjectWithDefaults, createPlanFromJSON } from '../../../appActions.js'; +import { + createDomainObjectWithDefaults, + createPlanFromJSON, + navigateToObjectWithFixedTimeBounds +} from '../../../appActions.js'; import { expect, test } from '../../../pluginFixtures.js'; const examplePlanSmall1 = JSON.parse( @@ -59,14 +63,12 @@ test.describe('Time List', () => { const endBound = lastActivity.end; // Switch to fixed time mode with all plan events within the bounds - await page.goto( - `${timelist.url}?tc.mode=fixed&tc.startBound=${startBound}&tc.endBound=${endBound}&tc.timeSystem=utc&view=timelist.view` - ); + await navigateToObjectWithFixedTimeBounds(page, timelist.url, startBound, endBound); // Verify all events are displayed const eventCount = await page.getByRole('row').count(); // subtracting one for the header - await expect(eventCount - 1).toEqual(firstGroupItems.length); + expect(eventCount - 1).toEqual(firstGroupItems.length); }); await test.step('Does not show milliseconds in times', async () => { @@ -124,9 +126,7 @@ test("View a timelist in expanded view, verify all the activities are displayed const endBound = lastActivity.end; // Switch to fixed time mode with all plan events within the bounds - await page.goto( - `${timelist.url}?tc.mode=fixed&tc.startBound=${startBound}&tc.endBound=${endBound}&tc.timeSystem=utc&view=timelist.view` - ); + await navigateToObjectWithFixedTimeBounds(page, timelist.url, startBound, endBound); // Change the object to edit mode await page.getByRole('button', { name: 'Edit Object' }).click(); @@ -142,7 +142,7 @@ test("View a timelist in expanded view, verify all the activities are displayed // Verify all events are displayed const eventCount = await page.getByRole('row').count(); - await expect(eventCount).toEqual(firstGroupItems.length); + expect(eventCount).toEqual(firstGroupItems.length); }); await test.step('Shows activity properties when a row is selected in the expanded view', async () => { @@ -158,7 +158,7 @@ test("View a timelist in expanded view, verify all the activities are displayed await test.step("Verify absence of progress indication for an activity that's not in progress", async () => { // When an activity is not in progress, the progress pie is not visible - const hidden = await page.getByRole('row').locator('path').nth(1).isHidden(); - await expect(hidden).toBe(true); + const hidden = page.getByRole('row').locator('path').nth(1); + await expect(hidden).toBeHidden(); }); }); diff --git a/e2e/tests/functional/planning/timelistControlledClock.e2e.spec.js b/e2e/tests/functional/planning/timelistControlledClock.e2e.spec.js index 4baec66718..156d48aebe 100644 --- a/e2e/tests/functional/planning/timelistControlledClock.e2e.spec.js +++ b/e2e/tests/functional/planning/timelistControlledClock.e2e.spec.js @@ -22,12 +22,16 @@ /* Collection of Time List tests set to run with browser clock manipulate made possible with the -clockOptions plugin fixture. +page.clock() API. */ import fs from 'fs'; -import { createDomainObjectWithDefaults, createPlanFromJSON } from '../../../appActions.js'; +import { + createDomainObjectWithDefaults, + createPlanFromJSON, + navigateToObjectWithRealTime +} from '../../../appActions.js'; import { createTimelistWithPlanAndSetActivityInProgress, getEarliestStartTime, @@ -93,14 +97,12 @@ const COUNTDOWN = Object.freeze({ SECONDS: 5 }); +const FIRST_ACTIVITY_SMALL_1 = getFirstActivity(examplePlanSmall1); + test.describe('Time List with controlled clock @clock', () => { - test.use({ - clockOptions: { - now: getEarliestStartTime(examplePlanSmall3), - shouldAdvanceTime: true - } - }); test.beforeEach(async ({ page }) => { + await page.clock.install({ time: getEarliestStartTime(examplePlanSmall3) }); + await page.clock.resume(); await page.goto('./', { waitUntil: 'domcontentloaded' }); // Create Time List const timelist = await createDomainObjectWithDefaults(page, { @@ -115,9 +117,7 @@ test.describe('Time List with controlled clock @clock', () => { }); // Navigate to the Time List in real-time mode - await page.goto( - `${timelist.url}?tc.mode=local&tc.startDelta=900000&tc.endDelta=1800000&tc.timeSystem=utc&view=grid` - ); + await navigateToObjectWithRealTime(page, timelist.url, 900000, 1800000); //Expand the viewport to show the entire time list await page.getByLabel('Collapse Inspect Pane').click(); @@ -172,16 +172,9 @@ test.describe('Time List with controlled clock @clock', () => { }); test.describe('Activity progress when activity is in the future @clock', () => { - const firstActivity = getFirstActivity(examplePlanSmall1); - - test.use({ - clockOptions: { - now: firstActivity.start - 1, - shouldAdvanceTime: true - } - }); - test.beforeEach(async ({ page }) => { + await page.clock.install({ time: FIRST_ACTIVITY_SMALL_1.start - 1 }); + await page.clock.resume(); await createTimelistWithPlanAndSetActivityInProgress(page, examplePlanSmall1); }); @@ -195,18 +188,13 @@ test.describe('Activity progress when activity is in the future @clock', () => { }); test.describe('Activity progress when now is between start and end of the activity @clock', () => { - const firstActivity = getFirstActivity(examplePlanSmall1); test.beforeEach(async ({ page }) => { + await page.clock.install({ time: FIRST_ACTIVITY_SMALL_1.start + 50000 }); + await page.clock.resume(); + await page.goto('./', { waitUntil: 'domcontentloaded' }); await createTimelistWithPlanAndSetActivityInProgress(page, examplePlanSmall1); }); - test.use({ - clockOptions: { - now: firstActivity.start + 50000, - shouldAdvanceTime: true - } - }); - test('progress pie is partially filled', async ({ page }) => { const anActivity = page.getByRole('row').nth(0); const pathElement = anActivity.getByLabel('Activity in progress').locator('path'); @@ -216,16 +204,10 @@ test.describe('Activity progress when now is between start and end of the activi }); test.describe('Activity progress when now is after end of the activity @clock', () => { - const firstActivity = getFirstActivity(examplePlanSmall1); - - test.use({ - clockOptions: { - now: firstActivity.end + 10000, - shouldAdvanceTime: true - } - }); - test.beforeEach(async ({ page }) => { + await page.clock.install({ time: FIRST_ACTIVITY_SMALL_1.end + 10000 }); + await page.clock.resume(); + await page.goto('./', { waitUntil: 'domcontentloaded' }); await createTimelistWithPlanAndSetActivityInProgress(page, examplePlanSmall1); }); diff --git a/e2e/tests/functional/planning/timestrip.e2e.spec.js b/e2e/tests/functional/planning/timestrip.e2e.spec.js index e6b36181c7..1d82071cd1 100644 --- a/e2e/tests/functional/planning/timestrip.e2e.spec.js +++ b/e2e/tests/functional/planning/timestrip.e2e.spec.js @@ -23,7 +23,8 @@ import { createDomainObjectWithDefaults, createPlanFromJSON, - setIndependentTimeConductorBounds + navigateToObjectWithFixedTimeBounds, + setFixedIndependentTimeConductorBounds } from '../../../appActions.js'; import { expect, test } from '../../../pluginFixtures.js'; @@ -73,7 +74,7 @@ const testPlan = { }; test.describe('Time Strip', () => { - test('Create two Time Strips, add a single Plan to both, and verify they can have separate Independent Time Contexts @unstable', async ({ + test('Create two Time Strips, add a single Plan to both, and verify they can have separate Independent Time Contexts', async ({ page }) => { test.info().annotations.push({ @@ -103,17 +104,17 @@ test.describe('Time Strip', () => { await page.goto(timestrip.url); // Expand the tree to show the plan - await page.click("button[title='Show selected item in tree']"); - await page.dragAndDrop(`role=treeitem[name=/${createdPlan.name}/]`, '.c-object-view'); - await page.click("button[title='Save']"); - await page.click("li[title='Save and Finish Editing']"); + await page.getByLabel('Show selected item in tree').click(); + await page + .getByLabel(`Navigate to ${createdPlan.name}`) + .dragTo(page.getByLabel('Object View')); + await page.getByLabel('Save').click(); + await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); const startBound = testPlan.TEST_GROUP[0].start; const endBound = testPlan.TEST_GROUP[testPlan.TEST_GROUP.length - 1].end; // Switch to fixed time mode with all plan events within the bounds - await page.goto( - `${timestrip.url}?tc.mode=fixed&tc.startBound=${startBound}&tc.endBound=${endBound}&tc.timeSystem=utc&view=time-strip.view` - ); + await navigateToObjectWithFixedTimeBounds(page, timestrip.url, startBound, endBound); // Verify all events are displayed const eventCount = await page.locator('.activity-bounds').count(); @@ -131,7 +132,7 @@ test.describe('Time Strip', () => { const startBoundString = new Date(startBound).toISOString().replace('T', ' '); const endBoundString = new Date(endBound).toISOString().replace('T', ' '); - await setIndependentTimeConductorBounds(page, { + await setFixedIndependentTimeConductorBounds(page, { start: startBoundString, end: endBoundString }); @@ -149,9 +150,9 @@ test.describe('Time Strip', () => { expect(objectName).toBe(createdTimeStrip.name); // Drag the existing Plan onto the newly created Time Strip, and save. - await page.dragAndDrop(`role=treeitem[name=/${plan.name}/]`, '.c-object-view'); - await page.click("button[title='Save']"); - await page.click("li[title='Save and Finish Editing']"); + await page.getByLabel(`Navigate to ${plan.name}`).dragTo(page.getByLabel('Object View')); + await page.getByLabel('Save').click(); + await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); // All events should be displayed at this point because the // initial independent context bounds will match the global bounds @@ -163,7 +164,7 @@ test.describe('Time Strip', () => { const startBoundString = new Date(startBound).toISOString().replace('T', ' '); const endBoundString = new Date(endBound).toISOString().replace('T', ' '); - await setIndependentTimeConductorBounds(page, { + await setFixedIndependentTimeConductorBounds(page, { start: startBoundString, end: endBoundString }); diff --git a/e2e/tests/functional/plugins/conditionSet/conditionSet.e2e.spec.js b/e2e/tests/functional/plugins/conditionSet/conditionSet.e2e.spec.js index 7cdfae0708..6b76088b39 100644 --- a/e2e/tests/functional/plugins/conditionSet/conditionSet.e2e.spec.js +++ b/e2e/tests/functional/plugins/conditionSet/conditionSet.e2e.spec.js @@ -41,11 +41,10 @@ test.describe.serial('Condition Set CRUD Operations on @localStorage @2p', () => const context = await browser.newContext(); const page = await context.newPage(); await page.goto('./', { waitUntil: 'domcontentloaded' }); - await page.getByRole('button', { name: 'Create' }).click(); - - await page.locator('li[role="menuitem"]:has-text("Condition Set")').click(); - - await Promise.all([page.waitForNavigation(), page.click('button:has-text("OK")')]); + const conditionSet = await createDomainObjectWithDefaults(page, { + type: 'Condition Set', + name: 'Unnamed Condition Set' + }); //Save localStorage for future test execution await context.storageState({ @@ -55,7 +54,7 @@ test.describe.serial('Condition Set CRUD Operations on @localStorage @2p', () => }); //Set object identifier from url - conditionSetUrl = page.url(); + conditionSetUrl = conditionSet.url; await page.close(); }); @@ -68,44 +67,39 @@ test.describe.serial('Condition Set CRUD Operations on @localStorage @2p', () => }); //Begin suite of tests again localStorage - test.fixme( - 'Condition set object properties persist in main view and inspector @localStorage', - async ({ page }) => { - test.info().annotations.push({ - type: 'issue', - description: 'https://github.com/nasa/openmct/issues/7421' - }); - //Navigate to baseURL with injected localStorage - await page.goto(conditionSetUrl, { waitUntil: 'networkidle' }); + test('Condition set object properties persist in main view and inspector after reload @localStorage', async ({ + page + }) => { + //Navigate to baseURL with injected localStorage + await page.goto(conditionSetUrl, { waitUntil: 'domcontentloaded' }); - //Assertions on loaded Condition Set in main view. This is a stateful transition step after page.goto() - await expect - .soft(page.locator('.l-browse-bar__object-name')) - .toContainText('Unnamed Condition Set'); + //Assertions on loaded Condition Set in main view. This is a stateful transition step after page.goto() + await expect.soft(page.getByRole('main')).toContainText('Unnamed Condition Set'); - //Assertions on loaded Condition Set in Inspector - expect.soft(page.locator('_vue=item.name=Unnamed Condition Set')).toBeTruthy(); + //Assertions on loaded Condition Set in Inspector + await expect( + page.getByLabel('Title inspector properties').getByLabel('inspector property value') + ).toContainText('Unnamed Condition Set'); - //Reload Page - await Promise.all([page.reload(), page.waitForLoadState('networkidle')]); + //Reload Page + await page.reload({ waitUntil: 'domcontentloaded' }); + + //Re-verify after reload + await expect(page.getByRole('main')).toContainText('Unnamed Condition Set'); + + //Assertions on loaded Condition Set in Inspector + await expect( + page.getByLabel('Title inspector properties').getByLabel('inspector property value') + ).toContainText('Unnamed Condition Set'); + }); - //Re-verify after reload - await expect - .soft(page.locator('.l-browse-bar__object-name')) - .toContainText('Unnamed Condition Set'); - //Assertions on loaded Condition Set in Inspector - expect.soft(page.locator('_vue=item.name=Unnamed Condition Set')).toBeTruthy(); - } - ); test('condition set object can be modified on @localStorage', async ({ page, openmctConfig }) => { const { myItemsFolderName } = openmctConfig; - await page.goto(conditionSetUrl, { waitUntil: 'networkidle' }); + await page.goto(conditionSetUrl, { waitUntil: 'domcontentloaded' }); //Assertions on loaded Condition Set in main view. This is a stateful transition step after page.goto() - await expect - .soft(page.locator('.l-browse-bar__object-name')) - .toContainText('Unnamed Condition Set'); + await expect(page.locator('.l-browse-bar__object-name')).toContainText('Unnamed Condition Set'); //Update the Condition Set properties // Click Edit Button @@ -151,7 +145,7 @@ test.describe.serial('Condition Set CRUD Operations on @localStorage @2p', () => expect(page.locator('a:has-text("Renamed Condition Set")')).toBeTruthy(); //Reload Page - await Promise.all([page.reload(), page.waitForLoadState('networkidle')]); + await Promise.all([page.reload(), page.waitForLoadState('domcontentloaded')]); //Verify Main section reflects updated Name Property await expect @@ -213,7 +207,7 @@ test.describe.serial('Condition Set CRUD Operations on @localStorage @2p', () => //Feature? //Domain Object is still available by direct URL after delete - await page.goto(conditionSetUrl, { waitUntil: 'networkidle' }); + await page.goto(conditionSetUrl, { waitUntil: 'domcontentloaded' }); await expect(page.locator('.l-browse-bar__object-name')).toContainText('Unnamed Condition Set'); }); }); @@ -267,7 +261,7 @@ test.describe('Basic Condition Set Use', () => { await page.getByLabel('Edit Object').click(); // Expand the 'My Items' folder in the left tree - page.click('button[title="Show selected item in tree"]'); + await page.getByLabel('Show selected item in tree').click(); // Add the Alpha & Beta Sine Wave Generator to the Condition Set and save changes const treePane = page.getByRole('tree', { name: 'Main Tree' @@ -371,7 +365,7 @@ test.describe('Basic Condition Set Use', () => { // Validate that the condition set is evaluating and outputting // the correct value when the underlying telemetry subscription is active. - let outputValue = page.locator('[aria-label="Current Output Value"]'); + let outputValue = page.getByLabel('Current Output Value'); await expect(outputValue).toHaveText('false'); await page.goto(exampleTelemetry.url); @@ -462,7 +456,7 @@ test.describe('Basic Condition Set Use', () => { // Validate that the condition set is evaluating and outputting // the correct value when the underlying telemetry subscription is active. - let outputValue = page.locator('[aria-label="Current Output Value"]'); + let outputValue = page.getByLabel('Current Output Value'); await expect(outputValue).toHaveText('false'); await page.goto(exampleTelemetry.url); @@ -475,3 +469,81 @@ test.describe('Basic Condition Set Use', () => { }); }); }); + +test.describe('Condition Set Composition', () => { + let conditionSet; + let exampleTelemetry; + + test.beforeEach(async ({ page }) => { + await page.goto('./', { waitUntil: 'domcontentloaded' }); + + // Create Condition Set + conditionSet = await createDomainObjectWithDefaults(page, { + type: 'Condition Set' + }); + + // Create Telemetry Object as child to Condition Set + exampleTelemetry = await createExampleTelemetryObject(page, conditionSet.uuid); + + // Edit Condition Set + await page.goto(conditionSet.url); + await page.getByRole('button', { name: 'Edit Object' }).click(); + + // Add Condition to Condition Set + await page.getByRole('button', { name: 'Add Condition' }).click(); + + // Enter Condition Output + await page.getByLabel('Condition Name Input').first().fill('Negative'); + await page.getByLabel('Condition Output Type').first().selectOption({ value: 'string' }); + await page.getByLabel('Condition Output String').first().fill('Negative'); + + // Condition Trigger default is okay so no change needed to form + + // Enter Condition Criterion + await page.getByLabel('Criterion Telemetry Selection').first().selectOption({ value: 'all' }); + await page.getByLabel('Criterion Metadata Selection').first().selectOption({ value: 'sin' }); + await page + .locator('select[aria-label="Criterion Comparison Selection"]') + .first() + .selectOption({ value: 'lessThan' }); + await page.getByLabel('Criterion Input').first().fill('0'); + + // Save the Condition Set + await page.getByRole('button', { name: 'Save' }).click(); + await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); + }); + + test('You can remove telemetry from a condition set with existing conditions', async ({ + page + }) => { + test.info().annotations.push({ + type: 'issue', + description: 'https://github.com/nasa/openmct/issues/7710' + }); + + await page.getByLabel('Expand My Items folder').click(); + await page.getByLabel(`Expand ${conditionSet.name} conditionSet`).click(); + + await page + .getByLabel(`Navigate to ${exampleTelemetry.name}`, { exact: false }) + .click({ button: 'right' }); + + await page + .getByLabel(`${exampleTelemetry.name} Context Menu`) + .getByRole('menuitem', { name: 'Remove' }) + .click(); + await page.getByRole('button', { name: 'Ok', exact: true }).click(); + + await page + .getByLabel(`Navigate to ${conditionSet.name} conditionSet Object`, { exact: true }) + .click(); + await page.getByRole('button', { name: 'Edit Object' }).click(); + await page.getByRole('tab', { name: 'Elements' }).click(); + expect( + await page + .getByRole('tabpanel', { name: 'Inspector Views' }) + .getByRole('listitem', { name: exampleTelemetry.name }) + .count() + ).toEqual(0); + }); +}); diff --git a/e2e/tests/functional/plugins/conditionSet/conditionSetOperations.e2e.spec.js b/e2e/tests/functional/plugins/conditionSet/conditionSetOperations.e2e.spec.js new file mode 100644 index 0000000000..5cd5d86d25 --- /dev/null +++ b/e2e/tests/functional/plugins/conditionSet/conditionSetOperations.e2e.spec.js @@ -0,0 +1,368 @@ +/***************************************************************************** + * 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 the basic operations surrounding conditionSets. Note: this +suite is sharing state between tests which is considered an anti-pattern. Implementing in this way to +demonstrate some playwright for test developers. This pattern should not be re-used in other CRUD suites. +*/ + +import { + createDomainObjectWithDefaults, + createExampleTelemetryObject +} from '../../../../appActions.js'; +import { expect, test } from '../../../../pluginFixtures.js'; + +test.describe('Basic Condition Set Use', () => { + let conditionSet; + + test.beforeEach(async ({ page }) => { + // Open a browser, navigate to the main page, and wait until all network events to resolve + await page.goto('./', { waitUntil: 'domcontentloaded' }); + // Create a new condition set + conditionSet = await createDomainObjectWithDefaults(page, { + type: 'Condition Set', + name: 'Test Condition Set' + }); + }); + test('Creating a condition defaults the condition name to "Unnamed Condition"', async ({ + page + }) => { + await page.goto(conditionSet.url); + + // Change the object to edit mode + await page.getByLabel('Edit Object').click(); + + // Click Add Condition button + await page.locator('#addCondition').click(); + // Check that the new Unnamed Condition section appears + const numOfUnnamedConditions = await page + .locator('.c-condition__name', { hasText: 'Unnamed Condition' }) + .count(); + expect(numOfUnnamedConditions).toEqual(1); + }); + test('ConditionSet should display appropriate view options', async ({ page }) => { + test.info().annotations.push({ + type: 'issue', + description: 'https://github.com/nasa/openmct/issues/5924' + }); + + await createDomainObjectWithDefaults(page, { + type: 'Sine Wave Generator', + name: 'Alpha Sine Wave Generator' + }); + await createDomainObjectWithDefaults(page, { + type: 'Sine Wave Generator', + name: 'Beta Sine Wave Generator' + }); + + await page.goto(conditionSet.url); + + // Change the object to edit mode + await page.getByLabel('Edit Object').click(); + + // Expand the 'My Items' folder in the left tree + await page.getByLabel('Show selected item in tree').click(); + // Add the Alpha & Beta Sine Wave Generator to the Condition Set and save changes + const treePane = page.getByRole('tree', { + name: 'Main Tree' + }); + const alphaGeneratorTreeItem = treePane.getByRole('treeitem', { + name: 'Alpha Sine Wave Generator' + }); + const betaGeneratorTreeItem = treePane.getByRole('treeitem', { + name: 'Beta Sine Wave Generator' + }); + const conditionCollection = page.locator('#conditionCollection'); + + await alphaGeneratorTreeItem.dragTo(conditionCollection); + await betaGeneratorTreeItem.dragTo(conditionCollection); + + await page.locator('button[title="Save"]').click(); + await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); + + await page.getByLabel('Open the View Switcher Menu').click(); + + await expect(page.getByRole('menuitem', { name: /Lad Table/ })).toBeHidden(); + await expect(page.getByRole('menuitem', { name: /Conditions View/ })).toBeVisible(); + await expect(page.getByRole('menuitem', { name: /Plot/ })).toBeVisible(); + await expect(page.getByRole('menuitem', { name: /Telemetry Table/ })).toBeVisible(); + await page.getByLabel('Plot').click(); + await expect( + page.getByLabel('Plot Legend Collapsed').getByText('Test Condition Set') + ).toBeVisible(); + await page.getByLabel('Open the View Switcher Menu').click(); + await page.getByLabel('Telemetry Table').click(); + await expect(page.getByRole('searchbox', { name: 'output filter input' })).toBeVisible(); + await page.getByLabel('Open the View Switcher Menu').click(); + await page.getByLabel('Conditions View').click(); + await expect(page.getByText('Current Output')).toBeVisible(); + }); + test('ConditionSet has correct outputs when telemetry is and is not available', async ({ + page + }) => { + const exampleTelemetry = await createExampleTelemetryObject(page); + + await page.getByLabel('Show selected item in tree').click(); + await page.goto(conditionSet.url); + // Change the object to edit mode + await page.getByLabel('Edit Object').click(); + + // Create two conditions + await page.locator('#addCondition').click(); + await page.locator('#addCondition').click(); + await page.locator('#conditionCollection').getByRole('textbox').nth(0).fill('First Condition'); + await page.locator('#conditionCollection').getByRole('textbox').nth(1).fill('Second Condition'); + + // Add Telemetry to ConditionSet + const sineWaveGeneratorTreeItem = page + .getByRole('tree', { + name: 'Main Tree' + }) + .getByRole('treeitem', { + name: exampleTelemetry.name + }); + const conditionCollection = page.locator('#conditionCollection'); + await sineWaveGeneratorTreeItem.dragTo(conditionCollection); + + // Modify First Criterion + const firstCriterionTelemetry = page.locator( + '[aria-label="Criterion Telemetry Selection"] >> nth=0' + ); + firstCriterionTelemetry.selectOption({ label: exampleTelemetry.name }); + const firstCriterionMetadata = page.locator( + '[aria-label="Criterion Metadata Selection"] >> nth=0' + ); + firstCriterionMetadata.selectOption({ label: 'Sine' }); + const firstCriterionComparison = page.locator( + '[aria-label="Criterion Comparison Selection"] >> nth=0' + ); + firstCriterionComparison.selectOption({ label: 'is greater than or equal to' }); + const firstCriterionInput = page.locator('[aria-label="Criterion Input"] >> nth=0'); + await firstCriterionInput.fill('0'); + + // Modify First Criterion + const secondCriterionTelemetry = page.locator( + '[aria-label="Criterion Telemetry Selection"] >> nth=1' + ); + secondCriterionTelemetry.selectOption({ label: exampleTelemetry.name }); + + const secondCriterionMetadata = page.locator( + '[aria-label="Criterion Metadata Selection"] >> nth=1' + ); + secondCriterionMetadata.selectOption({ label: 'Sine' }); + + const secondCriterionComparison = page.locator( + '[aria-label="Criterion Comparison Selection"] >> nth=1' + ); + secondCriterionComparison.selectOption({ label: 'is less than' }); + + const secondCriterionInput = page.locator('[aria-label="Criterion Input"] >> nth=1'); + await secondCriterionInput.fill('0'); + + // Save ConditionSet + await page.locator('button[title="Save"]').click(); + await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); + + // Validate that the condition set is evaluating and outputting + // the correct value when the underlying telemetry subscription is active. + let outputValue = page.getByLabel('Current Output Value'); + await expect(outputValue).toHaveText('false'); + + await page.goto(exampleTelemetry.url); + + // Edit SWG to add 8 second loading delay to simulate the case + // where telemetry is not available. + await page.getByTitle('More actions').click(); + await page.getByRole('menuitem', { name: 'Edit Properties...' }).click(); + await page.getByRole('spinbutton', { name: 'Loading Delay (ms)' }).fill('8000'); + await page.getByLabel('Save').click(); + + // Expect that the output value is blank or '---' if the + // underlying telemetry subscription is not active. + await page.goto(conditionSet.url); + await expect(outputValue).toHaveText('---'); + }); + + test('ConditionSet has correct outputs when test data is enabled', async ({ page }) => { + const exampleTelemetry = await createExampleTelemetryObject(page); + + await page.getByLabel('Show selected item in tree').click(); + await page.goto(conditionSet.url); + // Change the object to edit mode + await page.getByLabel('Edit Object').click(); + + // Create two conditions + await page.locator('#addCondition').click(); + await page.locator('#addCondition').click(); + await page.locator('#conditionCollection').getByRole('textbox').nth(0).fill('First Condition'); + await page.locator('#conditionCollection').getByRole('textbox').nth(1).fill('Second Condition'); + + // Add Telemetry to ConditionSet + const sineWaveGeneratorTreeItem = page + .getByRole('tree', { + name: 'Main Tree' + }) + .getByRole('treeitem', { + name: exampleTelemetry.name + }); + const conditionCollection = page.locator('#conditionCollection'); + await sineWaveGeneratorTreeItem.dragTo(conditionCollection); + + // Modify First Criterion + const firstCriterionTelemetry = page.locator( + '[aria-label="Criterion Telemetry Selection"] >> nth=0' + ); + firstCriterionTelemetry.selectOption({ label: exampleTelemetry.name }); + const firstCriterionMetadata = page.locator( + '[aria-label="Criterion Metadata Selection"] >> nth=0' + ); + firstCriterionMetadata.selectOption({ label: 'Sine' }); + const firstCriterionComparison = page.locator( + '[aria-label="Criterion Comparison Selection"] >> nth=0' + ); + firstCriterionComparison.selectOption({ label: 'is greater than or equal to' }); + const firstCriterionInput = page.locator('[aria-label="Criterion Input"] >> nth=0'); + await firstCriterionInput.fill('0'); + + // Modify Second Criterion + const secondCriterionTelemetry = page.locator( + '[aria-label="Criterion Telemetry Selection"] >> nth=1' + ); + await secondCriterionTelemetry.selectOption({ label: exampleTelemetry.name }); + + const secondCriterionMetadata = page.locator( + '[aria-label="Criterion Metadata Selection"] >> nth=1' + ); + await secondCriterionMetadata.selectOption({ label: 'Sine' }); + + const secondCriterionComparison = page.locator( + '[aria-label="Criterion Comparison Selection"] >> nth=1' + ); + await secondCriterionComparison.selectOption({ label: 'is less than' }); + + const secondCriterionInput = page.locator('[aria-label="Criterion Input"] >> nth=1'); + await secondCriterionInput.fill('0'); + + // Enable test data + await page.getByLabel('Apply Test Data').nth(1).click(); + const testDataTelemetry = page.locator('[aria-label="Test Data Telemetry Selection"] >> nth=0'); + await testDataTelemetry.selectOption({ label: exampleTelemetry.name }); + + const testDataMetadata = page.locator('[aria-label="Test Data Metadata Selection"] >> nth=0'); + await testDataMetadata.selectOption({ label: 'Sine' }); + + const testInput = page.locator('[aria-label="Test Data Input"] >> nth=0'); + await testInput.fill('0'); + + // Validate that the condition set is evaluating and outputting + // the correct value when the underlying telemetry subscription is active. + let outputValue = page.getByLabel('Current Output Value'); + await expect(outputValue).toHaveText('false'); + + await page.goto(exampleTelemetry.url); + }); + + test.fixme('Ensure condition sets work with telemetry like operator status', ({ page }) => { + test.info().annotations.push({ + type: 'issue', + description: 'https://github.com/nasa/openmct/issues/7484' + }); + }); +}); + +test.describe('Condition Set Composition', () => { + let conditionSet; + let exampleTelemetry; + + test.beforeEach(async ({ page }) => { + await page.goto('./', { waitUntil: 'domcontentloaded' }); + + // Create Condition Set + conditionSet = await createDomainObjectWithDefaults(page, { + type: 'Condition Set' + }); + + // Create Telemetry Object as child to Condition Set + exampleTelemetry = await createExampleTelemetryObject(page, conditionSet.uuid); + + // Edit Condition Set + await page.goto(conditionSet.url); + await page.getByRole('button', { name: 'Edit Object' }).click(); + + // Add Condition to Condition Set + await page.getByRole('button', { name: 'Add Condition' }).click(); + + // Enter Condition Output + await page.getByLabel('Condition Name Input').first().fill('Negative'); + await page.getByLabel('Condition Output Type').first().selectOption({ value: 'string' }); + await page.getByLabel('Condition Output String').first().fill('Negative'); + + // Condition Trigger default is okay so no change needed to form + + // Enter Condition Criterion + await page.getByLabel('Criterion Telemetry Selection').first().selectOption({ value: 'all' }); + await page.getByLabel('Criterion Metadata Selection').first().selectOption({ value: 'sin' }); + await page + .locator('select[aria-label="Criterion Comparison Selection"]') + .first() + .selectOption({ value: 'lessThan' }); + await page.getByLabel('Criterion Input').first().fill('0'); + + // Save the Condition Set + await page.getByRole('button', { name: 'Save' }).click(); + await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); + }); + + test('You can remove telemetry from a condition set with existing conditions', async ({ + page + }) => { + test.info().annotations.push({ + type: 'issue', + description: 'https://github.com/nasa/openmct/issues/7710' + }); + + await page.getByLabel('Expand My Items folder').click(); + await page.getByLabel(`Expand ${conditionSet.name} conditionSet`).click(); + + await page + .getByLabel(`Navigate to ${exampleTelemetry.name}`, { exact: false }) + .click({ button: 'right' }); + + await page + .getByLabel(`${exampleTelemetry.name} Context Menu`) + .getByRole('menuitem', { name: 'Remove' }) + .click(); + await page.getByRole('button', { name: 'Ok', exact: true }).click(); + + await page + .getByLabel(`Navigate to ${conditionSet.name} conditionSet Object`, { exact: true }) + .click(); + await page.getByRole('button', { name: 'Edit Object' }).click(); + await page.getByRole('tab', { name: 'Elements' }).click(); + expect( + await page + .getByRole('tabpanel', { name: 'Inspector Views' }) + .getByRole('listitem', { name: exampleTelemetry.name }) + .count() + ).toEqual(0); + }); +}); diff --git a/e2e/tests/functional/plugins/displayLayout/displayLayout.e2e.spec.js b/e2e/tests/functional/plugins/displayLayout/displayLayout.e2e.spec.js index a187c88522..1d2294ab91 100644 --- a/e2e/tests/functional/plugins/displayLayout/displayLayout.e2e.spec.js +++ b/e2e/tests/functional/plugins/displayLayout/displayLayout.e2e.spec.js @@ -24,8 +24,8 @@ import { fileURLToPath } from 'url'; import { createDomainObjectWithDefaults, navigateToObjectWithFixedTimeBounds, + setFixedIndependentTimeConductorBounds, setFixedTimeMode, - setIndependentTimeConductorBounds, setRealTimeMode, setStartOffset } from '../../../../appActions.js'; @@ -75,18 +75,12 @@ test.describe('Display Layout Sub-object Actions @localStorage', () => { const TEST_FIXED_END_TIME = TEST_FIXED_START_TIME + 3600000; // 2024-11-11 20:11:11.000Z // Verify the ITC has the expected initial bounds - expect( - await page - .getByLabel('Child Overlay Plot 1 Frame Controls') - .getByLabel('Start bounds') - .textContent() - ).toEqual(INIT_ITC_START_BOUNDS); - expect( - await page - .getByLabel('Child Overlay Plot 1 Frame Controls') - .getByLabel('End bounds') - .textContent() - ).toEqual(INIT_ITC_END_BOUNDS); + await expect( + page.getByLabel('Child Overlay Plot 1 Frame Controls').getByLabel('Start bounds') + ).toHaveText(INIT_ITC_START_BOUNDS); + await expect( + page.getByLabel('Child Overlay Plot 1 Frame Controls').getByLabel('End bounds') + ).toHaveText(INIT_ITC_END_BOUNDS); // Update the global fixed bounds to 2024-11-11 19:11:11.000Z / 2024-11-11 20:11:11.000Z const url = page.url().split('?')[0]; @@ -98,18 +92,12 @@ test.describe('Display Layout Sub-object Actions @localStorage', () => { ); // ITC bounds should still match the initial ITC bounds - expect( - await page - .getByLabel('Child Overlay Plot 1 Frame Controls') - .getByLabel('Start bounds') - .textContent() - ).toEqual(INIT_ITC_START_BOUNDS); - expect( - await page - .getByLabel('Child Overlay Plot 1 Frame Controls') - .getByLabel('End bounds') - .textContent() - ).toEqual(INIT_ITC_END_BOUNDS); + await expect( + page.getByLabel('Child Overlay Plot 1 Frame Controls').getByLabel('Start bounds') + ).toHaveText(INIT_ITC_START_BOUNDS); + await expect( + page.getByLabel('Child Overlay Plot 1 Frame Controls').getByLabel('End bounds') + ).toHaveText(INIT_ITC_END_BOUNDS); // Open the Child Overlay Plot 1 in a new tab await page.getByLabel('View menu items').click(); @@ -120,28 +108,22 @@ test.describe('Display Layout Sub-object Actions @localStorage', () => { await newPage.waitForLoadState('domcontentloaded'); // Verify that the global time conductor bounds in the new page match the updated global bounds - expect( - await newPage.getByLabel('Global Time Conductor').getByLabel('Start bounds').textContent() - ).toEqual(NEW_GLOBAL_START_BOUNDS); - expect( - await newPage.getByLabel('Global Time Conductor').getByLabel('End bounds').textContent() - ).toEqual(NEW_GLOBAL_END_BOUNDS); + await expect(newPage.getByLabel('Global Time Conductor').getByLabel('Start bounds')).toHaveText( + NEW_GLOBAL_START_BOUNDS + ); + await expect(newPage.getByLabel('Global Time Conductor').getByLabel('End bounds')).toHaveText( + NEW_GLOBAL_END_BOUNDS + ); // Verify that the ITC is enabled in the new page await expect(newPage.getByLabel('Disable Independent Time Conductor')).toBeVisible(); // Verify that the ITC bounds in the new page match the original ITC bounds - expect( - await newPage - .getByLabel('Independent Time Conductor Panel') - .getByLabel('Start bounds') - .textContent() - ).toEqual(INIT_ITC_START_BOUNDS); - expect( - await newPage - .getByLabel('Independent Time Conductor Panel') - .getByLabel('End bounds') - .textContent() - ).toEqual(INIT_ITC_END_BOUNDS); + await expect( + newPage.getByLabel('Independent Time Conductor Panel').getByLabel('Start bounds') + ).toHaveText(INIT_ITC_START_BOUNDS); + await expect( + newPage.getByLabel('Independent Time Conductor Panel').getByLabel('End bounds') + ).toHaveText(INIT_ITC_END_BOUNDS); }); }); @@ -174,17 +156,17 @@ test.describe('Display Layout Toolbar Actions @localStorage', () => { test('can add/remove Image to a single layout', async ({ page }) => { const layoutObject = 'Image'; await test.step("Add and remove image element from the parent's layout", async () => { - expect(await page.getByLabel(`Move ${layoutObject} Frame`).count()).toBe(0); + await expect(page.getByLabel(`Move ${layoutObject} Frame`)).toHaveCount(0); await addLayoutObject(page, PARENT_DISPLAY_LAYOUT_NAME, layoutObject); - expect(await page.getByLabel(`Move ${layoutObject} Frame`).count()).toBe(1); + await expect(page.getByLabel(`Move ${layoutObject} Frame`)).toHaveCount(1); await removeLayoutObject(page, layoutObject); - expect(await page.getByLabel(`Move ${layoutObject} Frame`).count()).toBe(0); + await expect(page.getByLabel(`Move ${layoutObject} Frame`)).toHaveCount(0); }); await test.step("Add and remove image from the child's layout", async () => { await addLayoutObject(page, CHILD_DISPLAY_LAYOUT_NAME1, layoutObject); - expect(await page.getByLabel(`Move ${layoutObject} Frame`).count()).toBe(1); + await expect(page.getByLabel(`Move ${layoutObject} Frame`)).toHaveCount(1); await removeLayoutObject(page, layoutObject); - expect(await page.getByLabel(`Move ${layoutObject} Frame`).count()).toBe(0); + await expect(page.getByLabel(`Move ${layoutObject} Frame`)).toHaveCount(0); }); }); test(`can add/remove Box to a single layout`, async ({ page }) => { @@ -253,20 +235,17 @@ test.describe('Display Layout', () => { const sineWaveGeneratorTreeItem = treePane.getByRole('treeitem', { name: new RegExp(sineWaveObject.name) }); - const layoutGridHolder = page.locator('.l-layout__grid-holder'); - await sineWaveGeneratorTreeItem.dragTo(layoutGridHolder); + await sineWaveGeneratorTreeItem.dragTo(page.getByLabel('Layout Grid')); await page.locator('button[title="Save"]').click(); await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); // Subscribe to the Sine Wave Generator data // On getting data, check if the value found in the Display Layout is the most recent value // from the Sine Wave Generator - const getTelemValuePromise = await subscribeToTelemetry(page, sineWaveObject.uuid); - const formattedTelemetryValue = getTelemValuePromise; - const displayLayoutValuePromise = await page.waitForSelector( - `text="${formattedTelemetryValue}"` - ); - const displayLayoutValue = await displayLayoutValuePromise.textContent(); + const getTelemValuePromise = subscribeToTelemetry(page, sineWaveObject.uuid); + const formattedTelemetryValue = await getTelemValuePromise; + await expect(page.getByText(formattedTelemetryValue)).toBeVisible(); + const displayLayoutValue = await page.getByText(formattedTelemetryValue).textContent(); const trimmedDisplayValue = displayLayoutValue.trim(); expect(trimmedDisplayValue).toBe(formattedTelemetryValue); @@ -298,24 +277,21 @@ test.describe('Display Layout', () => { const sineWaveGeneratorTreeItem = treePane.getByRole('treeitem', { name: new RegExp(sineWaveObject.name) }); - const layoutGridHolder = page.locator('.l-layout__grid-holder'); - await sineWaveGeneratorTreeItem.dragTo(layoutGridHolder); + await sineWaveGeneratorTreeItem.dragTo(page.getByLabel('Layout Grid')); await page.locator('button[title="Save"]').click(); await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); // Subscribe to the Sine Wave Generator data - const getTelemValuePromise = await subscribeToTelemetry(page, sineWaveObject.uuid); + const getTelemValuePromise = subscribeToTelemetry(page, sineWaveObject.uuid); // Set an offset of 1 minute and then change the time mode to fixed to set a 1 minute historical window - await setStartOffset(page, { mins: '1' }); + await setStartOffset(page, { startMins: '1' }); await setFixedTimeMode(page); // On getting data, check if the value found in the Display Layout is the most recent value // from the Sine Wave Generator - const formattedTelemetryValue = getTelemValuePromise; - const displayLayoutValuePromise = await page.waitForSelector( - `text="${formattedTelemetryValue}"` - ); - const displayLayoutValue = await displayLayoutValuePromise.textContent(); + const formattedTelemetryValue = await getTelemValuePromise; + await expect(page.getByText(formattedTelemetryValue)).toBeVisible(); + const displayLayoutValue = await page.getByText(formattedTelemetryValue).textContent(); const trimmedDisplayValue = displayLayoutValue.trim(); expect(trimmedDisplayValue).toBe(formattedTelemetryValue); @@ -340,8 +316,7 @@ test.describe('Display Layout', () => { const sineWaveGeneratorTreeItem = treePane.getByRole('treeitem', { name: new RegExp(sineWaveObject.name) }); - const layoutGridHolder = page.locator('.l-layout__grid-holder'); - await sineWaveGeneratorTreeItem.dragTo(layoutGridHolder); + await sineWaveGeneratorTreeItem.dragTo(page.getByLabel('Layout Grid')); await page.locator('button[title="Save"]').click(); await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); @@ -382,8 +357,7 @@ test.describe('Display Layout', () => { const sineWaveGeneratorTreeItem = treePane.getByRole('treeitem', { name: new RegExp(sineWaveObject.name) }); - const layoutGridHolder = page.locator('.l-layout__grid-holder'); - await sineWaveGeneratorTreeItem.dragTo(layoutGridHolder); + await sineWaveGeneratorTreeItem.dragTo(page.getByLabel('Layout Grid')); await page.locator('button[title="Save"]').click(); await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); @@ -428,8 +402,7 @@ test.describe('Display Layout', () => { const exampleImageryTreeItem = treePane.getByRole('treeitem', { name: new RegExp(exampleImageryObject.name) }); - let layoutGridHolder = page.locator('.l-layout__grid-holder'); - await exampleImageryTreeItem.dragTo(layoutGridHolder); + await exampleImageryTreeItem.dragTo(page.getByLabel('Layout Grid')); //adjust so that we can see the independent time conductor toggle // Adjust object height @@ -445,7 +418,7 @@ test.describe('Display Layout', () => { const startDate = '2021-12-30 01:01:00.000Z'; const endDate = '2021-12-30 01:11:00.000Z'; - await setIndependentTimeConductorBounds(page, { start: startDate, end: endDate }); + await setFixedIndependentTimeConductorBounds(page, { start: startDate, end: endDate }); // check image date await expect(page.getByText('2021-12-30 01:11:00.000Z').first()).toBeVisible(); @@ -456,7 +429,7 @@ test.describe('Display Layout', () => { await expect(page.getByText('2021-12-30 01:11:00.000Z')).toBeHidden(); }); - test('When multiple plots are contained in a layout, we only ask for annotations once @couchdb', async ({ + test('When multiple plots are contained in a layout, we only ask for annotations once @couchdb @network', async ({ page }) => { await setFixedTimeMode(page); @@ -485,9 +458,8 @@ test.describe('Display Layout', () => { name: new RegExp(sineWaveObject.name) }); - let layoutGridHolder = page.locator('.l-layout__grid-holder'); // eslint-disable-next-line playwright/no-force-option - await sineWaveGeneratorTreeItem.dragTo(layoutGridHolder, { force: true }); + await sineWaveGeneratorTreeItem.dragTo(page.getByLabel('Layout Grid'), { force: true }); await page.getByText('View type').click(); await page.getByText('Overlay Plot').click(); @@ -495,14 +467,13 @@ test.describe('Display Layout', () => { const anotherSineWaveGeneratorTreeItem = treePane.getByRole('treeitem', { name: new RegExp(anotherSineWaveObject.name) }); - layoutGridHolder = page.locator('.l-layout__grid-holder'); // eslint-disable-next-line playwright/no-force-option - await anotherSineWaveGeneratorTreeItem.dragTo(layoutGridHolder, { force: true }); + await anotherSineWaveGeneratorTreeItem.dragTo(page.getByLabel('Layout Grid'), { force: true }); await page.getByText('View type').click(); await page.getByText('Overlay Plot').click(); - await page.locator('button[title="Save"]').click(); + await page.getByLabel('Save').click(); await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); // Time to inspect some network traffic @@ -519,10 +490,10 @@ test.describe('Display Layout', () => { await page.reload(); // wait for annotations requests to be batched and requested - await page.waitForLoadState('networkidle'); + await page.waitForLoadState('domcontentloaded'); // Network requests for the composite telemetry with multiple items should be: // 1. a single batched request for annotations - expect(networkRequests.length).toBe(1); + await expect.poll(() => networkRequests, { timeout: 10000 }).toHaveLength(1); await setRealTimeMode(page); @@ -531,15 +502,15 @@ test.describe('Display Layout', () => { await page.reload(); // wait for annotations to not load (if we have any, we've got a problem) - await page.waitForLoadState('networkidle'); + await page.waitForLoadState('domcontentloaded'); // In real time mode, we don't fetch annotations at all - expect(networkRequests.length).toBe(0); + await expect.poll(() => networkRequests, { timeout: 10000 }).toHaveLength(0); }); }); async function addAndRemoveDrawingObjectAndAssert(page, layoutObject, DISPLAY_LAYOUT_NAME) { - expect(await page.getByLabel(layoutObject, { exact: true }).count()).toBe(0); + await expect(page.getByLabel(layoutObject, { exact: true })).toHaveCount(0); await addLayoutObject(page, DISPLAY_LAYOUT_NAME, layoutObject); expect( await page @@ -549,7 +520,7 @@ async function addAndRemoveDrawingObjectAndAssert(page, layoutObject, DISPLAY_LA .count() ).toBe(1); await removeLayoutObject(page, layoutObject); - expect(await page.getByLabel(layoutObject, { exact: true }).count()).toBe(0); + await expect(page.getByLabel(layoutObject, { exact: true })).toHaveCount(0); } /** @@ -565,7 +536,7 @@ async function removeLayoutObject(page, layoutObject) { // eslint-disable-next-line playwright/no-force-option .click({ force: true }); await page.getByTitle('Delete the selected object').click(); - await page.getByRole('button', { name: 'OK', exact: true }).click(); + await page.getByRole('button', { name: 'Ok', exact: true }).click(); } /** @@ -584,10 +555,10 @@ async function addLayoutObject(page, layoutName, layoutObject) { .click(); if (layoutObject === 'Text') { await page.getByRole('textbox', { name: 'Text' }).fill('Hello, Universe!'); - await page.getByText('OK').click(); + await page.getByText('Ok').click(); } else if (layoutObject === 'Image') { await page.getByLabel('Image URL').fill(TINY_IMAGE_BASE64); - await page.getByText('OK').click(); + await page.getByText('Ok').click(); } } diff --git a/e2e/tests/functional/plugins/faultManagement/faultManagement.e2e.spec.js b/e2e/tests/functional/plugins/faultManagement/faultManagement.e2e.spec.js index 7b3898a34c..792c2abacc 100644 --- a/e2e/tests/functional/plugins/faultManagement/faultManagement.e2e.spec.js +++ b/e2e/tests/functional/plugins/faultManagement/faultManagement.e2e.spec.js @@ -62,17 +62,15 @@ test.describe('The Fault Management Plugin using example faults', () => { await selectFaultItem(page, 1); await page.getByRole('tab', { name: 'Config' }).click(); - const selectedFaultName = await page - .locator('.c-fault-mgmt__list.is-selected .c-fault-mgmt__list-faultname') - .textContent(); - const inspectorFaultNameCount = await page - .locator(`.c-inspector__properties >> :text("${selectedFaultName}")`) - .count(); + + const inspectorFaultName = page + .getByLabel('Source inspector properties') + .getByLabel('inspector property value'); await expect( page.locator('.c-faults-list-view-item-body > .c-fault-mgmt__list').first() ).toHaveClass(/is-selected/); - expect(inspectorFaultNameCount).toEqual(1); + await expect(inspectorFaultName).toHaveCount(1); }); test('When selecting multiple faults, no specific fault information is shown in the inspector', async ({ @@ -110,13 +108,13 @@ test.describe('The Fault Management Plugin using example faults', () => { // check it is removed from standard view const afterShelvedFault = getFaultByName(page, shelvedFaultName); - expect(await afterShelvedFault.count()).toBe(0); + await expect(afterShelvedFault).toHaveCount(0); await changeViewTo(page, 'shelved'); const shelvedViewFault = getFaultByName(page, shelvedFaultName); - expect(await shelvedViewFault.count()).toBe(1); + await expect(shelvedViewFault).toHaveCount(1); }); test('Allows you to acknowledge a fault', async ({ page }) => { diff --git a/e2e/tests/functional/plugins/flexibleLayout/flexibleLayout.e2e.spec.js b/e2e/tests/functional/plugins/flexibleLayout/flexibleLayout.e2e.spec.js index 9024199953..41540834ae 100644 --- a/e2e/tests/functional/plugins/flexibleLayout/flexibleLayout.e2e.spec.js +++ b/e2e/tests/functional/plugins/flexibleLayout/flexibleLayout.e2e.spec.js @@ -24,7 +24,7 @@ import { fileURLToPath } from 'url'; import { createDomainObjectWithDefaults, - setIndependentTimeConductorBounds + setFixedIndependentTimeConductorBounds } from '../../../../appActions.js'; import { expect, test } from '../../../../pluginFixtures.js'; @@ -78,8 +78,8 @@ test.describe('Flexible Layout', () => { // Expand the 'My Items' folder in the left tree await page.locator('.c-tree__item__view-control.c-disclosure-triangle').first().click(); // Add the Sine Wave Generator and Clock to the Flexible Layout - await sineWaveGeneratorTreeItem.dragTo(page.locator('.c-fl__container.is-empty').first()); - await clockTreeItem.dragTo(page.locator('.c-fl__container.is-empty')); + await sineWaveGeneratorTreeItem.dragTo(page.locator('.c-fl-container.is-empty').first()); + await clockTreeItem.dragTo(page.locator('.c-fl-container.is-empty')); // Check that panes can be dragged while Flexible Layout is in Edit mode let dragWrapper = page .locator('.c-fl-container__frames-holder .c-fl-frame__drag-wrapper') @@ -105,8 +105,8 @@ test.describe('Flexible Layout', () => { // Expand the 'My Items' folder in the left tree await page.locator('.c-tree__item__view-control.c-disclosure-triangle').first().click(); // Add the Sine Wave Generator and Clock to the Flexible Layout - await sineWaveGeneratorTreeItem.dragTo(page.locator('.c-fl__container.is-empty').first()); - await clockTreeItem.dragTo(page.locator('.c-fl__container.is-empty')); + await sineWaveGeneratorTreeItem.dragTo(page.locator('.c-fl-container.is-empty').first()); + await clockTreeItem.dragTo(page.locator('.c-fl-container.is-empty')); // Click on the first frame to select it await page.locator('.c-fl-container__frame').first().click(); @@ -122,7 +122,7 @@ test.describe('Flexible Layout', () => { expect(await page.locator('.c-fl--rows').count()).toEqual(0); // Change the layout to rows orientation - await page.getByTitle('Columns layout').click(); + await page.getByTitle('Switch to rows layout').click(); // Assert the layout is in rows orientation expect(await page.locator('.c-fl--rows').count()).toBeGreaterThan(0); @@ -171,7 +171,7 @@ test.describe('Flexible Layout', () => { // Expand the 'My Items' folder in the left tree await page.locator('.c-tree__item__view-control.c-disclosure-triangle').first().click(); // Add the Sine Wave Generator to the Flexible Layout and save changes - await sineWaveGeneratorTreeItem.dragTo(page.locator('.c-fl__container.is-empty').first()); + await sineWaveGeneratorTreeItem.dragTo(page.locator('.c-fl-container.is-empty').first()); await page.locator('button[title="Save"]').click(); await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); @@ -202,7 +202,7 @@ test.describe('Flexible Layout', () => { // Expand the 'My Items' folder in the left tree await page.locator('.c-tree__item__view-control.c-disclosure-triangle').click(); // Add the Sine Wave Generator to the Flexible Layout and save changes - await sineWaveGeneratorTreeItem.dragTo(page.locator('.c-fl__container.is-empty').first()); + await sineWaveGeneratorTreeItem.dragTo(page.locator('.c-fl-container.is-empty').first()); await page.locator('button[title="Save"]').click(); await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); @@ -242,13 +242,13 @@ test.describe('Flexible Layout', () => { name: new RegExp(exampleImageryObject.name) }); // Add the Sine Wave Generator to the Flexible Layout and save changes - await exampleImageryTreeItem.dragTo(page.locator('.c-fl__container.is-empty').first()); + await exampleImageryTreeItem.dragTo(page.locator('.c-fl-container.is-empty').first()); await page.locator('button[title="Save"]').click(); await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); // flip on independent time conductor - await setIndependentTimeConductorBounds(page, { + await setFixedIndependentTimeConductorBounds(page, { start: '2021-12-30 01:01:00.000Z', end: '2021-12-30 01:11:00.000Z' }); @@ -292,7 +292,7 @@ test.describe('Flexible Layout Toolbar Actions @localStorage', () => { await expect(page.getByRole('dialog', { name: 'Overlay' })).toContainText( 'This action will permanently delete this container from this Flexible Layout. Do you want to continue?' ); - await page.getByRole('button', { name: 'OK', exact: true }).click(); + await page.getByRole('button', { name: 'Ok', exact: true }).click(); expect(await containerHandles.count()).toEqual(2); }); test('Remove Frame', async ({ page }) => { @@ -302,16 +302,16 @@ test.describe('Flexible Layout Toolbar Actions @localStorage', () => { await expect(page.getByRole('dialog', { name: 'Overlay' })).toContainText( 'This action will remove this frame from this Flexible Layout. Do you want to continue?' ); - await page.getByRole('button', { name: 'OK', exact: true }).click(); + await page.getByRole('button', { name: 'Ok', exact: true }).click(); expect(await page.getByRole('group', { name: 'Frame' }).count()).toEqual(1); }); test('Columns/Rows Layout Toggle', async ({ page }) => { await page.getByRole('columnheader', { name: 'Container Handle 1' }).click(); const flexRows = page.getByLabel('Flexible Layout Row'); expect(await flexRows.count()).toEqual(0); - await page.getByTitle('Columns layout').click(); + await page.getByTitle('Switch to rows layout').click(); expect(await flexRows.count()).toEqual(1); - await page.getByTitle('Rows layout').click(); + await page.getByTitle('Switch to columns layout').click(); expect(await flexRows.count()).toEqual(0); }); }); diff --git a/e2e/tests/functional/plugins/gauge/gauge.e2e.spec.js b/e2e/tests/functional/plugins/gauge/gauge.e2e.spec.js index d2dd067f30..d85c89883a 100644 --- a/e2e/tests/functional/plugins/gauge/gauge.e2e.spec.js +++ b/e2e/tests/functional/plugins/gauge/gauge.e2e.spec.js @@ -38,7 +38,7 @@ test.describe('Gauge', () => { await page.goto('./', { waitUntil: 'domcontentloaded' }); }); - test('Can add and remove telemetry sources @unstable', async ({ page }) => { + test('Can add and remove telemetry sources', async ({ page }) => { // Create the gauge with defaults const gauge = await createDomainObjectWithDefaults(page, { type: 'Gauge' }); @@ -53,6 +53,7 @@ test.describe('Gauge', () => { // the SWG appears in the elements pool await page.goto(gauge.url); await page.getByLabel('Edit Object').click(); + await page.getByRole('tab', { name: 'Elements' }).click(); await expect.soft(page.locator(`#inspector-elements-tree >> text=${swg1.name}`)).toBeVisible(); await page.getByRole('button', { name: 'Save' }).click(); await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); @@ -65,38 +66,35 @@ test.describe('Gauge', () => { }); // Verify that the 'Replace telemetry source' modal appears and accept it - await expect - .soft( - page.locator( - 'text=This action will replace the current telemetry source. Do you want to continue?' - ) + await expect( + page.getByText( + 'This action will replace the current telemetry source. Do you want to continue?' ) - .toBeVisible(); - await page.click('text=Ok'); + ).toBeVisible(); + await page.getByRole('button', { name: 'Ok', exact: true }).click(); // Navigate to the gauge and verify that the new SWG // appears in the elements pool and the old one is gone await page.goto(gauge.url); await page.getByLabel('Edit Object').click(); - await expect.soft(page.locator(`#inspector-elements-tree >> text=${swg1.name}`)).toBeHidden(); - await expect.soft(page.locator(`#inspector-elements-tree >> text=${swg2.name}`)).toBeVisible(); + await page.getByRole('tab', { name: 'Elements' }).click(); + await expect(page.getByLabel(`Preview ${swg1.name}`)).toBeHidden(); + await expect(page.getByLabel(`Preview ${swg2.name}`)).toBeVisible(); await page.getByRole('button', { name: 'Save' }).click(); // Right click on the new SWG in the elements pool and delete it - await page.locator(`#inspector-elements-tree >> text=${swg2.name}`).click({ + await page.getByLabel(`Preview ${swg2.name}`).click({ button: 'right' }); - await page.locator('li[title="Remove this object from its containing object."]').click(); + await page.getByLabel('Remove').click(); // Verify that the 'Remove object' confirmation modal appears and accept it - await expect - .soft( - page.locator( - 'text=Warning! This action will remove this object. Are you sure you want to continue?' - ) + await expect( + page.getByText( + 'Warning! This action will remove this object. Are you sure you want to continue?' ) - .toBeVisible(); - await page.click('text=Ok'); + ).toBeVisible(); + await page.getByRole('button', { name: 'Ok', exact: true }).click(); // Verify that the elements pool shows no elements await expect(page.locator('text="No contained elements"')).toBeVisible(); @@ -110,11 +108,11 @@ test.describe('Gauge', () => { await page.getByRole('button', { name: 'Create' }).click(); // Click the object specified by 'type' - await page.click(`li[role='menuitem']:text("Gauge")`); + await page.getByRole('menuitem', { name: 'Gauge' }).click(); // FIXME: We need better selectors for these custom form controls const displayCurrentValueSwitch = page.locator('.c-toggle-switch__slider >> nth=0'); - await displayCurrentValueSwitch.setChecked(false); - await page.click('button[aria-label="Save"]'); + await displayCurrentValueSwitch.uncheck(); + await page.getByLabel('Save').click(); // TODO: Verify changes in the UI }); @@ -126,24 +124,21 @@ test.describe('Gauge', () => { // Create the gauge with defaults await createDomainObjectWithDefaults(page, { type: 'Gauge' }); - await page.click('button[title="More actions"]'); - await page.click('li[role="menuitem"]:has-text("Edit Properties")'); + await page.getByLabel('More actions').click(); + await page.getByRole('menuitem', { name: 'Edit Properties...' }).click(); // FIXME: We need better selectors for these custom form controls const displayCurrentValueSwitch = page.locator('.c-toggle-switch__slider >> nth=0'); - await displayCurrentValueSwitch.setChecked(false); - await page.click('button[aria-label="Save"]'); + await displayCurrentValueSwitch.uncheck(); + await page.getByLabel('Save').click(); // TODO: Verify changes in the UI }); - test.fixme('Gauge does not display NaN when data not available', async ({ page }) => { - test.info().annotations.push({ - type: 'issue', - description: 'https://github.com/nasa/openmct/issues/7421' - }); + test('Gauge does not display NaN when data not available', async ({ page }) => { // Create a Gauge const gauge = await createDomainObjectWithDefaults(page, { - type: 'Gauge' + type: 'Gauge', + name: 'Gauge with no data' }); // Create a Sine Wave Generator in the Gauge with a loading delay @@ -154,7 +149,7 @@ test.describe('Gauge', () => { await page.getByRole('menuitem', { name: /Edit Properties.../ }).click(); //Edit Example Telemetry Object to include 5s loading Delay - await page.locator('[aria-label="Loading Delay \\(ms\\)"]').fill('5000'); + await page.getByLabel('Loading Delay (ms)', { exact: true }).fill('5000'); await page.getByRole('button', { name: 'Save' }).click(); @@ -162,9 +157,13 @@ test.describe('Gauge', () => { await page.waitForURL(`**/${gauge.uuid}/*`); // Nav to the Gauge - await page.goto(gauge.url); - const gaugeNoDataText = await page.locator('.js-dial-current-value tspan').textContent(); - expect(gaugeNoDataText).toBe('--'); + await page.goto(gauge.url, { waitUntil: 'domcontentloaded' }); + // Check that the value is not displayed + //TODO https://github.com/nasa/openmct/issues/7790 update this locator + await expect(page.getByTitle('Value is currently out of')).toHaveAttribute( + 'aria-valuenow', + '--' + ); }); test('Gauge enforces composition policy', async ({ page }) => { diff --git a/e2e/tests/functional/plugins/imagery/exampleImagery.e2e.spec.js b/e2e/tests/functional/plugins/imagery/exampleImagery.e2e.spec.js index 9a7df4136c..d75e104e0d 100644 --- a/e2e/tests/functional/plugins/imagery/exampleImagery.e2e.spec.js +++ b/e2e/tests/functional/plugins/imagery/exampleImagery.e2e.spec.js @@ -25,14 +25,21 @@ This test suite is dedicated to tests which verify the basic operations surround but only assume that example imagery is present. */ -import { createDomainObjectWithDefaults, setRealTimeMode } from '../../../../appActions.js'; -import { waitForAnimations } from '../../../../baseFixtures.js'; +import { + createDomainObjectWithDefaults, + navigateToObjectWithRealTime, + setRealTimeMode +} from '../../../../appActions.js'; +import { MISSION_TIME } from '../../../../constants.js'; import { expect, test } from '../../../../pluginFixtures.js'; -const backgroundImageSelector = '.c-imagery__main-image__background-image'; const panHotkey = process.platform === 'linux' ? ['Shift', 'Alt'] : ['Alt']; const tagHotkey = ['Shift', 'Alt']; const expectedAltText = process.platform === 'linux' ? 'Shift+Alt drag to pan' : 'Alt drag to pan'; const thumbnailUrlParamsRegexp = /\?w=100&h=100/; +const IMAGE_LOAD_DELAY = 5 * 1000; +const MOUSE_WHEEL_DELTA_Y = 120; +const FIVE_MINUTES = 1000 * 60 * 5; +const THIRTY_SECONDS = 1000 * 30; //The following block of tests verifies the basic functionality of example imagery and serves as a template for Imagery objects embedded in other objects. test.describe('Example Imagery Object', () => { @@ -45,8 +52,10 @@ test.describe('Example Imagery Object', () => { // Verify that the created object is focused await expect(page.locator('.l-browse-bar__object-name')).toContainText(exampleImagery.name); - await page.locator('.c-imagery__main-image__bg').hover({ trial: true }); - await page.locator(backgroundImageSelector).waitFor(); + await page.getByLabel('Focused Image Element').hover({ trial: true }); + + // Wait for image thumbnail auto-scroll to complete + await expect(page.getByLabel('Image Thumbnail from').last()).toBeInViewport(); }); test('Can use Mouse Wheel to zoom in and out of latest image', async ({ page }) => { @@ -63,9 +72,10 @@ test.describe('Example Imagery Object', () => { test('Can right click on image and open it in a new tab @2p', async ({ page, context }) => { // try to right click on image - const backgroundImage = await page.locator(backgroundImageSelector); + const backgroundImage = page.getByLabel('Focused Image Element'); await backgroundImage.click({ button: 'right', + // Need force option here due to annotation overlay which blocks playwright's click // eslint-disable-next-line playwright/no-force-option force: true }); @@ -80,7 +90,7 @@ test.describe('Example Imagery Object', () => { const newPage = await pagePromise; await newPage.waitForLoadState(); // expect new tab url to have jpg in it - await expect(newPage.url()).toContain('.jpg'); + expect(newPage.url()).toContain('.jpg'); }); // this requires CORS to be enabled in some fashion @@ -105,27 +115,36 @@ test.describe('Example Imagery Object', () => { type: 'issue', description: 'https://github.com/nasa/openmct/issues/6821' }); + // Test independent fixed time with global fixed time // flip on independent time conductor - await page.getByRole('switch', { name: 'Enable Independent Time Conductor' }).click(); + await page.getByLabel('Enable Independent Time Conductor').click(); - // Adding in delay to address flakiness of ITC test-- button event handlers not registering in time await expect(page.locator('#independentTCToggle')).toBeChecked(); await expect(page.locator('.c-compact-tc').first()).toBeVisible(); - + await expect( + page.getByRole('button', { name: 'Independent Time Conductor Settings' }) + ).toBeEnabled(); await page.getByRole('button', { name: 'Independent Time Conductor Settings' }).click(); + await expect(page.getByLabel('Time Conductor Options')).toBeVisible(); + await page.getByLabel('Time Conductor Options').hover({ trial: true }); + await page.getByRole('textbox', { name: 'Start date' }).hover({ trial: true }); await page.getByRole('textbox', { name: 'Start date' }).fill('2021-12-30'); await page.keyboard.press('Tab'); + await page.getByRole('textbox', { name: 'Start time' }).hover({ trial: true }); await page.getByRole('textbox', { name: 'Start time' }).fill('01:01:00'); await page.keyboard.press('Tab'); + await page.getByRole('textbox', { name: 'End date' }).hover({ trial: true }); await page.getByRole('textbox', { name: 'End date' }).fill('2021-12-30'); await page.keyboard.press('Tab'); + await page.getByRole('textbox', { name: 'End time' }).hover({ trial: true }); await page.getByRole('textbox', { name: 'End time' }).fill('01:11:00'); - await page.keyboard.press('Tab'); - await page.keyboard.press('Enter'); + await page.getByRole('textbox', { name: 'End time' }).fill('01:11:00'); + await page.getByLabel('Submit time bounds').click(); - // check image date + // wait for image thumbnails to stabilize + await page.getByLabel('Image Thumbnails', { exact: true }).hover({ trial: true }); await expect(page.getByText('2021-12-30 01:01:00.000Z').first()).toBeVisible(); // flip it off @@ -166,14 +185,11 @@ test.describe('Example Imagery Object', () => { }); test('Can use alt+drag to move around image once zoomed in', async ({ page }) => { - const deltaYStep = 100; //equivalent to 1x zoom - await page.locator('.c-imagery__main-image__bg').hover({ trial: true }); // zoom in - await page.mouse.wheel(0, deltaYStep * 2); - await page.locator('.c-imagery__main-image__bg').hover({ trial: true }); - const zoomedBoundingBox = await page.locator(backgroundImageSelector).boundingBox(); + await page.mouse.wheel(0, MOUSE_WHEEL_DELTA_Y * 2); + const zoomedBoundingBox = await page.getByLabel('Focused Image Element').boundingBox(); const imageCenterX = zoomedBoundingBox.x + zoomedBoundingBox.width / 2; const imageCenterY = zoomedBoundingBox.y + zoomedBoundingBox.height / 2; // move to the right @@ -195,7 +211,7 @@ test.describe('Example Imagery Object', () => { await page.mouse.move(imageCenterX - 200, imageCenterY, 10); await page.mouse.up(); await Promise.all(panHotkey.map((x) => page.keyboard.up(x))); - const afterRightPanBoundingBox = await page.locator(backgroundImageSelector).boundingBox(); + const afterRightPanBoundingBox = await page.getByLabel('Focused Image Element').boundingBox(); expect(zoomedBoundingBox.x).toBeGreaterThan(afterRightPanBoundingBox.x); // pan left @@ -204,7 +220,7 @@ test.describe('Example Imagery Object', () => { await page.mouse.move(imageCenterX, imageCenterY, 10); await page.mouse.up(); await Promise.all(panHotkey.map((x) => page.keyboard.up(x))); - const afterLeftPanBoundingBox = await page.locator(backgroundImageSelector).boundingBox(); + const afterLeftPanBoundingBox = await page.getByLabel('Focused Image Element').boundingBox(); expect(afterRightPanBoundingBox.x).toBeLessThan(afterLeftPanBoundingBox.x); // pan up @@ -214,7 +230,7 @@ test.describe('Example Imagery Object', () => { await page.mouse.move(imageCenterX, imageCenterY + 200, 10); await page.mouse.up(); await Promise.all(panHotkey.map((x) => page.keyboard.up(x))); - const afterUpPanBoundingBox = await page.locator(backgroundImageSelector).boundingBox(); + const afterUpPanBoundingBox = await page.getByLabel('Focused Image Element').boundingBox(); expect(afterUpPanBoundingBox.y).toBeGreaterThan(afterLeftPanBoundingBox.y); // pan down @@ -223,7 +239,7 @@ test.describe('Example Imagery Object', () => { await page.mouse.move(imageCenterX, imageCenterY - 200, 10); await page.mouse.up(); await Promise.all(panHotkey.map((x) => page.keyboard.up(x))); - const afterDownPanBoundingBox = await page.locator(backgroundImageSelector).boundingBox(); + const afterDownPanBoundingBox = await page.getByLabel('Focused Image Element').boundingBox(); expect(afterDownPanBoundingBox.y).toBeLessThan(afterUpPanBoundingBox.y); }); @@ -282,26 +298,43 @@ test.describe('Example Imagery Object', () => { await expect(page.getByText('Drilling')).toBeVisible(); }); - test('Can use + - buttons to zoom on the image @unstable', async ({ page }) => { + test('Can use + - buttons to zoom on the image', async ({ page }) => { await buttonZoomOnImageAndAssert(page); }); - test('Can use the reset button to reset the image @unstable', async ({ page }, testInfo) => { + test('Can use the reset button to reset the image', async ({ page }) => { + await expect(page.getByLabel('Focused Image Element')).toHaveJSProperty( + 'style.transform', + 'scale(1) translate(0px, 0px)' + ); + // Get initial image dimensions - const initialBoundingBox = await page.locator(backgroundImageSelector).boundingBox(); + const initialBoundingBox = await page.getByLabel('Focused Image Element').boundingBox(); // Zoom in twice via button await zoomIntoImageryByButton(page); + await expect(page.getByLabel('Focused Image Element')).toHaveJSProperty( + 'style.transform', + 'scale(2) translate(0px, 0px)' + ); await zoomIntoImageryByButton(page); + await expect(page.getByLabel('Focused Image Element')).toHaveJSProperty( + 'style.transform', + 'scale(3) translate(0px, 0px)' + ); // Get and assert zoomed in image dimensions - const zoomedInBoundingBox = await page.locator(backgroundImageSelector).boundingBox(); - expect.soft(zoomedInBoundingBox.height).toBeGreaterThan(initialBoundingBox.height); - expect.soft(zoomedInBoundingBox.width).toBeGreaterThan(initialBoundingBox.width); + const zoomedInBoundingBox = await page.getByLabel('Focused Image Element').boundingBox(); + expect(zoomedInBoundingBox.height).toBeGreaterThan(initialBoundingBox.height); + expect(zoomedInBoundingBox.width).toBeGreaterThan(initialBoundingBox.width); // Reset pan and zoom and assert against initial image dimensions await resetImageryPanAndZoom(page); - const finalBoundingBox = await page.locator(backgroundImageSelector).boundingBox(); + await expect(page.getByLabel('Focused Image Element')).toHaveJSProperty( + 'style.transform', + 'scale(1) translate(0px, 0px)' + ); + const finalBoundingBox = await page.getByLabel('Focused Image Element').boundingBox(); expect(finalBoundingBox).toEqual(initialBoundingBox); }); @@ -319,25 +352,30 @@ test.describe('Example Imagery Object', () => { }); test('Uses low fetch priority', async ({ page }) => { - const priority = await page.locator('.js-imageryView-image').getAttribute('fetchpriority'); - expect(priority).toBe('low'); + const priority = page.locator('.js-imageryView-image'); + await expect(priority).toHaveAttribute('fetchpriority', 'low'); }); }); -test.describe('Example Imagery in Display Layout', () => { +test.describe('Example Imagery in Display Layout @clock', () => { let displayLayout; + test.beforeEach(async ({ page }) => { + // We mock the clock so that we don't need to wait for time driven events + // to verify functionality. + await page.clock.install({ time: MISSION_TIME }); + await page.clock.resume(); + // Go to baseURL await page.goto('./', { waitUntil: 'domcontentloaded' }); displayLayout = await createDomainObjectWithDefaults(page, { type: 'Display Layout' }); - await page.goto(displayLayout.url); - await createImageryView(page); - - await expect(page.locator('.l-browse-bar__object-name')).toContainText( - 'Unnamed Example Imagery' - ); + // Create Example Imagery inside Display Layout + await createImageryViewWithShortDelay(page, { + name: 'Unnamed Example Imagery', + parent: displayLayout.uuid + }); await page.goto(displayLayout.url); }); @@ -390,7 +428,7 @@ test.describe('Example Imagery in Display Layout', () => { await expect.soft(pausePlayButton).toHaveClass(/is-paused/); }); - test('Imagery View operations @unstable', async ({ page }) => { + test('Imagery View operations @clock', async ({ page }) => { test.info().annotations.push({ type: 'issue', description: 'https://github.com/nasa/openmct/issues/5265' @@ -410,7 +448,9 @@ test.describe('Example Imagery in Display Layout', () => { await page.locator('div[title="Resize object width"] > input').click(); await page.locator('div[title="Resize object width"] > input').fill('50'); - await performImageryViewOperationsAndAssert(page); + await expect(page.getByLabel('Image Thumbnail from').last()).toBeInViewport(); + + await performImageryViewOperationsAndAssert(page, displayLayout); }); test('Resizing the layout changes thumbnail visibility and size', async ({ page }) => { @@ -454,7 +494,10 @@ test.describe('Example Imagery in Display Layout', () => { type: 'issue', description: 'https://github.com/nasa/openmct/issues/6709' }); - await createImageryView(page); + await createImageryViewWithShortDelay(page, { + name: 'Unnamed Example Imagery', + parent: displayLayout.uuid + }); await page.goto(displayLayout.url); const imageElements = page.locator('.c-imagery__main-image-wrapper'); @@ -483,80 +526,61 @@ test.describe('Example Imagery in Display Layout', () => { }); }); -test.describe('Example Imagery in Flexible layout', () => { +test.describe('Example Imagery in Flexible layout @clock', () => { let flexibleLayout; test.beforeEach(async ({ page }) => { + // We mock the clock so that we don't need to wait for time driven events + // to verify functionality. + await page.clock.install({ time: MISSION_TIME }); + await page.clock.resume(); + await page.goto('./', { waitUntil: 'domcontentloaded' }); flexibleLayout = await createDomainObjectWithDefaults(page, { type: 'Flexible Layout' }); // Create Example Imagery inside the Flexible Layout - await createDomainObjectWithDefaults(page, { - type: 'Example Imagery', + await createImageryViewWithShortDelay(page, { + name: 'Unnamed Example Imagery', parent: flexibleLayout.uuid }); // Navigate back to Flexible Layout await page.goto(flexibleLayout.url); + // Wait for image thumbnail auto-scroll to complete + await expect(page.getByLabel('Image Thumbnail from').last()).toBeInViewport(); }); test('Can double-click on the image to view large image', async ({ page }) => { // Double-click on the image to open large view - const imageElement = await page.getByRole('button', { name: 'Image Wrapper' }); + const imageElement = page.getByRole('button', { name: 'Image Wrapper' }); await imageElement.dblclick(); // Check if the large view is visible - await page.getByRole('button', { name: 'Background Image', state: 'visible' }); + page.getByRole('button', { name: 'Focused Image Element', state: 'visible' }); // Close the large view await page.getByRole('button', { name: 'Close' }).click(); }); - test.beforeEach(async ({ page }) => { - await page.goto('./', { waitUntil: 'domcontentloaded' }); - - flexibleLayout = await createDomainObjectWithDefaults(page, { type: 'Flexible Layout' }); - await page.goto(flexibleLayout.url); - - /* Create Sine Wave Generator with minimum Image Load Delay */ - // Click the Create button - await page.getByRole('button', { name: 'Create' }).click(); - - // Click text=Example Imagery - await page.click('li[role="menuitem"]:has-text("Example Imagery")'); - - // Clear and set Image load delay to minimum value - await page.locator('input[type="number"]').fill(''); - await page.locator('input[type="number"]').fill('5000'); - - // Click text=OK - await Promise.all([ - page.waitForNavigation({ waitUntil: 'networkidle' }), - page.click('button:has-text("OK")'), - //Wait for Save Banner to appear - page.waitForSelector('.c-message-banner__message') - ]); - - await expect(page.locator('.l-browse-bar__object-name')).toContainText( - 'Unnamed Example Imagery' - ); - - await page.goto(flexibleLayout.url); - }); - test('Imagery View operations @unstable', async ({ page, browserName }) => { + test('Imagery View operations @clock', async ({ page, browserName }) => { test.fixme(browserName === 'firefox', 'This test needs to be updated to work with firefox'); test.info().annotations.push({ type: 'issue', description: 'https://github.com/nasa/openmct/issues/5326' }); - await performImageryViewOperationsAndAssert(page); + await performImageryViewOperationsAndAssert(page, flexibleLayout); }); }); -test.describe('Example Imagery in Tabs View', () => { +test.describe('Example Imagery in Tabs View @clock', () => { let tabsView; test.beforeEach(async ({ page }) => { + // We mock the clock so that we don't need to wait for time driven events + // to verify functionality. + await page.clock.install({ time: MISSION_TIME }); + await page.clock.resume(); + await page.goto('./', { waitUntil: 'domcontentloaded' }); tabsView = await createDomainObjectWithDefaults(page, { type: 'Tabs View' }); @@ -567,28 +591,24 @@ test.describe('Example Imagery in Tabs View', () => { await page.getByRole('button', { name: 'Create' }).click(); // Click text=Example Imagery - await page.click('li[role="menuitem"]:has-text("Example Imagery")'); + await page.getByRole('menuitem', { name: 'Example Imagery' }).click(); // Clear and set Image load delay to minimum value - await page.locator('input[type="number"]').fill(''); - await page.locator('input[type="number"]').fill('5000'); + await page.locator('input[type="number"]').clear(); + await page.locator('input[type="number"]').fill(`${IMAGE_LOAD_DELAY}`); - // Click text=OK - await Promise.all([ - page.waitForNavigation({ waitUntil: 'networkidle' }), - page.click('button:has-text("OK")'), - //Wait for Save Banner to appear - page.waitForSelector('.c-message-banner__message') - ]); + await page.getByLabel('Save').click(); await expect(page.locator('.l-browse-bar__object-name')).toContainText( 'Unnamed Example Imagery' ); await page.goto(tabsView.url); + // Wait for image thumbnail auto-scroll to complete + await expect(page.getByLabel('Image Thumbnail from').last()).toBeInViewport(); }); - test('Imagery View operations @unstable', async ({ page }) => { - await performImageryViewOperationsAndAssert(page); + test('Imagery View operations @clock', async ({ page }) => { + await performImageryViewOperationsAndAssert(page, tabsView); }); }); @@ -652,20 +672,21 @@ test.describe('Example Imagery in Time Strip', () => { * 7. Image brightness/contrast can be adjusted by dragging the sliders * @param {import('@playwright/test').Page} page */ -async function performImageryViewOperationsAndAssert(page) { +async function performImageryViewOperationsAndAssert(page, layoutObject) { // Verify that imagery thumbnails use a thumbnail url - const thumbnailImages = page.locator('.c-thumb__image'); + const thumbnailImages = page.getByLabel('Image thumbnail from').locator('.c-thumb__image'); const mainImage = page.locator('.c-imagery__main-image__image'); await expect(thumbnailImages.first()).toHaveAttribute('src', thumbnailUrlParamsRegexp); await expect(mainImage).not.toHaveAttribute('src', thumbnailUrlParamsRegexp); - // Click previous image button - const previousImageButton = page.locator('.c-nav--prev'); - await previousImageButton.click(); + const previousImageButton = page.getByLabel('Previous image'); + await expect(previousImageButton).toBeVisible(); + await page.getByLabel('Image Wrapper').hover({ trial: true }); - // Verify previous image - const selectedImage = page.locator('.selected'); - await expect(selectedImage).toBeVisible(); + // Need to force click as the annotation canvas lies on top of the image + // and fails the accessibility checks + // eslint-disable-next-line playwright/no-force-option + await previousImageButton.click({ force: true }); // Use the zoom buttons to zoom in and out await buttonZoomOnImageAndAssert(page); @@ -680,42 +701,51 @@ async function performImageryViewOperationsAndAssert(page) { await mouseZoomOnImageAndAssert(page, -2); // Click next image button - const nextImageButton = page.locator('.c-nav--next'); - await nextImageButton.click(); - + const nextImageButton = page.getByLabel('Next image'); + await expect(nextImageButton).toBeVisible(); + await page.getByLabel('Image Wrapper').hover({ trial: true }); + // eslint-disable-next-line playwright/no-force-option + await nextImageButton.click({ force: true }); // set realtime mode - await setRealTimeMode(page); + await navigateToObjectWithRealTime( + page, + layoutObject.url, + `${FIVE_MINUTES}`, + `${THIRTY_SECONDS}` + ); + // Verify previous image + await expect(previousImageButton).toBeVisible(); + await page.getByLabel('Image Wrapper').hover({ trial: true }); + // eslint-disable-next-line playwright/no-force-option + await previousImageButton.click({ force: true }); + await page.locator('.active').click(); + const selectedImage = page.locator('.selected'); + await expect(selectedImage).toBeVisible(); // Zoom in on next image await mouseZoomOnImageAndAssert(page, 2); // Clicking on the left arrow should pause the imagery and go to previous image await previousImageButton.click(); - await expect(page.locator('.c-button.pause-play')).toHaveClass(/is-paused/); + await expect(page.getByLabel('Pause automatic scrolling of image thumbnails')).toBeVisible(); await expect(selectedImage).toBeVisible(); - // The imagery view should be updated when new images come in - const imageCount = await page.locator('.c-imagery__thumb').count(); - await expect - .poll( - async () => { - const newImageCount = await page.locator('.c-imagery__thumb').count(); - - return newImageCount; - }, - { - message: 'verify that old images are discarded', - timeout: 7 * 1000 - } - ) - .toBe(imageCount); - // Verify selected image is still displayed await expect(selectedImage).toBeVisible(); // Unpause imagery await page.locator('.pause-play').click(); + // verify that old images are discarded + const lastImageInBounds = page.getByLabel('Image thumbnail from').first(); + const lastImageTimestamp = await lastImageInBounds.getAttribute('title'); + expect(lastImageTimestamp).not.toBeNull(); + + // go forward in time to ensure old images are discarded + await page.clock.fastForward(IMAGE_LOAD_DELAY); + await page.clock.resume(); + await expect(page.getByLabel(lastImageTimestamp)).toBeHidden(); + //Get background-image url from background-image css prop await assertBackgroundImageUrlFromBackgroundCss(page); @@ -789,47 +819,26 @@ async function assertBackgroundImageBrightness(page, expected) { * @param {import('@playwright/test').Page} page */ async function assertBackgroundImageUrlFromBackgroundCss(page) { - const backgroundImage = page.locator('.c-imagery__main-image__background-image'); - let backgroundImageUrl = await backgroundImage.evaluate((el) => { + const backgroundImage = page.getByLabel('Focused Image Element'); + const backgroundImageUrl = await backgroundImage.evaluate((el) => { return window .getComputedStyle(el) .getPropertyValue('background-image') .match(/url\(([^)]+)\)/)[1]; }); - let backgroundImageUrl1 = backgroundImageUrl.slice(1, -1); //forgive me, padre - console.log('backgroundImageUrl1 ' + backgroundImageUrl1); - let backgroundImageUrl2; - await expect - .poll( - async () => { - // Verify next image has updated - let backgroundImageUrlNext = await backgroundImage.evaluate((el) => { - return window - .getComputedStyle(el) - .getPropertyValue('background-image') - .match(/url\(([^)]+)\)/)[1]; - }); - backgroundImageUrl2 = backgroundImageUrlNext.slice(1, -1); //forgive me, padre - - return backgroundImageUrl2; - }, - { - message: 'verify next image has updated', - timeout: 7 * 1000 - } - ) - .not.toBe(backgroundImageUrl1); - console.log('backgroundImageUrl2 ' + backgroundImageUrl2); + // go forward in time to ensure old images are discarded + await page.clock.fastForward(IMAGE_LOAD_DELAY); + await page.clock.resume(); + await expect(backgroundImage).not.toHaveJSProperty('background-image', backgroundImageUrl); } /** * @param {import('@playwright/test').Page} page */ async function panZoomAndAssertImageProperties(page) { - const imageryHintsText = await page.locator('.c-imagery__hints').innerText(); - expect(expectedAltText).toEqual(imageryHintsText); - const zoomedBoundingBox = await page.locator(backgroundImageSelector).boundingBox(); + await expect(page.locator('.c-imagery__hints')).toContainText(expectedAltText); + const zoomedBoundingBox = await page.getByLabel('Focused Image Element').boundingBox(); const imageCenterX = zoomedBoundingBox.x + zoomedBoundingBox.width / 2; const imageCenterY = zoomedBoundingBox.y + zoomedBoundingBox.height / 2; @@ -839,7 +848,7 @@ async function panZoomAndAssertImageProperties(page) { await page.mouse.move(imageCenterX - 200, imageCenterY, 10); await page.mouse.up(); await Promise.all(panHotkey.map((x) => page.keyboard.up(x))); - const afterRightPanBoundingBox = await page.locator(backgroundImageSelector).boundingBox(); + const afterRightPanBoundingBox = await page.getByLabel('Focused Image Element').boundingBox(); expect(zoomedBoundingBox.x).toBeGreaterThan(afterRightPanBoundingBox.x); // Pan left @@ -848,7 +857,7 @@ async function panZoomAndAssertImageProperties(page) { await page.mouse.move(imageCenterX, imageCenterY, 10); await page.mouse.up(); await Promise.all(panHotkey.map((x) => page.keyboard.up(x))); - const afterLeftPanBoundingBox = await page.locator(backgroundImageSelector).boundingBox(); + const afterLeftPanBoundingBox = await page.getByLabel('Focused Image Element').boundingBox(); expect(afterRightPanBoundingBox.x).toBeLessThan(afterLeftPanBoundingBox.x); // Pan up @@ -858,7 +867,7 @@ async function panZoomAndAssertImageProperties(page) { await page.mouse.move(imageCenterX, imageCenterY + 200, 10); await page.mouse.up(); await Promise.all(panHotkey.map((x) => page.keyboard.up(x))); - const afterUpPanBoundingBox = await page.locator(backgroundImageSelector).boundingBox(); + const afterUpPanBoundingBox = await page.getByLabel('Focused Image Element').boundingBox(); expect(afterUpPanBoundingBox.y).toBeGreaterThanOrEqual(afterLeftPanBoundingBox.y); // Pan down @@ -867,7 +876,7 @@ async function panZoomAndAssertImageProperties(page) { await page.mouse.move(imageCenterX, imageCenterY - 200, 10); await page.mouse.up(); await Promise.all(panHotkey.map((x) => page.keyboard.up(x))); - const afterDownPanBoundingBox = await page.locator(backgroundImageSelector).boundingBox(); + const afterDownPanBoundingBox = await page.getByLabel('Focused Image Element').boundingBox(); expect(afterDownPanBoundingBox.y).toBeLessThanOrEqual(afterUpPanBoundingBox.y); } @@ -879,19 +888,20 @@ async function panZoomAndAssertImageProperties(page) { */ async function mouseZoomOnImageAndAssert(page, factor = 2) { // Zoom in - const originalImageDimensions = await page.locator(backgroundImageSelector).boundingBox(); - const deltaYStep = 100; // equivalent to 1x zoom - await page.mouse.wheel(0, deltaYStep * factor); - const zoomedBoundingBox = await page.locator(backgroundImageSelector).boundingBox(); + await page.getByLabel('Focused Image Element').hover({ trial: true }); + const originalImageDimensions = await page.getByLabel('Focused Image Element').boundingBox(); + await page.mouse.wheel(0, MOUSE_WHEEL_DELTA_Y * factor); + await waitForZoomAndPanTransitions(page); + + const zoomedBoundingBox = await page.getByLabel('Focused Image Element').boundingBox(); const imageCenterX = zoomedBoundingBox.x + zoomedBoundingBox.width / 2; const imageCenterY = zoomedBoundingBox.y + zoomedBoundingBox.height / 2; // center the mouse pointer await page.mouse.move(imageCenterX, imageCenterY); - // Wait for zoom animation to finish - await page.locator('.c-imagery__main-image__bg').hover({ trial: true }); - const imageMouseZoomed = await page.locator(backgroundImageSelector).boundingBox(); + // Wait for zoom animation to finish and get the new image dimensions + const imageMouseZoomed = await page.getByLabel('Focused Image Element').boundingBox(); if (factor > 0) { expect(imageMouseZoomed.height).toBeGreaterThan(originalImageDimensions.height); @@ -908,29 +918,61 @@ async function mouseZoomOnImageAndAssert(page, factor = 2) { * @param {import('@playwright/test').Page} page */ async function buttonZoomOnImageAndAssert(page) { + // Lock the zoom and pan so it doesn't reset if a new image comes in + await page.getByLabel('Focused Image Element').hover({ trial: true }); + const lockButton = page.getByRole('button', { + name: 'Lock current zoom and pan across all images' + }); + if (!(await lockButton.isVisible())) { + await page.getByLabel('Focused Image Element').hover({ trial: true }); + } + await lockButton.click(); + + await expect(page.getByLabel('Focused Image Element')).toHaveJSProperty( + 'style.transform', + 'scale(1) translate(0px, 0px)' + ); + // Get initial image dimensions - const initialBoundingBox = await page.locator(backgroundImageSelector).boundingBox(); + const initialBoundingBox = await page.getByLabel('Focused Image Element').boundingBox(); // Zoom in twice via button await zoomIntoImageryByButton(page); + await expect(page.getByLabel('Focused Image Element')).toHaveJSProperty( + 'style.transform', + 'scale(2) translate(0px, 0px)' + ); await zoomIntoImageryByButton(page); + await expect(page.getByLabel('Focused Image Element')).toHaveJSProperty( + 'style.transform', + 'scale(3) translate(0px, 0px)' + ); // Get and assert zoomed in image dimensions - const zoomedInBoundingBox = await page.locator(backgroundImageSelector).boundingBox(); + const zoomedInBoundingBox = await page.getByLabel('Focused Image Element').boundingBox(); expect(zoomedInBoundingBox.height).toBeGreaterThan(initialBoundingBox.height); expect(zoomedInBoundingBox.width).toBeGreaterThan(initialBoundingBox.width); // Zoom out once via button await zoomOutOfImageryByButton(page); + await expect(page.getByLabel('Focused Image Element')).toHaveJSProperty( + 'style.transform', + 'scale(2) translate(0px, 0px)' + ); // Get and assert zoomed out image dimensions - const zoomedOutBoundingBox = await page.locator(backgroundImageSelector).boundingBox(); + const zoomedOutBoundingBox = await page.getByLabel('Focused Image Element').boundingBox(); expect(zoomedOutBoundingBox.height).toBeLessThan(zoomedInBoundingBox.height); expect(zoomedOutBoundingBox.width).toBeLessThan(zoomedInBoundingBox.width); // Zoom out again via button, assert against the initial image dimensions await zoomOutOfImageryByButton(page); - const finalBoundingBox = await page.locator(backgroundImageSelector).boundingBox(); + await expect(page.getByLabel('Focused Image Element')).toHaveJSProperty( + 'style.transform', + 'scale(1) translate(0px, 0px)' + ); + + const finalBoundingBox = await page.getByLabel('Focused Image Element').boundingBox(); expect(finalBoundingBox).toEqual(initialBoundingBox); } @@ -957,16 +999,11 @@ async function assertBackgroundImageContrast(page, expected) { */ async function zoomIntoImageryByButton(page) { // FIXME: There should only be one set of imagery buttons, but there are two? - const zoomInBtn = page - .locator("[role='toolbar'][aria-label='Image controls'] .t-btn-zoom-in") - .nth(0); - const backgroundImage = page.locator(backgroundImageSelector); - if (!(await zoomInBtn.isVisible())) { - await backgroundImage.hover({ trial: true }); - } - + const zoomInBtn = page.getByRole('button', { name: 'Zoom in' }); + const backgroundImage = page.getByLabel('Focused Image Element'); + await backgroundImage.hover({ trial: true }); await zoomInBtn.click(); - await waitForAnimations(backgroundImage); + await waitForZoomAndPanTransitions(page); } /** @@ -975,17 +1012,11 @@ async function zoomIntoImageryByButton(page) { * @param {import('@playwright/test').Page} page */ async function zoomOutOfImageryByButton(page) { - // FIXME: There should only be one set of imagery buttons, but there are two? - const zoomOutBtn = page - .locator("[role='toolbar'][aria-label='Image controls'] .t-btn-zoom-out") - .nth(0); - const backgroundImage = page.locator(backgroundImageSelector); - if (!(await zoomOutBtn.isVisible())) { - await backgroundImage.hover({ trial: true }); - } - + const zoomOutBtn = page.getByRole('button', { name: 'Zoom out' }); + const backgroundImage = page.getByLabel('Focused Image Element'); + await backgroundImage.hover({ trial: true }); await zoomOutBtn.click(); - await waitForAnimations(backgroundImage); + await waitForZoomAndPanTransitions(page); } /** @@ -994,38 +1025,42 @@ async function zoomOutOfImageryByButton(page) { * @param {import('@playwright/test').Page} page */ async function resetImageryPanAndZoom(page) { - // FIXME: There should only be one set of imagery buttons, but there are two? - const panZoomResetBtn = page - .locator("[role='toolbar'][aria-label='Image controls'] .t-btn-zoom-reset") - .nth(0); - const backgroundImage = page.locator(backgroundImageSelector); - if (!(await panZoomResetBtn.isVisible())) { - await backgroundImage.hover({ trial: true }); - } - + const panZoomResetBtn = page.getByRole('button', { name: 'Remove zoom and pan' }); + await expect(panZoomResetBtn).toBeVisible(); + await panZoomResetBtn.hover({ trial: true }); await panZoomResetBtn.click(); - await waitForAnimations(backgroundImage); + + await waitForZoomAndPanTransitions(page); + await expect(page.getByText('Alt drag to pan')).toBeHidden(); + await expect(page.locator('.c-thumb__viewable-area')).toBeHidden(); } /** * @param {import('@playwright/test').Page} page */ -async function createImageryView(page) { - // Click the Create button - await page.getByRole('button', { name: 'Create' }).click(); - - // Click text=Example Imagery - await page.click('li[role="menuitem"]:has-text("Example Imagery")'); +async function createImageryViewWithShortDelay(page, { name, parent }) { + await createDomainObjectWithDefaults(page, { + name, + type: 'Example Imagery', + parent + }); + await expect(page.locator('.l-browse-bar__object-name')).toContainText('Unnamed Example Imagery'); + await page.getByLabel('More actions').click(); + await page.getByLabel('Edit Properties').click(); // Clear and set Image load delay to minimum value - await page.locator('input[type="number"]').fill(''); - await page.locator('input[type="number"]').fill('5000'); - - // Click text=OK - await Promise.all([ - page.waitForNavigation({ waitUntil: 'networkidle' }), - page.click('button:has-text("OK")'), - //Wait for Save Banner to appear - page.waitForSelector('.c-message-banner__message') - ]); + await page.locator('input[type="number"]').fill(`${IMAGE_LOAD_DELAY}`); + await page.getByLabel('Save').click(); +} + +/** + * @param {import('@playwright/test').Page} page + */ +async function waitForZoomAndPanTransitions(page) { + // Wait for image to stabilize + await page.getByLabel('Focused Image Element').hover({ trial: true }); + // Wait for zoom to end + await expect(page.getByLabel('Focused Image Element')).not.toHaveClass(/is-zooming|is-panning/); + // Wait for image to stabilize + await page.getByLabel('Focused Image Element').hover({ trial: true }); } diff --git a/e2e/tests/functional/plugins/importAndExportAsJSON/exportAsJson.e2e.spec.js b/e2e/tests/functional/plugins/importAndExportAsJSON/exportAsJson.e2e.spec.js index e8cc3c6344..753ae18d9d 100644 --- a/e2e/tests/functional/plugins/importAndExportAsJSON/exportAsJson.e2e.spec.js +++ b/e2e/tests/functional/plugins/importAndExportAsJSON/exportAsJson.e2e.spec.js @@ -26,10 +26,7 @@ This test suite is dedicated to tests which verify the basic operations surround import fs from 'fs/promises'; -import { - createDomainObjectWithDefaults, - openObjectTreeContextMenu -} from '../../../../appActions.js'; +import { createDomainObjectWithDefaults } from '../../../../appActions.js'; import { expect, test } from '../../../../baseFixtures.js'; import { navigateToFaultManagementWithExample } from '../../../../helper/faultUtils.js'; @@ -51,7 +48,10 @@ test.describe('ExportAsJSON', () => { await page.goto(folder.url); // Open context menu and initiate download - await openObjectTreeContextMenu(page, folder.url); + await page.getByLabel('Show selected item in tree').click(); + await page.getByRole('treeitem', { name: 'Expand e2e folder folder' }).click({ + button: 'right' + }); const [download] = await Promise.all([ page.waitForEvent('download'), // Waits for the download event page.getByLabel('Export as JSON').click() // Triggers the download @@ -105,7 +105,12 @@ test.describe('ExportAsJSON', () => { await page.goto(timer.url); //do this against parent folder.url, NOT timer.url child - await openObjectTreeContextMenu(page, folder.url); + // Open context menu and initiate download + await page.getByLabel('Show selected item in tree').click(); + await page.getByRole('treeitem', { name: 'Collapse e2e folder folder' }).click({ + button: 'right' + }); + // Open context menu and initiate download const [download] = await Promise.all([ page.waitForEvent('download'), // Waits for the download event @@ -141,18 +146,18 @@ test.describe('ExportAsJSON Disabled Actions', () => { }); test('Verify that the ExportAsJSON dropdown does not appear for the item X', async ({ page }) => { await page.getByLabel('More actions').click(); - await expect(await page.getByLabel('Export as JSON')).toHaveCount(0); + await expect(page.getByLabel('Export as JSON')).toHaveCount(0); await page.getByRole('treeitem', { name: 'Fault Management' }).click({ button: 'right' }); - await expect(await page.getByLabel('Export as JSON')).toHaveCount(0); + await expect(page.getByLabel('Export as JSON')).toHaveCount(0); }); }); test.describe('ExportAsJSON ProgressBar @couchdb', () => { let folder; test.beforeEach(async ({ page }) => { - await page.goto('./', { waitUntil: 'networkidle' }); + await page.goto('./', { waitUntil: 'domcontentloaded' }); // Perform actions to create the domain object folder = await createDomainObjectWithDefaults(page, { type: 'Folder' diff --git a/e2e/tests/functional/plugins/inspectorDataVisualization/numericData.e2e.spec.js b/e2e/tests/functional/plugins/inspectorDataVisualization/numericData.e2e.spec.js index d8ff8df76e..80e28bb5cd 100644 --- a/e2e/tests/functional/plugins/inspectorDataVisualization/numericData.e2e.spec.js +++ b/e2e/tests/functional/plugins/inspectorDataVisualization/numericData.e2e.spec.js @@ -36,7 +36,7 @@ test.describe('Testing numeric data with inspector data visualization (i.e., dat }); test('Can click on telemetry and see data in inspector @2p', async ({ page, context }) => { - const initStartBounds = await page.getByLabel('Start bounds').textContent(); + const initStartBounds = page.getByLabel('Start bounds'); const initEndBounds = await page.getByLabel('End bounds').textContent(); const exampleDataVisualizationSource = await createDomainObjectWithDefaults(page, { type: 'Example Data Visualization Source' @@ -81,7 +81,9 @@ test.describe('Testing numeric data with inspector data visualization (i.e., dat await expect(newPage).toHaveTitle('Second Sine Wave Generator'); // Verify that "Open in New Tab" preserves the time bounds - expect(initStartBounds).toEqual(await newPage.getByLabel('Start bounds').textContent()); + await expect(initStartBounds).toHaveText( + await newPage.getByLabel('Start bounds').textContent() + ); expect(initEndBounds).toEqual(await newPage.getByLabel('End bounds').textContent()); }); }); diff --git a/e2e/tests/functional/plugins/lad/lad.e2e.spec.js b/e2e/tests/functional/plugins/lad/lad.e2e.spec.js index 289b1690e8..fd2f385bd7 100644 --- a/e2e/tests/functional/plugins/lad/lad.e2e.spec.js +++ b/e2e/tests/functional/plugins/lad/lad.e2e.spec.js @@ -22,7 +22,7 @@ import { createDomainObjectWithDefaults, - openObjectTreeContextMenu, + navigateToObjectWithRealTime, setFixedTimeMode, setRealTimeMode, setStartOffset @@ -56,61 +56,61 @@ test.describe('Testing LAD table configuration', () => { await page.getByRole('tab', { name: 'LAD Table Configuration' }).click(); // make sure headers are visible initially - await expect(page.getByRole('cell', { name: 'Timestamp', exact: true })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Units' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Type', exact: true })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'WATCH' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'WARNING' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'DISTRESS' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'CRITICAL' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'SEVERE' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Timestamp', exact: true })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Units' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Type', exact: true })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit WATCH' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit WARNING' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit DISTRESS' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit CRITICAL' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit SEVERE' })).toBeVisible(); // hide timestamp column await page.getByLabel('Timestamp', { exact: true }).uncheck(); - await expect(page.getByRole('cell', { name: 'Timestamp', exact: true })).toBeHidden(); - await expect(page.getByRole('cell', { name: 'Units' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Type', exact: true })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'WATCH' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'WARNING' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'DISTRESS' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'CRITICAL' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'SEVERE' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Timestamp', exact: true })).toBeHidden(); + await expect(page.getByRole('columnheader', { name: 'Units' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Type', exact: true })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit WATCH' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit WARNING' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit DISTRESS' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit CRITICAL' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit SEVERE' })).toBeVisible(); // hide units & type column await page.getByLabel('Units').uncheck(); await page.getByLabel('Type', { exact: true }).uncheck(); - await expect(page.getByRole('cell', { name: 'Timestamp', exact: true })).toBeHidden(); - await expect(page.getByRole('cell', { name: 'Units' })).toBeHidden(); - await expect(page.getByRole('cell', { name: 'Type', exact: true })).toBeHidden(); - await expect(page.getByRole('cell', { name: 'WATCH' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'WARNING' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'DISTRESS' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'CRITICAL' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'SEVERE' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Timestamp', exact: true })).toBeHidden(); + await expect(page.getByRole('columnheader', { name: 'Units' })).toBeHidden(); + await expect(page.getByRole('columnheader', { name: 'Type', exact: true })).toBeHidden(); + await expect(page.getByRole('columnheader', { name: 'Limit WATCH' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit WARNING' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit DISTRESS' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit CRITICAL' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit SEVERE' })).toBeVisible(); // hide WATCH column await page.getByLabel('WATCH').uncheck(); - await expect(page.getByRole('cell', { name: 'Timestamp', exact: true })).toBeHidden(); - await expect(page.getByRole('cell', { name: 'Units' })).toBeHidden(); - await expect(page.getByRole('cell', { name: 'Type', exact: true })).toBeHidden(); - await expect(page.getByRole('cell', { name: 'WATCH' })).toBeHidden(); - await expect(page.getByRole('cell', { name: 'WARNING' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'DISTRESS' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'CRITICAL' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'SEVERE' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Timestamp', exact: true })).toBeHidden(); + await expect(page.getByRole('columnheader', { name: 'Units' })).toBeHidden(); + await expect(page.getByRole('columnheader', { name: 'Type', exact: true })).toBeHidden(); + await expect(page.getByRole('columnheader', { name: 'Limit WATCH' })).toBeHidden(); + await expect(page.getByRole('columnheader', { name: 'Limit WARNING' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit DISTRESS' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit CRITICAL' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit SEVERE' })).toBeVisible(); // save and reload and verify they columns are still hidden - await page.locator('button[title="Save"]').click(); + await page.getByRole('button', { name: 'Save' }).click(); await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); await page.reload(); - await expect(page.getByRole('cell', { name: 'Timestamp', exact: true })).toBeHidden(); - await expect(page.getByRole('cell', { name: 'Units' })).toBeHidden(); - await expect(page.getByRole('cell', { name: 'Type', exact: true })).toBeHidden(); - await expect(page.getByRole('cell', { name: 'WATCH' })).toBeHidden(); - await expect(page.getByRole('cell', { name: 'WARNING' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'DISTRESS' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'CRITICAL' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'SEVERE' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Timestamp', exact: true })).toBeHidden(); + await expect(page.getByRole('columnheader', { name: 'Units' })).toBeHidden(); + await expect(page.getByRole('columnheader', { name: 'Type', exact: true })).toBeHidden(); + await expect(page.getByRole('columnheader', { name: 'Limit WATCH' })).toBeHidden(); + await expect(page.getByRole('columnheader', { name: 'Limit WARNING' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit DISTRESS' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit CRITICAL' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit SEVERE' })).toBeVisible(); // Edit LAD table await page.getByLabel('Edit Object').click(); @@ -118,27 +118,27 @@ test.describe('Testing LAD table configuration', () => { // show timestamp column await page.getByLabel('Timestamp', { exact: true }).check(); - await expect(page.getByRole('cell', { name: 'Units' })).toBeHidden(); - await expect(page.getByRole('cell', { name: 'Type', exact: true })).toBeHidden(); - await expect(page.getByRole('cell', { name: 'Timestamp', exact: true })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'WATCH' })).toBeHidden(); - await expect(page.getByRole('cell', { name: 'WARNING' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'DISTRESS' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'CRITICAL' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'SEVERE' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Units' })).toBeHidden(); + await expect(page.getByRole('columnheader', { name: 'Type', exact: true })).toBeHidden(); + await expect(page.getByRole('columnheader', { name: 'Timestamp', exact: true })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit WATCH' })).toBeHidden(); + await expect(page.getByRole('columnheader', { name: 'Limit WARNING' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit DISTRESS' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit CRITICAL' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit SEVERE' })).toBeVisible(); // save and reload and make sure timestamp is still visible - await page.locator('button[title="Save"]').click(); + await page.getByRole('button', { name: 'Save' }).click(); await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); await page.reload(); - await expect(page.getByRole('cell', { name: 'Units' })).toBeHidden(); - await expect(page.getByRole('cell', { name: 'Type', exact: true })).toBeHidden(); - await expect(page.getByRole('cell', { name: 'Timestamp', exact: true })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'WATCH' })).toBeHidden(); - await expect(page.getByRole('cell', { name: 'WARNING' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'DISTRESS' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'CRITICAL' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'SEVERE' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Units' })).toBeHidden(); + await expect(page.getByRole('columnheader', { name: 'Type', exact: true })).toBeHidden(); + await expect(page.getByRole('columnheader', { name: 'Timestamp', exact: true })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit WATCH' })).toBeHidden(); + await expect(page.getByRole('columnheader', { name: 'Limit WARNING' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit DISTRESS' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit CRITICAL' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit SEVERE' })).toBeVisible(); // Edit LAD table await page.getByLabel('Edit Object').click(); @@ -148,27 +148,27 @@ test.describe('Testing LAD table configuration', () => { await page.getByLabel('Units').check(); await page.getByLabel('Type', { exact: true }).check(); await page.getByLabel('WATCH').check(); - await expect(page.getByRole('cell', { name: 'Timestamp', exact: true })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Units' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Type', exact: true })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'WATCH' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'WARNING' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'DISTRESS' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'CRITICAL' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'SEVERE' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Timestamp', exact: true })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Units' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Type', exact: true })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit WATCH' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit WARNING' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit DISTRESS' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit CRITICAL' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit SEVERE' })).toBeVisible(); // save and reload and make sure all columns are still visible await page.locator('button[title="Save"]').click(); await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); await page.reload(); - await expect(page.getByRole('cell', { name: 'Timestamp', exact: true })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Units' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Type', exact: true })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'WATCH' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'WARNING' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'DISTRESS' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'CRITICAL' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'SEVERE' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Timestamp', exact: true })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Units' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Type', exact: true })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit WATCH' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit WARNING' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit DISTRESS' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit CRITICAL' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit SEVERE' })).toBeVisible(); }); test('When adding something without Units, do not show Units column', async ({ page }) => { @@ -185,14 +185,14 @@ test.describe('Testing LAD table configuration', () => { await page.getByRole('tab', { name: 'LAD Table Configuration' }).click(); // make sure Sine Wave headers are visible initially too - await expect(page.getByRole('cell', { name: 'Timestamp', exact: true })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Units' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Type', exact: true })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'WATCH' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'WARNING' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'DISTRESS' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'CRITICAL' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'SEVERE' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Timestamp', exact: true })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Units' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Type', exact: true })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit WATCH' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit WARNING' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit DISTRESS' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit CRITICAL' })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Limit SEVERE' })).toBeVisible(); // save and reload and verify they columns are still hidden await page.getByLabel('Save').click(); @@ -201,25 +201,25 @@ test.describe('Testing LAD table configuration', () => { // Remove Sine Wave Generator openObjectTreeContextMenu(page, sineWaveObject.url); await page.getByRole('menuitem', { name: /Remove/ }).click(); - await page.getByRole('button', { name: 'OK', exact: true }).click(); + await page.getByRole('button', { name: 'Ok', exact: true }).click(); // Ensure Units & Limit columns are gone // as Event Generator don't have them await page.goto(ladTable.url); - await expect(page.getByRole('cell', { name: 'Timestamp', exact: true })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Type', exact: true })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Units' })).toBeHidden(); - await expect(page.getByRole('cell', { name: 'WATCH' })).toBeHidden(); - await expect(page.getByRole('cell', { name: 'WARNING' })).toBeHidden(); - await expect(page.getByRole('cell', { name: 'DISTRESS' })).toBeHidden(); - await expect(page.getByRole('cell', { name: 'CRITICAL' })).toBeHidden(); - await expect(page.getByRole('cell', { name: 'SEVERE' })).toBeHidden(); + await expect(page.getByRole('columnheader', { name: 'Timestamp', exact: true })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Type', exact: true })).toBeVisible(); + await expect(page.getByRole('columnheader', { name: 'Units' })).toBeHidden(); + await expect(page.getByRole('columnheader', { name: 'Limit WATCH' })).toBeHidden(); + await expect(page.getByRole('columnheader', { name: 'Limit WARNING' })).toBeHidden(); + await expect(page.getByRole('columnheader', { name: 'Limit DISTRESS' })).toBeHidden(); + await expect(page.getByRole('columnheader', { name: 'Limit CRITICAL' })).toBeHidden(); + await expect(page.getByRole('columnheader', { name: 'Limit SEVERE' })).toBeHidden(); }); test("LAD Tables don't allow selection of rows but does show context click menus", async ({ page }) => { - const cell = await page.locator('.js-first-data'); + const cell = page.locator('.js-first-data'); const userSelectable = await cell.evaluate((el) => { return window.getComputedStyle(el).getPropertyValue('user-select'); }); @@ -237,19 +237,21 @@ test.describe('Testing LAD table configuration', () => { }); }); -test.describe('Testing LAD table @unstable', () => { +test.describe('Testing LAD table', () => { let sineWaveObject; test.beforeEach(async ({ page }) => { await page.goto('./', { waitUntil: 'domcontentloaded' }); - await setRealTimeMode(page); // Create Sine Wave Generator sineWaveObject = await createDomainObjectWithDefaults(page, { type: 'Sine Wave Generator', name: 'Test Sine Wave Generator' }); + + // Switch to real time mode by navigating directly to the URL + await navigateToObjectWithRealTime(page, sineWaveObject.url); }); - test('telemetry value exactly matches latest telemetry value received in real time', async ({ + test('telemetry value exactly matches latest telemetry value received in realtime mode', async ({ page }) => { // Create LAD table @@ -261,23 +263,23 @@ test.describe('Testing LAD table @unstable', () => { await page.getByLabel('Edit Object').click(); // Expand the 'My Items' folder in the left tree - await page.locator('.c-tree__item__view-control.c-disclosure-triangle').click(); + await page.getByLabel('Expand My Items').click(); // Add the Sine Wave Generator to the LAD table and save changes - await page.dragAndDrop('text=Test Sine Wave Generator', '.c-lad-table-wrapper'); - await page.locator('button[title="Save"]').click(); + await page.getByLabel('Preview Test Sine Wave').dragTo(page.locator('#lad-table-drop-area')); + await page.getByRole('button', { name: 'Save' }).click(); await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); // Subscribe to the Sine Wave Generator data // On getting data, check if the value found in the LAD table is the most recent value // from the Sine Wave Generator - const getTelemValuePromise = await subscribeToTelemetry(page, sineWaveObject.uuid); + const getTelemValuePromise = subscribeToTelemetry(page, sineWaveObject.uuid); const subscribeTelemValue = await getTelemValuePromise; - const ladTableValuePromise = await page.waitForSelector(`text="${subscribeTelemValue}"`); - const ladTableValue = await ladTableValuePromise.textContent(); + await expect(page.getByLabel('lad value')).toHaveText(subscribeTelemValue); + const ladTableValue = await page.getByText(subscribeTelemValue).textContent(); - expect(ladTableValue).toBe(subscribeTelemValue); + expect(ladTableValue).toEqual(subscribeTelemValue); }); - test('telemetry value exactly matches latest telemetry value received in fixed time', async ({ + test('telemetry value exactly matches latest telemetry value received in fixed time mode', async ({ page }) => { // Create LAD table @@ -289,25 +291,23 @@ test.describe('Testing LAD table @unstable', () => { await page.getByLabel('Edit Object').click(); // Expand the 'My Items' folder in the left tree - await page.locator('.c-tree__item__view-control.c-disclosure-triangle').click(); + await page.getByLabel('Expand My Items').click(); // Add the Sine Wave Generator to the LAD table and save changes - await page.dragAndDrop('text=Test Sine Wave Generator', '.c-lad-table-wrapper'); - await page.locator('button[title="Save"]').click(); + await page.getByLabel('Preview Test Sine Wave').dragTo(page.locator('#lad-table-drop-area')); + await page.getByRole('button', { name: 'Save' }).click(); await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); // Subscribe to the Sine Wave Generator data - const getTelemValuePromise = await subscribeToTelemetry(page, sineWaveObject.uuid); + const getTelemValuePromise = subscribeToTelemetry(page, sineWaveObject.uuid); // Set an offset of 1 minute and then change the time mode to fixed to set a 1 minute historical window - await setStartOffset(page, { mins: '1' }); + await setRealTimeMode(page); + await setStartOffset(page, { startMins: '01' }); await setFixedTimeMode(page); // On getting data, check if the value found in the LAD table is the most recent value // from the Sine Wave Generator const subscribeTelemValue = await getTelemValuePromise; - const ladTableValuePromise = await page.waitForSelector(`text="${subscribeTelemValue}"`); - const ladTableValue = await ladTableValuePromise.textContent(); - - expect(ladTableValue).toBe(subscribeTelemValue); + await expect(page.getByLabel('lad value')).toHaveText(subscribeTelemValue); }); }); @@ -338,3 +338,18 @@ async function subscribeToTelemetry(page, objectIdentifier) { return getTelemValuePromise; } + +/** + * Open the given `domainObject`'s context menu from the object tree. + * Expands the path to the object and scrolls to it if necessary. + * + * @param {import('@playwright/test').Page} page + * @param {string} url the url to the object + */ +async function openObjectTreeContextMenu(page, url) { + await page.goto(url); + await page.getByLabel('Show selected item in tree').click(); + await page.locator('.is-navigated-object').click({ + button: 'right' + }); +} diff --git a/e2e/tests/functional/plugins/lad/ladTable.e2e.spec.js b/e2e/tests/functional/plugins/lad/ladTable.e2e.spec.js index 42ca563ffe..10bae36f35 100644 --- a/e2e/tests/functional/plugins/lad/ladTable.e2e.spec.js +++ b/e2e/tests/functional/plugins/lad/ladTable.e2e.spec.js @@ -76,7 +76,7 @@ test.describe('LAD Table', () => { // Right-click the SWG treeitem context menu and click 'Remove' and confirm await page.getByRole('treeitem', { name: swg.name }).click({ button: 'right' }); await page.getByRole('menuitem', { name: 'Remove' }).click(); - await page.getByRole('button', { name: 'OK', exact: true }).click(); + await page.getByRole('button', { name: 'Ok', exact: true }).click(); // Assert that the SWG is no longer in the tree and the table is empty await expect(page.getByRole('treeitem', { name: swg.name })).toBeHidden(); diff --git a/e2e/tests/functional/plugins/notebook/notebook.e2e.spec.js b/e2e/tests/functional/plugins/notebook/notebook.e2e.spec.js index 296cd20f4e..070a99058e 100644 --- a/e2e/tests/functional/plugins/notebook/notebook.e2e.spec.js +++ b/e2e/tests/functional/plugins/notebook/notebook.e2e.spec.js @@ -259,7 +259,7 @@ test.describe('Notebook export tests', () => { const exportedText = await streamToString(readStream); expect(exportedText).toContain('Foo bar entry'); }); - test.fixme('can export multiple notebook entries as text ', async ({ page }) => {}); + test.fixme('can export multiple notebook entries as text', async ({ page }) => {}); test.fixme('can export all notebook entry metdata', async ({ page }) => {}); test.fixme('can export all notebook tags', async ({ page }) => {}); test.fixme('can export all notebook snapshots', async ({ page }) => {}); @@ -296,7 +296,7 @@ test.describe('Notebook entry tests', () => { await expect(page.getByLabel('Notebook Entry Input')).toBeVisible(); await expect(page.getByLabel('Notebook Entry', { exact: true })).toHaveClass(/is-selected/); }); - test('When an object is dropped into a notebook, a new entry is created and it should be focused @unstable', async ({ + test('When an object is dropped into a notebook, a new entry is created and it should be focused', async ({ page }) => { // Create Overlay Plot @@ -320,7 +320,7 @@ test.describe('Notebook entry tests', () => { await expect(embed).toHaveClass(/icon-plot-overlay/); expect(embedName).toBe(overlayPlot.name); }); - test('When an object is dropped into a notebooks existing entry, it should be focused @unstable', async ({ + test('When an object is dropped into a notebooks existing entry, it should be focused', async ({ page }) => { // Create Overlay Plot @@ -354,19 +354,19 @@ test.describe('Notebook entry tests', () => { await page.goto(notebookObject.url); await nbUtils.enterTextEntry(page, 'First Entry'); - await page.hover('text="First Entry"'); - await page.click('button[title="Delete this entry"]'); - await page.getByRole('button', { name: 'Ok' }).filter({ hasText: 'Ok' }).click(); - await expect(page.locator('text="First Entry"')).toBeHidden(); + await page.getByLabel('Notebook Entry', { exact: true }).hover(); + await page.getByLabel('Delete this entry').click(); + await page.getByRole('button', { name: 'Ok', exact: true }).click(); + await expect(page.getByText('First Entry')).toBeHidden(); await nbUtils.enterTextEntry(page, 'Another First Entry'); await nbUtils.enterTextEntry(page, 'Second Entry'); await nbUtils.enterTextEntry(page, 'Third Entry'); - await page.hover('[aria-label="Notebook Entry"] >> nth=2'); - await page.click('button[title="Delete this entry"] >> nth=2'); - await page.getByRole('button', { name: 'Ok' }).filter({ hasText: 'Ok' }).click(); - await expect(page.locator('text="Third Entry"')).toBeHidden(); - await expect(page.locator('text="Another First Entry"')).toBeVisible(); - await expect(page.locator('text="Second Entry"')).toBeVisible(); + await page.getByLabel('Notebook Entry', { exact: true }).nth(2).hover(); + await page.getByLabel('Delete this entry').nth(2).click(); + await page.getByRole('button', { name: 'Ok', exact: true }).click(); + await expect(page.getByText('Third Entry')).toBeHidden(); + await expect(page.getByText('Another First Entry')).toBeVisible(); + await expect(page.getByText('Second Entry')).toBeVisible(); }); test('when a valid link is entered into a notebook entry, it becomes clickable when viewing', async ({ page @@ -383,7 +383,7 @@ test.describe('Notebook entry tests', () => { const validLink = page.locator(`a[href="${TEST_LINK}"]`); - expect(await validLink.count()).toBe(1); + await expect(validLink).toHaveCount(1); // Start waiting for popup before clicking. Note no await. const popupPromise = page.waitForEvent('popup'); @@ -410,7 +410,7 @@ test.describe('Notebook entry tests', () => { const invalidLink = page.locator(`a[href="${TEST_LINK}"]`); - expect(await invalidLink.count()).toBe(0); + await expect(invalidLink).toHaveCount(0); }); test('when a link is entered, but it is not in the whitelisted urls, it does not become clickable when viewing', async ({ page @@ -427,7 +427,7 @@ test.describe('Notebook entry tests', () => { const invalidLink = page.locator(`a[href="${TEST_LINK}"]`); - expect(await invalidLink.count()).toBe(0); + await expect(invalidLink).toHaveCount(0); }); test('when a valid link with a subdomain and a valid domain in the whitelisted urls is entered into a notebook entry, it becomes clickable when viewing', async ({ page @@ -444,7 +444,7 @@ test.describe('Notebook entry tests', () => { const validLink = page.locator(`a[href="${INVALID_TEST_LINK}"]`); - expect(await validLink.count()).toBe(1); + await expect(validLink).toHaveCount(1); }); test('when a valid secure link is entered into a notebook entry, it becomes clickable when viewing', async ({ page @@ -461,7 +461,7 @@ test.describe('Notebook entry tests', () => { const validLink = page.locator(`a[href="${TEST_LINK}"]`); - expect(await validLink.count()).toBe(1); + await expect(validLink).toHaveCount(1); // Start waiting for popup before clicking. Note no await. const popupPromise = page.waitForEvent('popup'); @@ -494,7 +494,7 @@ test.describe('Notebook entry tests', () => { const unsanitizedLink = page.locator(`a[href="${TEST_LINK_BAD}"]`); expect.soft(await sanitizedLink.count()).toBe(1); - expect(await unsanitizedLink.count()).toBe(0); + await expect(unsanitizedLink).toHaveCount(0); }); test('Can add markdown to a notebook entry', async ({ page }) => { await page.goto(notebookObject.url); diff --git a/e2e/tests/functional/plugins/notebook/notebookSnapshotImage.e2e.spec.js b/e2e/tests/functional/plugins/notebook/notebookSnapshotImage.e2e.spec.js index 15fd97b214..8159238e14 100644 --- a/e2e/tests/functional/plugins/notebook/notebookSnapshotImage.e2e.spec.js +++ b/e2e/tests/functional/plugins/notebook/notebookSnapshotImage.e2e.spec.js @@ -76,7 +76,7 @@ test.describe('Snapshot image tests', () => { const secondThumbnail = page.getByRole('img', { name: 'favicon-96x96.png thumbnail' }).nth(1); await secondThumbnail.waitFor({ state: 'attached' }); // expect two embedded images now - expect(await page.getByRole('img', { name: 'favicon-96x96.png thumbnail' }).count()).toBe(2); + await expect(page.getByRole('img', { name: 'favicon-96x96.png thumbnail' })).toHaveCount(2); await page.locator('.c-snapshot.c-ne__embed').first().getByTitle('More actions').click(); @@ -86,7 +86,7 @@ test.describe('Snapshot image tests', () => { await secondThumbnail.waitFor({ state: 'detached' }); // expect one embedded image now as we deleted the other - expect(await page.getByRole('img', { name: 'favicon-96x96.png thumbnail' }).count()).toBe(1); + await expect(page.getByRole('img', { name: 'favicon-96x96.png thumbnail' })).toHaveCount(1); }); }); diff --git a/e2e/tests/functional/plugins/notebook/notebookWithCouchDB.e2e.spec.js b/e2e/tests/functional/plugins/notebook/notebookWithCouchDB.e2e.spec.js index 985af38447..62e9df6229 100644 --- a/e2e/tests/functional/plugins/notebook/notebookWithCouchDB.e2e.spec.js +++ b/e2e/tests/functional/plugins/notebook/notebookWithCouchDB.e2e.spec.js @@ -24,16 +24,22 @@ This test suite is dedicated to tests which verify the basic operations surrounding Notebooks with CouchDB. */ +/** + * Disable no-networkidle eslint rule until we can engineer more deterministic network-event + * driven tests. + */ +/* eslint-disable playwright/no-networkidle */ + import { createDomainObjectWithDefaults } from '../../../../appActions.js'; import * as nbUtils from '../../../../helper/notebookUtils.js'; import { expect, test } from '../../../../pluginFixtures.js'; -test.describe('Notebook Tests with CouchDB @couchdb', () => { +test.describe('Notebook Tests with CouchDB @couchdb @network', () => { let testNotebook; test.beforeEach(async ({ page }) => { - //Navigate to baseURL - await page.goto('./', { waitUntil: 'domcontentloaded' }); + // Navigate to baseURL + await page.goto('./', { waitUntil: 'networkidle' }); // Create Notebook testNotebook = await createDomainObjectWithDefaults(page, { type: 'Notebook' }); @@ -55,7 +61,7 @@ test.describe('Notebook Tests with CouchDB @couchdb', () => { // Waits for the next request with the specified url page.waitForRequest(`**/openmct/${testNotebook.uuid}`), // Triggers the request - page.click('[aria-label="Add Page"]') + page.getByLabel('Add Page').click() ]); // Ensures that there are no other network requests await page.waitForLoadState('networkidle'); @@ -63,7 +69,7 @@ test.describe('Notebook Tests with CouchDB @couchdb', () => { // Assert that only two requests are made // Network Requests are: // 1) The actual POST to create the page - expect(notebookElementsRequests.length).toBe(1); + expect(notebookElementsRequests).toHaveLength(1); // Assert on request object expect(notebookUrlRequest.postDataJSON().metadata.name).toBe(testNotebook.name); @@ -120,8 +126,8 @@ test.describe('Notebook Tests with CouchDB @couchdb', () => { expect(filterNonFetchRequests(notebookElementsRequests).length).toBeLessThanOrEqual(12); // Add two more pages - await page.click('[aria-label="Add Page"]'); - await page.click('[aria-label="Add Page"]'); + await page.getByLabel('Add Page').click(); + await page.getByLabel('Add Page').click(); // Add three entries await nbUtils.enterTextEntry(page, 'First Entry'); diff --git a/e2e/tests/functional/plugins/notebook/restrictedNotebook.e2e.spec.js b/e2e/tests/functional/plugins/notebook/restrictedNotebook.e2e.spec.js index 9b66e044f2..d57ebb754d 100644 --- a/e2e/tests/functional/plugins/notebook/restrictedNotebook.e2e.spec.js +++ b/e2e/tests/functional/plugins/notebook/restrictedNotebook.e2e.spec.js @@ -20,7 +20,6 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -import { openObjectTreeContextMenu } from '../../../../appActions.js'; import { dragAndDropEmbed, enterTextEntry, @@ -51,27 +50,22 @@ test.describe('Restricted Notebook', () => { const restrictedNotebookTreeObject = page.locator(`a:has-text("${notebook.name}")`); // notebook tree object exists - expect.soft(await restrictedNotebookTreeObject.count()).toEqual(1); + await expect(restrictedNotebookTreeObject).toHaveCount(1); // Click Remove Text await page.locator('li[role="menuitem"]:has-text("Remove")').click(); - // Click 'OK' on confirmation window and wait for save banner to appear - await Promise.all([ - page.waitForNavigation(), - page.locator('button:has-text("OK")').click(), - page.waitForSelector('.c-message-banner__message') - ]); + // Click 'Ok' on confirmation window + await page.locator('button:has-text("OK")').click(); // has been deleted - expect(await restrictedNotebookTreeObject.count()).toEqual(0); + await expect(restrictedNotebookTreeObject).toHaveCount(0); }); test('Can be locked if at least one page has one entry @addInit', async ({ page }) => { await enterTextEntry(page, TEST_TEXT); - const commitButton = page.locator('button:has-text("Commit Entries")'); - expect(await commitButton.count()).toEqual(1); + await expect(page.getByLabel('Commit Entries')).toHaveCount(1); }); }); @@ -86,20 +80,18 @@ test.describe('Restricted Notebook with at least one entry and with the page loc await page.locator('button.c-notebook__toggle-nav-button').click(); }); - test('Locked page should now be in a locked state @addInit @unstable', async ({ - page - }, testInfo) => { + test('Locked page should now be in a locked state @addInit', async ({ page }, testInfo) => { // eslint-disable-next-line playwright/no-skipped-test test.skip(testInfo.project === 'chrome-beta', 'Test is unreliable on chrome-beta'); // main lock message on page const lockMessage = page.locator( 'text=This page has been committed and cannot be modified or removed' ); - expect.soft(await lockMessage.count()).toEqual(1); + await expect(lockMessage).toHaveCount(1); // lock icon on page in sidebar const pageLockIcon = page.locator('ul.c-notebook__pages li div.icon-lock'); - expect.soft(await pageLockIcon.count()).toEqual(1); + await expect(pageLockIcon).toHaveCount(1); // no way to remove a restricted notebook with a locked page await openObjectTreeContextMenu(page, notebook.url); @@ -119,17 +111,14 @@ test.describe('Restricted Notebook with at least one entry and with the page loc await page.getByText('Unnamed Page').nth(1).fill(TEST_TEXT_NAME); // expect to be able to rename unlocked pages - const newPageElement = page.getByText(TEST_TEXT_NAME); - const newPageCount = await newPageElement.count(); - await newPageElement.press('Enter'); // exit contenteditable state - expect.soft(newPageCount).toEqual(1); + await page.getByText(TEST_TEXT_NAME).press('Enter'); // exit contenteditable state + await expect(page.locator('div').filter({ hasText: /^Test Page$/ })).toHaveCount(1); // enter test text await enterTextEntry(page, TEST_TEXT); // expect new page to be lockable - const commitButton = page.getByRole('button', { name: ' Commit Entries' }); - expect.soft(await commitButton.count()).toEqual(1); + await expect(page.getByLabel('Commit Entries')).toHaveCount(1); // Click the context menu button for the new page await page.getByTitle('Open context menu').click(); @@ -140,7 +129,7 @@ test.describe('Restricted Notebook with at least one entry and with the page loc // deleted page, should no longer exist const deletedPageElement = page.getByText(TEST_TEXT_NAME); - expect(await deletedPageElement.count()).toEqual(0); + await expect(deletedPageElement).toHaveCount(0); }); }); @@ -173,7 +162,7 @@ test.describe('can export restricted notebook as text', () => { await startAndAddRestrictedNotebookObject(page); }); - test('basic functionality ', async ({ page }) => { + test('basic functionality', async ({ page }) => { await enterTextEntry(page, `Foo bar entry`); // Click on 3 Dot Menu await page.locator('button[title="More actions"]').click(); @@ -190,8 +179,23 @@ test.describe('can export restricted notebook as text', () => { expect(exportedText).toContain('Foo bar entry'); }); - test.fixme('can export multiple notebook entries as text ', async ({ page }) => {}); + test.fixme('can export multiple notebook entries as text', async ({ page }) => {}); test.fixme('can export all notebook entry metdata', async ({ page }) => {}); test.fixme('can export all notebook tags', async ({ page }) => {}); test.fixme('can export all notebook snapshots', async ({ page }) => {}); }); + +/** + * Open the given `domainObject`'s context menu from the object tree. + * Expands the path to the object and scrolls to it if necessary. + * + * @param {import('@playwright/test').Page} page + * @param {string} url the url to the object + */ +async function openObjectTreeContextMenu(page, url) { + await page.goto(url); + await page.getByLabel('Show selected item in tree').click(); + await page.locator('.is-navigated-object').click({ + button: 'right' + }); +} diff --git a/e2e/tests/functional/plugins/plot/autoscale.e2e.spec.js b/e2e/tests/functional/plugins/plot/autoscale.e2e.spec.js index 55b97fc3fc..464d5284e6 100644 --- a/e2e/tests/functional/plugins/plot/autoscale.e2e.spec.js +++ b/e2e/tests/functional/plugins/plot/autoscale.e2e.spec.js @@ -24,7 +24,10 @@ Testsuite for plot autoscale. */ -import { createDomainObjectWithDefaults } from '../../../../appActions.js'; +import { + createDomainObjectWithDefaults, + navigateToObjectWithFixedTimeBounds +} from '../../../../appActions.js'; import { expect, test } from '../../../../pluginFixtures.js'; test.use({ viewport: { @@ -51,9 +54,7 @@ test.describe('Autoscale', () => { }); // Switch to fixed time, start: 2022-03-28 22:00:00.000 UTC, end: 2022-03-28 22:00:30.000 UTC - await page.goto( - `${overlayPlot.url}?tc.mode=fixed&tc.startBound=1648591200000&tc.endBound=1648591230000&tc.timeSystem=utc&view=plot-overlay` - ); + await navigateToObjectWithFixedTimeBounds(page, overlayPlot.url, 1648591200000, 1648591230000); await testYTicks(page, ['-1.00', '-0.50', '0.00', '0.50', '1.00']); @@ -61,20 +62,23 @@ test.describe('Autoscale', () => { await page.getByLabel('Edit Object').click(); await page.getByRole('tab', { name: 'Config' }).click(); - await turnOffAutoscale(page); - await setUserDefinedMinAndMax(page, '-2', '2'); + // turn off autoscale + await page.getByRole('checkbox', { name: 'Auto scale' }).uncheck(); + + await page.getByLabel('Y Axis 1 Minimum value').fill('-2'); + await page.getByLabel('Y Axis 1 Maximum value').fill('2'); // save - await page.click('button[title="Save"]'); + await page.getByLabel('Save').click(); await Promise.all([ page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(), //Wait for Save Banner to appear - page.waitForSelector('.c-message-banner__message') + page.locator('.c-message-banner__message').hover({ trial: true }) ]); //Wait until Save Banner is gone await page.locator('.c-message-banner__close-button').click(); - await page.waitForSelector('.c-message-banner__message', { state: 'detached' }); + await page.locator('.c-message-banner__message').waitFor({ state: 'detached' }); // Make sure that after turning off autoscale, the user entered range values are reflected in the ticks. await testYTicks(page, [ @@ -127,26 +131,6 @@ test.describe('Autoscale', () => { }); }); -/** - * @param {import('@playwright/test').Page} page - */ -async function turnOffAutoscale(page) { - // uncheck autoscale - await page.getByRole('checkbox', { name: 'Auto scale' }).uncheck(); -} - -/** - * @param {import('@playwright/test').Page} page - * @param {string} min - * @param {string} max - */ -async function setUserDefinedMinAndMax(page, min, max) { - // set minimum value - await page.getByRole('spinbutton').first().fill(min); - // set maximum value - await page.getByRole('spinbutton').nth(1).fill(max); -} - /** * @param {import('@playwright/test').Page} page */ diff --git a/e2e/tests/functional/plugins/plot/logPlot.e2e.spec.js b/e2e/tests/functional/plugins/plot/logPlot.e2e.spec.js index 20e4443034..3b92bb3933 100644 --- a/e2e/tests/functional/plugins/plot/logPlot.e2e.spec.js +++ b/e2e/tests/functional/plugins/plot/logPlot.e2e.spec.js @@ -25,19 +25,50 @@ Tests to verify log plot functionality. Note this test suite if very much under necessarily be used for reference when writing new tests in this area. */ -import { setTimeConductorBounds } from '../../../../appActions.js'; +import { createDomainObjectWithDefaults, setTimeConductorBounds } from '../../../../appActions.js'; import { expect, test } from '../../../../pluginFixtures.js'; test.describe('Log plot tests', () => { - test('Log Plot ticks are functionally correct in regular and log mode and after refresh', async ({ - page, - openmctConfig - }) => { - const { myItemsFolderName } = openmctConfig; - //Test is slow and should be split in the future - test.slow(); + test.beforeEach(async ({ page }) => { + // fresh page with time range from 2022-03-29 22:00:00.000Z to 2022-03-29 22:00:30.000Z + await page.goto('./', { waitUntil: 'domcontentloaded' }); - await makeOverlayPlot(page, myItemsFolderName); + // Set a specific time range for consistency, otherwise it will change + // on every test to a range based on the current time. + const startDate = '2022-03-29'; + const startTime = '22:00:00'; + const endDate = '2022-03-29'; + const endTime = '22:00:30'; + + await setTimeConductorBounds(page, { startDate, startTime, endDate, endTime }); + + const overlayPlot = await createDomainObjectWithDefaults(page, { + type: 'Overlay Plot', + name: 'Unnamed Overlay Plot' + }); + + // create a sinewave generator + await createDomainObjectWithDefaults(page, { + type: 'Sine Wave Generator', + name: 'Unnamed Sine Wave Generator', + parent: overlayPlot.uuid + }); + + await page.getByLabel('More actions').click(); + await page.getByLabel('Edit Properties...').click(); + + // set amplitude to 6, offset 4, data rate 2 hz + await page.getByLabel('Amplitude', { exact: true }).fill('6'); + await page.getByLabel('Offset', { exact: true }).fill('4'); + await page.getByLabel('Data Rate (hz)', { exact: true }).fill('2'); + + await page.getByLabel('Save').click(); + + await page.goto(overlayPlot.url); + }); + test('Log Plot ticks are functionally correct in regular and log mode and after refresh', async ({ + page + }) => { await testRegularTicks(page); await enableEditMode(page); await page.getByRole('tab', { name: 'Config' }).click(); @@ -47,98 +78,35 @@ test.describe('Log plot tests', () => { await testRegularTicks(page); await enableLogMode(page); await testLogTicks(page); - await saveOverlayPlot(page); + await page.getByRole('button', { name: 'Save' }).click(); + await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); await testLogTicks(page); }); // Leaving test as 'TODO' for now. // NOTE: Not eligible for community contributions. - test.fixme( - 'Verify that log mode option is reflected in import/export JSON', - async ({ page, openmctConfig }) => { - const { myItemsFolderName } = openmctConfig; + test.fixme('Verify that log mode option is reflected in import/export JSON', async ({ page }) => { + await enableEditMode(page); + await enableLogMode(page); + await page.getByRole('button', { name: 'Save' }).click(); + await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); - await makeOverlayPlot(page, myItemsFolderName); - await enableEditMode(page); - await enableLogMode(page); - await saveOverlayPlot(page); + // TODO ...export, delete the overlay, then import it... - // TODO ...export, delete the overlay, then import it... + //await testLogTicks(page); - //await testLogTicks(page); - - // TODO, the plot is slightly at different position that in the other test, so this fails. - // ...We can fix it by copying all steps from the first test... - // await testLogPlotPixels(page); - } - ); + // TODO, the plot is slightly at different position that in the other test, so this fails. + // ...We can fix it by copying all steps from the first test... + // await testLogPlotPixels(page); + }); }); -/** - * Makes an overlay plot with a sine wave generator and clicks on the overlay plot in the sidebar so it is the active thing displayed. - * @param {import('@playwright/test').Page} page - * @param {string} myItemsFolderName - */ -async function makeOverlayPlot(page, myItemsFolderName) { - // fresh page with time range from 2022-03-29 22:00:00.000Z to 2022-03-29 22:00:30.000Z - await page.goto('./', { waitUntil: 'domcontentloaded' }); - - // Set a specific time range for consistency, otherwise it will change - // on every test to a range based on the current time. - - const start = '2022-03-29 22:00:00.000Z'; - const end = '2022-03-29 22:00:30.000Z'; - - await setTimeConductorBounds(page, start, end); - - // create overlay plot - - await page.locator('button.c-create-button').click(); - await page.locator('li[role="menuitem"]:has-text("Overlay Plot")').click(); - // Click OK button and wait for Navigate event - await Promise.all([ - page.waitForLoadState(), - await page.getByRole('button', { name: 'Save' }).click(), - // Wait for Save Banner to appear - page.waitForSelector('.c-message-banner__message') - ]); - - // save the overlay plot - await saveOverlayPlot(page); - - // create a sinewave generator - - await page.locator('button.c-create-button').click(); - await page.locator('li[role="menuitem"]:has-text("Sine Wave Generator")').click(); - - // set amplitude to 6, offset 4, data rate 2 hz - - await page.getByLabel('Amplitude').fill('6'); - await page.getByLabel('Offset').fill('4'); - await page.getByLabel('Data Rate (hz)').fill('2'); - - // Click OK button and wait for Navigate event - await Promise.all([ - page.waitForLoadState(), - await page.getByRole('button', { name: 'Save' }).click(), - // Wait for Save Banner to appear - page.waitForSelector('.c-message-banner__message') - ]); - - // click on overlay plot - await page.locator(`text=Open MCT ${myItemsFolderName} >> span`).nth(3).click(); - await Promise.all([ - page.waitForLoadState(), - page.locator('text=Unnamed Overlay Plot').first().click() - ]); -} - /** * @param {import('@playwright/test').Page} page */ async function testRegularTicks(page) { const yTicks = page.locator('.gl-plot-y-tick-label'); - expect(await yTicks.count()).toBe(7); + await expect(yTicks).toHaveCount(7); await expect(yTicks.nth(0)).toHaveText('-2'); await expect(yTicks.nth(1)).toHaveText('0'); await expect(yTicks.nth(2)).toHaveText('2'); @@ -153,7 +121,7 @@ async function testRegularTicks(page) { */ async function testLogTicks(page) { const yTicks = page.locator('.gl-plot-y-tick-label'); - expect(await yTicks.count()).toBe(9); + await expect(yTicks).toHaveCount(9); await expect(yTicks.nth(0)).toHaveText('-2.98'); await expect(yTicks.nth(1)).toHaveText('-1.51'); await expect(yTicks.nth(2)).toHaveText('-0.58'); @@ -190,26 +158,6 @@ async function disableLogMode(page) { await page.getByRole('checkbox', { name: 'Log mode' }).uncheck(); } -/** - * @param {import('@playwright/test').Page} page - */ -async function saveOverlayPlot(page) { - // save overlay plot - await page - .locator('text=Snapshot Save and Finish Editing Save and Continue Editing >> button') - .nth(1) - .click(); - - await Promise.all([ - page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(), - //Wait for Save Banner to appear - page.waitForSelector('.c-message-banner__message') - ]); - //Wait until Save Banner is gone - await page.locator('.c-message-banner__close-button').click(); - await page.waitForSelector('.c-message-banner__message', { state: 'detached' }); -} - /** * @param {import('@playwright/test').Page} page */ diff --git a/e2e/tests/functional/plugins/plot/overlayPlot.e2e.spec.js b/e2e/tests/functional/plugins/plot/overlayPlot.e2e.spec.js index 114d8beb79..7af05a00ea 100644 --- a/e2e/tests/functional/plugins/plot/overlayPlot.e2e.spec.js +++ b/e2e/tests/functional/plugins/plot/overlayPlot.e2e.spec.js @@ -52,8 +52,8 @@ test.describe('Overlay Plot', () => { await page.getByRole('tab', { name: 'Config' }).click(); // navigate to plot series color palette - await page.click('.l-browse-bar__actions__edit'); - await page.locator('li.c-tree__item.menus-to-left .c-disclosure-triangle').click(); + await page.getByLabel('Edit Object').click(); + await page.getByLabel('Expand Sine Wave Generator:').click(); await page.locator('.c-click-swatch--menu').click(); await page.locator('.c-palette__item[style="background: rgb(255, 166, 61);"]').click(); // gets color for swatch located in legend @@ -91,9 +91,9 @@ test.describe('Overlay Plot', () => { // Assert that the legend is collapsed by default await expect(page.getByLabel('Plot Legend Collapsed')).toBeVisible(); await expect(page.getByLabel('Plot Legend Expanded')).toBeHidden(); - await expect(page.getByLabel('Expand by Default')).toHaveText('No'); + await expect(page.getByLabel('Expand by Default')).toHaveText(/No/); - expect(await page.getByLabel('Plot Legend Item').count()).toBe(3); + await expect(page.getByLabel('Plot Legend Item')).toHaveCount(3); // Change the legend to expand by default await page.getByLabel('Edit Object').click(); @@ -106,7 +106,7 @@ test.describe('Overlay Plot', () => { await expect(page.getByRole('cell', { name: 'Name' })).toBeVisible(); await expect(page.getByRole('cell', { name: 'Timestamp' })).toBeVisible(); await expect(page.getByRole('cell', { name: 'Value' })).toBeVisible(); - await expect(page.getByLabel('Expand by Default')).toHaveText('Yes'); + await expect(page.getByLabel('Expand by Default')).toHaveText(/Yes/); await expect(page.getByLabel('Plot Legend Item')).toHaveCount(3); // Assert that the legend is expanded on page load @@ -116,7 +116,7 @@ test.describe('Overlay Plot', () => { await expect(page.getByRole('cell', { name: 'Name' })).toBeVisible(); await expect(page.getByRole('cell', { name: 'Timestamp' })).toBeVisible(); await expect(page.getByRole('cell', { name: 'Value' })).toBeVisible(); - await expect(page.getByLabel('Expand by Default')).toHaveText('Yes'); + await expect(page.getByLabel('Expand by Default')).toHaveText(/Yes/); await expect(page.getByLabel('Plot Legend Item')).toHaveCount(3); }); @@ -136,23 +136,16 @@ test.describe('Overlay Plot', () => { await page.goto(overlayPlot.url); // Assert that no limit lines are shown by default - await page.waitForSelector('.js-limit-area', { state: 'attached' }); - expect(await page.locator('.c-plot-limit-line').count()).toBe(0); + await page.locator('.js-limit-area').waitFor({ state: 'attached' }); + await expect(page.locator('.c-plot-limit-line')).toHaveCount(0); // Enter edit mode await page.getByLabel('Edit Object').click(); // Expand the "Sine Wave Generator" plot series options and enable limit lines await page.getByRole('tab', { name: 'Config' }).click(); - await page - .getByRole('list', { name: 'Plot Series Properties' }) - .locator('span') - .first() - .click(); - await page - .getByRole('list', { name: 'Plot Series Properties' }) - .locator('[title="Display limit lines"]~div input') - .check(); + await page.getByLabel('Expand Sine Wave Generator:').click(); + await page.getByLabel('Limit lines').check(); await assertLimitLinesExistAndAreVisible(page); @@ -207,29 +200,21 @@ test.describe('Overlay Plot', () => { await page.goto(overlayPlot.url); // Assert that no limit lines are shown by default - await page.waitForSelector('.js-limit-area', { state: 'attached' }); - expect(await page.locator('.c-plot-limit-line').count()).toBe(0); + await expect(page.locator('.js-limit-area')).toBeAttached(); + await expect(page.locator('.c-plot-limit-line')).toHaveCount(0); // Enter edit mode await page.getByLabel('Edit Object').click(); // Expand the "Sine Wave Generator" plot series options and enable limit lines await page.getByRole('tab', { name: 'Config' }).click(); - await page - .getByRole('list', { name: 'Plot Series Properties' }) - .locator('span') - .first() - .click(); - await page - .getByRole('list', { name: 'Plot Series Properties' }) - .getByRole('checkbox', { name: 'Limit lines' }) - .check(); + await page.getByLabel('Expand Sine Wave Generator:').click(); + await page.getByLabel('Limit lines').check(); await assertLimitLinesExistAndAreVisible(page); - // Save (exit edit mode) - await page.locator('button[title="Save"]').click(); - await page.locator('li[title="Save and Finish Editing"]').click(); + await page.getByRole('button', { name: 'Save' }).click(); + await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); const initialCoords = await assertLimitLinesExistAndAreVisible(page); // Resize the chart container by showing the snapshot pane. @@ -324,32 +309,26 @@ test.describe('Overlay Plot', () => { expect(yAxis3Group.getByRole('listitem').nth(0).getByText(swgB.name)).toBeTruthy(); }); - test.fixme( - 'Clicking on an item in the elements pool brings up the plot preview with data points', - async ({ page }) => { - test.info().annotations.push({ - type: 'issue', - description: 'https://github.com/nasa/openmct/issues/7421' - }); + test('Clicking on an item in the elements pool brings up the plot preview with data points', async ({ + page + }) => { + const swgA = await createDomainObjectWithDefaults(page, { + type: 'Sine Wave Generator', + parent: overlayPlot.uuid + }); - const swgA = await createDomainObjectWithDefaults(page, { - type: 'Sine Wave Generator', - parent: overlayPlot.uuid - }); + await page.goto(overlayPlot.url); + // Wait for plot series data to load and be drawn + await waitForPlotsToRender(page); + await page.getByLabel('Edit Object').click(); - await page.goto(overlayPlot.url); - // Wait for plot series data to load and be drawn - await waitForPlotsToRender(page); - await page.getByLabel('Edit Object').click(); + await page.getByRole('tab', { name: 'Elements' }).click(); - await page.getByRole('tab', { name: 'Elements' }).click(); - - await page.locator(`#inspector-elements-tree >> text=${swgA.name}`).click(); - const plotPixels = await getCanvasPixels(page, '.js-overlay canvas'); - const plotPixelSize = plotPixels.length; - expect(plotPixelSize).toBeGreaterThan(0); - } - ); + await page.locator(`#inspector-elements-tree >> text=${swgA.name}`).click(); + const plotPixels = await getCanvasPixels(page, '.js-overlay canvas'); + const plotPixelSize = plotPixels.length; + expect(plotPixelSize).toBeGreaterThan(0); + }); test('Can remove an item via the elements pool action menu', async ({ page }) => { const swgA = await createDomainObjectWithDefaults(page, { @@ -372,7 +351,7 @@ test.describe('Overlay Plot', () => { await expect(swgAElementsPoolItem).toBeVisible(); await swgAElementsPoolItem.click({ button: 'right' }); await page.getByRole('menuitem', { name: 'Remove' }).click(); - await page.getByRole('button', { name: 'OK', exact: true }).click(); + await page.getByRole('button', { name: 'Ok', exact: true }).click(); await expect(swgAElementsPoolItem).toBeHidden(); await page.getByRole('button', { name: 'Save' }).click(); @@ -402,7 +381,7 @@ async function assertLimitLinesExistAndAreVisible(page) { // Wait for plot series data to load await waitForPlotsToRender(page); // Wait for limit lines to be created - await page.waitForSelector('.js-limit-area', { state: 'attached' }); + await page.locator('.js-limit-area').waitFor({ state: 'attached' }); // There should be 10 limit lines created by default await expect(page.locator('.c-plot-limit-line')).toHaveCount(10); const limitLineCount = await page.locator('.c-plot-limit-line').count(); diff --git a/e2e/tests/functional/plugins/plot/plotControls.e2e.spec.js b/e2e/tests/functional/plugins/plot/plotControls.e2e.spec.js new file mode 100644 index 0000000000..87f608f528 --- /dev/null +++ b/e2e/tests/functional/plugins/plot/plotControls.e2e.spec.js @@ -0,0 +1,111 @@ +/***************************************************************************** + * 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 testing the rendering and interaction of plots. + * + */ + +import { + createDomainObjectWithDefaults, + getCanvasPixels, + setEndOffset, + setRealTimeMode, + setStartOffset +} from '../../../../appActions.js'; +import { expect, test } from '../../../../pluginFixtures.js'; + +test.describe('Plot Controls', () => { + let overlayPlot; + + test.beforeEach(async ({ page }) => { + // Open a browser, navigate to the main page, and wait until all networkevents to resolve + await page.goto('./', { waitUntil: 'domcontentloaded' }); + overlayPlot = await createDomainObjectWithDefaults(page, { + type: 'Overlay Plot' + }); + + // Create an overlay plot with a sine wave generator + await createDomainObjectWithDefaults(page, { + type: 'Sine Wave Generator', + parent: overlayPlot.uuid + }); + await page.goto(`${overlayPlot.url}`); + }); + + test("Plots don't purge data when paused", async ({ page }) => { + // Set realtime mode with 2 second window + const startOffset = { + startMins: '00', + startSecs: '01' + }; + + const endOffset = { + endMins: '00', + endSecs: '01' + }; + + // Switch to real-time mode + await setRealTimeMode(page); + + // Set start time offset + await setStartOffset(page, startOffset); + + // Set end time offset + await setEndOffset(page, endOffset); + // Edit the overlay plot and turn off auto scale, setting the min and max to -1 and 1 + // enter edit mode + await page.getByLabel('Edit Object').click(); + + await page.getByRole('tab', { name: 'Config' }).click(); + + // turn off autoscale + await page.getByRole('checkbox', { name: 'Auto scale' }).uncheck(); + + await page.getByLabel('Y Axis 1 Minimum value').fill('-1'); + await page.getByLabel('Y Axis 1 Maximum value').fill('1'); + + // save + await page.getByRole('button', { name: 'Save' }).click(); + await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); + // hover over plot for plot controls + await page.getByLabel('Plot Canvas').hover(); + // click on pause control + await page.getByTitle('Pause incoming real-time data').click(); + // expect plot to be paused + await expect(page.getByTitle('Resume displaying real-time data')).toBeVisible(); + // Wait for 2 seconds to stabilize plot data - future timestamp + // eslint-disable-next-line + await page.waitForTimeout(2000); + // Capture the # of plot points + const plotPixels = await getCanvasPixels(page, 'canvas'); + const plotPixelSizeAtPause = plotPixels.length; + // Wait 2 seconds + // eslint-disable-next-line + await page.waitForTimeout(2000); + // Capture the # of plot points + const plotPixelsAfterWait = await getCanvasPixels(page, 'canvas'); + const plotPixelSizeAfterWait = plotPixelsAfterWait.length; + // Expect before and after plot points to match + await expect(plotPixelSizeAtPause).toEqual(plotPixelSizeAfterWait); + }); +}); diff --git a/e2e/tests/functional/plugins/plot/plotRendering.e2e.spec.js b/e2e/tests/functional/plugins/plot/plotRendering.e2e.spec.js index 31b1b03078..d90310d22c 100644 --- a/e2e/tests/functional/plugins/plot/plotRendering.e2e.spec.js +++ b/e2e/tests/functional/plugins/plot/plotRendering.e2e.spec.js @@ -25,7 +25,11 @@ * */ -import { createDomainObjectWithDefaults, getCanvasPixels } from '../../../../appActions.js'; +import { + createDomainObjectWithDefaults, + getCanvasPixels, + setRealTimeMode +} from '../../../../appActions.js'; import { expect, test } from '../../../../pluginFixtures.js'; test.describe('Plot Rendering', () => { @@ -50,13 +54,37 @@ test.describe('Plot Rendering', () => { createMineFolderRequests.push(req); }); expect(createMineFolderRequests.length).toEqual(0); + await page.getByLabel('Plot Canvas').hover(); }); - test.fixme('Plot is rendered when infinity values exist', async ({ page }) => { - test.info().annotations.push({ - type: 'issue', - description: 'https://github.com/nasa/openmct/issues/7421' - }); + test('Time conductor synchronizes with plot time range when that plot control is clicked', async ({ + page + }) => { + // Navigate to Sine Wave Generator + await page.goto(sineWaveGeneratorObject.url); + // Switch to real-time mode + await setRealTimeMode(page); + + // hover over plot for plot controls + await page.getByLabel('Plot Canvas').hover(); + // click on pause control + await page.getByTitle('Pause incoming real-time data').click(); + + // expect plot to be paused + await expect(page.getByTitle('Resume displaying real-time data')).toBeVisible(); + + // hover over plot for plot controls + await page.getByLabel('Plot Canvas').hover(); + // click on synchronize with time conductor + await page.getByTitle('Synchronize Time Conductor').click(); + + await page.getByRole('button', { name: 'Ok', exact: true }).click(); + + //confirm that you're now in fixed mode with the correct range + await expect(page.getByLabel('Time Conductor Mode')).toHaveText('Fixed Timespan'); + }); + + test('Plot is rendered when infinity values exist', async ({ page }) => { // Edit Plot await editSineWaveToUseInfinityOption(page, sineWaveGeneratorObject); diff --git a/e2e/tests/functional/plugins/plot/scatterPlot.e2e.spec.js b/e2e/tests/functional/plugins/plot/scatterPlot.e2e.spec.js index c392c26095..ed25ff5747 100644 --- a/e2e/tests/functional/plugins/plot/scatterPlot.e2e.spec.js +++ b/e2e/tests/functional/plugins/plot/scatterPlot.e2e.spec.js @@ -53,7 +53,7 @@ test.describe('Scatter Plot', () => { await page.goto(scatterPlot.url); await page.getByLabel('Edit Object').click(); await page.getByRole('tab', { name: 'Elements' }).click(); - await expect.soft(page.locator(`#inspector-elements-tree >> text=${swg1.name}`)).toBeVisible(); + await expect(page.getByLabel(`Preview ${swg1.name}`)).toBeVisible(); await page.getByRole('button', { name: 'Save' }).click(); await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); @@ -65,14 +65,12 @@ test.describe('Scatter Plot', () => { }); // Verify that the 'Replace telemetry source' modal appears and accept it - await expect - .soft( - page.locator( - 'text=This action will replace the current telemetry source. Do you want to continue?' - ) + await expect( + page.getByText( + 'This action will replace the current telemetry source. Do you want to continue?' ) - .toBeVisible(); - await page.click('text=Ok'); + ).toBeVisible(); + await page.getByRole('button', { name: 'Ok', exact: true }).click(); // Navigate to the scatter plot and verify that the new SWG // appears in the elements pool and the old one is gone @@ -81,27 +79,25 @@ test.describe('Scatter Plot', () => { // Click the "Elements" tab await page.getByRole('tab', { name: 'Elements' }).click(); - await expect.soft(page.locator(`#inspector-elements-tree >> text=${swg1.name}`)).toBeHidden(); - await expect.soft(page.locator(`#inspector-elements-tree >> text=${swg2.name}`)).toBeVisible(); + await expect(page.getByLabel(`Preview ${swg1.name}`)).toBeHidden(); + await expect(page.getByLabel(`Preview ${swg2.name}`)).toBeVisible(); await page.getByRole('button', { name: 'Save' }).click(); // Right click on the new SWG in the elements pool and delete it - await page.locator(`#inspector-elements-tree >> text=${swg2.name}`).click({ + await page.getByLabel(`Preview ${swg2.name}`).click({ button: 'right' }); - await page.locator('li[title="Remove this object from its containing object."]').click(); + await page.getByLabel('Remove').click(); // Verify that the 'Remove object' confirmation modal appears and accept it - await expect - .soft( - page.locator( - 'text=Warning! This action will remove this object. Are you sure you want to continue?' - ) + await expect( + page.getByText( + 'Warning! This action will remove this object. Are you sure you want to continue?' ) - .toBeVisible(); - await page.click('text=Ok'); + ).toBeVisible(); + await page.getByRole('button', { name: 'Ok', exact: true }).click(); // Verify that the elements pool shows no elements - await expect(page.locator('text="No contained elements"')).toBeVisible(); + await expect(page.getByText('No contained elements')).toBeVisible(); }); }); diff --git a/e2e/tests/functional/plugins/plot/stackedPlot.e2e.spec.js b/e2e/tests/functional/plugins/plot/stackedPlot.e2e.spec.js index 3cffb3b28c..6926097c8f 100644 --- a/e2e/tests/functional/plugins/plot/stackedPlot.e2e.spec.js +++ b/e2e/tests/functional/plugins/plot/stackedPlot.e2e.spec.js @@ -39,19 +39,23 @@ test.describe('Stacked Plot', () => { await page.goto('./', { waitUntil: 'domcontentloaded' }); stackedPlot = await createDomainObjectWithDefaults(page, { - type: 'Stacked Plot' + type: 'Stacked Plot', + name: 'Stacked Plot' }); swgA = await createDomainObjectWithDefaults(page, { type: 'Sine Wave Generator', + name: 'Sine Wave Generator A', parent: stackedPlot.uuid }); swgB = await createDomainObjectWithDefaults(page, { type: 'Sine Wave Generator', + name: 'Sine Wave Generator B', parent: stackedPlot.uuid }); swgC = await createDomainObjectWithDefaults(page, { type: 'Sine Wave Generator', + name: 'Sine Wave Generator C', parent: stackedPlot.uuid }); }); @@ -78,7 +82,7 @@ test.describe('Stacked Plot', () => { .getByRole('menuitem') .filter({ hasText: /Remove/ }) .click(); - await page.getByRole('button').filter({ hasText: 'OK' }).click(); + await page.getByRole('button').filter({ hasText: 'Ok' }).click(); await expect(page.locator('#inspector-elements-tree .js-elements-pool__item')).toHaveCount(2); @@ -151,40 +155,80 @@ test.describe('Stacked Plot', () => { await page.getByRole('tab', { name: 'Config' }).click(); // Click on the 1st plot - await page.locator(`[aria-label="Stacked Plot Item ${swgA.name}"] canvas`).nth(1).click(); + await page + .getByLabel('Stacked Plot Item Sine Wave Generator A') + .getByLabel('Plot Canvas') + .click(); // Assert that the inspector shows the Y Axis properties for swgA - await expect(page.locator('[aria-label="Plot Series Properties"] >> h2')).toContainText( - 'Plot Series' - ); + await expect(page.getByRole('heading', { name: 'Plot Series' })).toBeVisible(); await expect(page.getByRole('heading', { name: 'Y Axis' })).toBeVisible(); await expect( - page.locator('[aria-label="Plot Series Properties"] .c-object-label') - ).toContainText(swgA.name); + page.getByLabel('Inspector Views').getByText('Sine Wave Generator A', { exact: true }) + ).toBeVisible(); // Click on the 2nd plot - await page.locator(`[aria-label="Stacked Plot Item ${swgB.name}"] canvas`).nth(1).click(); - + await page + .getByLabel('Stacked Plot Item Sine Wave Generator B') + .getByLabel('Plot Canvas') + .click(); // Assert that the inspector shows the Y Axis properties for swgB - await expect(page.locator('[aria-label="Plot Series Properties"] >> h2')).toContainText( - 'Plot Series' - ); + await expect(page.getByRole('heading', { name: 'Plot Series' })).toBeVisible(); await expect(page.getByRole('heading', { name: 'Y Axis' })).toBeVisible(); await expect( - page.locator('[aria-label="Plot Series Properties"] .c-object-label') - ).toContainText(swgB.name); + page.getByLabel('Inspector Views').getByText('Sine Wave Generator B', { exact: true }) + ).toBeVisible(); // Click on the 3rd plot - await page.locator(`[aria-label="Stacked Plot Item ${swgC.name}"] canvas`).nth(1).click(); - - // Assert that the inspector shows the Y Axis properties for swgC - await expect(page.locator('[aria-label="Plot Series Properties"] >> h2')).toContainText( - 'Plot Series' - ); + await page + .getByLabel('Stacked Plot Item Sine Wave Generator C') + .getByLabel('Plot Canvas') + .click(); + // Assert that the inspector shows the Y Axis properties for swgB + await expect(page.getByRole('heading', { name: 'Plot Series' })).toBeVisible(); await expect(page.getByRole('heading', { name: 'Y Axis' })).toBeVisible(); await expect( - page.locator('[aria-label="Plot Series Properties"] .c-object-label') - ).toContainText(swgC.name); + page.getByLabel('Inspector Views').getByText('Sine Wave Generator C', { exact: true }) + ).toBeVisible(); + + // Go into edit mode + await page.getByLabel('Edit Object').click(); + + await page.getByRole('tab', { name: 'Config' }).click(); + + // Click on the 1st plot + await page.getByLabel('Stacked Plot Item Sine Wave Generator A').click(); + + // Assert that the inspector shows the Y Axis properties for swgA + await expect(page.getByRole('heading', { name: 'Plot Series' })).toBeVisible(); + await expect(page.getByRole('heading', { name: 'Y Axis' })).toBeVisible(); + await expect( + page.getByLabel('Inspector Views').getByText('Sine Wave Generator A', { exact: true }) + ).toBeVisible(); + + // Click on the 2nd plot + await page.getByLabel('Stacked Plot Item Sine Wave Generator B').click(); + + // Assert that the inspector shows the Y Axis properties for swgB + await expect(page.getByRole('heading', { name: 'Plot Series' })).toBeVisible(); + await expect(page.getByRole('heading', { name: 'Y Axis' })).toBeVisible(); + await expect( + page.getByLabel('Inspector Views').getByText('Sine Wave Generator B', { exact: true }) + ).toBeVisible(); + + // Click on the 3rd plot + await page.getByLabel('Stacked Plot Item Sine Wave Generator C').click(); + + // Assert that the inspector shows the Y Axis properties for swgC + await expect(page.getByRole('heading', { name: 'Plot Series' })).toBeVisible(); + await expect(page.getByRole('heading', { name: 'Y Axis' })).toBeVisible(); + await expect( + page.getByLabel('Inspector Views').getByText('Sine Wave Generator C', { exact: true }) + ).toBeVisible(); + }); + + test('Changing properties of an immutable child plot are applied correctly', async ({ page }) => { + await page.goto(stackedPlot.url); // Go into edit mode await page.getByLabel('Edit Object').click(); @@ -192,40 +236,34 @@ test.describe('Stacked Plot', () => { await page.getByRole('tab', { name: 'Config' }).click(); // Click on canvas for the 1st plot - await page.locator(`[aria-label="Stacked Plot Item ${swgA.name}"]`).click(); + await page.getByLabel(`Stacked Plot Item ${swgA.name}`).click(); - // Assert that the inspector shows the Y Axis properties for swgA - await expect(page.locator('[aria-label="Plot Series Properties"] >> h2')).toContainText( - 'Plot Series' - ); - await expect(page.getByRole('heading', { name: 'Y Axis' })).toBeVisible(); + // Expand config for the series + await page.getByLabel('Expand Sine Wave Generator A Plot Series Options').click(); + + // turn off alarm markers + await page.getByLabel('Alarm Markers').uncheck(); + + // save + await page.getByRole('button', { name: 'Save' }).click(); + await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); + + // reload page and waitForPlotsToRender + await page.reload(); + await waitForPlotsToRender(page); + + // Click on canvas for the 1st plot + await page.getByLabel(`Stacked Plot Item ${swgA.name}`).click(); + + // Expand config for the series + await page.getByLabel('Expand Sine Wave Generator A Plot Series Options').click(); + + // Assert that alarm markers are still turned off await expect( - page.locator('[aria-label="Plot Series Properties"] .c-object-label') - ).toContainText(swgA.name); - - //Click on canvas for the 2nd plot - await page.locator(`[aria-label="Stacked Plot Item ${swgB.name}"]`).click(); - - // Assert that the inspector shows the Y Axis properties for swgB - await expect(page.locator('[aria-label="Plot Series Properties"] >> h2')).toContainText( - 'Plot Series' - ); - await expect(page.getByRole('heading', { name: 'Y Axis' })).toBeVisible(); - await expect( - page.locator('[aria-label="Plot Series Properties"] .c-object-label') - ).toContainText(swgB.name); - - //Click on canvas for the 3rd plot - await page.locator(`[aria-label="Stacked Plot Item ${swgC.name}"]`).click(); - - // Assert that the inspector shows the Y Axis properties for swgC - await expect(page.locator('[aria-label="Plot Series Properties"] >> h2')).toContainText( - 'Plot Series' - ); - await expect(page.getByRole('heading', { name: 'Y Axis' })).toBeVisible(); - await expect( - page.locator('[aria-label="Plot Series Properties"] .c-object-label') - ).toContainText(swgC.name); + page + .getByTitle('Display markers visually denoting points in alarm.') + .getByRole('cell', { name: 'Disabled' }) + ).toBeVisible(); }); test('the legend toggles between aggregate and per child', async ({ page }) => { @@ -238,7 +276,7 @@ test.describe('Stacked Plot', () => { await page.getByRole('tab', { name: 'Config' }).click(); - let legendProperties = await page.locator('[aria-label="Legend Properties"]'); + const legendProperties = page.getByLabel('Legend Properties'); await legendProperties.locator('[title="Display legends per sub plot."]~div input').uncheck(); await assertAggregateLegendIsVisible(page); @@ -317,11 +355,9 @@ async function assertAggregateLegendIsVisible(page) { // Wait for plot series data to load await waitForPlotsToRender(page); // Wait for plot legend to be shown - await page.waitForSelector('.js-stacked-plot-legend', { state: 'attached' }); + await expect(page.locator('.js-stacked-plot-legend')).toBeVisible(); // There should be 3 legend items - expect( - await page - .locator('.js-stacked-plot-legend .c-plot-legend__wrapper div.plot-legend-item') - .count() - ).toBe(3); + await expect( + page.locator('.js-stacked-plot-legend .c-plot-legend__wrapper div.plot-legend-item') + ).toHaveCount(3); } diff --git a/e2e/tests/functional/plugins/plot/tagging.e2e.spec.js b/e2e/tests/functional/plugins/plot/tagging.e2e.spec.js index 51c2bbbd1f..e62c65772a 100644 --- a/e2e/tests/functional/plugins/plot/tagging.e2e.spec.js +++ b/e2e/tests/functional/plugins/plot/tagging.e2e.spec.js @@ -89,7 +89,7 @@ test.describe('Plot Tagging', () => { await setRealTimeMode(page); // Search for Science Tag - await page.getByRole('searchbox', { name: 'Search Input' }); + await page.getByRole('searchbox', { name: 'Search Input' }).click(); await page.getByRole('searchbox', { name: 'Search Input' }).fill('sc'); // Click on the search object result diff --git a/e2e/tests/functional/plugins/reloadAction/reloadAction.e2e.spec.js b/e2e/tests/functional/plugins/reloadAction/reloadAction.e2e.spec.js index 0855d2efc8..499454bb2a 100644 --- a/e2e/tests/functional/plugins/reloadAction/reloadAction.e2e.spec.js +++ b/e2e/tests/functional/plugins/reloadAction/reloadAction.e2e.spec.js @@ -42,19 +42,21 @@ test.describe('Reload action', () => { await createDomainObjectWithDefaults(page, { type: 'Sine Wave Generator', - parent: alphaTable.uuid, - customParameters: { - '[aria-label="Data Rate (hz)"]': '0.001' - } + parent: alphaTable.uuid }); + await page.getByLabel('More actions').click(); + await page.getByRole('menuitem', { name: /Edit Properties/ }).click(); + await page.getByLabel('Data Rate (hz)', { exact: true }).fill('0.001'); + await page.getByLabel('Save').click(); await createDomainObjectWithDefaults(page, { type: 'Sine Wave Generator', - parent: betaTable.uuid, - customParameters: { - '[aria-label="Data Rate (hz)"]': '0.001' - } + parent: betaTable.uuid }); + await page.getByLabel('More actions').click(); + await page.getByRole('menuitem', { name: /Edit Properties/ }).click(); + await page.getByLabel('Data Rate (hz)', { exact: true }).fill('0.001'); + await page.getByLabel('Save').click(); await page.goto(displayLayout.url); @@ -63,20 +65,26 @@ test.describe('Reload action', () => { await page.getByLabel('Edit Object', { exact: true }).click(); - await page.dragAndDrop(`text='Alpha Table'`, '.l-layout__grid-holder', { - targetPosition: { x: 0, y: 0 } - }); + await page + .getByLabel('Main Tree') + .getByLabel(`Preview ${alphaTable.name}`) + .dragTo(page.getByLabel('Layout Grid'), { + targetPosition: { x: 0, y: 0 } + }); - await page.dragAndDrop(`text='Beta Table'`, '.l-layout__grid-holder', { - targetPosition: { x: 0, y: 250 } - }); + await page + .getByLabel('Main Tree') + .getByLabel(`Preview ${betaTable.name}`) + .dragTo(page.getByLabel('Layout Grid'), { + targetPosition: { x: 0, y: 250 } + }); - await page.locator('button[title="Save"]').click(); + await page.getByLabel('Save').click(); await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); }); test('can reload display layout and its children', async ({ page }) => { - const beforeReloadAlphaTelemetryValue = await page + const beforeReloadAlphaTelemetryValue = page .getByLabel('Alpha Table table content') .getByLabel('wavelengths table cell') .first() diff --git a/e2e/tests/functional/plugins/styling/flexLayoutStyling.e2e.spec.js b/e2e/tests/functional/plugins/styling/flexLayoutStyling.e2e.spec.js index 27129822fd..e74accfe82 100644 --- a/e2e/tests/functional/plugins/styling/flexLayoutStyling.e2e.spec.js +++ b/e2e/tests/functional/plugins/styling/flexLayoutStyling.e2e.spec.js @@ -466,7 +466,7 @@ test.describe('Flexible Layout styling', () => { page.getByLabel('Flexible Layout Column') ); await page.getByLabel('Cancel Editing').click(); - await page.getByRole('button', { name: 'OK', exact: true }).click(); + await page.getByRole('button', { name: 'Ok', exact: true }).click(); await checkStyles( hexToRGB(defaultBorderTargetColor), NO_STYLE_RGBA, diff --git a/e2e/tests/functional/plugins/tabs/tabs.e2e.spec.js b/e2e/tests/functional/plugins/tabs/tabs.e2e.spec.js index 508a08a75b..8e9a3bb586 100644 --- a/e2e/tests/functional/plugins/tabs/tabs.e2e.spec.js +++ b/e2e/tests/functional/plugins/tabs/tabs.e2e.spec.js @@ -114,8 +114,8 @@ test.describe('Tabs View CRUD', () => { await page.getByLabel('Edit Object').click(); await page.getByLabel('More actions').click(); await page.getByLabel('Edit Properties...').click(); - await expect(await page.getByLabel('Eager Load Tabs')).not.toBeChecked(); + await expect(page.getByLabel('Eager Load Tabs')).not.toBeChecked(); await page.getByLabel('Eager Load Tabs').setChecked(true); - await expect(await page.getByLabel('Eager Load Tabs')).toBeChecked(); + await expect(page.getByLabel('Eager Load Tabs')).toBeChecked(); }); }); diff --git a/e2e/tests/functional/plugins/telemetryTable/telemetryTable.e2e.spec.js b/e2e/tests/functional/plugins/telemetryTable/telemetryTable.e2e.spec.js index f46dbd48fd..9aea26f395 100644 --- a/e2e/tests/functional/plugins/telemetryTable/telemetryTable.e2e.spec.js +++ b/e2e/tests/functional/plugins/telemetryTable/telemetryTable.e2e.spec.js @@ -22,8 +22,8 @@ import { createDomainObjectWithDefaults, - setTimeConductorBounds, - setTimeConductorMode + navigateToObjectWithRealTime, + setTimeConductorBounds } from '../../../../appActions.js'; import { expect, test } from '../../../../pluginFixtures.js'; @@ -39,12 +39,52 @@ test.describe('Telemetry Table', () => { type: 'Sine Wave Generator', parent: table.uuid }); - await page.goto(table.url); - await setTimeConductorMode(page, false); + await navigateToObjectWithRealTime(page, table.url); const rows = page.getByLabel('table content').getByLabel('Table Row'); await expect(rows).toHaveCount(50); }); + test('on load, auto scrolls to top for descending, and to bottom for ascending', async ({ + page + }) => { + const sineWaveGenerator = await createDomainObjectWithDefaults(page, { + type: 'Sine Wave Generator', + parent: table.uuid + }); + + // verify in telemetry table object view + await navigateToObjectWithRealTime(page, table.url); + + expect(await getScrollPosition(page)).toBe(0); + + // verify in telemetry table view + await page.goto(sineWaveGenerator.url); + await page.getByLabel('Open the View Switcher Menu').click(); + await page.getByText('Telemetry Table', { exact: true }).click(); + + expect(await getScrollPosition(page)).toBe(0); + + // navigate back to table + await page.goto(table.url); + + // go into edit mode + await page.getByLabel('Edit Object').click(); + + // change sort direction + await page.locator('thead div').filter({ hasText: 'Time' }).click(); + + // save view + await page.getByRole('button', { name: 'Save' }).click(); + await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); + + // navigate away and back + await page.goto(sineWaveGenerator.url); + await page.goto(table.url); + + // verify scroll position + expect(await getScrollPosition(page, false)).toBeLessThan(1); + }); + test('unpauses and filters data when paused by button and user changes bounds', async ({ page }) => { @@ -72,13 +112,14 @@ test.describe('Telemetry Table', () => { // Subtract 5 minutes from the current end bound datetime and set it // Bring up the time conductor popup - let endDate = await page.locator('[aria-label="End bounds"]').textContent(); - endDate = new Date(endDate); + let endTimeStamp = await page.getByLabel('End bounds').textContent(); + endTimeStamp = new Date(endTimeStamp); - endDate.setUTCMinutes(endDate.getUTCMinutes() - 5); - endDate = endDate.toISOString().replace(/T/, ' '); + endTimeStamp.setUTCMinutes(endTimeStamp.getUTCMinutes() - 5); + const endDate = endTimeStamp.toISOString().split('T')[0]; + const endTime = endTimeStamp.toISOString().split('T')[1]; - await setTimeConductorBounds(page, undefined, endDate); + await setTimeConductorBounds(page, { endDate, endTime }); await expect(tableWrapper).not.toHaveClass(/is-paused/); @@ -91,7 +132,7 @@ test.describe('Telemetry Table', () => { // Verify that it is <= our new end bound const latestMilliseconds = Date.parse(latestTelemetryDate); - const endBoundMilliseconds = Date.parse(endDate); + const endBoundMilliseconds = Date.parse(endTimeStamp); expect(latestMilliseconds).toBeLessThanOrEqual(endBoundMilliseconds); }); @@ -114,8 +155,7 @@ test.describe('Telemetry Table', () => { expect(cells.length).toBeGreaterThan(1); // ensure the text content of each cell contains the search term for (const cell of cells) { - const text = await cell.textContent(); - expect(text).toContain('Roger'); + await expect(cell).toHaveText(/Roger/); } await page.getByRole('searchbox', { name: 'message filter input' }).click(); @@ -126,15 +166,14 @@ test.describe('Telemetry Table', () => { .getByText(/Dodger/) .all(); // ensure we've got more than one cell - expect(cells.length).toBe(0); + expect(cells).toHaveLength(0); // ensure the text content of each cell contains the search term for (const cell of cells) { - const text = await cell.textContent(); - expect(text).not.toContain('Dodger'); + await expect(cell).not.toHaveText(/Dodger/); } // Click pause button - await page.click('button[title="Pause"]'); + await page.getByLabel('Pause').click(); }); test('Supports filtering using Regex', async ({ page }) => { @@ -160,8 +199,7 @@ test.describe('Telemetry Table', () => { expect(cells.length).toBeGreaterThan(1); // ensure the text content of each cell contains the search term for (const cell of cells) { - const text = await cell.textContent(); - expect(text).toContain('Roger'); + await expect(cell).toHaveText(/Roger/); } await page.getByRole('searchbox', { name: 'message filter input' }).click(); @@ -172,14 +210,51 @@ test.describe('Telemetry Table', () => { .getByText(/Dodger/) .all(); // ensure we've got more than one cell - expect(cells.length).toBe(0); + expect(cells).toHaveLength(0); // ensure the text content of each cell contains the search term for (const cell of cells) { - const text = await cell.textContent(); - expect(text).not.toContain('Dodger'); + await expect(cell).not.toHaveText(/Dodger/); } // Click pause button - await page.click('button[title="Pause"]'); + await page.getByLabel('Pause').click(); }); }); + +async function getScrollPosition(page, top = true) { + const tableBody = page.locator('.c-table__body-w'); + + // Wait for the scrollbar to appear + await tableBody.evaluate((node) => { + return new Promise((resolve) => { + function checkScroll() { + if (node.scrollHeight > node.clientHeight) { + resolve(); + } else { + setTimeout(checkScroll, 100); + } + } + checkScroll(); + }); + }); + + // make sure there are rows + const rows = page.getByLabel('table content').getByLabel('Table Row'); + await rows.first().waitFor(); + + // Using this to allow for rows to come and go, so we can truly test the scroll position + // eslint-disable-next-line playwright/no-wait-for-timeout + await page.waitForTimeout(1000); + + const { scrollTop, clientHeight, scrollHeight } = await tableBody.evaluate((node) => ({ + scrollTop: node.scrollTop, + clientHeight: node.clientHeight, + scrollHeight: node.scrollHeight + })); + + if (top) { + return scrollTop; + } else { + return Math.abs(scrollHeight - (scrollTop + clientHeight)); + } +} diff --git a/e2e/tests/functional/plugins/timeConductor/datepicker.e2e.spec.js b/e2e/tests/functional/plugins/timeConductor/datepicker.e2e.spec.js index e65de8c465..0da324bb98 100644 --- a/e2e/tests/functional/plugins/timeConductor/datepicker.e2e.spec.js +++ b/e2e/tests/functional/plugins/timeConductor/datepicker.e2e.spec.js @@ -22,16 +22,18 @@ import { createDomainObjectWithDefaults, - setIndependentTimeConductorBounds + navigateToObjectWithFixedTimeBounds, + setFixedIndependentTimeConductorBounds } from '../../../../appActions.js'; import { expect, test } from '../../../../pluginFixtures.js'; -const FIXED_TIME = - './#/browse/mine?tc.mode=fixed&tc.startBound=1693592063607&tc.endBound=1693593893607&tc.timeSystem=utc&view=grid&hideInspector=true&hideTree=true'; +const FIXED_TIME_URL = './#/browse/mine'; + test.describe('Datepicker operations', () => { test.beforeEach(async ({ page }) => { - await page.goto(FIXED_TIME); + await navigateToObjectWithFixedTimeBounds(page, FIXED_TIME_URL, 1693592063607, 1693593893607); }); + test('Verify that user can use the datepicker in the TC', async ({ page }) => { await page.getByLabel('Time Conductor Mode').click(); // Click on the date picker that is left-most on the screen @@ -42,12 +44,13 @@ test.describe('Datepicker operations', () => { // Expect datepicker to close and time conductor date setting to be changed await expect(page.getByRole('dialog')).toHaveCount(0); }); + test('Verify that user can use the datepicker in the ITC', async ({ page }) => { const createdTimeList = await createDomainObjectWithDefaults(page, { type: 'Time List' }); await page.goto(createdTimeList.url, { waitUntil: 'domcontentloaded' }); - await setIndependentTimeConductorBounds(page, { + await setFixedIndependentTimeConductorBounds(page, { start: '2024-11-12 19:11:11.000Z', end: '2024-11-12 20:11:11.000Z' }); diff --git a/e2e/tests/functional/plugins/timeConductor/timeConductor.e2e.spec.js b/e2e/tests/functional/plugins/timeConductor/timeConductor.e2e.spec.js index 8d3822852f..79346f382e 100644 --- a/e2e/tests/functional/plugins/timeConductor/timeConductor.e2e.spec.js +++ b/e2e/tests/functional/plugins/timeConductor/timeConductor.e2e.spec.js @@ -30,68 +30,80 @@ import { import { expect, test } from '../../../../pluginFixtures.js'; test.describe('Time conductor operations', () => { - test('validate start time does not exceeds end time', async ({ page }) => { + test('validate start time does not exceed end time', async ({ page }) => { // Go to baseURL await page.goto('./', { waitUntil: 'domcontentloaded' }); const year = new Date().getFullYear(); - let startDate = 'xxxx-01-01 01:00:00.000Z'; - startDate = year + startDate.substring(4); + // Set initial valid time bounds + const startDate = `${year}-01-01`; + const startTime = '01:00:00'; + const endDate = `${year}-01-01`; + const endTime = '02:00:00'; + await setTimeConductorBounds(page, { startDate, startTime, endDate, endTime }); - let endDate = 'xxxx-01-01 02:00:00.000Z'; - endDate = year + endDate.substring(4); + // Open the time conductor popup + await page.getByRole('button', { name: 'Time Conductor Mode', exact: true }).click(); - await setTimeConductorBounds(page, startDate, endDate); + // Test invalid start date + const invalidStartDate = `${year}-01-02`; + await page.getByLabel('Start date').fill(invalidStartDate); + await expect(page.getByLabel('Submit time bounds')).toBeDisabled(); + await page.getByLabel('Start date').fill(startDate); + await expect(page.getByLabel('Submit time bounds')).toBeEnabled(); - // invalid start date - startDate = year + 1 + startDate.substring(4); - await setTimeConductorBounds(page, startDate); + // Test invalid end date + const invalidEndDate = `${year - 1}-12-31`; + await page.getByLabel('End date').fill(invalidEndDate); + await expect(page.getByLabel('Submit time bounds')).toBeDisabled(); + await page.getByLabel('End date').fill(endDate); + await expect(page.getByLabel('Submit time bounds')).toBeEnabled(); - // Bring up the time conductor popup - const timeConductorMode = page.locator('.c-compact-tc'); - await timeConductorMode.click(); - const startDateLocator = page.locator('input[type="text"]').first(); - const endDateLocator = page.locator('input[type="text"]').nth(2); + // Test invalid start time + const invalidStartTime = '42:00:00'; + await page.getByLabel('Start time').fill(invalidStartTime); + await expect(page.getByLabel('Submit time bounds')).toBeDisabled(); + await page.getByLabel('Start time').fill(startTime); + await expect(page.getByLabel('Submit time bounds')).toBeEnabled(); - await endDateLocator.click(); + // Test invalid end time + const invalidEndTime = '43:00:00'; + await page.getByLabel('End time').fill(invalidEndTime); + await expect(page.getByLabel('Submit time bounds')).toBeDisabled(); + await page.getByLabel('End time').fill(endTime); + await expect(page.getByLabel('Submit time bounds')).toBeEnabled(); - const startDateValidityStatus = await startDateLocator.evaluate((element) => - element.checkValidity() + // Submit valid time bounds + await page.getByLabel('Submit time bounds').click(); + + // Verify the submitted time bounds + await expect(page.getByLabel('Start bounds')).toHaveText( + new RegExp(`${startDate} ${startTime}.000Z`) ); - expect(startDateValidityStatus).not.toBeTruthy(); - - // fix to valid start date - startDate = year - 1 + startDate.substring(4); - await setTimeConductorBounds(page, startDate); - - // invalid end date - endDate = year - 2 + endDate.substring(4); - await setTimeConductorBounds(page, undefined, endDate); - - await startDateLocator.click(); - - const endDateValidityStatus = await endDateLocator.evaluate((element) => - element.checkValidity() + await expect(page.getByLabel('End bounds')).toHaveText( + new RegExp(`${endDate} ${endTime}.000Z`) ); - expect(endDateValidityStatus).not.toBeTruthy(); }); }); -// Testing instructions: -// Try to change the realtime offsets when in realtime (local clock) mode. -test.describe('Time conductor input fields real-time mode', () => { - test('validate input fields in real-time mode', async ({ page }) => { +test.describe('Global Time Conductor', () => { + test.beforeEach(async ({ page }) => { + await page.goto('./', { waitUntil: 'domcontentloaded' }); + }); + + test('Input field validation: real-time mode', async ({ page }) => { const startOffset = { + startHours: '01', + startMins: '29', startSecs: '23' }; const endOffset = { + endHours: '01', + endMins: '30', endSecs: '31' }; - // Go to baseURL - await page.goto('./', { waitUntil: 'domcontentloaded' }); - // Switch to real-time mode await setRealTimeMode(page); @@ -99,13 +111,95 @@ test.describe('Time conductor input fields real-time mode', () => { await setStartOffset(page, startOffset); // Verify time was updated on time offset button - await expect(page.locator('.c-compact-tc__setting-value.icon-minus')).toContainText('00:30:23'); + await expect(page.getByLabel('Start offset: 01:29:23')).toBeVisible(); // Set end time offset await setEndOffset(page, endOffset); // Verify time was updated on preceding time offset button - await expect(page.locator('.c-compact-tc__setting-value.icon-plus')).toContainText('00:00:31'); + await expect(page.getByLabel('End offset: 01:30:31')).toBeVisible(); + + // Discard changes and verify that offsets remain unchanged + await setStartOffset(page, { + startHours: '00', + startMins: '30', + startSecs: '00', + submitChanges: false + }); + + await expect(page.getByLabel('Start offset: 01:29:23')).toBeVisible(); + await expect(page.getByLabel('End offset: 01:30:31')).toBeVisible(); + }); + + test('Input field validation: fixed time mode', async ({ page }) => { + test.info().annotations.push({ + type: 'issue', + description: 'https://github.com/nasa/openmct/issues/7791' + }); + // Switch to fixed time mode + await setFixedTimeMode(page); + + // Define valid time bounds for testing + const validBounds = { + startDate: '2024-04-20', + startTime: '00:04:20', + endDate: '2024-04-20', + endTime: '16:04:20' + }; + // Set valid time conductor bounds ✌️ + await setTimeConductorBounds(page, validBounds); + + // Verify that the time bounds are set correctly + await expect(page.getByLabel(`Start bounds: 2024-04-20 00:04:20.000Z`)).toBeVisible(); + await expect(page.getByLabel(`End bounds: 2024-04-20 16:04:20.000Z`)).toBeVisible(); + + // Open the Time Conductor Mode popup + await page.getByLabel('Time Conductor Mode').click(); + + // Test invalid start date + const invalidStartDate = '2024-04-21'; + await page.getByLabel('Start date').fill(invalidStartDate); + await expect(page.getByLabel('Submit time bounds')).toBeDisabled(); + await page.getByLabel('Start date').fill(validBounds.startDate); + await expect(page.getByLabel('Submit time bounds')).toBeEnabled(); + + // Test invalid end date + const invalidEndDate = '2024-04-19'; + await page.getByLabel('End date').fill(invalidEndDate); + await expect(page.getByLabel('Submit time bounds')).toBeDisabled(); + await page.getByLabel('End date').fill(validBounds.endDate); + await expect(page.getByLabel('Submit time bounds')).toBeEnabled(); + + // Test invalid start time + const invalidStartTime = '16:04:21'; + await page.getByLabel('Start time').fill(invalidStartTime); + await expect(page.getByLabel('Submit time bounds')).toBeDisabled(); + await page.getByLabel('Start time').fill(validBounds.startTime); + await expect(page.getByLabel('Submit time bounds')).toBeEnabled(); + + // Test invalid end time + const invalidEndTime = '00:04:19'; + await page.getByLabel('End time').fill(invalidEndTime); + await expect(page.getByLabel('Submit time bounds')).toBeDisabled(); + await page.getByLabel('End time').fill(validBounds.endTime); + await expect(page.getByLabel('Submit time bounds')).toBeEnabled(); + + // Verify that the time bounds remain unchanged after invalid inputs + await expect(page.getByLabel(`Start bounds: 2024-04-20 00:04:20.000Z`)).toBeVisible(); + await expect(page.getByLabel(`End bounds: 2024-04-20 16:04:20.000Z`)).toBeVisible(); + + // Discard changes and verify that bounds remain unchanged + await setTimeConductorBounds(page, { + startDate: validBounds.startDate, + startTime: '04:20:00', + endDate: validBounds.endDate, + endTime: '04:20:20', + submitChanges: false + }); + + // Verify that the original time bounds are still displayed after discarding changes + await expect(page.getByLabel(`Start bounds: 2024-04-20 00:04:20.000Z`)).toBeVisible(); + await expect(page.getByLabel(`End bounds: 2024-04-20 16:04:20.000Z`)).toBeVisible(); }); /** @@ -147,14 +241,15 @@ test.describe('Time conductor input fields real-time mode', () => { await setRealTimeMode(page); // Verify updated start time offset persists after mode switch - await expect(page.locator('.c-compact-tc__setting-value.icon-minus')).toContainText('00:30:23'); + await expect(page.getByLabel('Start offset: 00:30:23')).toBeVisible(); // Verify updated end time offset persists after mode switch - await expect(page.locator('.c-compact-tc__setting-value.icon-plus')).toContainText('00:00:01'); + await expect(page.getByLabel('End offset: 00:00:01')).toBeVisible(); // Verify url parameters persist after mode switch - expect(page.url()).toContain(`startDelta=${startDelta}`); - expect(page.url()).toContain(`endDelta=${endDelta}`); + // eslint-disable-next-line no-useless-escape + const urlRegex = new RegExp(`.*tc\.startDelta=${startDelta}&tc\.endDelta=${endDelta}.*`); + await page.waitForURL(urlRegex); }); test.fixme( @@ -186,29 +281,3 @@ test.describe('Time conductor input fields real-time mode', () => { // select an option and verify the offsets are updated correctly }); }); - -test.describe('Time Conductor History', () => { - test('shows milliseconds on hover @unstable', async ({ page }) => { - test.info().annotations.push({ - type: 'issue', - description: 'https://github.com/nasa/openmct/issues/4386' - }); - // Navigate to Open MCT in Fixed Time Mode, UTC Time System - // with startBound at 2022-01-01 00:00:00.000Z - // and endBound at 2022-01-01 00:00:00.200Z - await page.goto( - './#/browse/mine?view=grid&tc.mode=fixed&tc.startBound=1640995200000&tc.endBound=1640995200200&tc.timeSystem=utc&hideInspector=true' - ); - await page.getByRole('button', { name: 'Time Conductor Settings' }).click(); - await page.getByRole('button', { name: 'Time Conductor History' }).hover({ trial: true }); - await page.getByRole('button', { name: 'Time Conductor History' }).click(); - - // Validate history item format - const historyItem = page.locator('text="2022-01-01 00:00:00 + 200ms"'); - await expect(historyItem).toBeEnabled(); - await expect(historyItem).toHaveAttribute( - 'title', - '2022-01-01 00:00:00.000 - 2022-01-01 00:00:00.200' - ); - }); -}); diff --git a/e2e/tests/functional/plugins/timer/timer.e2e.spec.js b/e2e/tests/functional/plugins/timer/timer.e2e.spec.js index 1e0393545f..f63cd4c1e7 100644 --- a/e2e/tests/functional/plugins/timer/timer.e2e.spec.js +++ b/e2e/tests/functional/plugins/timer/timer.e2e.spec.js @@ -20,10 +20,7 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -import { - createDomainObjectWithDefaults, - openObjectTreeContextMenu -} from '../../../../appActions.js'; +import { createDomainObjectWithDefaults } from '../../../../appActions.js'; import { MISSION_TIME } from '../../../../constants.js'; import { expect, test } from '../../../../pluginFixtures.js'; @@ -33,7 +30,6 @@ test.describe('Timer', () => { test.beforeEach(async ({ page }) => { await page.goto('./', { waitUntil: 'domcontentloaded' }); timer = await createDomainObjectWithDefaults(page, { type: 'timer' }); - await assertTimerElements(page, timer); }); test('Can perform actions on the Timer', async ({ page }) => { @@ -42,13 +38,11 @@ test.describe('Timer', () => { description: 'https://github.com/nasa/openmct/issues/4313' }); - const timerUrl = timer.url; - await test.step('From the tree context menu', async () => { - await triggerTimerContextMenuAction(page, timerUrl, 'Start'); - await triggerTimerContextMenuAction(page, timerUrl, 'Pause'); - await triggerTimerContextMenuAction(page, timerUrl, 'Restart at 0'); - await triggerTimerContextMenuAction(page, timerUrl, 'Stop'); + await triggerTimerContextMenuAction(page, timer.url, 'Start'); + await triggerTimerContextMenuAction(page, timer.url, 'Pause'); + await triggerTimerContextMenuAction(page, timer.url, 'Restart at 0'); + await triggerTimerContextMenuAction(page, timer.url, 'Stop'); }); await test.step('From the 3dot menu', async () => { @@ -67,26 +61,18 @@ test.describe('Timer', () => { }); test.describe('Timer with target date @clock', () => { - let timer; - test.beforeEach(async ({ page }) => { + await page.clock.install({ time: MISSION_TIME }); + await page.clock.resume(); await page.goto('./', { waitUntil: 'domcontentloaded' }); - timer = await createDomainObjectWithDefaults(page, { type: 'timer' }); - await assertTimerElements(page, timer); - }); - - // Override clock - test.use({ - clockOptions: { - now: MISSION_TIME, - shouldAdvanceTime: true - } + await createDomainObjectWithDefaults(page, { type: 'timer' }); }); test('Can count down to a target date', async ({ page }) => { // Set the target date to 2024-11-24 03:30:00 await page.getByTitle('More actions').click(); await page.getByRole('menuitem', { name: /Edit Properties.../ }).click(); + await page.getByPlaceholder('YYYY-MM-DD').fill('2024-11-24'); await page.locator('input[name="hour"]').fill('3'); await page.locator('input[name="min"]').fill('30'); @@ -159,14 +145,13 @@ async function triggerTimerContextMenuAction(page, timerUrl, action) { */ async function triggerTimer3dotMenuAction(page, action) { const menuAction = `.c-menu ul li >> text="${action}"`; - const threeDotMenuButton = 'button[title="More actions"]'; let isActionAvailable = false; let iterations = 0; // Dismiss/open the 3dot menu until the action is available // or a maximum number of iterations is reached while (!isActionAvailable && iterations <= 20) { - await page.click('.c-object-view'); - await page.click(threeDotMenuButton); + await page.getByLabel('Object View').click(); + await page.getByLabel('More actions').click(); isActionAvailable = await page.locator(menuAction).isVisible(); iterations++; } @@ -183,7 +168,7 @@ async function triggerTimer3dotMenuAction(page, action) { async function triggerTimerViewAction(page, action) { await page.locator('.c-timer').hover({ trial: true }); const buttonTitle = buttonTitleFromAction(action); - await page.click(`button[title="${buttonTitle}"]`); + await page.getByLabel(buttonTitle, { exact: true }).click(); assertTimerStateAfterAction(page, action); } @@ -214,11 +199,11 @@ async function assertTimerStateAfterAction(page, action) { case 'Start': case 'Restart at 0': timerStateClass = 'is-started'; - expect(await timerValue.innerText()).toBe('0D 00:00:00'); + await expect(timerValue).toHaveText('0D 00:00:00'); break; case 'Stop': timerStateClass = 'is-stopped'; - expect(await timerValue.innerText()).toBe('--:--:--'); + await expect(timerValue).toHaveText('--:--:--'); break; case 'Pause': timerStateClass = 'is-paused'; @@ -229,23 +214,16 @@ async function assertTimerStateAfterAction(page, action) { } /** - * Assert that all the major components of a timer are present in the DOM. + * Open the given `domainObject`'s context menu from the object tree. + * Expands the path to the object and scrolls to it if necessary. + * * @param {import('@playwright/test').Page} page - * @param {import('../../../../appActions').CreatedObjectInfo} timer + * @param {string} url the url to the object */ -async function assertTimerElements(page, timer) { - const timerElement = page.locator('.c-timer'); - const resetButton = page.getByRole('button', { name: 'Reset' }); - const pausePlayButton = page - .getByRole('button', { name: 'Pause' }) - .or(page.getByRole('button', { name: 'Start' })); - const timerDirectionIcon = page.locator('.c-timer__direction'); - const timerValue = page.locator('.c-timer__value'); - - expect(await page.locator('.l-browse-bar__object-name').innerText()).toBe(timer.name); - expect(timerElement).toBeAttached(); - expect(resetButton).toBeAttached(); - expect(pausePlayButton).toBeAttached(); - expect(timerDirectionIcon).toBeAttached(); - expect(timerValue).toBeAttached(); +async function openObjectTreeContextMenu(page, url) { + await page.goto(url); + await page.getByLabel('Show selected item in tree').click(); + await page.locator('.is-navigated-object').click({ + button: 'right' + }); } diff --git a/e2e/tests/functional/recentObjects.e2e.spec.js b/e2e/tests/functional/recentObjects.e2e.spec.js index 6b18d6eb02..1a5cc7afd7 100644 --- a/e2e/tests/functional/recentObjects.e2e.spec.js +++ b/e2e/tests/functional/recentObjects.e2e.spec.js @@ -95,7 +95,7 @@ test.describe('Recent Objects', () => { ).toBeGreaterThan(0); expect(recentObjectsList.getByRole('listitem', { name: folderA.name })).toBeTruthy(); - await page.click('button[title="Show selected item in tree"]'); + await page.getByLabel('Show selected item in tree').click(); // Delete the folder via the left tree pane treeitem context menu await page .getByRole('treeitem', { name: new RegExp(folderA.name) }) @@ -104,7 +104,7 @@ test.describe('Recent Objects', () => { button: 'right' }); await page.getByRole('menuitem', { name: /Remove/ }).click(); - await page.getByRole('button', { name: 'OK', exact: true }).click(); + await page.getByRole('button', { name: 'Ok', exact: true }).click(); // Verify that the folder and clock are no longer in the recent objects list await expect(recentObjectsList.getByRole('listitem', { name: folderA.name })).toBeHidden(); @@ -227,24 +227,22 @@ test.describe('Recent Objects', () => { .click(); // Assert that two recent objects are displayed and one of them is an alias - expect(await recentObjectsList.getByRole('listitem', { name: clock.name }).count()).toBe(2); - expect(await recentObjectsList.locator('.is-alias').count()).toBe(1); + await expect(recentObjectsList.getByRole('listitem', { name: clock.name })).toHaveCount(2); + await expect(recentObjectsList.locator('.is-alias')).toHaveCount(1); // Assert that the alias and the original's breadcrumbs are different const clockBreadcrumbs = recentObjectsList .getByRole('listitem', { name: clock.name }) .getByRole('navigation'); - expect(await clockBreadcrumbs.count()).toBe(2); - expect(await clockBreadcrumbs.nth(0).innerText()).not.toEqual( - await clockBreadcrumbs.nth(1).innerText() - ); + await expect(clockBreadcrumbs).toHaveCount(2); + await expect(clockBreadcrumbs.nth(0)).not.toHaveText(await clockBreadcrumbs.nth(1).innerText()); }); test('Enforces a limit of 20 recent objects and clears the recent objects', async ({ page }) => { // Creating 21 objects takes a while, so increase the timeout test.slow(); // Assert that the list initially contains 3 objects (clock, folder, my items) - expect(await recentObjectsList.locator('.c-recentobjects-listitem').count()).toBe(3); + await expect(recentObjectsList.locator('.c-recentobjects-listitem')).toHaveCount(3); let lastFolder; let lastClock; @@ -261,7 +259,7 @@ test.describe('Recent Objects', () => { } // Assert that the list contains 20 objects - expect(await recentObjectsList.locator('.c-recentobjects-listitem').count()).toBe(20); + await expect(recentObjectsList.locator('.c-recentobjects-listitem')).toHaveCount(20); // Collapse the tree await page.getByTitle('Collapse all tree items').click(); @@ -293,44 +291,38 @@ test.describe('Recent Objects', () => { await page.getByRole('button', { name: 'Clear Recently Viewed' }).click(); // Click on the "OK" button in the confirmation dialog - await page.getByRole('button', { name: 'OK', exact: true }).click(); + await page.getByRole('button', { name: 'Ok', exact: true }).click(); // Assert that the list is empty - expect(await recentObjectsList.locator('.c-recentobjects-listitem').count()).toBe(0); + await expect(recentObjectsList.locator('.c-recentobjects-listitem')).toHaveCount(0); }); test('Verify functionality of "clear" and "collapse pane" buttons', async ({ page }) => { // Assert that the list initially contains 3 objects (clock, folder, my items) - expect(await recentObjectsList.locator('.c-recentobjects-listitem').count()).toBe(3); + await expect(recentObjectsList.locator('.c-recentobjects-listitem')).toHaveCount(3); // Assert that the button is enabled - expect(await page.getByRole('button', { name: 'Clear Recently Viewed' }).isEnabled()).toBe( - true - ); + await expect(page.getByRole('button', { name: 'Clear Recently Viewed' })).toBeEnabled(); // Click the aria-label="Clear Recently Viewed" button await page.getByRole('button', { name: 'Clear Recently Viewed' }).click(); // Click on the "OK" button in the confirmation dialog - await page.getByRole('button', { name: 'OK', exact: true }).click(); + await page.getByRole('button', { name: 'Ok', exact: true }).click(); // Assert that the list is empty - expect(await recentObjectsList.locator('.c-recentobjects-listitem').count()).toBe(0); + await expect(recentObjectsList.locator('.c-recentobjects-listitem')).toHaveCount(0); // Assert that the button is disabled - expect(await page.getByRole('button', { name: 'Clear Recently Viewed' }).isEnabled()).toBe( - false - ); + await expect(page.getByRole('button', { name: 'Clear Recently Viewed' })).toBeDisabled(); // Navigate to folder object await page.goto(folderA.url); // Assert that the list contains 1 object - expect(await recentObjectsList.locator('.c-recentobjects-listitem').count()).toBe(1); + await expect(recentObjectsList.locator('.c-recentobjects-listitem')).toHaveCount(1); // Assert that the button is enabled - expect(await page.getByRole('button', { name: 'Clear Recently Viewed' }).isEnabled()).toBe( - true - ); + await expect(page.getByRole('button', { name: 'Clear Recently Viewed' })).toBeEnabled(); // Assert initial state of pane and collapse the Recent Objects panel await expect(page.getByLabel('Expand Recently Viewed Pane')).toBeHidden(); diff --git a/e2e/tests/functional/renaming.e2e.spec.js b/e2e/tests/functional/renaming.e2e.spec.js index f201c07028..80641fb29b 100644 --- a/e2e/tests/functional/renaming.e2e.spec.js +++ b/e2e/tests/functional/renaming.e2e.spec.js @@ -24,13 +24,13 @@ This test suite is dedicated to tests for renaming objects, and their global application effects. */ -import { createDomainObjectWithDefaults, renameObjectFromContextMenu } from '../../appActions.js'; +import { createDomainObjectWithDefaults } from '../../appActions.js'; import { expect, test } from '../../baseFixtures.js'; test.describe('Renaming objects', () => { test.beforeEach(async ({ page }) => { // Go to baseURL - await page.goto('./', { waitUntil: 'networkidle' }); + await page.goto('./', { waitUntil: 'domcontentloaded' }); }); test('When renaming objects, the browse bar and various components all update', async ({ @@ -73,3 +73,33 @@ test.describe('Renaming objects', () => { expect(title).toBe(clock.name); }); }); + +/** + * @param {import('@playwright/test').Page} page + * @param {string} myItemsFolderName + * @param {string} url + * @param {string} newName + */ +async function renameObjectFromContextMenu(page, url, newName) { + await openObjectTreeContextMenu(page, url); + await page.locator('li:text("Edit Properties")').click(); + const nameInput = page.getByLabel('Title', { exact: true }); + await nameInput.fill(''); + await nameInput.fill(newName); + await page.locator('[aria-label="Save"]').click(); +} + +/** + * Open the given `domainObject`'s context menu from the object tree. + * Expands the path to the object and scrolls to it if necessary. + * + * @param {import('@playwright/test').Page} page + * @param {string} url the url to the object + */ +async function openObjectTreeContextMenu(page, url) { + await page.goto(url); + await page.getByLabel('Show selected item in tree').click(); + await page.locator('.is-navigated-object').click({ + button: 'right' + }); +} diff --git a/e2e/tests/functional/search.e2e.spec.js b/e2e/tests/functional/search.e2e.spec.js index ccc0163b18..f0a7357a13 100644 --- a/e2e/tests/functional/search.e2e.spec.js +++ b/e2e/tests/functional/search.e2e.spec.js @@ -162,13 +162,13 @@ test.describe('Grand Search', () => { const searchResults = page.getByRole('listitem', { name: 'Object Search Result' }); // Verify that no results are found - expect(await searchResults.count()).toBe(0); + await expect(searchResults).toHaveCount(0); // Verify proper message appears await expect(page.getByText('No results found')).toBeVisible(); }); - test('Validate single object in search result @couchdb', async ({ page }) => { + test('Validate single object in search result @couchdb @network', async ({ page }) => { // Create a folder object const folderName = uuid(); await createDomainObjectWithDefaults(page, { @@ -187,11 +187,11 @@ test.describe('Grand Search', () => { // Verify that one result is found await expect(searchResults).toBeVisible(); - expect(await searchResults.count()).toBe(1); + await expect(searchResults).toHaveCount(1); await expect(searchResults).toContainText(folderName); }); - test('Search results are debounced @couchdb', async ({ page }) => { + test('Search results are debounced @couchdb @network', async ({ page }) => { test.info().annotations.push({ type: 'issue', description: 'https://github.com/nasa/openmct/issues/6179' @@ -216,12 +216,14 @@ test.describe('Grand Search', () => { // Network requests for the composite telemetry with multiple items should be: // 1. batched request for latest telemetry using the bulk API - expect(networkRequests.length).toBe(1); + await expect.poll(() => networkRequests, { timeout: 10000 }).toHaveLength(1); await expect(page.getByRole('list', { name: 'Object Results' })).toContainText('Clock A'); }); - test('Slowly typing after search debounce will abort requests @couchdb', async ({ page }) => { + test('Slowly typing after search debounce will abort requests @couchdb @network', async ({ + page + }) => { let requestWasAborted = false; await createObjectsForSearch(page); page.on('requestfailed', (request) => { @@ -282,7 +284,7 @@ test.describe('Grand Search', () => { // Get the search results const objectSearchResults = page.getByLabel('Object Search Result'); // Verify that two results are found - expect(await objectSearchResults.count()).toBe(2); + await expect(objectSearchResults).toHaveCount(2); }); }); diff --git a/e2e/tests/functional/staleness.e2e.spec.js b/e2e/tests/functional/staleness.e2e.spec.js new file mode 100644 index 0000000000..d247674cae --- /dev/null +++ b/e2e/tests/functional/staleness.e2e.spec.js @@ -0,0 +1,62 @@ +/***************************************************************************** + * Open MCT, Copyright (c) 2014-2023, 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. + *****************************************************************************/ + +import { createDomainObjectWithDefaults, navigateToObjectWithRealTime } from '../../appActions.js'; +import { expect, test } from '../../pluginFixtures.js'; + +test.describe('Staleness', () => { + test.beforeEach(async ({ page }) => { + await page.goto('./', { waitUntil: 'domcontentloaded' }); + }); + + test('Does not show staleness after navigating from a stale object', async ({ page }) => { + const staleSWG = await createDomainObjectWithDefaults(page, { + type: 'Sine Wave Generator', + name: 'SWG' + }); + + // edit properties and enable staleness updates + await page.getByLabel('More actions').click(); + await page.getByLabel('Edit properties...').click(); + await page.getByLabel('Provide Staleness Updates', { exact: true }).click(); + await page.getByLabel('Save').click(); + + const folder = await createDomainObjectWithDefaults(page, { + type: 'Folder', + name: 'Folder 1' + }); + + // Navigate to the stale object + await navigateToObjectWithRealTime(page, staleSWG.url); + + // Assert that staleness is shown + await expect(page.getByLabel('Object View')).toHaveClass(/is-stale/, { + timeout: 30 * 1000 // Give 30 seconds for the staleness to be updated + }); + + // Immediately navigate to the folder + await page.goto(folder.url); + + // Verify that staleness is not shown + await expect(page.getByLabel('Object View')).not.toHaveClass(/is-stale/); + }); +}); diff --git a/e2e/tests/functional/tooltips.e2e.spec.js b/e2e/tests/functional/tooltips.e2e.spec.js index 711abfd786..42d831196c 100644 --- a/e2e/tests/functional/tooltips.e2e.spec.js +++ b/e2e/tests/functional/tooltips.e2e.spec.js @@ -21,19 +21,11 @@ *****************************************************************************/ /* -This test suite is dedicated to tests which can quickly verify that any openmct installation is -operable and that any type of testing can proceed. - -Ideally, smoke tests should make zero assumptions about how and where they are run. This makes them -more resilient to change and therefor a better indicator of failure. Smoke tests will also run quickly -as they cover a very "thin surface" of functionality. - -When deciding between authoring new smoke tests or functional tests, ask yourself "would I feel -comfortable running this test during a live mission?" Avoid creating or deleting Domain Objects. -Make no assumptions about the order that elements appear in the DOM. +This suite is dedicated to tests which verify that tooltips are displayed correctly. */ import { createDomainObjectWithDefaults, expandEntireTree } from '../../appActions.js'; +import { MISSION_TIME } from '../../constants.js'; import { expect, test } from '../../pluginFixtures.js'; test.describe('Verify tooltips', () => { @@ -48,7 +40,7 @@ test.describe('Verify tooltips', () => { const swg2Path = 'My Items / Folder Foo / Folder Bar / SWG 2'; const swg3Path = 'My Items / Folder Foo / Folder Bar / Folder Baz / SWG 3'; - test.beforeEach(async ({ page, openmctConfig }) => { + test.beforeEach(async ({ page }) => { await page.goto('./', { waitUntil: 'domcontentloaded' }); folder1 = await createDomainObjectWithDefaults(page, { @@ -89,7 +81,7 @@ test.describe('Verify tooltips', () => { await expandEntireTree(page); }); - test('display correct paths for LAD tables', async ({ page, openmctConfig }) => { + test('display correct paths for LAD tables', async ({ page }) => { // Create LAD table await createDomainObjectWithDefaults(page, { type: 'LAD Table', @@ -98,25 +90,32 @@ test.describe('Verify tooltips', () => { // Edit LAD table await page.getByLabel('Edit Object').click(); - // Add the Sine Wave Generator to the LAD table and save changes - await page.dragAndDrop(`text=${sineWaveObject1.name}`, '.c-lad-table-wrapper'); - await page.dragAndDrop(`text=${sineWaveObject2.name}`, '.c-lad-table-wrapper'); - await page.dragAndDrop(`text=${sineWaveObject3.name}`, '.c-lad-table-wrapper'); - await page.locator('button[title="Save"]').click(); + // Add the Sine Wave Generator to the LAD table and save changes. + //TODO Follow up with https://github.com/nasa/openmct/issues/7773 + await page.getByLabel(`Preview ${sineWaveObject1.name}`).dragTo(page.getByLabel('Object View')); + await page.getByLabel(`Preview ${sineWaveObject2.name}`).dragTo(page.getByLabel('Object View')); + await page.getByLabel(`Preview ${sineWaveObject3.name}`).dragTo(page.getByLabel('Object View')); + await page.getByRole('button', { name: 'Save' }).click(); await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); await page.keyboard.down('Control'); + //Hover on something else + await page.getByRole('button', { name: 'Create' }).hover(); + //Hover over the first + await page.getByLabel('lad name').getByText(sineWaveObject1.name).hover(); + await expect(page.getByRole('tooltip', { name: sineWaveObject1.path })).toBeVisible(); - async function getToolTip(object) { - await page.locator('.c-create-button').hover(); - await page.getByLabel('lad name').getByText(object.name).hover(); - let tooltipText = await page.locator('.c-tooltip').textContent(); - return tooltipText.replace('\n', '').trim(); - } + //Hover on something else + await page.getByRole('button', { name: 'Create' }).hover(); + //Hover over second object + await page.getByLabel('lad name').getByText(sineWaveObject2.name).hover(); + await expect(page.getByRole('tooltip', { name: sineWaveObject2.path })).toBeVisible(); - expect(await getToolTip(sineWaveObject1)).toBe(sineWaveObject1.path); - expect(await getToolTip(sineWaveObject2)).toBe(sineWaveObject2.path); - expect(await getToolTip(sineWaveObject3)).toBe(sineWaveObject3.path); + //Hover on something else + await page.getByRole('button', { name: 'Create' }).hover(); + //Hover over third object + await page.getByLabel('lad name').getByText(sineWaveObject3.name).hover(); + await expect(page.getByRole('tooltip', { name: sineWaveObject3.path })).toBeVisible(); }); test('display correct paths for expanded and collapsed plot legend items', async ({ page }) => { @@ -128,66 +127,74 @@ test.describe('Verify tooltips', () => { // Edit Overlay Plot await page.getByLabel('Edit Object').click(); - // Add the Sine Wave Generator to the LAD table and save changes - await page.dragAndDrop(`text=${sineWaveObject1.name}`, '.gl-plot'); - await page.dragAndDrop(`text=${sineWaveObject2.name}`, '.gl-plot'); - await page.dragAndDrop(`text=${sineWaveObject3.name}`, '.gl-plot'); - await page.locator('button[title="Save"]').click(); + // Add the Sine Wave Generators to the and save changes + await page + .getByLabel('Preview SWG 1 generator Object') + .dragTo(page.getByLabel('Plot Container Style Target')); + await page + .getByLabel('Preview SWG 2 generator Object') + .dragTo(page.getByLabel('Plot Container Style Target')); + await page + .getByLabel('Preview SWG 3 generator Object') + .dragTo(page.getByLabel('Plot Container Style Target')); + + await page.getByRole('button', { name: 'Save' }).click(); await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); + //Hover over Collapsed Plot Legend Components with the Control Key pressed await page.keyboard.down('Control'); - - async function getCollapsedLegendToolTip(object) { - await page.locator('.c-create-button').hover(); - await page - .locator('.plot-series-name', { has: page.locator(`text="${object.name} Hz"`) }) - .hover(); - let tooltipText = await page.locator('.c-tooltip').textContent(); - return tooltipText.replace('\n', '').trim(); - } - - async function getExpandedLegendToolTip(object) { - await page.locator('.c-create-button').hover(); - await page - .locator('.plot-series-name', { has: page.locator(`text="${object.name}"`) }) - .hover(); - let tooltipText = await page.locator('.c-tooltip').textContent(); - return tooltipText.replace('\n', '').trim(); - } - - expect(await getCollapsedLegendToolTip(sineWaveObject1)).toBe(sineWaveObject1.path); - expect(await getCollapsedLegendToolTip(sineWaveObject2)).toBe(sineWaveObject2.path); - expect(await getCollapsedLegendToolTip(sineWaveObject3)).toBe(sineWaveObject3.path); - + //Hover over first object + await page.getByText('SWG 1 Hz').hover(); + await expect(page.getByRole('tooltip')).toHaveText(sineWaveObject1.path); + //Hover over another object to clear + await page.getByRole('button', { name: 'create' }).hover(); + //Hover over second object + await page.getByText('SWG 2 Hz').hover(); + await expect(page.getByRole('tooltip')).toHaveText(sineWaveObject2.path); + //Hover over another object to clear + await page.getByRole('button', { name: 'create' }).hover(); + //Hover over third object + await page.getByText('SWG 3 Hz').hover(); + await expect(page.getByRole('tooltip')).toHaveText(sineWaveObject3.path); + //Release the Control Key await page.keyboard.up('Control'); + + //Expand the legend await page.locator('.gl-plot-legend__view-control.c-disclosure-triangle').click(); + + //Hover over Expanded Plot Legend Components with the Control Key pressed await page.keyboard.down('Control'); - expect(await getExpandedLegendToolTip(sineWaveObject1)).toBe(sineWaveObject1.path); - expect(await getExpandedLegendToolTip(sineWaveObject2)).toBe(sineWaveObject2.path); - expect(await getExpandedLegendToolTip(sineWaveObject3)).toBe(sineWaveObject3.path); + await page.getByLabel('Plot Legend Expanded').getByText('SWG 1').hover(); + await expect(page.getByRole('tooltip')).toHaveText(sineWaveObject1.path); + //Hover over another object to clear + await page.getByRole('button', { name: 'create' }).hover(); + //Hover over second object + await page.getByLabel('Plot Legend Expanded').getByText('SWG 2').hover(); + await expect(page.getByRole('tooltip')).toHaveText(sineWaveObject2.path); + //Hover over another object to clear + await page.getByRole('button', { name: 'create' }).hover(); + //Hover over third object + await page.getByLabel('Plot Legend Expanded').getByText('SWG 3').hover(); + await expect(page.getByRole('tooltip')).toHaveText(sineWaveObject3.path); }); test('display correct paths when hovering over object labels', async ({ page }) => { - async function getObjectLabelTooltip(object) { - await page - .locator('.c-tree__item__name.c-object-label__name', { - has: page.locator(`text="${object.name}"`) - }) - .click(); - await page.keyboard.down('Control'); - await page - .locator('.l-browse-bar__object-name.c-object-label__name', { - has: page.locator(`text="${object.name}"`) - }) - .hover(); - const tooltipText = await page.locator('.c-tooltip').textContent(); - await page.keyboard.up('Control'); - return tooltipText.replace('\n', '').trim(); - } + //Navigate to SWG 1 in Tree + await page.getByLabel('Navigate to SWG 1 generator').click(); - expect(await getObjectLabelTooltip(sineWaveObject1)).toBe(sineWaveObject1.path); - expect(await getObjectLabelTooltip(sineWaveObject3)).toBe(sineWaveObject3.path); + //Expect tooltip to be the path of SWG 1 + await page.keyboard.down('Control'); + await page.getByRole('main').getByText('SWG 1', { exact: true }).hover(); + await expect(page.getByRole('tooltip')).toHaveText(sineWaveObject1.path); + await page.keyboard.up('Control'); + + //Navigate to SWG 3 in Tree + await page.getByLabel('Navigate to SWG 3 generator').click(); + //Expect tooltip to be the path of SWG 3 + await page.keyboard.down('Control'); + await page.getByRole('main').getByText('SWG 3', { exact: true }).hover(); + await expect(page.getByRole('tooltip')).toHaveText(sineWaveObject3.path); }); test('display correct paths when hovering over display layout pane headers', async ({ page }) => { @@ -198,8 +205,11 @@ test.describe('Verify tooltips', () => { }); // Edit Overlay Plot await page.getByLabel('Edit Object').click(); - await page.dragAndDrop(`text=${sineWaveObject1.name}`, '.gl-plot'); - await page.locator('button[title="Save"]').click(); + + await page + .getByLabel('Preview SWG 1 generator Object') + .dragTo(page.getByLabel('Plot Container Style Target')); + await page.getByRole('button', { name: 'Save' }).click(); await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); // Create Stacked Plot @@ -209,8 +219,9 @@ test.describe('Verify tooltips', () => { }); // Edit Stacked Plot await page.getByLabel('Edit Object').click(); - await page.dragAndDrop(`text=${sineWaveObject2.name}`, '.c-plot--stacked.holder'); - await page.locator('button[title="Save"]').click(); + + await page.getByLabel(`Preview ${sineWaveObject2.name}`).dragTo(page.getByLabel('Object View')); + await page.getByRole('button', { name: 'Save' }).click(); await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); // Create Display Layout @@ -221,66 +232,77 @@ test.describe('Verify tooltips', () => { // Edit Display Layout await page.getByLabel('Edit Object').click(); - await page.dragAndDrop("text='Test Overlay Plot'", '.l-layout__grid-holder', { - targetPosition: { x: 0, y: 0 } - }); - await page.dragAndDrop("text='Test Stacked Plot'", '.l-layout__grid-holder', { - targetPosition: { x: 0, y: 250 } - }); - await page.dragAndDrop(`text=${sineWaveObject3.name}`, '.l-layout__grid-holder', { - targetPosition: { x: 500, y: 200 } - }); - await page.locator('button[title="Save"]').click(); + await page + .getByLabel('Preview Test Overlay Plot') + .dragTo(page.locator('#display-layout-drop-area'), { + targetPosition: { x: 0, y: 0 } + }); + + //Add Display Layout below Overlay Plot + await page + .getByLabel('Preview Test Stacked Plot') + .dragTo(page.locator('#display-layout-drop-area'), { + targetPosition: { x: 0, y: 250 } + }); + + //Drag the SWG3 Object to the Display off to the right + await page + .getByLabel('Preview SWG 3 generator Object') + .dragTo(page.locator('#display-layout-drop-area'), { + targetPosition: { x: 500, y: 200 } + }); + + await page.getByRole('button', { name: 'Save' }).click(); await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); + //Hover over Overlay Plot with the Control Key pressed await page.keyboard.down('Control'); - await page.getByText('Test Overlay Plot').nth(2).hover(); - let tooltipText = await page.locator('.c-tooltip').textContent(); - tooltipText = tooltipText.replace('\n', '').trim(); - expect(tooltipText).toBe('My Items / Test Overlay Plot'); - + //Hover Overlay Plot + await page.getByTitle('Test Overlay Plot').hover(); + await expect(page.getByRole('tooltip')).toHaveText('My Items / Test Overlay Plot'); await page.keyboard.up('Control'); - await page.locator('.c-plot-legend__view-control >> nth=0').click(); + + //Expand the Overlay Plot Legend and hover over the first legend item + await page.getByLabel('Expand Test Overlay Plot Legend').click(); + await page.keyboard.down('Control'); - await page.locator('.plot-wrapper-expanded-legend .plot-series-name').first().hover(); - tooltipText = await page.locator('.c-tooltip').textContent(); - tooltipText = tooltipText.replace('\n', '').trim(); - expect(tooltipText).toBe(sineWaveObject1.path); + await page.getByLabel('Plot Legend Item for Test').getByText('SWG').hover(); + await expect(page.getByRole('tooltip')).toHaveText(sineWaveObject1.path); - await page.getByText('Test Stacked Plot').nth(2).hover(); - tooltipText = await page.locator('.c-tooltip').textContent(); - tooltipText = tooltipText.replace('\n', '').trim(); - expect(tooltipText).toBe('My Items / Test Stacked Plot'); + //Hover over Stacked Plot Title + await page.getByTitle('Test Stacked Plot').hover(); + await expect(page.getByRole('tooltip')).toHaveText('My Items / Test Stacked Plot'); - await page.getByText('SWG 3').nth(2).hover(); - tooltipText = await page.locator('.c-tooltip').textContent(); - tooltipText = tooltipText.replace('\n', '').trim(); - expect(sineWaveObject3.path).toBe(tooltipText); + //Hover over SWG3 Object + await page.getByLabel('Alpha-numeric telemetry name for SWG').hover(); + await expect(page.getByRole('tooltip')).toHaveText(sineWaveObject3.path); }); test('display correct paths when hovering over flexible object labels', async ({ page }) => { + //Create Flexible Layout await createDomainObjectWithDefaults(page, { type: 'Flexible Layout', name: 'Test Flexible Layout' }); - await page.dragAndDrop(`text=${sineWaveObject1.name}`, '.c-fl__container >> nth=0'); - await page.dragAndDrop(`text=${sineWaveObject3.name}`, '.c-fl__container >> nth=1'); + //Add SWG1 and SWG3 to Flexible Layout + await page.getByLabel('Navigate to SWG 1 generator').dragTo(page.getByRole('row').nth(0)); + await page + .getByLabel('Preview SWG 3 generator Object') + .dragTo(page.getByLabel('Container Handle 2')); - await page.locator('button[title="Save"]').click(); + await page.getByRole('button', { name: 'Save' }).click(); await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); + //Hover over SWG1 Object await page.keyboard.down('Control'); - await page.getByText('SWG 1').nth(2).hover(); - let tooltipText = await page.locator('.c-tooltip').textContent(); - tooltipText = tooltipText.replace('\n', '').trim(); - expect(tooltipText).toBe(sineWaveObject1.path); + await page.getByTitle('SWG 1').hover(); + await expect(page.getByRole('tooltip')).toHaveText(sineWaveObject1.path); - await page.getByText('SWG 3').nth(2).hover(); - tooltipText = await page.locator('.c-tooltip').textContent(); - tooltipText = tooltipText.replace('\n', '').trim(); - expect(tooltipText).toBe(sineWaveObject3.path); + //Hover over SWG3 Object + await page.getByTitle('SWG 3').hover(); + await expect(page.getByRole('tooltip')).toHaveText(sineWaveObject3.path); }); test('display correct paths when hovering over tab view labels', async ({ page }) => { @@ -289,46 +311,40 @@ test.describe('Verify tooltips', () => { name: 'Test Tabs View' }); - await page.dragAndDrop(`text=${sineWaveObject1.name}`, '.c-tabs-view__tabs-holder'); - await page.dragAndDrop(`text=${sineWaveObject3.name}`, '.c-tabs-view__tabs-holder'); + //Add SWG1 and SWG3 to Flexible Layout + await page + .getByLabel('Navigate to SWG 1 generator') + .dragTo(page.getByText('Drag objects here to add them')); + await page.getByLabel('Preview SWG 3 generator Object').dragTo(page.getByLabel('SWG 1 tab')); - await page.locator('button[title="Save"]').click(); + await page.getByRole('button', { name: 'Save' }).click(); await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); await page.keyboard.down('Control'); - await page.getByText('SWG 1').nth(2).hover(); - let tooltipText = await page.locator('.c-tooltip').textContent(); - tooltipText = tooltipText.replace('\n', '').trim(); - expect(tooltipText).toBe(sineWaveObject1.path); + await page.getByLabel('SWG 1 tab').getByText('SWG').hover(); - await page.getByText('SWG 3').nth(2).hover(); - tooltipText = await page.locator('.c-tooltip').textContent(); - tooltipText = tooltipText.replace('\n', '').trim(); - expect(tooltipText).toBe(sineWaveObject3.path); + await expect(page.getByRole('tooltip')).toHaveText(sineWaveObject1.path); + + await page.getByLabel('SWG 3 tab').getByText('SWG').hover(); + await expect(page.getByRole('tooltip')).toHaveText(sineWaveObject3.path); }); test('display correct paths when hovering tree items', async ({ page }) => { await page.keyboard.down('Control'); - await page.getByText('SWG 1').nth(0).hover(); - let tooltipText = await page.locator('.c-tooltip').textContent(); - tooltipText = tooltipText.replace('\n', '').trim(); - expect(tooltipText).toBe(sineWaveObject1.path); + await page.getByText('SWG 1').first().hover(); + await expect(page.getByRole('tooltip')).toHaveText(sineWaveObject1.path); - await page.getByText('SWG 3').nth(0).hover(); - tooltipText = await page.locator('.c-tooltip').textContent(); - tooltipText = tooltipText.replace('\n', '').trim(); - expect(tooltipText).toBe(sineWaveObject3.path); + await page.getByText('SWG 3').first().hover(); + await expect(page.getByRole('tooltip')).toHaveText(sineWaveObject3.path); }); test('display correct paths when hovering search items', async ({ page }) => { await page.getByRole('searchbox', { name: 'Search Input' }).click(); - await page.fill('.c-search__input', 'SWG 3'); + await page.getByRole('searchbox', { name: 'Search Input' }).fill('SWG 3'); await page.keyboard.down('Control'); - await page.locator('.c-gsearch-result__title').hover(); - let tooltipText = await page.locator('.c-tooltip').textContent(); - tooltipText = tooltipText.replace('\n', '').trim(); - expect(tooltipText).toBe(sineWaveObject3.path); + await page.getByLabel('Object Results').getByText('SWG').hover(); + await expect(page.getByRole('tooltip')).toHaveText(sineWaveObject3.path); }); test('display path for source telemetry when hovering over gauge', async ({ page }) => { @@ -336,13 +352,14 @@ test.describe('Verify tooltips', () => { type: 'Gauge', name: 'Test Gauge' }); - await page.dragAndDrop(`text=${sineWaveObject3.name}`, '.c-gauge__wrapper'); + + await page.getByLabel('Navigate to SWG 3 generator').dragTo(page.getByRole('meter')); await page.keyboard.down('Control'); + // FIXME: We shouldn't need a `force: true` here, but the parent + // element blocks // eslint-disable-next-line playwright/no-force-option - await page.locator('.c-gauge.c-dial').hover({ position: { x: 0, y: 0 }, force: true }); - let tooltipText = await page.locator('.c-tooltip').textContent(); - tooltipText = tooltipText.replace('\n', '').trim(); - expect(tooltipText).toBe(sineWaveObject3.path); + await page.getByRole('meter').hover({ position: { x: 0, y: 0 }, force: true }); + await expect(page.getByRole('tooltip')).toHaveText(sineWaveObject3.path); }); test('display tooltip path for notebook embeds', async ({ page }) => { @@ -351,78 +368,72 @@ test.describe('Verify tooltips', () => { name: 'Test Notebook' }); - await page.dragAndDrop(`text=${sineWaveObject3.name}`, '.c-notebook__drag-area'); + await page + .getByLabel('Navigate to SWG 3 generator') + .dragTo(page.getByLabel('To start a new entry, click')); await page.keyboard.down('Control'); - await page.locator('.c-ne__embed').hover(); - let tooltipText = await page.locator('.c-tooltip').textContent(); - tooltipText = tooltipText.replace('\n', '').trim(); - expect(tooltipText).toBe(sineWaveObject3.path); + await page.getByLabel('SWG 3 Notebook Embed').hover(); + await expect(page.getByRole('tooltip')).toHaveText(sineWaveObject3.path); }); - test.fixme('display tooltip path for telemetry table names', async ({ page }) => { - test.info().annotations.push({ - type: 'issue', - description: 'https://github.com/nasa/openmct/issues/7421' - }); - // set endBound to 10 seconds after start bound - const url = await page.url(); - const parsedUrl = new URL(url.replace('#', '!')); - const startBound = Number(parsedUrl.searchParams.get('tc.startBound')); - const tenSecondsInMilliseconds = 10 * 1000; - const endBound = startBound + tenSecondsInMilliseconds; - parsedUrl.searchParams.set('tc.endBound', endBound); - await page.goto(parsedUrl.href.replace('!', '#')); - + test('display tooltip path for telemetry table names @clock', async ({ page }) => { + await page.clock.install({ time: MISSION_TIME }); + await page.clock.resume(); await createDomainObjectWithDefaults(page, { type: 'Telemetry Table', name: 'Test Telemetry Table' }); - await page.dragAndDrop(`text=${sineWaveObject1.name}`, '.c-telemetry-table'); - await page.dragAndDrop(`text=${sineWaveObject3.name}`, '.c-telemetry-table'); + await page + .getByLabel(`Navigate to ${sineWaveObject1.name}`) + .dragTo(page.getByLabel('Object View')); + await page.getByLabel(`Preview ${sineWaveObject3.name}`).dragTo(page.getByLabel('Object View')); - await page.locator('button[title="Save"]').click(); + await page.getByRole('button', { name: 'Save' }).click(); await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); + + // Confirm that telemetry rows exist for SWG 1 and 3 and are in view + await expect(page.getByLabel('name table cell SWG 1').first()).toBeInViewport(); + await expect(page.getByLabel('name table cell SWG 3').first()).toBeInViewport(); + + // Pause to prevent more telemetry from streaming in + await page.clock.pauseAt(MISSION_TIME + 30 * 1000); + // Run for 30 seconds to allow SOME telemetry to stream in + await page.clock.runFor(30 * 1000); + await page.keyboard.down('Control'); + // Hover over SWG3 in Telemetry Table + await page.getByLabel('name table cell SWG 3').first().hover(); + await expect(page.getByRole('tooltip', { name: sineWaveObject3.path })).toBeVisible(); - await page.locator('.noselect > [title="SWG 3"]').first().hover(); - let tooltipText = await page.locator('.c-tooltip').textContent(); - tooltipText = tooltipText.replace('\n', '').trim(); - expect(tooltipText).toBe(sineWaveObject3.path); + // Release Control Key + await page.keyboard.up('Control'); + // Hover somewhere else so the tooltip goes away + await page.getByLabel('Navigate to Test Telemetry Table').hover(); + await expect(page.getByRole('tooltip')).toBeHidden(); - await page.locator('.noselect > [title="SWG 1"]').first().hover(); - tooltipText = await page.locator('.c-tooltip').textContent(); - tooltipText = tooltipText.replace('\n', '').trim(); - expect(tooltipText).toBe(sineWaveObject1.path); + await page.keyboard.down('Control'); + // Hover over SWG1 in Telemetry Table + await page.getByLabel('name table cell SWG 1').first().hover(); + await expect(page.getByRole('tooltip', { name: sineWaveObject1.path })).toBeVisible(); }); test('display tooltip path for recently viewed items', async ({ page }) => { // drag up Recently Viewed pane - await page - .locator('.l-pane.l-pane--vertical-handle-before', { - hasText: 'Recently Viewed' - }) - .locator('.l-pane__handle') - .hover(); + await page.getByLabel('Resize Recently Viewed Pane').hover(); await page.mouse.down(); await page.mouse.move(0, 300); await page.mouse.up(); await page.keyboard.down('Control'); await page.getByLabel('Recent Objects').getByText(sineWaveObject3.name).hover(); - let tooltipText = await page.locator('.c-tooltip').textContent(); - tooltipText = tooltipText.replace('\n', '').trim(); - expect(tooltipText).toBe(sineWaveObject3.path); + await expect(page.getByRole('tooltip')).toHaveText(sineWaveObject3.path); await page.getByLabel('Recent Objects').getByText(sineWaveObject2.name).hover(); - tooltipText = await page.locator('.c-tooltip').textContent(); - tooltipText = tooltipText.replace('\n', '').trim(); - expect(tooltipText).toBe(sineWaveObject2.path); + await expect(page.getByRole('tooltip')).toHaveText(sineWaveObject2.path); await page.getByLabel('Recent Objects').getByText(sineWaveObject1.name).hover(); - tooltipText = await page.locator('.c-tooltip').textContent(); - tooltipText = tooltipText.replace('\n', '').trim(); - expect(tooltipText).toBe(sineWaveObject1.path); + await expect(page.getByRole('tooltip')).toHaveText(sineWaveObject1.path); }); test('display tooltip path for time strips', async ({ page }) => { @@ -433,35 +444,27 @@ test.describe('Verify tooltips', () => { }); // Edit Overlay Plot await page.getByLabel('Edit Object').click(); - await page.dragAndDrop( - `text=${sineWaveObject1.name}`, - '.c-object-view.is-object-type-time-strip' - ); - await page.dragAndDrop( - `text=${sineWaveObject2.name}`, - '.c-object-view.is-object-type-time-strip' - ); - await page.dragAndDrop( - `text=${sineWaveObject3.name}`, - '.c-object-view.is-object-type-time-strip' - ); - await page.locator('button[title="Save"]').click(); + await page + .getByLabel(`Preview ${sineWaveObject1.name}`) + .dragTo(page.getByLabel('Test Time Strip Object View')); + await page + .getByLabel(`Preview ${sineWaveObject2.name}`) + .dragTo(page.getByLabel('Test Time Strip Object View')); + await page + .getByLabel(`Preview ${sineWaveObject3.name}`) + .dragTo(page.getByLabel('Test Time Strip Object View')); + + await page.getByRole('button', { name: 'Save' }).click(); await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); await page.keyboard.down('Control'); await page.getByText(sineWaveObject1.name).nth(2).hover(); - let tooltipText = await page.locator('.c-tooltip').textContent(); - tooltipText = tooltipText.replace('\n', '').trim(); - expect(tooltipText).toBe(sineWaveObject1.path); + await expect(page.getByRole('tooltip')).toHaveText(sineWaveObject1.path); await page.getByText(sineWaveObject2.name).nth(2).hover(); - tooltipText = await page.locator('.c-tooltip').textContent(); - tooltipText = tooltipText.replace('\n', '').trim(); - expect(tooltipText).toBe(sineWaveObject2.path); + await expect(page.getByRole('tooltip')).toHaveText(sineWaveObject2.path); await page.getByText(sineWaveObject3.name).nth(2).hover(); - tooltipText = await page.locator('.c-tooltip').textContent(); - tooltipText = tooltipText.replace('\n', '').trim(); - expect(tooltipText).toBe(sineWaveObject3.path); + await expect(page.getByRole('tooltip')).toHaveText(sineWaveObject3.path); }); }); diff --git a/e2e/tests/functional/tree.e2e.spec.js b/e2e/tests/functional/tree.e2e.spec.js index 0db239205f..d434d3c8c2 100644 --- a/e2e/tests/functional/tree.e2e.spec.js +++ b/e2e/tests/functional/tree.e2e.spec.js @@ -20,7 +20,7 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -import { createDomainObjectWithDefaults, renameObjectFromContextMenu } from '../../appActions.js'; +import { createDomainObjectWithDefaults } from '../../appActions.js'; import { expect, test } from '../../pluginFixtures.js'; test.describe('Main Tree', () => { @@ -28,7 +28,7 @@ test.describe('Main Tree', () => { await page.goto('./', { waitUntil: 'domcontentloaded' }); }); - test('Creating a child object within a folder and immediately opening it shows the created object in the tree @couchdb', async ({ + test('Creating a child object within a folder and immediately opening it shows the created object in the tree @couchdb @network', async ({ page }) => { test.info().annotations.push({ @@ -47,123 +47,139 @@ test.describe('Main Tree', () => { parent: folder.uuid }); - await expandTreePaneItemByName(page, folder.name); - await assertTreeItemIsVisible(page, clock.name); + await page.getByLabel(`Expand ${folder.name} folder`).click(); + + await expect( + page.getByRole('tree', { name: 'Main Tree' }).getByRole('treeitem', { name: clock.name }) + ).toBeVisible(); }); test('Creating a child object on one tab and expanding its parent on the other shows the correct composition @2p', async ({ - page, - openmctConfig + page }) => { test.info().annotations.push({ type: 'issue', description: 'https://github.com/nasa/openmct/issues/6391' }); - const { myItemsFolderName } = openmctConfig; const page2 = await page.context().newPage(); // Both pages: Go to baseURL await Promise.all([ - page.goto('./', { waitUntil: 'networkidle' }), - page2.goto('./', { waitUntil: 'networkidle' }) + page.goto('./', { waitUntil: 'domcontentloaded' }), + page2.goto('./', { waitUntil: 'domcontentloaded' }) + ]); + + await Promise.all([ + page.waitForURL('**/browse/mine?**'), + page2.waitForURL('**/browse/mine?**') ]); const page1Folder = await createDomainObjectWithDefaults(page, { type: 'Folder' }); - await expandTreePaneItemByName(page2, myItemsFolderName); - await assertTreeItemIsVisible(page2, page1Folder.name); + await page2.getByLabel('Expand My Items folder').click(); + + await expect( + page2 + .getByRole('tree', { name: 'Main Tree' }) + .getByRole('treeitem', { name: page1Folder.name }) + ).toBeVisible(); }); - test('Creating a child object on one tab and expanding its parent on the other shows the correct composition @couchdb @2p', async ({ - page, - openmctConfig + test('Creating a child object on one tab and expanding its parent on the other shows the correct composition @couchdb @network @2p', async ({ + page }) => { test.info().annotations.push({ type: 'issue', description: 'https://github.com/nasa/openmct/issues/6391' }); - const { myItemsFolderName } = openmctConfig; const page2 = await page.context().newPage(); // Both pages: Go to baseURL await Promise.all([ - page.goto('./', { waitUntil: 'networkidle' }), - page2.goto('./', { waitUntil: 'networkidle' }) + page.goto('./', { waitUntil: 'domcontentloaded' }), + page2.goto('./', { waitUntil: 'domcontentloaded' }) + ]); + + await Promise.all([ + page.waitForURL('**/browse/mine?**'), + page2.waitForURL('**/browse/mine?**') ]); const page1Folder = await createDomainObjectWithDefaults(page, { type: 'Folder' }); - await expandTreePaneItemByName(page2, myItemsFolderName); - await assertTreeItemIsVisible(page2, page1Folder.name); + await page2.getByLabel('Expand My Items folder').click(); + await expect( + page2 + .getByRole('tree', { name: 'Main Tree' }) + .getByRole('treeitem', { name: page1Folder.name }) + ).toBeVisible(); }); - test('Renaming an object reorders the tree @unstable', async ({ page, openmctConfig }) => { - const { myItemsFolderName } = openmctConfig; - - await createDomainObjectWithDefaults(page, { + test('Renaming an object reorders the tree', async ({ page }) => { + const foo = await createDomainObjectWithDefaults(page, { type: 'Folder', name: 'Foo' }); - await createDomainObjectWithDefaults(page, { + const bar = await createDomainObjectWithDefaults(page, { type: 'Folder', name: 'Bar' }); - await createDomainObjectWithDefaults(page, { + const baz = await createDomainObjectWithDefaults(page, { type: 'Folder', name: 'Baz' }); - const clock1 = await createDomainObjectWithDefaults(page, { + let clock1 = await createDomainObjectWithDefaults(page, { type: 'Clock', name: 'aaa' }); - await createDomainObjectWithDefaults(page, { + const www = await createDomainObjectWithDefaults(page, { type: 'Clock', name: 'www' }); // Expand the root folder - await expandTreePaneItemByName(page, myItemsFolderName); + await page.getByLabel('Expand My Items folder').click(); await test.step('Reorders objects with the same tree depth', async () => { - await getAndAssertTreeItems(page, ['aaa', 'Bar', 'Baz', 'Foo', 'www']); - await renameObjectFromContextMenu(page, clock1.url, 'zzz'); - await getAndAssertTreeItems(page, ['Bar', 'Baz', 'Foo', 'www', 'zzz']); + await getAndAssertTreeItems(page, ['My Items', 'aaa', 'Bar', 'Baz', 'Foo', 'www']); + clock1.name = 'zzz'; + await renameObjectFromContextMenu(page, clock1.url, clock1.name); + await getAndAssertTreeItems(page, ['My Items', 'Bar', 'Baz', 'Foo', 'www', 'zzz']); }); await test.step('Reorders links to objects as well as original objects', async () => { - await page.click('role=treeitem[name=/Bar/]'); - await page.dragAndDrop('role=treeitem[name=/www/]', '.c-object-view'); - await page.dragAndDrop('role=treeitem[name=/zzz/]', '.c-object-view'); - await page.click('role=treeitem[name=/Baz/]'); - await page.dragAndDrop('role=treeitem[name=/www/]', '.c-object-view'); - await page.dragAndDrop('role=treeitem[name=/zzz/]', '.c-object-view'); - await page.click('role=treeitem[name=/Foo/]'); - await page.dragAndDrop('role=treeitem[name=/www/]', '.c-object-view'); - await page.dragAndDrop('role=treeitem[name=/zzz/]', '.c-object-view'); + await page.getByLabel(`Navigate to ${bar.name}`).dragTo(page.getByLabel('Object View')); + await page.getByLabel(`Navigate to ${www.name}`).dragTo(page.getByLabel('Object View')); + await page.getByLabel(`Navigate to ${clock1.name}`).dragTo(page.getByLabel('Object View')); + await page.getByLabel(`Navigate to ${baz.name}`).dragTo(page.getByLabel('Object View')); + await page.getByLabel(`Navigate to ${www.name}`).dragTo(page.getByLabel('Object View')); + await page.getByLabel(`Navigate to ${clock1.name}`).dragTo(page.getByLabel('Object View')); + await page.goto(foo.url); + await page.getByLabel(`Navigate to ${www.name}`).dragTo(page.getByLabel('Object View')); + await page.getByLabel(`Navigate to ${clock1.name}`).dragTo(page.getByLabel('Object View')); // Expand the unopened folders - await expandTreePaneItemByName(page, 'Bar'); - await expandTreePaneItemByName(page, 'Baz'); - await expandTreePaneItemByName(page, 'Foo'); + await page.getByLabel(`Expand Bar folder`).click(); + await page.getByLabel(`Expand Baz folder`).click(); + await page.getByLabel(`Expand Foo folder`).click(); - await renameObjectFromContextMenu(page, clock1.url, '___'); + clock1.name = '___'; + await renameObjectFromContextMenu(page, clock1.url, clock1.name); + await expect(page.getByLabel('Navigate to ' + clock1.name)).toHaveCount(2); await getAndAssertTreeItems(page, [ + 'My Items', '___', 'Bar', - '___', - 'www', 'Baz', - '___', - 'www', 'Foo', '___', 'www', @@ -171,11 +187,9 @@ test.describe('Main Tree', () => { ]); }); }); - test('Opening and closing an item before the request has been fulfilled will abort the request @couchdb', async ({ - page, - openmctConfig + test('Opening and closing an item before the request has been fulfilled will abort the request @couchdb @network', async ({ + page }) => { - const { myItemsFolderName } = openmctConfig; let requestWasAborted = false; page.on('requestfailed', (request) => { @@ -201,7 +215,7 @@ test.describe('Main Tree', () => { // Quickly Expand/close the root folder await page .getByRole('button', { - name: `Expand ${myItemsFolderName} folder` + name: `Expand My Items folder` }) .dblclick({ delay: 400 }); @@ -214,35 +228,36 @@ test.describe('Main Tree', () => { * @param {Array} expected */ async function getAndAssertTreeItems(page, expected) { - const treeItems = page.locator('[role="treeitem"]'); - const allTexts = await treeItems.allInnerTexts(); - // Get rid of root folder ('My Items') as its position will not change - allTexts.shift(); - expect(allTexts).toEqual(expected); -} - -async function assertTreeItemIsVisible(page, name) { - const mainTree = page.getByRole('tree', { - name: 'Main Tree' - }); - const treeItem = mainTree.getByRole('treeitem', { - name - }); - - await expect(treeItem).toBeVisible(); + const treeItems = page.getByRole('treeitem'); + await expect(treeItems).toHaveCount(expected.length); + await expect(treeItems).toHaveText(expected, { useInnerText: true }); } /** * @param {import('@playwright/test').Page} page - * @param {string} name + * @param {string} myItemsFolderName + * @param {string} url + * @param {string} newName */ -async function expandTreePaneItemByName(page, name) { - const mainTree = page.getByRole('tree', { - name: 'Main Tree' - }); - const treeItem = mainTree.getByRole('treeitem', { - name, - expanded: false - }); - await treeItem.locator('.c-disclosure-triangle').click(); +async function renameObjectFromContextMenu(page, url, newName) { + await openObjectTreeContextMenu(page, url); + await page.getByLabel('Edit Properties...').click(); + const nameInput = page.getByLabel('Title', { exact: true }); + await nameInput.fill(newName); + await page.getByLabel('Save').click(); +} + +/** + * Open the given `domainObject`'s context menu from the object tree. + * Expands the path to the object and scrolls to it if necessary. + * + * @param {import('@playwright/test').Page} page + * @param {string} url the url to the object + */ +async function openObjectTreeContextMenu(page, url) { + await page.goto(url); + await page.getByLabel('Show selected item in tree').click(); + await page.locator('.is-navigated-object').click({ + button: 'right' + }); } diff --git a/e2e/tests/mobile/smoke.e2e.spec.js b/e2e/tests/mobile/smoke.e2e.spec.js index cd0ad707a4..adb39820c0 100644 --- a/e2e/tests/mobile/smoke.e2e.spec.js +++ b/e2e/tests/mobile/smoke.e2e.spec.js @@ -62,7 +62,7 @@ test.describe('Smoke tests for @mobile', () => { test('Verify that user can change time conductor @mobile', async ({ page }) => { //Collapse Browse Pane to get more Time Conductor space await page.getByLabel('Collapse Browse Pane').click(); - //Open Time Conductor and change to Real Time Mode and set offset hour by 1 hour + // Open Time Conductor and change to Real Time Mode and set offset hour by 1 hour // Disabling line because we're intentionally obscuring the text // eslint-disable-next-line playwright/no-force-option await page.getByLabel('Time Conductor Mode').click({ force: true }); @@ -82,14 +82,14 @@ test.describe('Smoke tests for @mobile', () => { await page.getByTitle('Collapse Browse Pane').click(); await expect(page.getByRole('main').getByText('Parent Display Layout')).toBeVisible(); //Verify both objects are in view - await expect(await page.getByLabel('Child Layout 1 Layout')).toBeVisible(); - await expect(await page.getByLabel('Child Layout 2 Layout')).toBeVisible(); + await expect(page.getByLabel('Child Layout 1 Layout')).toBeVisible(); + await expect(page.getByLabel('Child Layout 2 Layout')).toBeVisible(); //Remove First Object to bring up confirmation dialog await page.getByLabel('View menu items').nth(1).click(); await page.getByLabel('Remove').click(); - await page.getByRole('button', { name: 'OK' }).click(); + await page.getByRole('button', { name: 'Ok' }).click(); //Verify that the object is removed - await expect(await page.getByLabel('Child Layout 1 Layout')).toBeVisible(); - expect(await page.getByLabel('Child Layout 2 Layout').count()).toBe(0); + await expect(page.getByLabel('Child Layout 1 Layout')).toBeVisible(); + await expect(page.getByLabel('Child Layout 2 Layout')).toHaveCount(0); }); }); diff --git a/e2e/tests/performance/contract/imagery.contract.perf.spec.js b/e2e/tests/performance/contract/imagery.contract.perf.spec.js index 7b3b00b6cf..b08afd88d4 100644 --- a/e2e/tests/performance/contract/imagery.contract.perf.spec.js +++ b/e2e/tests/performance/contract/imagery.contract.perf.spec.js @@ -39,7 +39,7 @@ const filePath = 'test-data/PerformanceDisplayLayout.json'; test.describe('Performance tests', () => { test.beforeEach(async ({ page, browser }, testInfo) => { // Go to baseURL - await page.goto('./', { waitUntil: 'networkidle' }); + await page.goto('./', { waitUntil: 'domcontentloaded' }); // Click a:has-text("My Items") await page.locator('a:has-text("My Items")').click({ @@ -129,12 +129,12 @@ test.describe('Performance tests', () => { ]); //Time to Example Imagery Frame loads within Display Layout - await page.waitForSelector('.c-imagery__main-image__bg', { state: 'visible' }); + await page.locator('.c-imagery__main-image__bg').waitFor({ state: 'visible' }); //Time to Example Imagery object loads - await page.waitForSelector('.c-imagery__main-image__background-image', { state: 'visible' }); + await page.locator('.c-imagery__main-image__background-image').waitFor({ state: 'visible' }); //Get background-image url from background-image css prop - const backgroundImage = await page.locator('.c-imagery__main-image__background-image'); + const backgroundImage = page.locator('.c-imagery__main-image__background-image'); let backgroundImageUrl = await backgroundImage.evaluate((el) => { return window .getComputedStyle(el) @@ -156,15 +156,15 @@ test.describe('Performance tests', () => { await page.evaluate(() => window.performance.mark('viewLarge.start.test')); //This is a mark only to compare evaluate timing //Time to Imagery Rendered in Large Frame - await page.waitForSelector('.c-imagery__main-image__bg', { state: 'visible' }); + await page.locator('.c-imagery__main-image__bg').waitFor({ state: 'visible' }); await page.evaluate(() => window.performance.mark('background-image-frame')); //Time to Example Imagery object loads - await page.waitForSelector('.c-imagery__main-image__background-image', { state: 'visible' }); + await page.locator('.c-imagery__main-image__background-image').waitFor({ state: 'visible' }); await page.evaluate(() => window.performance.mark('background-image-visible')); // Get Current number of images in thumbstrip - await page.waitForSelector('.c-imagery__thumb'); + await expect(page.locator('.c-imagery__thumb').last()).toBeInViewport(); const thumbCount = await page.locator('.c-imagery__thumb').count(); console.log('number of thumbs rendered ' + thumbCount); await page.locator('.c-imagery__thumb').last().click(); diff --git a/e2e/tests/performance/contract/notebook.contract.perf.spec.js b/e2e/tests/performance/contract/notebook.contract.perf.spec.js index 5a63d73ed3..27e7a1a703 100644 --- a/e2e/tests/performance/contract/notebook.contract.perf.spec.js +++ b/e2e/tests/performance/contract/notebook.contract.perf.spec.js @@ -38,7 +38,7 @@ const notebookFilePath = 'test-data/PerformanceNotebook.json'; test.describe('Performance tests', () => { test.beforeEach(async ({ page, browser }, testInfo) => { // Go to baseURL - await page.goto('./', { waitUntil: 'networkidle' }); + await page.goto('./', { waitUntil: 'domcontentloaded' }); // Click a:has-text("My Items") await page.locator('a:has-text("My Items")').click({ @@ -110,20 +110,19 @@ test.describe('Performance tests', () => { await page.evaluate(() => window.performance.mark('search-entered')); //Search Result Appears and is clicked await Promise.all([ - page.waitForNavigation(), page.locator('a:has-text("Performance Notebook")').first().click(), page.evaluate(() => window.performance.mark('click-search-result')) ]); - await page.waitForSelector('.c-tree__item c-tree-and-search__loading loading', { - state: 'hidden' - }); + await page + .locator('.c-tree__item c-tree-and-search__loading loading') + .waitFor({ state: 'hidden' }); await page.evaluate(() => window.performance.mark('search-spinner-gone')); - await page.waitForSelector('.l-browse-bar__object-name', { state: 'visible' }); + await page.locator('.l-browse-bar__object-name').waitFor({ state: 'visible' }); await page.evaluate(() => window.performance.mark('object-title-appears')); - await page.waitForSelector('.c-notebook__entry >> nth=0', { state: 'visible' }); + await page.locator('.c-notebook__entry >> nth=0').waitFor({ state: 'visible' }); await page.evaluate(() => window.performance.mark('notebook-entry-appears')); // Click Add new Notebook Entry @@ -139,9 +138,9 @@ test.describe('Performance tests', () => { await page.evaluate(() => window.performance.mark('notebook-search-start')); await page.locator('.c-notebook__search >> input').fill('Existing Entry'); await page.evaluate(() => window.performance.mark('notebook-search-filled')); - await page.waitForSelector('text=Search Results (3)', { state: 'visible' }); + await page.locator('text=Search Results (3)').waitFor({ state: 'visible' }); await page.evaluate(() => window.performance.mark('notebook-search-processed')); - await page.waitForSelector('.c-notebook__entry >> nth=2', { state: 'visible' }); + await page.locator('.c-notebook__entry >> nth=2').waitFor({ state: 'visible' }); await page.evaluate(() => window.performance.mark('notebook-search-processed')); //Clear Search @@ -154,7 +153,7 @@ test.describe('Performance tests', () => { await page.locator('div.c-ne__time-and-content').last().hover(); await page.locator('button[title="Delete this entry"]').last().click(); await page.locator('button:has-text("Ok")').click(); - await page.waitForSelector('.c-notebook__entry >> nth=3', { state: 'detached' }); + await page.locator('.c-notebook__entry >> nth=3').waitFor({ state: 'detached' }); await page.evaluate(() => window.performance.mark('new-notebook-entry-deleted')); //await client.send('HeapProfiler.enable'); diff --git a/e2e/tests/performance/memory/navigation.memory.perf.spec.js b/e2e/tests/performance/memory/navigation.memory.perf.spec.js index cb74b6a11a..022c0bb1c2 100644 --- a/e2e/tests/performance/memory/navigation.memory.perf.spec.js +++ b/e2e/tests/performance/memory/navigation.memory.perf.spec.js @@ -228,9 +228,7 @@ test.describe('Navigation memory leak is not detected in', () => { expect(result).toBe(true); }); - test('display layout with plots of swgs, alphanumerics, and condition sets, ', async ({ - page - }) => { + test('display layout with plots of swgs, alphanumerics, and condition sets', async ({ page }) => { const result = await navigateToObjectAndDetectMemoryLeak( page, 'display-layout-simple-telemetry' diff --git a/e2e/tests/performance/tabs.perf.spec.js b/e2e/tests/performance/tabs.perf.spec.js index 3db219f1da..6141bf61ee 100644 --- a/e2e/tests/performance/tabs.perf.spec.js +++ b/e2e/tests/performance/tabs.perf.spec.js @@ -78,7 +78,7 @@ test.describe('Tabs View', () => { await page.getByLabel(`${sineWaveGenerator.name} tab`, { exact: true }).click(); // ensure sine wave generator visible - expect(await page.locator('.c-plot').isVisible()).toBe(true); + await expect(page.locator('.c-plot')).toBeVisible(); // now select notebook and clear animation calls await page.getByLabel(`${notebook.name} tab`, { exact: true }).click(); diff --git a/e2e/tests/performance/tagging.perf.spec.js b/e2e/tests/performance/tagging.perf.spec.js index 495026f7a8..4fa19db2f9 100644 --- a/e2e/tests/performance/tagging.perf.spec.js +++ b/e2e/tests/performance/tagging.perf.spec.js @@ -84,7 +84,7 @@ test.describe('Plot Tagging Performance', () => { await setRealTimeMode(page); // Search for Science - await page.getByRole('searchbox', { name: 'Search Input' }); + await page.getByRole('searchbox', { name: 'Search Input' }).click(); await page.getByRole('searchbox', { name: 'Search Input' }).fill('sc'); // click on the search result diff --git a/e2e/tests/visual-a11y/a11y.visual.spec.js b/e2e/tests/visual-a11y/a11y.visual.spec.js index d981b3a8a8..bbe7264201 100644 --- a/e2e/tests/visual-a11y/a11y.visual.spec.js +++ b/e2e/tests/visual-a11y/a11y.visual.spec.js @@ -20,15 +20,14 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -import { test } from '../../avpFixtures.js'; +import { scanForA11yViolations, test } from '../../avpFixtures.js'; import { VISUAL_FIXED_URL } from '../../constants.js'; -test.describe('a11y - Default', () => { +test.describe('a11y - Default @a11y', () => { test.beforeEach(async ({ page }) => { await page.goto(VISUAL_FIXED_URL, { waitUntil: 'domcontentloaded' }); }); test('main view', async ({ page }, testInfo) => { - //Skipping for https://github.com/nasa/openmct/issues/7421 - //await scanForA11yViolations(page, testInfo.title); + await scanForA11yViolations(page, testInfo.title); }); }); diff --git a/e2e/tests/visual-a11y/components/header.visual.spec.js b/e2e/tests/visual-a11y/components/header.visual.spec.js index 0c3d44c8a8..f1dd4e0adc 100644 --- a/e2e/tests/visual-a11y/components/header.visual.spec.js +++ b/e2e/tests/visual-a11y/components/header.visual.spec.js @@ -27,7 +27,7 @@ Tests the branding associated with the default deployment. At least the about mo import percySnapshot from '@percy/playwright'; import { fileURLToPath } from 'url'; -import { expect, test } from '../../../avpFixtures.js'; +import { expect, scanForA11yViolations, test } from '../../../avpFixtures.js'; import { VISUAL_FIXED_URL } from '../../../constants.js'; //Declare the component scope of the visual test for Percy @@ -69,10 +69,23 @@ test.describe('Visual - Header @a11y', () => { }); test('show snapshot button', async ({ page, theme }) => { + test.slow(true, 'We have to wait for the snapshot indicator to stop flashing'); await page.getByLabel('Open the Notebook Snapshot Menu').click(); await page.getByRole('menuitem', { name: 'Save to Notebook Snapshots' }).click(); + await expect(page.getByLabel('Show Snapshots')).toBeVisible(); + + /** + * We have to wait for the snapshot indicator to stop flashing. This happens + * for a really long time (15 seconds 😳). + * TODO: Either reduce the length of the animation, convert this to a + * Playwright snapshot test (and disable animations), or augment the `waitForAnimations` + * fixture to adjust the timeout. + */ + await expect(page.locator('.has-new-snapshot')).not.toBeAttached({ + timeout: 30 * 1000 + }); await percySnapshot(page, `Notebook Snapshot Show button (theme: '${theme}')`, { scope: header }); @@ -99,7 +112,6 @@ test.describe('Mission Header @a11y', () => { }); }); }); -// Skipping for https://github.com/nasa/openmct/issues/7421 -// test.afterEach(async ({ page }, testInfo) => { -// await scanForA11yViolations(page, testInfo.title); -// }); +test.afterEach(async ({ page }, testInfo) => { + await scanForA11yViolations(page, testInfo.title); +}); diff --git a/e2e/tests/visual-a11y/components/inspector.visual.spec.js b/e2e/tests/visual-a11y/components/inspector.visual.spec.js index 90e641fed4..5f1dd2be00 100644 --- a/e2e/tests/visual-a11y/components/inspector.visual.spec.js +++ b/e2e/tests/visual-a11y/components/inspector.visual.spec.js @@ -22,22 +22,21 @@ import percySnapshot from '@percy/playwright'; -import { test } from '../../../avpFixtures.js'; +import { scanForA11yViolations, test } from '../../../avpFixtures.js'; import { MISSION_TIME, VISUAL_FIXED_URL } from '../../../constants.js'; //Declare the scope of the visual test const inspectorPane = '.l-shell__pane-inspector'; test.describe('Visual - Inspector @ally @clock', () => { - test.beforeEach(async ({ page }) => { - await page.goto(VISUAL_FIXED_URL, { waitUntil: 'domcontentloaded' }); - }); test.use({ - storageState: 'test-data/overlay_plot_with_delay_storage.json', - clockOptions: { - now: MISSION_TIME, - shouldAdvanceTime: true - } + storageState: 'test-data/overlay_plot_with_delay_storage.json' + }); + + test.beforeEach(async ({ page }) => { + await page.clock.install({ time: MISSION_TIME }); + await page.clock.resume(); + await page.goto(VISUAL_FIXED_URL, { waitUntil: 'domcontentloaded' }); }); test('Inspector from overlay_plot_with_delay_storage @localStorage', async ({ page, theme }) => { @@ -55,7 +54,6 @@ test.describe('Visual - Inspector @ally @clock', () => { }); }); }); -// Skipping for https://github.com/nasa/openmct/issues/7421 -// test.afterEach(async ({ page }, testInfo) => { -// await scanForA11yViolations(page, testInfo.title); -// }); +test.afterEach(async ({ page }, testInfo) => { + await scanForA11yViolations(page, testInfo.title); +}); diff --git a/e2e/tests/visual-a11y/components/timeConductor.visual.spec.js b/e2e/tests/visual-a11y/components/timeConductor.visual.spec.js index eef1114e40..e880bd6642 100644 --- a/e2e/tests/visual-a11y/components/timeConductor.visual.spec.js +++ b/e2e/tests/visual-a11y/components/timeConductor.visual.spec.js @@ -33,13 +33,9 @@ import { } from '../../../constants.js'; test.describe('Visual - Time Conductor', () => { - test.use({ - clockOptions: { - now: MISSION_TIME, - shouldAdvanceTime: false - } - }); test.beforeEach(async ({ page }) => { + await page.clock.install({ time: MISSION_TIME }); + await page.clock.pauseAt(MISSION_TIME); await page.goto('./', { waitUntil: 'domcontentloaded' }); }); @@ -48,7 +44,13 @@ test.describe('Visual - Time Conductor', () => { // await scanForA11yViolations(page, testInfo.title); // }); - test('Visual - Time Conductor (Fixed time) @clock @snapshot', async ({ page }) => { + /** + * FIXME: This test fails sporadically due to layout shift during initial load. + * The layout shift seems to be caused by loading Open MCT's icons, which are not preloaded + * and load after the initial DOM content has loaded. + * @see https://github.com/nasa/openmct/issues/7775 + */ + test.fixme('Visual - Time Conductor (Fixed time) @clock @snapshot', async ({ page }) => { // Navigate to a specific view that uses the Time Conductor in Fixed Time mode with inspect and browse panes collapsed await page.goto( `./#/browse/mine?tc.mode=fixed&tc.startBound=${MISSION_TIME_FIXED_START}&tc.endBound=${MISSION_TIME_FIXED_END}&tc.timeSystem=utc&view=grid&hideInspector=true&hideTree=true`, @@ -81,7 +83,7 @@ test.describe('Visual - Time Conductor', () => { test( 'Visual - Time Conductor Axis Resized @clock @snapshot', { annotation: [{ type: 'issue', description: 'https://github.com/nasa/openmct/issues/7623' }] }, - async ({ page, tick }) => { + async ({ page }) => { const VISUAL_REALTIME_WITH_PANES = VISUAL_REALTIME_URL.replace( 'hideTree=true', 'hideTree=false' @@ -102,7 +104,7 @@ test.describe('Visual - Time Conductor', () => { await page.getByLabel('Collapse Browse Pane').click(); // manually tick the clock to trigger the resize / re-render - await tick(1000 * 2); + await page.clock.runFor(1000 * 2); const mask = []; diff --git a/e2e/tests/visual-a11y/components/timeConductor.visual.spec.js-snapshots/time-conductor-axis-resized-chrome-linux.png b/e2e/tests/visual-a11y/components/timeConductor.visual.spec.js-snapshots/time-conductor-axis-resized-chrome-linux.png index b86cc7eade..fd70070289 100644 Binary files a/e2e/tests/visual-a11y/components/timeConductor.visual.spec.js-snapshots/time-conductor-axis-resized-chrome-linux.png and b/e2e/tests/visual-a11y/components/timeConductor.visual.spec.js-snapshots/time-conductor-axis-resized-chrome-linux.png differ diff --git a/e2e/tests/visual-a11y/components/timeConductor.visual.spec.js-snapshots/time-conductor-fixed-time-chrome-linux.png b/e2e/tests/visual-a11y/components/timeConductor.visual.spec.js-snapshots/time-conductor-fixed-time-chrome-linux.png index 7dd0a84073..05fc627cb2 100644 Binary files a/e2e/tests/visual-a11y/components/timeConductor.visual.spec.js-snapshots/time-conductor-fixed-time-chrome-linux.png and b/e2e/tests/visual-a11y/components/timeConductor.visual.spec.js-snapshots/time-conductor-fixed-time-chrome-linux.png differ diff --git a/e2e/tests/visual-a11y/components/timeConductor.visual.spec.js-snapshots/time-conductor-realtime-chrome-linux.png b/e2e/tests/visual-a11y/components/timeConductor.visual.spec.js-snapshots/time-conductor-realtime-chrome-linux.png index b7b480324d..c89fc2df45 100644 Binary files a/e2e/tests/visual-a11y/components/timeConductor.visual.spec.js-snapshots/time-conductor-realtime-chrome-linux.png and b/e2e/tests/visual-a11y/components/timeConductor.visual.spec.js-snapshots/time-conductor-realtime-chrome-linux.png differ diff --git a/e2e/tests/visual-a11y/components/tree.visual.spec.js b/e2e/tests/visual-a11y/components/tree.visual.spec.js index 5eb2bba1ca..649b005bc4 100644 --- a/e2e/tests/visual-a11y/components/tree.visual.spec.js +++ b/e2e/tests/visual-a11y/components/tree.visual.spec.js @@ -22,16 +22,15 @@ import percySnapshot from '@percy/playwright'; -import { createDomainObjectWithDefaults, expandTreePaneItemByName } from '../../../appActions.js'; +import { createDomainObjectWithDefaults } from '../../../appActions.js'; +import { test } from '../../../avpFixtures.js'; import { VISUAL_FIXED_URL } from '../../../constants.js'; -import { test } from '../../../pluginFixtures.js'; //Declare the scope of the visual test const treePane = "[role=tree][aria-label='Main Tree']"; test.describe('Visual - Tree Pane', () => { - test('Tree pane in various states', async ({ page, theme, openmctConfig }) => { - const { myItemsFolderName } = openmctConfig; + test('Tree pane in various states', async ({ page, theme }) => { await page.goto(VISUAL_FIXED_URL, { waitUntil: 'domcontentloaded' }); //Open Tree @@ -69,28 +68,28 @@ test.describe('Visual - Tree Pane', () => { scope: treePane }); - await expandTreePaneItemByName(page, myItemsFolderName); + await page.getByLabel('Expand My Items folder').click(); await page.goto(foo.url); - await page.dragAndDrop('role=treeitem[name=/A Clock/]', '.c-object-view'); - await page.dragAndDrop('role=treeitem[name=/Z Clock/]', '.c-object-view'); + await page.getByLabel('Navigate to A Clock').dragTo(page.getByLabel('Object View')); + await page.getByLabel('Navigate to Z Clock').dragTo(page.getByLabel('Object View')); await page.goto(bar.url); - await page.dragAndDrop('role=treeitem[name=/A Clock/]', '.c-object-view'); - await page.dragAndDrop('role=treeitem[name=/Z Clock/]', '.c-object-view'); + await page.getByLabel('Navigate to A Clock').dragTo(page.getByLabel('Object View')); + await page.getByLabel('Navigate to Z Clock').dragTo(page.getByLabel('Object View')); await page.goto(baz.url); - await page.dragAndDrop('role=treeitem[name=/A Clock/]', '.c-object-view'); - await page.dragAndDrop('role=treeitem[name=/Z Clock/]', '.c-object-view'); + await page.getByLabel('Navigate to A Clock').dragTo(page.getByLabel('Object View')); + await page.getByLabel('Navigate to Z Clock').dragTo(page.getByLabel('Object View')); await percySnapshot(page, `Tree Pane w/ single level expanded (theme: ${theme})`, { scope: treePane }); - await expandTreePaneItemByName(page, foo.name); - await expandTreePaneItemByName(page, bar.name); - await expandTreePaneItemByName(page, baz.name); + await page.getByLabel(`Expand ${foo.name} folder`).click(); + await page.getByLabel(`Expand ${bar.name} folder`).click(); + await page.getByLabel(`Expand ${baz.name} folder`).click(); // eslint-disable-next-line playwright/no-wait-for-timeout - await page.waitForTimeout(1 * 1000); //https://github.com/nasa/openmct/issues/7059 + await page.waitForTimeout(3 * 1000); //https://github.com/nasa/openmct/issues/7059 await percySnapshot(page, `Tree Pane w/ multiple levels expanded (theme: ${theme})`, { scope: treePane diff --git a/e2e/tests/visual-a11y/controlledClock.visual.spec.js b/e2e/tests/visual-a11y/controlledClock.visual.spec.js index 8778713107..c175a776ab 100644 --- a/e2e/tests/visual-a11y/controlledClock.visual.spec.js +++ b/e2e/tests/visual-a11y/controlledClock.visual.spec.js @@ -32,18 +32,14 @@ import { expect, test } from '../../pluginFixtures.js'; test.describe('Visual - Controlled Clock @clock', () => { test.beforeEach(async ({ page }) => { + await page.clock.install({ time: MISSION_TIME }); await page.goto(VISUAL_FIXED_URL, { waitUntil: 'domcontentloaded' }); }); test.use({ - storageState: 'test-data/overlay_plot_with_delay_storage.json', - clockOptions: { - now: MISSION_TIME, - shouldAdvanceTime: false //Don't advance the clock - } + storageState: 'test-data/overlay_plot_with_delay_storage.json' }); test('Overlay Plot Loading Indicator @localStorage', async ({ page, theme }) => { - await page.goto(VISUAL_FIXED_URL, { waitUntil: 'domcontentloaded' }); await page .getByRole('gridcell', { hasText: 'Overlay Plot with 5s Delay Overlay Plot' }) .click(); diff --git a/e2e/tests/visual-a11y/displayLayout.visual.spec.js b/e2e/tests/visual-a11y/displayLayout.visual.spec.js index f9cf123d4b..401c5b243c 100644 --- a/e2e/tests/visual-a11y/displayLayout.visual.spec.js +++ b/e2e/tests/visual-a11y/displayLayout.visual.spec.js @@ -27,13 +27,9 @@ import { MISSION_TIME, VISUAL_FIXED_URL } from '../../constants.js'; import { test } from '../../pluginFixtures.js'; test.describe('Visual - Display Layout @clock', () => { - test.use({ - clockOptions: { - now: MISSION_TIME, - shouldAdvanceTime: true - } - }); test.beforeEach(async ({ page }) => { + await page.clock.install({ time: MISSION_TIME }); + await page.clock.resume(); await page.goto(VISUAL_FIXED_URL, { waitUntil: 'domcontentloaded' }); const parentLayout = await createDomainObjectWithDefaults(page, { @@ -110,6 +106,7 @@ test.describe('Visual - Display Layout @clock', () => { }); await page.getByLabel('Expand Inspect Pane').click(); await page.getByLabel('Resize Inspect Pane').dragTo(page.getByLabel('X:')); + await page.getByRole('tab', { name: 'Elements' }).click(); await percySnapshot(page, `Toolbar does not overflow into inspector (theme: '${theme}')`); }); }); diff --git a/e2e/tests/visual-a11y/imagery.visual.spec.js b/e2e/tests/visual-a11y/imagery.visual.spec.js index d46df5435b..b063dee0f7 100644 --- a/e2e/tests/visual-a11y/imagery.visual.spec.js +++ b/e2e/tests/visual-a11y/imagery.visual.spec.js @@ -19,7 +19,6 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ - import percySnapshot from '@percy/playwright'; import { createDomainObjectWithDefaults, setRealTimeMode } from '../../appActions.js'; @@ -45,17 +44,19 @@ test.describe('Visual - Example Imagery', () => { parent: parentLayout.uuid }); - // Modify Example Imagery to create a really stable Example Imagery + // Modify Example Imagery to create a really stable image which will never let us down await page.goto(exampleImagery.url, { waitUntil: 'domcontentloaded' }); await page.getByRole('button', { name: 'More actions' }).click(); await page.getByRole('menuitem', { name: 'Edit Properties...' }).click(); await page .locator('#imageLocation-textarea') .fill( - 'https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18731.jpg,https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18731.jpg,https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18731.jpg,https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18731.jpg,https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18731.jpg,https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18731.jpg,https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18731.jpg,https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18731.jpg,https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18731.jpg,https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18731.jpg,https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18731.jpg,https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18731.jpg,https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18731.jpg,https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18731.jpg,https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18731.jpg,https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18731.jpg,https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18731.jpg' + 'https://raw.githubusercontent.com/nasa/openmct/554f77c42fec81cf0f63e62b278012cb08d82af9/e2e/test-data/rick.jpg,https://raw.githubusercontent.com/nasa/openmct/554f77c42fec81cf0f63e62b278012cb08d82af9/e2e/test-data/rick.jpg' ); await page.getByRole('button', { name: 'Save' }).click(); await page.reload({ waitUntil: 'domcontentloaded' }); + + //Hide the Browse and Inspect panes to make the image more stable await page.getByTitle('Collapse Browse Pane').click(); await page.getByTitle('Collapse Inspect Pane').click(); }); @@ -63,6 +64,10 @@ test.describe('Visual - Example Imagery', () => { test('Example Imagery in Fixed Time', async ({ page, theme }) => { await page.goto(exampleImagery.url, { waitUntil: 'domcontentloaded' }); + // Wait for the thumbnails to finish their scroll animation + // (Wait until the rightmost thumbnail is in view) + await expect(page.getByLabel('Image Thumbnail from').last()).toBeInViewport(); + await expect(page.getByLabel('Image Wrapper')).toBeVisible(); await percySnapshot(page, `Example Imagery in Fixed Time (theme: ${theme})`); @@ -75,6 +80,9 @@ test.describe('Visual - Example Imagery', () => { test('Example Imagery in Real Time', async ({ page, theme }) => { await page.goto(exampleImagery.url, { waitUntil: 'domcontentloaded' }); + // Wait for the thumbnails to finish their scroll animation + // (Wait until the rightmost thumbnail is in view) + await expect(page.getByLabel('Image Thumbnail from').last()).toBeInViewport(); await setRealTimeMode(page, true); await expect(page.getByLabel('Image Wrapper')).toBeVisible(); diff --git a/e2e/tests/visual-a11y/notebook.visual.spec.js b/e2e/tests/visual-a11y/notebook.visual.spec.js index b42ea15258..3532953fbf 100644 --- a/e2e/tests/visual-a11y/notebook.visual.spec.js +++ b/e2e/tests/visual-a11y/notebook.visual.spec.js @@ -22,8 +22,8 @@ import percySnapshot from '@percy/playwright'; -import { createDomainObjectWithDefaults, expandTreePaneItemByName } from '../../appActions.js'; -import { expect, test } from '../../avpFixtures.js'; +import { createDomainObjectWithDefaults } from '../../appActions.js'; +import { expect, scanForA11yViolations, test } from '../../avpFixtures.js'; import { VISUAL_FIXED_URL } from '../../constants.js'; import { enterTextEntry, startAndAddRestrictedNotebookObject } from '../../helper/notebookUtils.js'; @@ -86,9 +86,7 @@ test.describe('Visual - Notebook @a11y', () => { name: 'Test Notebook' }); }); - test('Accepts dropped objects as embeds', async ({ page, theme, openmctConfig }) => { - const { myItemsFolderName } = openmctConfig; - + test('Accepts dropped objects as embeds', async ({ page, theme }) => { // Create Overlay Plot await createDomainObjectWithDefaults(page, { type: 'Overlay Plot', @@ -98,11 +96,13 @@ test.describe('Visual - Notebook @a11y', () => { //Open Tree to perform drag await page.getByRole('button', { name: 'Browse' }).click(); - await expandTreePaneItemByName(page, myItemsFolderName); + await page.getByLabel('Expand My Items folder').click(); await page.goto(notebook.url); - await page.dragAndDrop('role=treeitem[name=/Dropped Overlay Plot/]', '.c-notebook__drag-area'); + await page + .getByLabel('Navigate to Dropped Overlay Plot') + .dragTo(page.getByLabel('To start a new entry, click here or drag and drop any object')); await percySnapshot(page, `Notebook w/ dropped embed (theme: ${theme})`); }); @@ -163,8 +163,7 @@ test.describe('Visual - Notebook @a11y', () => { // Take a snapshot await percySnapshot(page, `Notebook Selected Entry Text Area Active (theme: '${theme}')`); }); - // Skipping for https://github.com/nasa/openmct/issues/7421 - // test.afterEach(async ({ page }, testInfo) => { - // await scanForA11yViolations(page, testInfo.title); - // }); + test.afterEach(async ({ page }, testInfo) => { + await scanForA11yViolations(page, testInfo.title); + }); }); diff --git a/e2e/tests/visual-a11y/planning.visual.spec.js b/e2e/tests/visual-a11y/planning-gantt.visual.spec.js similarity index 59% rename from e2e/tests/visual-a11y/planning.visual.spec.js rename to e2e/tests/visual-a11y/planning-gantt.visual.spec.js index fbd9151a6e..f41cfa23fd 100644 --- a/e2e/tests/visual-a11y/planning.visual.spec.js +++ b/e2e/tests/visual-a11y/planning-gantt.visual.spec.js @@ -24,91 +24,15 @@ import percySnapshot from '@percy/playwright'; import fs from 'fs'; import { createDomainObjectWithDefaults, createPlanFromJSON } from '../../appActions.js'; -import { test } from '../../avpFixtures.js'; +import { scanForA11yViolations, test } from '../../avpFixtures.js'; import { VISUAL_FIXED_URL } from '../../constants.js'; -import { - createTimelistWithPlanAndSetActivityInProgress, - getFirstActivity, - setBoundsToSpanAllActivities, - setDraftStatusForPlan -} from '../../helper/planningUtils.js'; - -const examplePlanSmall1 = JSON.parse( - fs.readFileSync(new URL('../../test-data/examplePlans/ExamplePlan_Small1.json', import.meta.url)) -); +import { setBoundsToSpanAllActivities, setDraftStatusForPlan } from '../../helper/planningUtils.js'; const examplePlanSmall2 = JSON.parse( fs.readFileSync(new URL('../../test-data/examplePlans/ExamplePlan_Small2.json', import.meta.url)) ); -test.describe('Visual - Timelist progress bar @clock', () => { - const firstActivity = getFirstActivity(examplePlanSmall1); - - test.use({ - clockOptions: { - now: firstActivity.end + 10000, - shouldAdvanceTime: true - } - }); - - test.beforeEach(async ({ page }) => { - await createTimelistWithPlanAndSetActivityInProgress(page, examplePlanSmall1); - await page.getByLabel('Click to collapse items').click(); - }); - - test('progress pie is full', async ({ page, theme }) => { - // Progress pie is completely full and doesn't update if now is greater than the end time - await percySnapshot(page, `Time List with Activity in Progress (theme: ${theme})`); - }); -}); - -test.describe('Visual - Planning', () => { - test.beforeEach(async ({ page }) => { - await page.goto(VISUAL_FIXED_URL, { waitUntil: 'domcontentloaded' }); - }); - - test('Plan View', async ({ page, theme }) => { - const plan = await createPlanFromJSON(page, { - name: 'Plan Visual Test', - json: examplePlanSmall2 - }); - await setBoundsToSpanAllActivities(page, examplePlanSmall2, plan.url); - await percySnapshot(page, `Plan View (theme: ${theme})`); - }); - - test('Resize Plan View @2p', async ({ browser, theme }) => { - // need to set viewport to null to allow for resizing - const newContext = await browser.newContext({ - viewport: null - }); - const newPage = await newContext.newPage(); - - await newPage.goto(VISUAL_FIXED_URL, { waitUntil: 'domcontentloaded' }); - const plan = await createPlanFromJSON(newPage, { - name: 'Plan Visual Test', - json: examplePlanSmall2 - }); - - await setBoundsToSpanAllActivities(newPage, examplePlanSmall2, plan.url); - // resize the window - await newPage.setViewportSize({ width: 800, height: 600 }); - await percySnapshot(newPage, `Plan View resized (theme: ${theme})`); - }); - - test('Plan View w/ draft status', async ({ page, theme }) => { - const plan = await createPlanFromJSON(page, { - name: 'Plan Visual Test (Draft)', - json: examplePlanSmall2 - }); - await page.goto(VISUAL_FIXED_URL, { waitUntil: 'domcontentloaded' }); - await setDraftStatusForPlan(page, plan); - - await setBoundsToSpanAllActivities(page, examplePlanSmall2, plan.url); - await percySnapshot(page, `Plan View w/ draft status (theme: ${theme})`); - }); -}); - -test.describe('Visual - Gantt Chart', () => { +test.describe('Visual - Gantt Chart @a11y', () => { test.beforeEach(async ({ page }) => { await page.goto(VISUAL_FIXED_URL, { waitUntil: 'domcontentloaded' }); }); @@ -179,7 +103,6 @@ test.describe('Visual - Gantt Chart', () => { }); }); -// Skipping for https://github.com/nasa/openmct/issues/7421 -// test.afterEach(async ({ page }, testInfo) => { -// await scanForA11yViolations(page, testInfo.title); -// }); +test.afterEach(async ({ page }, testInfo) => { + await scanForA11yViolations(page, testInfo.title); +}); diff --git a/e2e/tests/visual-a11y/planning-timelist.visual.spec.js b/e2e/tests/visual-a11y/planning-timelist.visual.spec.js new file mode 100644 index 0000000000..baf23a02a9 --- /dev/null +++ b/e2e/tests/visual-a11y/planning-timelist.visual.spec.js @@ -0,0 +1,54 @@ +/***************************************************************************** + * 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. + *****************************************************************************/ + +import percySnapshot from '@percy/playwright'; +import fs from 'fs'; + +import { scanForA11yViolations, test } from '../../avpFixtures.js'; +import { + createTimelistWithPlanAndSetActivityInProgress, + getFirstActivity +} from '../../helper/planningUtils.js'; + +const examplePlanSmall1 = JSON.parse( + fs.readFileSync(new URL('../../test-data/examplePlans/ExamplePlan_Small1.json', import.meta.url)) +); + +const FIRST_ACTIVITY_SMALL_1 = getFirstActivity(examplePlanSmall1); + +test.describe('Visual - Timelist progress bar @clock @a11y', () => { + test.beforeEach(async ({ page }) => { + await page.clock.install({ time: FIRST_ACTIVITY_SMALL_1.end + 10000 }); + await page.clock.resume(); + await createTimelistWithPlanAndSetActivityInProgress(page, examplePlanSmall1); + await page.getByLabel('Click to collapse items').click(); + }); + + test('progress pie is full', async ({ page, theme }) => { + // Progress pie is completely full and doesn't update if now is greater than the end time + await percySnapshot(page, `Time List with Activity in Progress (theme: ${theme})`); + }); +}); + +test.afterEach(async ({ page }, testInfo) => { + await scanForA11yViolations(page, testInfo.title); +}); diff --git a/e2e/tests/visual-a11y/planning-timestrip.visual.spec.js b/e2e/tests/visual-a11y/planning-timestrip.visual.spec.js new file mode 100644 index 0000000000..f0a6c9a90c --- /dev/null +++ b/e2e/tests/visual-a11y/planning-timestrip.visual.spec.js @@ -0,0 +1,71 @@ +/***************************************************************************** + * 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. + *****************************************************************************/ + +import percySnapshot from '@percy/playwright'; +import fs from 'fs'; + +import { createDomainObjectWithDefaults, createPlanFromJSON } from '../../appActions.js'; +import { scanForA11yViolations, test } from '../../avpFixtures.js'; +import { waitForAnimations } from '../../baseFixtures.js'; +import { VISUAL_FIXED_URL } from '../../constants.js'; +import { setBoundsToSpanAllActivities } from '../../helper/planningUtils.js'; + +const examplePlanSmall2 = JSON.parse( + fs.readFileSync(new URL('../../test-data/examplePlans/ExamplePlan_Small2.json', import.meta.url)) +); + +test.describe('Visual - Time Strip @a11y', () => { + test.beforeEach(async ({ page }) => { + await page.goto(VISUAL_FIXED_URL, { waitUntil: 'domcontentloaded' }); + }); + test('Time Strip View', async ({ page, theme }) => { + const timeStrip = await createDomainObjectWithDefaults(page, { + type: 'Time Strip', + name: 'Time Strip Visual Test' + }); + await createPlanFromJSON(page, { + json: examplePlanSmall2, + parent: timeStrip.uuid, + name: 'examplePlanSmall2' + }); + await createDomainObjectWithDefaults(page, { + type: 'Sine Wave Generator', + parent: timeStrip.uuid, + name: 'Sine Wave Generator' + }); + await page.goto(VISUAL_FIXED_URL, { waitUntil: 'domcontentloaded' }); + + //This will indirectly modify the url such that the SWG is not rendered + await setBoundsToSpanAllActivities(page, examplePlanSmall2, timeStrip.url); + + //TODO Find a way to set the "now" activity line + + //This will stabilize the state of the test and allow the SWG to render as empty + await waitForAnimations(page.getByLabel('Plot Canvas')); + + await percySnapshot(page, `Time Strip View (theme: ${theme}) - With SWG and Plan`); + }); +}); + +test.afterEach(async ({ page }, testInfo) => { + await scanForA11yViolations(page, testInfo.title); +}); diff --git a/e2e/tests/visual-a11y/planning-view.visual.spec.js b/e2e/tests/visual-a11y/planning-view.visual.spec.js new file mode 100644 index 0000000000..7ca1200c03 --- /dev/null +++ b/e2e/tests/visual-a11y/planning-view.visual.spec.js @@ -0,0 +1,108 @@ +/***************************************************************************** + * 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. + *****************************************************************************/ + +import percySnapshot from '@percy/playwright'; +import fs from 'fs'; + +import { createPlanFromJSON } from '../../appActions.js'; +import { scanForA11yViolations, test } from '../../avpFixtures.js'; +import { VISUAL_FIXED_URL } from '../../constants.js'; +import { + createTimelistWithPlanAndSetActivityInProgress, + getFirstActivity, + setBoundsToSpanAllActivities, + setDraftStatusForPlan +} from '../../helper/planningUtils.js'; + +const examplePlanSmall1 = JSON.parse( + fs.readFileSync(new URL('../../test-data/examplePlans/ExamplePlan_Small1.json', import.meta.url)) +); + +const examplePlanSmall2 = JSON.parse( + fs.readFileSync(new URL('../../test-data/examplePlans/ExamplePlan_Small2.json', import.meta.url)) +); + +const FIRST_ACTIVITY_SMALL_1 = getFirstActivity(examplePlanSmall1); + +test.describe('Visual - Timelist progress bar @clock @a11y', () => { + test.beforeEach(async ({ page }) => { + await page.clock.install({ time: FIRST_ACTIVITY_SMALL_1.end + 10000 }); + await page.clock.resume(); + await createTimelistWithPlanAndSetActivityInProgress(page, examplePlanSmall1); + await page.getByLabel('Click to collapse items').click(); + }); + + test('progress pie is full', async ({ page, theme }) => { + // Progress pie is completely full and doesn't update if now is greater than the end time + await percySnapshot(page, `Time List with Activity in Progress (theme: ${theme})`); + }); +}); + +test.describe('Visual - Plan View @a11y', () => { + test.beforeEach(async ({ page }) => { + await page.goto(VISUAL_FIXED_URL, { waitUntil: 'domcontentloaded' }); + }); + + test('Plan View', async ({ page, theme }) => { + const plan = await createPlanFromJSON(page, { + name: 'Plan Visual Test', + json: examplePlanSmall2 + }); + await setBoundsToSpanAllActivities(page, examplePlanSmall2, plan.url); + await percySnapshot(page, `Plan View (theme: ${theme})`); + }); + + test('Resize Plan View @2p', async ({ browser, theme }) => { + // need to set viewport to null to allow for resizing + const newContext = await browser.newContext({ + viewport: null + }); + const newPage = await newContext.newPage(); + + await newPage.goto(VISUAL_FIXED_URL, { waitUntil: 'domcontentloaded' }); + const plan = await createPlanFromJSON(newPage, { + name: 'Plan Visual Test', + json: examplePlanSmall2 + }); + + await setBoundsToSpanAllActivities(newPage, examplePlanSmall2, plan.url); + // resize the window + await newPage.setViewportSize({ width: 800, height: 600 }); + await percySnapshot(newPage, `Plan View resized (theme: ${theme})`); + }); + + test('Plan View w/ draft status', async ({ page, theme }) => { + const plan = await createPlanFromJSON(page, { + name: 'Plan Visual Test (Draft)', + json: examplePlanSmall2 + }); + await page.goto(VISUAL_FIXED_URL, { waitUntil: 'domcontentloaded' }); + await setDraftStatusForPlan(page, plan); + + await setBoundsToSpanAllActivities(page, examplePlanSmall2, plan.url); + await percySnapshot(page, `Plan View w/ draft status (theme: ${theme})`); + }); +}); + +test.afterEach(async ({ page }, testInfo) => { + await scanForA11yViolations(page, testInfo.title); +}); diff --git a/example/exampleUser/ExampleUserProvider.js b/example/exampleUser/ExampleUserProvider.js index d80735abd0..712b18868a 100644 --- a/example/exampleUser/ExampleUserProvider.js +++ b/example/exampleUser/ExampleUserProvider.js @@ -20,7 +20,7 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -import EventEmitter from 'EventEmitter'; +import { EventEmitter } from 'eventemitter3'; import { v4 as uuid } from 'uuid'; import createExampleUser from './exampleUserCreator.js'; diff --git a/example/generator/SinewaveStalenessProvider.js b/example/generator/SinewaveStalenessProvider.js index 27f6ce96d4..0a54022ed4 100644 --- a/example/generator/SinewaveStalenessProvider.js +++ b/example/generator/SinewaveStalenessProvider.js @@ -20,13 +20,12 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -import EventEmitter from 'EventEmitter'; +import { EventEmitter } from 'eventemitter3'; export default class SinewaveLimitProvider extends EventEmitter { #openmct; #observingStaleness; #watchingTheClock; - #isRealTime; constructor(openmct) { super(); @@ -34,7 +33,6 @@ export default class SinewaveLimitProvider extends EventEmitter { this.#openmct = openmct; this.#observingStaleness = {}; this.#watchingTheClock = false; - this.#isRealTime = undefined; } supportsStaleness(domainObject) { @@ -61,10 +59,7 @@ export default class SinewaveLimitProvider extends EventEmitter { subscribeToStaleness(domainObject, callback) { const id = this.#getObjectKeyString(domainObject); - if (this.#isRealTime === undefined) { - this.#updateRealTime(this.#openmct.time.getMode()); - } - + this.#realTimeCheck(); this.#handleClockUpdate(); if (this.#observerExists(id)) { @@ -92,17 +87,15 @@ export default class SinewaveLimitProvider extends EventEmitter { if (observers && !this.#watchingTheClock) { this.#watchingTheClock = true; - this.#openmct.time.on('modeChanged', this.#updateRealTime, this); + this.#openmct.time.on('modeChanged', this.#realTimeCheck, this); } else if (!observers && this.#watchingTheClock) { this.#watchingTheClock = false; - this.#openmct.time.off('modeChanged', this.#updateRealTime, this); + this.#openmct.time.off('modeChanged', this.#realTimeCheck, this); } } - #updateRealTime(mode) { - this.#isRealTime = mode !== 'fixed'; - - if (!this.#isRealTime) { + #realTimeCheck() { + if (!this.#openmct.time.isRealTime()) { Object.keys(this.#observingStaleness).forEach((id) => { this.#updateStaleness(id, false); }); @@ -140,7 +133,7 @@ export default class SinewaveLimitProvider extends EventEmitter { } #providingStaleness(domainObject) { - return domainObject.telemetry?.staleness === true && this.#isRealTime; + return domainObject.telemetry?.staleness === true && this.#openmct.time.isRealTime(); } #getObjectKeyString(object) { diff --git a/openmct.js b/openmct.js index ecf82b35ad..aebb13a077 100644 --- a/openmct.js +++ b/openmct.js @@ -22,13 +22,38 @@ const matcher = /\/openmct.js$/; if (document.currentScript) { + // @ts-ignore let src = document.currentScript.src; if (src && matcher.test(src)) { - // eslint-disable-next-line no-undef + // @ts-ignore __webpack_public_path__ = src.replace(matcher, '') + '/'; } } +import { MCT } from './src/MCT.js'; + +const openmct = new MCT(); + +export default openmct; + +/** + * @typedef {MCT} OpenMCT + * @typedef {import('./src/api/objects/ObjectAPI.js').DomainObject} DomainObject + * @typedef {import('./src/api/objects/ObjectAPI.js').Identifier} Identifier + * @typedef {import('./src/api/objects/Transaction.js').default} Transaction + * @typedef {import('./src/api/actions/ActionsAPI.js').Action} Action + * @typedef {import('./src/api/actions/ActionCollection.js').default} ActionCollection + * @typedef {import('./src/api/composition/CompositionCollection.js').default} CompositionCollection + * @typedef {import('./src/api/composition/CompositionProvider.js').default} CompositionProvider + * @typedef {import('./src/ui/registries/ViewRegistry.js').ViewProvider} ViewProvider + * @typedef {import('./src/ui/registries/ViewRegistry.js').View} View + * + * @typedef {DomainObject[]} ObjectPath + * @typedef {(...args: any[]) => (openmct: OpenMCT) => void} OpenMCTPlugin + * An OpenMCT Plugin returns a function that receives an instance of + * the OpenMCT API and uses it to install itself. + */ + /** * @typedef {Object} BuildInfo * @property {string} version @@ -36,46 +61,3 @@ if (document.currentScript) { * @property {string} revision * @property {string} branch */ -/** - * @typedef {Object} OpenMCT - * @property {BuildInfo} buildInfo - * @property {import('./src/selection/Selection').default} selection - * @property {import('./src/api/time/TimeAPI').default} time - * @property {import('./src/api/composition/CompositionAPI').default} composition - * @property {import('./src/ui/registries/ViewRegistry').default} objectViews - * @property {import('./src/ui/registries/InspectorViewRegistry').default} inspectorViews - * @property {import('./src/ui/registries/ViewRegistry').default} propertyEditors - * @property {import('./src/ui/registries/ToolbarRegistry').default} toolbars - * @property {import('./src/api/types/TypeRegistry').default} types - * @property {import('./src/api/objects/ObjectAPI').default} objects - * @property {import('./src/api/telemetry/TelemetryAPI').default} telemetry - * @property {import('./src/api/indicators/IndicatorAPI').default} indicators - * @property {import('./src/api/user/UserAPI').default} user - * @property {import('./src/api/notifications/NotificationAPI').default} notifications - * @property {import('./src/api/Editor').default} editor - * @property {import('./src/api/overlays/OverlayAPI')} overlays - * @property {import('./src/api/tooltips/ToolTipAPI')} tooltips - * @property {import('./src/api/menu/MenuAPI').default} menus - * @property {import('./src/api/actions/ActionsAPI').default} actions - * @property {import('./src/api/status/StatusAPI').default} status - * @property {import('./src/api/priority/PriorityAPI').default} priority - * @property {import('./src/ui/router/ApplicationRouter')} router - * @property {import('./src/api/faultmanagement/FaultManagementAPI').default} faults - * @property {import('./src/api/forms/FormsAPI').default} forms - * @property {import('./src/api/Branding').default} branding - * @property {import('./src/api/annotation/AnnotationAPI').default} annotation - * @property {{(plugin: OpenMCTPlugin) => void}} install - * @property {{() => string}} getAssetPath - * @property {{(assetPath: string) => void}} setAssetPath - * @property {{(domElement: HTMLElement, isHeadlessMode: boolean) => void}} start - * @property {{() => void}} startHeadless - * @property {{() => void}} destroy - * @property {OpenMCTPlugin[]} plugins - * @property {OpenMCTComponent[]} components - */ -import { MCT } from './src/MCT.js'; - -/** @type {OpenMCT} */ -const openmct = new MCT(); - -export default openmct; diff --git a/package-lock.json b/package-lock.json index 9794ac219d..b15818b907 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37,13 +37,13 @@ "eslint-config-prettier": "9.1.0", "eslint-plugin-compat": "4.2.0", "eslint-plugin-no-unsanitized": "4.0.2", - "eslint-plugin-playwright": "0.12.0", + "eslint-plugin-playwright": "1.5.2", "eslint-plugin-prettier": "5.1.3", "eslint-plugin-simple-import-sort": "10.0.0", "eslint-plugin-unicorn": "49.0.0", "eslint-plugin-vue": "9.22.0", "eslint-plugin-you-dont-need-lodash-underscore": "6.13.0", - "eventemitter3": "1.2.0", + "eventemitter3": "5.0.1", "file-saver": "2.0.5", "flatbush": "4.2.0", "git-rev-sync": "3.0.2", @@ -84,7 +84,7 @@ "tiny-emitter": "2.1.0", "typescript": "5.3.3", "uuid": "9.0.1", - "vue": "3.4.19", + "vue": "3.4.24", "vue-eslint-parser": "9.4.2", "vue-loader": "16.8.3", "webpack": "5.90.3", @@ -104,9 +104,243 @@ "@axe-core/playwright": "4.8.5", "@percy/cli": "1.27.4", "@percy/playwright": "1.0.4", - "@playwright/test": "1.42.1", - "@types/sinonjs__fake-timers": "8.1.5", - "sinon": "17.0.0" + "@playwright/test": "1.45.2" + } + }, + "e2e/node_modules/@percy/cli": { + "version": "1.27.4", + "resolved": "https://registry.npmjs.org/@percy/cli/-/cli-1.27.4.tgz", + "integrity": "sha512-eIM44ejCMFc/S2W7X0htV+lvvmf63x5CaBpsSoQ9LRc/W02zHVAwQYdFFUowZEK6G1EwJEPIUnDxuuEx9PLG5A==", + "dev": true, + "dependencies": { + "@percy/cli-app": "1.27.4", + "@percy/cli-build": "1.27.4", + "@percy/cli-command": "1.27.4", + "@percy/cli-config": "1.27.4", + "@percy/cli-exec": "1.27.4", + "@percy/cli-snapshot": "1.27.4", + "@percy/cli-upload": "1.27.4", + "@percy/client": "1.27.4", + "@percy/logger": "1.27.4" + }, + "bin": { + "percy": "bin/run.cjs" + }, + "engines": { + "node": ">=14" + } + }, + "e2e/node_modules/@percy/cli-app": { + "version": "1.27.4", + "resolved": "https://registry.npmjs.org/@percy/cli-app/-/cli-app-1.27.4.tgz", + "integrity": "sha512-av/s6K2QmQgq4SCQQ+3lmteNHeQtIpMeBjMfSgxs9zeBoPVOMx5hXrdsi6l7ChvOLXyYfzl/TbEuwrSDXiA8mw==", + "dev": true, + "dependencies": { + "@percy/cli-command": "1.27.4", + "@percy/cli-exec": "1.27.4" + }, + "engines": { + "node": ">=14" + } + }, + "e2e/node_modules/@percy/cli-build": { + "version": "1.27.4", + "resolved": "https://registry.npmjs.org/@percy/cli-build/-/cli-build-1.27.4.tgz", + "integrity": "sha512-tzCAcV0sAw608Gr/Q6NtPvVkA8dnIehMzvEXNIN3WP9DkprOgu7MYuexN0fZXf4vSroDWYXT87pHYP8YrrnDag==", + "dev": true, + "dependencies": { + "@percy/cli-command": "1.27.4" + }, + "engines": { + "node": ">=14" + } + }, + "e2e/node_modules/@percy/cli-command": { + "version": "1.27.4", + "resolved": "https://registry.npmjs.org/@percy/cli-command/-/cli-command-1.27.4.tgz", + "integrity": "sha512-YDKeeOr1MvksDOnc2ZKQ/XuERGrWwzuT/vWZ9it8L+0SyPj28UbklDu0e9zBgPsSDfxJlIvsWXRuHNGHsweKXg==", + "dev": true, + "dependencies": { + "@percy/config": "1.27.4", + "@percy/core": "1.27.4", + "@percy/logger": "1.27.4" + }, + "bin": { + "percy-cli-readme": "bin/readme.js" + }, + "engines": { + "node": ">=14" + } + }, + "e2e/node_modules/@percy/cli-config": { + "version": "1.27.4", + "resolved": "https://registry.npmjs.org/@percy/cli-config/-/cli-config-1.27.4.tgz", + "integrity": "sha512-wFtQwPw4LEqpcZ6ac6WtejyGrvrrzzLdyvXNvsCPQLE47qXnXVXJ+E99k9KGcjavtUuPxrbWtX996Fz9Fb5hoQ==", + "dev": true, + "dependencies": { + "@percy/cli-command": "1.27.4" + }, + "engines": { + "node": ">=14" + } + }, + "e2e/node_modules/@percy/cli-exec": { + "version": "1.27.4", + "resolved": "https://registry.npmjs.org/@percy/cli-exec/-/cli-exec-1.27.4.tgz", + "integrity": "sha512-aSDLvzXXdwJso+p5iI4iTOa7AYzgFdRoqY9ij/R5aAL9juNkvG5QatB1bkUNbJabKFe16t7iigt4eJnlS0R13A==", + "dev": true, + "dependencies": { + "@percy/cli-command": "1.27.4", + "cross-spawn": "^7.0.3", + "which": "^2.0.2" + }, + "engines": { + "node": ">=14" + } + }, + "e2e/node_modules/@percy/cli-snapshot": { + "version": "1.27.4", + "resolved": "https://registry.npmjs.org/@percy/cli-snapshot/-/cli-snapshot-1.27.4.tgz", + "integrity": "sha512-dDT2UpeP6X5NcMdj3AKLhHGmnobwzlXsHa52C+ne3kg3HSZgaXH9OsNY866Xe7onvcsZxvnRKDYHmWW6kC3cKQ==", + "dev": true, + "dependencies": { + "@percy/cli-command": "1.27.4", + "yaml": "^2.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "e2e/node_modules/@percy/cli-upload": { + "version": "1.27.4", + "resolved": "https://registry.npmjs.org/@percy/cli-upload/-/cli-upload-1.27.4.tgz", + "integrity": "sha512-+4mcEOUydFubyMWVzQjPV79sL1Jar95SR7Yr7Vp4FBoE0iq0CbaHoJtyOWDfwvHYYp4rRjVMxpY0ha3jnmF0mA==", + "dev": true, + "dependencies": { + "@percy/cli-command": "1.27.4", + "fast-glob": "^3.2.11", + "image-size": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "e2e/node_modules/@percy/client": { + "version": "1.27.4", + "resolved": "https://registry.npmjs.org/@percy/client/-/client-1.27.4.tgz", + "integrity": "sha512-1F8ulTJhfk4/Lgj1Cn0blaRd8vTRJDxahAGseTbfrnZ2PHsftPZ65/5nCHPtpdD/2CE8N5COBQscGTMQQO+hBA==", + "dev": true, + "dependencies": { + "@percy/env": "1.27.4", + "@percy/logger": "1.27.4" + }, + "engines": { + "node": ">=14" + } + }, + "e2e/node_modules/@percy/config": { + "version": "1.27.4", + "resolved": "https://registry.npmjs.org/@percy/config/-/config-1.27.4.tgz", + "integrity": "sha512-mlgiOdzdSfUSx9FskVIjmbT/iHbTif0Ow5evZQJTT1W0xgHOBWDCZyhINdsqulSBw+K1PNhHsu1J0h2ijxF4uA==", + "dev": true, + "dependencies": { + "@percy/logger": "1.27.4", + "ajv": "^8.6.2", + "cosmiconfig": "^8.0.0", + "yaml": "^2.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "e2e/node_modules/@percy/core": { + "version": "1.27.4", + "resolved": "https://registry.npmjs.org/@percy/core/-/core-1.27.4.tgz", + "integrity": "sha512-WdsA4zlPgXl9xj+a5WW2wA20iU6VTDmRq5sgsYNSuPzZfQB2I5Cecgvb55p86dhlUTbPJrC76daQKzDTGe0hfA==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "@percy/client": "1.27.4", + "@percy/config": "1.27.4", + "@percy/dom": "1.27.4", + "@percy/logger": "1.27.4", + "@percy/webdriver-utils": "1.27.4", + "content-disposition": "^0.5.4", + "cross-spawn": "^7.0.3", + "extract-zip": "^2.0.1", + "fast-glob": "^3.2.11", + "micromatch": "^4.0.4", + "mime-types": "^2.1.34", + "path-to-regexp": "^6.2.0", + "rimraf": "^3.0.2", + "ws": "^8.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "e2e/node_modules/@percy/dom": { + "version": "1.27.4", + "resolved": "https://registry.npmjs.org/@percy/dom/-/dom-1.27.4.tgz", + "integrity": "sha512-pwPDx3e9y7uRobVlEya8xu3BB3GeXbC74kQ6pPM/wFYDwi/Dg8DJywCsj5Nko/7QuhXP02rYgatkbREOIRxDnA==", + "dev": true + }, + "e2e/node_modules/@percy/env": { + "version": "1.27.4", + "resolved": "https://registry.npmjs.org/@percy/env/-/env-1.27.4.tgz", + "integrity": "sha512-Xl2VUpljOrlCvAp/+KfmN9NUcTGpRdXPa1U9zSIyBnV/oAksp3/CK5EPpKZX/f8xUUkTp78UPaG99sEMA8VvXQ==", + "dev": true, + "dependencies": { + "@percy/logger": "1.27.4" + }, + "engines": { + "node": ">=14" + } + }, + "e2e/node_modules/@percy/logger": { + "version": "1.27.4", + "resolved": "https://registry.npmjs.org/@percy/logger/-/logger-1.27.4.tgz", + "integrity": "sha512-AwXqYaDkHaq1TPkP+ByB8rjvH9ddvkAH9tFd2kmq8AeFFXZ0amAPSbm6u090OUtdHWjRmKQK9JjSouBxEh0aRw==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "e2e/node_modules/@percy/playwright": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@percy/playwright/-/playwright-1.0.4.tgz", + "integrity": "sha512-prXvaEyvM6M7vGx0YujdMmFf+rZqkQpDEK32ZOwXbMzKYhGXjyiYESa4Axhc+Pz/c0THhXZWH4/70IW0RcyCQA==", + "dev": true, + "dependencies": { + "@percy/sdk-utils": "^1.0.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "playwright-core": ">=1" + } + }, + "e2e/node_modules/@percy/sdk-utils": { + "version": "1.27.4", + "resolved": "https://registry.npmjs.org/@percy/sdk-utils/-/sdk-utils-1.27.4.tgz", + "integrity": "sha512-vhPcdtmJlvTYJ5VOqiVzo02ujdtBFNw1/Bj+2ybiZgn7PkCDPFcITfXoWWPea319EIibGC4ZHjWHctRBgtW/tQ==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "e2e/node_modules/@percy/webdriver-utils": { + "version": "1.27.4", + "resolved": "https://registry.npmjs.org/@percy/webdriver-utils/-/webdriver-utils-1.27.4.tgz", + "integrity": "sha512-pZOOYns8Fikh2qlbxO16DxFEnCrnFIoLpE7iz4M9jXxOfk16VZF1PWknMChSr5NqG2I9k2OMjizUE2j8zvtl2Q==", + "dev": true, + "dependencies": { + "@percy/config": "1.27.4", + "@percy/sdk-utils": "1.27.4" + }, + "engines": { + "node": ">=14" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -398,9 +632,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.24.0", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.0.tgz", - "integrity": "sha512-QuP/FxEAzMSjXygs8v4N9dvdXzEHN4W1oF3PxuWAtPo08UdM17u89RDMgjLn/mlc56iM0HlLmVkO/wgR+rDgHg==", + "version": "7.24.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.4.tgz", + "integrity": "sha512-zTvEBcghmeBma9QIGunWevvBAp4/Qu9Bdq+2k0Ot4fVMD6v3dsC9WOcRSKk7tRRyBM/53yKMJko9xOatGQAwSg==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -1291,251 +1525,6 @@ "node": ">= 8" } }, - "node_modules/@percy/cli": { - "version": "1.27.4", - "resolved": "https://registry.npmjs.org/@percy/cli/-/cli-1.27.4.tgz", - "integrity": "sha512-eIM44ejCMFc/S2W7X0htV+lvvmf63x5CaBpsSoQ9LRc/W02zHVAwQYdFFUowZEK6G1EwJEPIUnDxuuEx9PLG5A==", - "dev": true, - "dependencies": { - "@percy/cli-app": "1.27.4", - "@percy/cli-build": "1.27.4", - "@percy/cli-command": "1.27.4", - "@percy/cli-config": "1.27.4", - "@percy/cli-exec": "1.27.4", - "@percy/cli-snapshot": "1.27.4", - "@percy/cli-upload": "1.27.4", - "@percy/client": "1.27.4", - "@percy/logger": "1.27.4" - }, - "bin": { - "percy": "bin/run.cjs" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@percy/cli-app": { - "version": "1.27.4", - "resolved": "https://registry.npmjs.org/@percy/cli-app/-/cli-app-1.27.4.tgz", - "integrity": "sha512-av/s6K2QmQgq4SCQQ+3lmteNHeQtIpMeBjMfSgxs9zeBoPVOMx5hXrdsi6l7ChvOLXyYfzl/TbEuwrSDXiA8mw==", - "dev": true, - "dependencies": { - "@percy/cli-command": "1.27.4", - "@percy/cli-exec": "1.27.4" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@percy/cli-build": { - "version": "1.27.4", - "resolved": "https://registry.npmjs.org/@percy/cli-build/-/cli-build-1.27.4.tgz", - "integrity": "sha512-tzCAcV0sAw608Gr/Q6NtPvVkA8dnIehMzvEXNIN3WP9DkprOgu7MYuexN0fZXf4vSroDWYXT87pHYP8YrrnDag==", - "dev": true, - "dependencies": { - "@percy/cli-command": "1.27.4" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@percy/cli-command": { - "version": "1.27.4", - "resolved": "https://registry.npmjs.org/@percy/cli-command/-/cli-command-1.27.4.tgz", - "integrity": "sha512-YDKeeOr1MvksDOnc2ZKQ/XuERGrWwzuT/vWZ9it8L+0SyPj28UbklDu0e9zBgPsSDfxJlIvsWXRuHNGHsweKXg==", - "dev": true, - "dependencies": { - "@percy/config": "1.27.4", - "@percy/core": "1.27.4", - "@percy/logger": "1.27.4" - }, - "bin": { - "percy-cli-readme": "bin/readme.js" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@percy/cli-config": { - "version": "1.27.4", - "resolved": "https://registry.npmjs.org/@percy/cli-config/-/cli-config-1.27.4.tgz", - "integrity": "sha512-wFtQwPw4LEqpcZ6ac6WtejyGrvrrzzLdyvXNvsCPQLE47qXnXVXJ+E99k9KGcjavtUuPxrbWtX996Fz9Fb5hoQ==", - "dev": true, - "dependencies": { - "@percy/cli-command": "1.27.4" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@percy/cli-exec": { - "version": "1.27.4", - "resolved": "https://registry.npmjs.org/@percy/cli-exec/-/cli-exec-1.27.4.tgz", - "integrity": "sha512-aSDLvzXXdwJso+p5iI4iTOa7AYzgFdRoqY9ij/R5aAL9juNkvG5QatB1bkUNbJabKFe16t7iigt4eJnlS0R13A==", - "dev": true, - "dependencies": { - "@percy/cli-command": "1.27.4", - "cross-spawn": "^7.0.3", - "which": "^2.0.2" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@percy/cli-snapshot": { - "version": "1.27.4", - "resolved": "https://registry.npmjs.org/@percy/cli-snapshot/-/cli-snapshot-1.27.4.tgz", - "integrity": "sha512-dDT2UpeP6X5NcMdj3AKLhHGmnobwzlXsHa52C+ne3kg3HSZgaXH9OsNY866Xe7onvcsZxvnRKDYHmWW6kC3cKQ==", - "dev": true, - "dependencies": { - "@percy/cli-command": "1.27.4", - "yaml": "^2.0.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@percy/cli-upload": { - "version": "1.27.4", - "resolved": "https://registry.npmjs.org/@percy/cli-upload/-/cli-upload-1.27.4.tgz", - "integrity": "sha512-+4mcEOUydFubyMWVzQjPV79sL1Jar95SR7Yr7Vp4FBoE0iq0CbaHoJtyOWDfwvHYYp4rRjVMxpY0ha3jnmF0mA==", - "dev": true, - "dependencies": { - "@percy/cli-command": "1.27.4", - "fast-glob": "^3.2.11", - "image-size": "^1.0.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@percy/client": { - "version": "1.27.4", - "resolved": "https://registry.npmjs.org/@percy/client/-/client-1.27.4.tgz", - "integrity": "sha512-1F8ulTJhfk4/Lgj1Cn0blaRd8vTRJDxahAGseTbfrnZ2PHsftPZ65/5nCHPtpdD/2CE8N5COBQscGTMQQO+hBA==", - "dev": true, - "dependencies": { - "@percy/env": "1.27.4", - "@percy/logger": "1.27.4" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@percy/config": { - "version": "1.27.4", - "resolved": "https://registry.npmjs.org/@percy/config/-/config-1.27.4.tgz", - "integrity": "sha512-mlgiOdzdSfUSx9FskVIjmbT/iHbTif0Ow5evZQJTT1W0xgHOBWDCZyhINdsqulSBw+K1PNhHsu1J0h2ijxF4uA==", - "dev": true, - "dependencies": { - "@percy/logger": "1.27.4", - "ajv": "^8.6.2", - "cosmiconfig": "^8.0.0", - "yaml": "^2.0.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@percy/core": { - "version": "1.27.4", - "resolved": "https://registry.npmjs.org/@percy/core/-/core-1.27.4.tgz", - "integrity": "sha512-WdsA4zlPgXl9xj+a5WW2wA20iU6VTDmRq5sgsYNSuPzZfQB2I5Cecgvb55p86dhlUTbPJrC76daQKzDTGe0hfA==", - "dev": true, - "hasInstallScript": true, - "dependencies": { - "@percy/client": "1.27.4", - "@percy/config": "1.27.4", - "@percy/dom": "1.27.4", - "@percy/logger": "1.27.4", - "@percy/webdriver-utils": "1.27.4", - "content-disposition": "^0.5.4", - "cross-spawn": "^7.0.3", - "extract-zip": "^2.0.1", - "fast-glob": "^3.2.11", - "micromatch": "^4.0.4", - "mime-types": "^2.1.34", - "path-to-regexp": "^6.2.0", - "rimraf": "^3.0.2", - "ws": "^8.0.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@percy/dom": { - "version": "1.27.4", - "resolved": "https://registry.npmjs.org/@percy/dom/-/dom-1.27.4.tgz", - "integrity": "sha512-pwPDx3e9y7uRobVlEya8xu3BB3GeXbC74kQ6pPM/wFYDwi/Dg8DJywCsj5Nko/7QuhXP02rYgatkbREOIRxDnA==", - "dev": true - }, - "node_modules/@percy/env": { - "version": "1.27.4", - "resolved": "https://registry.npmjs.org/@percy/env/-/env-1.27.4.tgz", - "integrity": "sha512-Xl2VUpljOrlCvAp/+KfmN9NUcTGpRdXPa1U9zSIyBnV/oAksp3/CK5EPpKZX/f8xUUkTp78UPaG99sEMA8VvXQ==", - "dev": true, - "dependencies": { - "@percy/logger": "1.27.4" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@percy/logger": { - "version": "1.27.4", - "resolved": "https://registry.npmjs.org/@percy/logger/-/logger-1.27.4.tgz", - "integrity": "sha512-AwXqYaDkHaq1TPkP+ByB8rjvH9ddvkAH9tFd2kmq8AeFFXZ0amAPSbm6u090OUtdHWjRmKQK9JjSouBxEh0aRw==", - "dev": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/@percy/playwright": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@percy/playwright/-/playwright-1.0.4.tgz", - "integrity": "sha512-prXvaEyvM6M7vGx0YujdMmFf+rZqkQpDEK32ZOwXbMzKYhGXjyiYESa4Axhc+Pz/c0THhXZWH4/70IW0RcyCQA==", - "dev": true, - "dependencies": { - "@percy/sdk-utils": "^1.0.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "playwright-core": ">=1" - } - }, - "node_modules/@percy/sdk-utils": { - "version": "1.28.2", - "resolved": "https://registry.npmjs.org/@percy/sdk-utils/-/sdk-utils-1.28.2.tgz", - "integrity": "sha512-cMFz8AjZ2KunN0dVwzA+Wosk4B+6G9dUkh2YPhYvqs0KLcCyYs3s91IzOQmtBOYwAUVja/W/u6XmBHw0jaxg0A==", - "dev": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/@percy/webdriver-utils": { - "version": "1.27.4", - "resolved": "https://registry.npmjs.org/@percy/webdriver-utils/-/webdriver-utils-1.27.4.tgz", - "integrity": "sha512-pZOOYns8Fikh2qlbxO16DxFEnCrnFIoLpE7iz4M9jXxOfk16VZF1PWknMChSr5NqG2I9k2OMjizUE2j8zvtl2Q==", - "dev": true, - "dependencies": { - "@percy/config": "1.27.4", - "@percy/sdk-utils": "1.27.4" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@percy/webdriver-utils/node_modules/@percy/sdk-utils": { - "version": "1.27.4", - "resolved": "https://registry.npmjs.org/@percy/sdk-utils/-/sdk-utils-1.27.4.tgz", - "integrity": "sha512-vhPcdtmJlvTYJ5VOqiVzo02ujdtBFNw1/Bj+2ybiZgn7PkCDPFcITfXoWWPea319EIibGC4ZHjWHctRBgtW/tQ==", - "dev": true, - "engines": { - "node": ">=14" - } - }, "node_modules/@pkgjs/parseargs": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", @@ -1559,18 +1548,18 @@ } }, "node_modules/@playwright/test": { - "version": "1.42.1", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.42.1.tgz", - "integrity": "sha512-Gq9rmS54mjBL/7/MvBaNOBwbfnh7beHvS6oS4srqXFcQHpQCV1+c8JXWE8VLPyRDhgS3H8x8A7hztqI9VnwrAQ==", + "version": "1.45.2", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.45.2.tgz", + "integrity": "sha512-JxG9eq92ET75EbVi3s+4sYbcG7q72ECeZNbdBlaMkGcNbiDQ4cAi8U2QP5oKkOx+1gpaiL1LDStmzCaEM1Z6fQ==", "dev": true, "dependencies": { - "playwright": "1.42.1" + "playwright": "1.45.2" }, "bin": { "playwright": "cli.js" }, "engines": { - "node": ">=16" + "node": ">=18" } }, "node_modules/@sinclair/typebox": { @@ -1591,50 +1580,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@sinonjs/commons": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", - "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", - "dev": true, - "dependencies": { - "type-detect": "4.0.8" - } - }, - "node_modules/@sinonjs/fake-timers": { - "version": "11.2.2", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-11.2.2.tgz", - "integrity": "sha512-G2piCSxQ7oWOxwGSAyFHfPIsyeJGXYtc6mFbnFA+kRXkiEnTl8c/8jul2S329iFBnDI9HGoeWWAZvuvOkZccgw==", - "dev": true, - "dependencies": { - "@sinonjs/commons": "^3.0.0" - } - }, - "node_modules/@sinonjs/samsam": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-8.0.0.tgz", - "integrity": "sha512-Bp8KUVlLp8ibJZrnvq2foVhP0IVX2CIprMJPK0vqGqgrDa0OHVKeZyBykqskkrdxV6yKBPmGasO8LVjAKR3Gew==", - "dev": true, - "dependencies": { - "@sinonjs/commons": "^2.0.0", - "lodash.get": "^4.4.2", - "type-detect": "^4.0.8" - } - }, - "node_modules/@sinonjs/samsam/node_modules/@sinonjs/commons": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-2.0.0.tgz", - "integrity": "sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg==", - "dev": true, - "dependencies": { - "type-detect": "4.0.8" - } - }, - "node_modules/@sinonjs/text-encoding": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.2.tgz", - "integrity": "sha512-sXXKG+uL9IrKqViTtao2Ws6dy0znu9sOaP1di/jKGW1M6VssO8vlpXCQcpZ+jisQ1tTFAC5Jo/EOzFbggBagFQ==", - "dev": true - }, "node_modules/@socket.io/component-emitter": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz", @@ -1915,12 +1860,6 @@ "@types/node": "*" } }, - "node_modules/@types/sinonjs__fake-timers": { - "version": "8.1.5", - "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.5.tgz", - "integrity": "sha512-mQkU2jY8jJEF7YHjHvsQO8+3ughTL1mcnn96igfhONmR+fUPSKIkefQYpSe8bsly2Ep7oQbn/6VG5/9/0qcArQ==", - "dev": true - }, "node_modules/@types/sockjs": { "version": "0.3.36", "resolved": "https://registry.npmjs.org/@types/sockjs/-/sockjs-0.3.36.tgz", @@ -1939,6 +1878,16 @@ "@types/node": "*" } }, + "node_modules/@types/yauzl": { + "version": "2.10.3", + "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.3.tgz", + "integrity": "sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==", + "dev": true, + "optional": true, + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@ungap/structured-clone": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", @@ -1996,103 +1945,103 @@ } }, "node_modules/@vue/reactivity": { - "version": "3.4.19", - "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.4.19.tgz", - "integrity": "sha512-+VcwrQvLZgEclGZRHx4O2XhyEEcKaBi50WbxdVItEezUf4fqRh838Ix6amWTdX0CNb/b6t3Gkz3eOebfcSt+UA==", + "version": "3.4.24", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.4.24.tgz", + "integrity": "sha512-nup3fSYg4i4LtNvu9slF/HF/0dkMQYfepUdORBcMSsankzRPzE7ypAFurpwyRBfU1i7Dn1kcwpYsE1wETSh91g==", "dev": true, "dependencies": { - "@vue/shared": "3.4.19" + "@vue/shared": "3.4.24" } }, "node_modules/@vue/reactivity/node_modules/@vue/shared": { - "version": "3.4.19", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.19.tgz", - "integrity": "sha512-/KliRRHMF6LoiThEy+4c1Z4KB/gbPrGjWwJR+crg2otgrf/egKzRaCPvJ51S5oetgsgXLfc4Rm5ZgrKHZrtMSw==", + "version": "3.4.24", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.24.tgz", + "integrity": "sha512-BW4tajrJBM9AGAknnyEw5tO2xTmnqgup0VTnDAMcxYmqOX0RG0b9aSUGAbEKolD91tdwpA6oCwbltoJoNzpItw==", "dev": true }, "node_modules/@vue/runtime-core": { - "version": "3.4.19", - "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.4.19.tgz", - "integrity": "sha512-/Z3tFwOrerJB/oyutmJGoYbuoadphDcJAd5jOuJE86THNZji9pYjZroQ2NFsZkTxOq0GJbb+s2kxTYToDiyZzw==", + "version": "3.4.24", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.4.24.tgz", + "integrity": "sha512-c7iMfj6cJMeAG3s5yOn9Rc5D9e2/wIuaozmGf/ICGCY3KV5H7mbTVdvEkd4ZshTq7RUZqj2k7LMJWVx+EBiY1g==", "dev": true, "dependencies": { - "@vue/reactivity": "3.4.19", - "@vue/shared": "3.4.19" + "@vue/reactivity": "3.4.24", + "@vue/shared": "3.4.24" } }, "node_modules/@vue/runtime-core/node_modules/@vue/shared": { - "version": "3.4.19", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.19.tgz", - "integrity": "sha512-/KliRRHMF6LoiThEy+4c1Z4KB/gbPrGjWwJR+crg2otgrf/egKzRaCPvJ51S5oetgsgXLfc4Rm5ZgrKHZrtMSw==", + "version": "3.4.24", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.24.tgz", + "integrity": "sha512-BW4tajrJBM9AGAknnyEw5tO2xTmnqgup0VTnDAMcxYmqOX0RG0b9aSUGAbEKolD91tdwpA6oCwbltoJoNzpItw==", "dev": true }, "node_modules/@vue/runtime-dom": { - "version": "3.4.19", - "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.4.19.tgz", - "integrity": "sha512-IyZzIDqfNCF0OyZOauL+F4yzjMPN2rPd8nhqPP2N1lBn3kYqJpPHHru+83Rkvo2lHz5mW+rEeIMEF9qY3PB94g==", + "version": "3.4.24", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.4.24.tgz", + "integrity": "sha512-uXKzuh/Emfad2Y7Qm0ABsLZZV6H3mAJ5ZVqmAOlrNQRf+T5mxpPGZBfec1hkP41t6h6FwF6RSGCs/gd8WbuySQ==", "dev": true, "dependencies": { - "@vue/runtime-core": "3.4.19", - "@vue/shared": "3.4.19", + "@vue/runtime-core": "3.4.24", + "@vue/shared": "3.4.24", "csstype": "^3.1.3" } }, "node_modules/@vue/runtime-dom/node_modules/@vue/shared": { - "version": "3.4.19", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.19.tgz", - "integrity": "sha512-/KliRRHMF6LoiThEy+4c1Z4KB/gbPrGjWwJR+crg2otgrf/egKzRaCPvJ51S5oetgsgXLfc4Rm5ZgrKHZrtMSw==", + "version": "3.4.24", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.24.tgz", + "integrity": "sha512-BW4tajrJBM9AGAknnyEw5tO2xTmnqgup0VTnDAMcxYmqOX0RG0b9aSUGAbEKolD91tdwpA6oCwbltoJoNzpItw==", "dev": true }, "node_modules/@vue/server-renderer": { - "version": "3.4.19", - "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.4.19.tgz", - "integrity": "sha512-eAj2p0c429RZyyhtMRnttjcSToch+kTWxFPHlzGMkR28ZbF1PDlTcmGmlDxccBuqNd9iOQ7xPRPAGgPVj+YpQw==", + "version": "3.4.24", + "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.4.24.tgz", + "integrity": "sha512-H+DLK4sQF6sRgzKyofmlEVBIV/9KrQU6HIV7nt6yIwSGGKvSwlV8pqJlebUKLpbXaNHugdSfAbP6YmXF69lxow==", "dev": true, "dependencies": { - "@vue/compiler-ssr": "3.4.19", - "@vue/shared": "3.4.19" + "@vue/compiler-ssr": "3.4.24", + "@vue/shared": "3.4.24" }, "peerDependencies": { - "vue": "3.4.19" + "vue": "3.4.24" } }, "node_modules/@vue/server-renderer/node_modules/@vue/compiler-core": { - "version": "3.4.19", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.4.19.tgz", - "integrity": "sha512-gj81785z0JNzRcU0Mq98E56e4ltO1yf8k5PQ+tV/7YHnbZkrM0fyFyuttnN8ngJZjbpofWE/m4qjKBiLl8Ju4w==", + "version": "3.4.24", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.4.24.tgz", + "integrity": "sha512-vbW/tgbwJYj62N/Ww99x0zhFTkZDTcGh3uwJEuadZ/nF9/xuFMC4693P9r+3sxGXISABpDKvffY5ApH9pmdd1A==", "dev": true, "dependencies": { - "@babel/parser": "^7.23.9", - "@vue/shared": "3.4.19", + "@babel/parser": "^7.24.4", + "@vue/shared": "3.4.24", "entities": "^4.5.0", "estree-walker": "^2.0.2", - "source-map-js": "^1.0.2" + "source-map-js": "^1.2.0" } }, "node_modules/@vue/server-renderer/node_modules/@vue/compiler-dom": { - "version": "3.4.19", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.4.19.tgz", - "integrity": "sha512-vm6+cogWrshjqEHTzIDCp72DKtea8Ry/QVpQRYoyTIg9k7QZDX6D8+HGURjtmatfgM8xgCFtJJaOlCaRYRK3QA==", + "version": "3.4.24", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.4.24.tgz", + "integrity": "sha512-4XgABML/4cNndVsQndG6BbGN7+EoisDwi3oXNovqL/4jdNhwvP8/rfRMTb6FxkxIxUUtg6AI1/qZvwfSjxJiWA==", "dev": true, "dependencies": { - "@vue/compiler-core": "3.4.19", - "@vue/shared": "3.4.19" + "@vue/compiler-core": "3.4.24", + "@vue/shared": "3.4.24" } }, "node_modules/@vue/server-renderer/node_modules/@vue/compiler-ssr": { - "version": "3.4.19", - "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.4.19.tgz", - "integrity": "sha512-P0PLKC4+u4OMJ8sinba/5Z/iDT84uMRRlrWzadgLA69opCpI1gG4N55qDSC+dedwq2fJtzmGald05LWR5TFfLw==", + "version": "3.4.24", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.4.24.tgz", + "integrity": "sha512-ZsAtr4fhaUFnVcDqwW3bYCSDwq+9Gk69q2r/7dAHDrOMw41kylaMgOP4zRnn6GIEJkQznKgrMOGPMFnLB52RbQ==", "dev": true, "dependencies": { - "@vue/compiler-dom": "3.4.19", - "@vue/shared": "3.4.19" + "@vue/compiler-dom": "3.4.24", + "@vue/shared": "3.4.24" } }, "node_modules/@vue/server-renderer/node_modules/@vue/shared": { - "version": "3.4.19", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.19.tgz", - "integrity": "sha512-/KliRRHMF6LoiThEy+4c1Z4KB/gbPrGjWwJR+crg2otgrf/egKzRaCPvJ51S5oetgsgXLfc4Rm5ZgrKHZrtMSw==", + "version": "3.4.24", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.24.tgz", + "integrity": "sha512-BW4tajrJBM9AGAknnyEw5tO2xTmnqgup0VTnDAMcxYmqOX0RG0b9aSUGAbEKolD91tdwpA6oCwbltoJoNzpItw==", "dev": true }, "node_modules/@vue/shared": { @@ -2701,12 +2650,12 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -4234,15 +4183,6 @@ "integrity": "sha512-uJaamHkagcZtHPqCIHZxnFrXlunQXgBOsZSUOWwFw31QJCAbyTBoHMW75YOTur5ZNx8pIeAKgf6GWIgaqqiLhA==", "dev": true }, - "node_modules/diff": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", - "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", - "dev": true, - "engines": { - "node": ">=0.3.1" - } - }, "node_modules/dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", @@ -4425,9 +4365,9 @@ } }, "node_modules/engine.io": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.5.4.tgz", - "integrity": "sha512-KdVSDKhVKyOi+r5uEabrDLZw2qXStVvCsEB/LN3mw4WFi6Gx50jTyuxYVCwAAC0U46FdnzP/ScKRBTXb/NiEOg==", + "version": "6.5.5", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.5.5.tgz", + "integrity": "sha512-C5Pn8Wk+1vKBoHghJODM63yk8MvrO9EWZUfkAt5HAqIgPE4/8FF0PEGHXtEd40l223+cE5ABWuPzm38PHFXfMA==", "dev": true, "dependencies": { "@types/cookie": "^0.4.1", @@ -4439,7 +4379,7 @@ "cors": "~2.8.5", "debug": "~4.3.1", "engine.io-parser": "~5.2.1", - "ws": "~8.11.0" + "ws": "~8.17.1" }, "engines": { "node": ">=10.2.0" @@ -4454,27 +4394,6 @@ "node": ">=10.0.0" } }, - "node_modules/engine.io/node_modules/ws": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz", - "integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==", - "dev": true, - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, "node_modules/enhanced-resolve": { "version": "5.16.0", "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.16.0.tgz", @@ -4776,13 +4695,22 @@ } }, "node_modules/eslint-plugin-playwright": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-playwright/-/eslint-plugin-playwright-0.12.0.tgz", - "integrity": "sha512-KXuzQjVzca5irMT/7rvzJKsVDGbQr43oQPc8i+SLEBqmfrTxlwMwRqfv9vtZqh4hpU0jmrnA/EOfwtls+5QC1w==", + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-playwright/-/eslint-plugin-playwright-1.5.2.tgz", + "integrity": "sha512-TMzLrLGQMccngU8GogtzIc9u5RzXGnfsQEUjLfEfshINuVR2fS4SHfDtU7xYP90Vwm5vflHECf610KTdGvO53w==", "dev": true, + "workspaces": [ + "examples" + ], + "dependencies": { + "globals": "^13.23.0" + }, + "engines": { + "node": ">=16.6.0" + }, "peerDependencies": { - "eslint": ">=7", - "eslint-plugin-jest": ">=24" + "eslint": ">=8.40.0", + "eslint-plugin-jest": ">=25" }, "peerDependenciesMeta": { "eslint-plugin-jest": { @@ -4790,6 +4718,33 @@ } } }, + "node_modules/eslint-plugin-playwright/node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint-plugin-playwright/node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/eslint-plugin-prettier": { "version": "5.1.3", "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.1.3.tgz", @@ -5391,9 +5346,9 @@ } }, "node_modules/eventemitter3": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-1.2.0.tgz", - "integrity": "sha512-DOFqA1MF46fmZl2xtzXR3MPCRsXqgoFqdXcrCVYM3JNnfUeHTm/fh/v/iU7gBFpwkuBmoJPAm5GuhdDfSEJMJA==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", "dev": true }, "node_modules/events": { @@ -5699,9 +5654,9 @@ "dev": true }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "dependencies": { "to-regex-range": "^5.0.1" @@ -7270,12 +7225,6 @@ "graceful-fs": "^4.1.6" } }, - "node_modules/just-extend": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-6.2.0.tgz", - "integrity": "sha512-cYofQu2Xpom82S6qD778jBDpwvvy39s1l/hrYij2u9AMdQcGRpaBu6kY4mVhuno5kJVi1DAz4aiphA2WI1/OAw==", - "dev": true - }, "node_modules/karma": { "version": "6.4.2", "resolved": "https://registry.npmjs.org/karma/-/karma-6.4.2.tgz", @@ -7656,12 +7605,6 @@ "integrity": "sha512-uHaJFihxmJcEX3kT4I23ABqKKalJ/zDrDg0lsFtc1h+3uw49SIJ5beyhx5ExVRti3AvKoOJngIj7xz3oylPdWQ==", "dev": true }, - "node_modules/lodash.get": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", - "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==", - "dev": true - }, "node_modules/lodash.memoize": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", @@ -7778,15 +7721,12 @@ } }, "node_modules/magic-string": { - "version": "0.30.8", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.8.tgz", - "integrity": "sha512-ISQTe55T2ao7XtlAStud6qwYPZjE4GK1S/BeVPus4jrq6JuOnQ00YKQC581RWhR122W7msZV263KzVeLoqidyQ==", + "version": "0.30.10", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.10.tgz", + "integrity": "sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==", "dev": true, "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.15" - }, - "engines": { - "node": ">=12" } }, "node_modules/make-dir": { @@ -7881,12 +7821,12 @@ } }, "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", + "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", "dev": true, "dependencies": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" }, "engines": { @@ -8096,19 +8036,6 @@ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true }, - "node_modules/nise": { - "version": "5.1.9", - "resolved": "https://registry.npmjs.org/nise/-/nise-5.1.9.tgz", - "integrity": "sha512-qOnoujW4SV6e40dYxJOb3uvuoPHtmLzIk4TFo+j0jPJoC+5Z9xja5qH5JZobEPsa8+YYphMrOSwnrshEhG2qww==", - "dev": true, - "dependencies": { - "@sinonjs/commons": "^3.0.0", - "@sinonjs/fake-timers": "^11.2.2", - "@sinonjs/text-encoding": "^0.7.2", - "just-extend": "^6.2.0", - "path-to-regexp": "^6.2.1" - } - }, "node_modules/node-fetch": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", @@ -8836,33 +8763,33 @@ } }, "node_modules/playwright": { - "version": "1.42.1", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.42.1.tgz", - "integrity": "sha512-PgwB03s2DZBcNRoW+1w9E+VkLBxweib6KTXM0M3tkiT4jVxKSi6PmVJ591J+0u10LUrgxB7dLRbiJqO5s2QPMg==", + "version": "1.45.2", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.45.2.tgz", + "integrity": "sha512-ReywF2t/0teRvNBpfIgh5e4wnrI/8Su8ssdo5XsQKpjxJj+jspm00jSoz9BTg91TT0c9HRjXO7LBNVrgYj9X0g==", "dev": true, "dependencies": { - "playwright-core": "1.42.1" + "playwright-core": "1.45.2" }, "bin": { "playwright": "cli.js" }, "engines": { - "node": ">=16" + "node": ">=18" }, "optionalDependencies": { "fsevents": "2.3.2" } }, "node_modules/playwright-core": { - "version": "1.42.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.42.1.tgz", - "integrity": "sha512-mxz6zclokgrke9p1vtdy/COWBH+eOZgYUVVU34C73M+4j4HLlQJHtfcqiqqxpP0o8HhMkflvfbquLX5dg6wlfA==", + "version": "1.45.2", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.45.2.tgz", + "integrity": "sha512-ha175tAWb0dTK0X4orvBIqi3jGEt701SMxMhyujxNrgd8K0Uy5wMSwwcQHtyB4om7INUkfndx02XnQ2p6dvLDw==", "dev": true, "bin": { "playwright-core": "cli.js" }, "engines": { - "node": ">=16" + "node": ">=18" } }, "node_modules/playwright/node_modules/fsevents": { @@ -8901,9 +8828,9 @@ } }, "node_modules/postcss": { - "version": "8.4.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.35.tgz", - "integrity": "sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==", + "version": "8.4.38", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", + "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", "dev": true, "funding": [ { @@ -8922,7 +8849,7 @@ "dependencies": { "nanoid": "^3.3.7", "picocolors": "^1.0.0", - "source-map-js": "^1.0.2" + "source-map-js": "^1.2.0" }, "engines": { "node": "^10 || ^12 || >=14" @@ -10223,45 +10150,6 @@ "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true }, - "node_modules/sinon": { - "version": "17.0.0", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-17.0.0.tgz", - "integrity": "sha512-p4lJiYKBoOEVUxxVIC9H1MM2znG1/c8gud++I2BauJA5hsz7hHsst35eurNWXTusBsIq66FzOQbZ/uMdpvbPIQ==", - "dev": true, - "dependencies": { - "@sinonjs/commons": "^3.0.0", - "@sinonjs/fake-timers": "^11.2.2", - "@sinonjs/samsam": "^8.0.0", - "diff": "^5.1.0", - "nise": "^5.1.5", - "supports-color": "^7.2.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/sinon" - } - }, - "node_modules/sinon/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/sinon/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/slash": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz", @@ -10293,34 +10181,13 @@ } }, "node_modules/socket.io-adapter": { - "version": "2.5.4", - "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.4.tgz", - "integrity": "sha512-wDNHGXGewWAjQPt3pyeYBtpWSq9cLE5UW1ZUPL/2eGK9jtse/FpXib7epSTsz0Q0m+6sg6Y4KtcFTlah1bdOVg==", + "version": "2.5.5", + "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.5.tgz", + "integrity": "sha512-eLDQas5dzPgOWCk9GuuJC2lBqItuhKI4uxGgo9aIV7MYbk2h9Q6uULEh8WBzThoI7l+qU9Ast9fVUmkqPP9wYg==", "dev": true, "dependencies": { "debug": "~4.3.4", - "ws": "~8.11.0" - } - }, - "node_modules/socket.io-adapter/node_modules/ws": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz", - "integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==", - "dev": true, - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } + "ws": "~8.17.1" } }, "node_modules/socket.io-parser": { @@ -10366,9 +10233,9 @@ } }, "node_modules/source-map-js": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", - "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", + "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", "dev": true, "engines": { "node": ">=0.10.0" @@ -10988,15 +10855,6 @@ "node": ">= 0.8.0" } }, - "node_modules/type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/type-fest": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", @@ -11241,16 +11099,16 @@ "dev": true }, "node_modules/vue": { - "version": "3.4.19", - "resolved": "https://registry.npmjs.org/vue/-/vue-3.4.19.tgz", - "integrity": "sha512-W/7Fc9KUkajFU8dBeDluM4sRGc/aa4YJnOYck8dkjgZoXtVsn3OeTGni66FV1l3+nvPA7VBFYtPioaGKUmEADw==", + "version": "3.4.24", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.4.24.tgz", + "integrity": "sha512-NPdx7dLGyHmKHGRRU5bMRYVE+rechR+KDU5R2tSTNG36PuMwbfAJ+amEvOAw7BPfZp5sQulNELSLm5YUkau+Sg==", "dev": true, "dependencies": { - "@vue/compiler-dom": "3.4.19", - "@vue/compiler-sfc": "3.4.19", - "@vue/runtime-dom": "3.4.19", - "@vue/server-renderer": "3.4.19", - "@vue/shared": "3.4.19" + "@vue/compiler-dom": "3.4.24", + "@vue/compiler-sfc": "3.4.24", + "@vue/runtime-dom": "3.4.24", + "@vue/server-renderer": "3.4.24", + "@vue/shared": "3.4.24" }, "peerDependencies": { "typescript": "*" @@ -11440,59 +11298,59 @@ } }, "node_modules/vue/node_modules/@vue/compiler-core": { - "version": "3.4.19", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.4.19.tgz", - "integrity": "sha512-gj81785z0JNzRcU0Mq98E56e4ltO1yf8k5PQ+tV/7YHnbZkrM0fyFyuttnN8ngJZjbpofWE/m4qjKBiLl8Ju4w==", + "version": "3.4.24", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.4.24.tgz", + "integrity": "sha512-vbW/tgbwJYj62N/Ww99x0zhFTkZDTcGh3uwJEuadZ/nF9/xuFMC4693P9r+3sxGXISABpDKvffY5ApH9pmdd1A==", "dev": true, "dependencies": { - "@babel/parser": "^7.23.9", - "@vue/shared": "3.4.19", + "@babel/parser": "^7.24.4", + "@vue/shared": "3.4.24", "entities": "^4.5.0", "estree-walker": "^2.0.2", - "source-map-js": "^1.0.2" + "source-map-js": "^1.2.0" } }, "node_modules/vue/node_modules/@vue/compiler-dom": { - "version": "3.4.19", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.4.19.tgz", - "integrity": "sha512-vm6+cogWrshjqEHTzIDCp72DKtea8Ry/QVpQRYoyTIg9k7QZDX6D8+HGURjtmatfgM8xgCFtJJaOlCaRYRK3QA==", + "version": "3.4.24", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.4.24.tgz", + "integrity": "sha512-4XgABML/4cNndVsQndG6BbGN7+EoisDwi3oXNovqL/4jdNhwvP8/rfRMTb6FxkxIxUUtg6AI1/qZvwfSjxJiWA==", "dev": true, "dependencies": { - "@vue/compiler-core": "3.4.19", - "@vue/shared": "3.4.19" + "@vue/compiler-core": "3.4.24", + "@vue/shared": "3.4.24" } }, "node_modules/vue/node_modules/@vue/compiler-sfc": { - "version": "3.4.19", - "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.4.19.tgz", - "integrity": "sha512-LQ3U4SN0DlvV0xhr1lUsgLCYlwQfUfetyPxkKYu7dkfvx7g3ojrGAkw0AERLOKYXuAGnqFsEuytkdcComei3Yg==", + "version": "3.4.24", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.4.24.tgz", + "integrity": "sha512-nRAlJUK02FTWfA2nuvNBAqsDZuERGFgxZ8sGH62XgFSvMxO2URblzulExsmj4gFZ8e+VAyDooU9oAoXfEDNxTA==", "dev": true, "dependencies": { - "@babel/parser": "^7.23.9", - "@vue/compiler-core": "3.4.19", - "@vue/compiler-dom": "3.4.19", - "@vue/compiler-ssr": "3.4.19", - "@vue/shared": "3.4.19", + "@babel/parser": "^7.24.4", + "@vue/compiler-core": "3.4.24", + "@vue/compiler-dom": "3.4.24", + "@vue/compiler-ssr": "3.4.24", + "@vue/shared": "3.4.24", "estree-walker": "^2.0.2", - "magic-string": "^0.30.6", - "postcss": "^8.4.33", - "source-map-js": "^1.0.2" + "magic-string": "^0.30.10", + "postcss": "^8.4.38", + "source-map-js": "^1.2.0" } }, "node_modules/vue/node_modules/@vue/compiler-ssr": { - "version": "3.4.19", - "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.4.19.tgz", - "integrity": "sha512-P0PLKC4+u4OMJ8sinba/5Z/iDT84uMRRlrWzadgLA69opCpI1gG4N55qDSC+dedwq2fJtzmGald05LWR5TFfLw==", + "version": "3.4.24", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.4.24.tgz", + "integrity": "sha512-ZsAtr4fhaUFnVcDqwW3bYCSDwq+9Gk69q2r/7dAHDrOMw41kylaMgOP4zRnn6GIEJkQznKgrMOGPMFnLB52RbQ==", "dev": true, "dependencies": { - "@vue/compiler-dom": "3.4.19", - "@vue/shared": "3.4.19" + "@vue/compiler-dom": "3.4.24", + "@vue/shared": "3.4.24" } }, "node_modules/vue/node_modules/@vue/shared": { - "version": "3.4.19", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.19.tgz", - "integrity": "sha512-/KliRRHMF6LoiThEy+4c1Z4KB/gbPrGjWwJR+crg2otgrf/egKzRaCPvJ51S5oetgsgXLfc4Rm5ZgrKHZrtMSw==", + "version": "3.4.24", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.24.tgz", + "integrity": "sha512-BW4tajrJBM9AGAknnyEw5tO2xTmnqgup0VTnDAMcxYmqOX0RG0b9aSUGAbEKolD91tdwpA6oCwbltoJoNzpItw==", "dev": true }, "node_modules/watchpack": { @@ -12153,9 +12011,9 @@ } }, "node_modules/ws": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz", - "integrity": "sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", "dev": true, "engines": { "node": ">=10.0.0" @@ -12219,9 +12077,9 @@ "dev": true }, "node_modules/yaml": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.1.tgz", - "integrity": "sha512-pIXzoImaqmfOrL7teGUBt/T7ZDnyeGBWyXQBvOVhLkWLN37GXv8NMLK406UY6dS51JfcQHsmcW5cJ441bHg6Lg==", + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.5.tgz", + "integrity": "sha512-aBx2bnqDzVOyNKfsysjA2ms5ZlnjSAW2eG3/L5G/CSujfjLJTJsEw1bGw8kCf04KodQWk1pxlGnZ56CRxiawmg==", "dev": true, "bin": { "yaml": "bin.mjs" diff --git a/package.json b/package.json index 60852a235a..654ddac942 100644 --- a/package.json +++ b/package.json @@ -40,13 +40,13 @@ "eslint-config-prettier": "9.1.0", "eslint-plugin-compat": "4.2.0", "eslint-plugin-no-unsanitized": "4.0.2", - "eslint-plugin-playwright": "0.12.0", + "eslint-plugin-playwright": "1.5.2", "eslint-plugin-prettier": "5.1.3", "eslint-plugin-simple-import-sort": "10.0.0", "eslint-plugin-unicorn": "49.0.0", "eslint-plugin-vue": "9.22.0", "eslint-plugin-you-dont-need-lodash-underscore": "6.13.0", - "eventemitter3": "1.2.0", + "eventemitter3": "5.0.1", "file-saver": "2.0.5", "flatbush": "4.2.0", "git-rev-sync": "3.0.2", @@ -87,7 +87,7 @@ "tiny-emitter": "2.1.0", "typescript": "5.3.3", "uuid": "9.0.1", - "vue": "3.4.19", + "vue": "3.4.24", "vue-eslint-parser": "9.4.2", "vue-loader": "16.8.3", "webpack": "5.90.3", @@ -96,7 +96,7 @@ "webpack-merge": "5.10.0" }, "scripts": { - "clean": "rm -rf ./dist ./node_modules ./coverage ./html-test-results ./test-results ./.nyc_output", + "clean": "rm -rf ./dist ./node_modules ./coverage ./html-test-results ./e2e/test-results ./.nyc_output ./e2e/.nyc_output", "start": "npx webpack serve --config ./.webpack/webpack.dev.mjs", "start:prod": "npx webpack serve --config ./.webpack/webpack.prod.mjs", "start:coverage": "npx webpack serve --config ./.webpack/webpack.coverage.mjs", @@ -116,14 +116,13 @@ "test:e2e:a11y": "npm test --workspace e2e -- --config=playwright-visual-a11y.config.js --project=chrome --grep @a11y", "test:e2e:mobile": "npm test --workspace e2e -- --config=playwright-mobile.config.js", "test:e2e:couchdb": "npm test --workspace e2e -- --config=playwright-ci.config.js --project=chrome --grep @couchdb --workers=1", - "test:e2e:stable": "npm test --workspace e2e -- --config=playwright-ci.config.js --project=chrome --grep-invert \"@unstable|@couchdb|@generatedata\"", - "test:e2e:unstable": "npm test --workspace e2e -- --config=playwright-ci.config.js --project=chrome --grep @unstable", + "test:e2e:ci": "npm test --workspace e2e -- --config=playwright-ci.config.js --project=chrome --grep-invert \"@couchdb|@generatedata\"", "test:e2e:local": "npm test --workspace e2e -- --config=playwright-local.config.js --project=chrome", "test:e2e:generatedata": "npm test --workspace e2e -- --config=playwright-ci.config.js --project=chrome --grep @generatedata", "test:e2e:checksnapshots": "npm test --workspace e2e -- --config=playwright-ci.config.js --project=chrome --grep @snapshot --retries=0", "test:e2e:updatesnapshots": "npm test --workspace e2e -- --config=playwright-ci.config.js --project=chrome --grep @snapshot --update-snapshots", - "test:e2e:visual:ci": "npm run test:visual --workspace e2e -- --config .percy.ci.yml --partial -- npx playwright test --config=playwright-visual-a11y.config.js --project=chrome --grep-invert @unstable", - "test:e2e:visual:full": "npm run test:visual --workspace e2e -- --config .percy.nightly.yml -- npx playwright test --config=playwright-visual-a11y.config.js --grep-invert @unstable", + "test:e2e:visual:ci": "npm run test:visual --workspace e2e -- --config .percy.ci.yml --partial -- npx playwright test --config=playwright-visual-a11y.config.js --project=chrome", + "test:e2e:visual:full": "npm run test:visual --workspace e2e -- --config .percy.nightly.yml -- npx playwright test --config=playwright-visual-a11y.config.js", "test:e2e:full": "npm test --workspace e2e -- --config=playwright-ci.config.js --grep-invert @couchdb", "test:e2e:watch": "npm test --workspace e2e -- --ui --config=playwright-watch.config.js", "test:perf:contract": "npm test --workspace e2e -- --config=playwright-performance-dev.config.js", @@ -133,7 +132,7 @@ "update-copyright-date": "npm run update-about-dialog-copyright && grep -lr --null --include=*.{js,scss,vue,ts,sh,html,md,frag} 'Copyright (c) 20' . | xargs -r0 perl -pi -e 's/Copyright\\s\\(c\\)\\s20\\d\\d\\-20\\d\\d/Copyright \\(c\\)\\ 2014\\-2024/gm'", "cov:e2e:report": "nyc report --reporter=lcovonly --report-dir=./coverage/e2e", "cov:e2e:full:publish": "codecov --disable=gcov -f ./coverage/e2e/lcov.info -F e2e-full", - "cov:e2e:stable:publish": "codecov --disable=gcov -f ./coverage/e2e/lcov.info -F e2e-stable", + "cov:e2e:ci:publish": "codecov --disable=gcov -f ./coverage/e2e/lcov.info -F e2e-ci", "cov:unit:publish": "codecov --disable=gcov -f ./coverage/unit/lcov.info -F unit", "prepare": "npm run build:prod && npx tsc" }, @@ -161,4 +160,4 @@ "keywords": [ "nasa" ] -} \ No newline at end of file +} diff --git a/src/MCT.js b/src/MCT.js index 7ef8661a02..6c16c3e8c2 100644 --- a/src/MCT.js +++ b/src/MCT.js @@ -19,8 +19,7 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ -/* eslint-disable no-undef */ -import EventEmitter from 'EventEmitter'; +import { EventEmitter } from 'eventemitter3'; import { createApp, markRaw } from 'vue'; import ActionsAPI from './api/actions/ActionsAPI.js'; @@ -73,13 +72,27 @@ import Browse from './ui/router/Browse.js'; * The Open MCT application. This may be configured by installing plugins * or registering extensions before the application is started. * @constructor - * @memberof module:openmct - * @extends EventEmitter */ export class MCT extends EventEmitter { + /** + * @type {import('openmct.js').BuildInfo} + */ + buildInfo; + /** + * @type {string} + */ + defaultClock; + /** + * @type {Record} + */ + plugins; + /** + * Tracks current selection state of the application. + * @type {Selection} + */ + selection; constructor() { super(); - EventEmitter.call(this); this.buildInfo = { version: __OPENMCT_VERSION__, @@ -90,21 +103,11 @@ export class MCT extends EventEmitter { this.destroy = this.destroy.bind(this); this.defaultClock = 'local'; - this.plugins = plugins; - - /** - * Tracks current selection state of the application. - * @private - */ this.selection = new Selection(this); /** - * MCT's time conductor, which may be used to synchronize view contents - * for telemetry- or time-based views. - * @type {module:openmct.TimeConductor} - * @memberof module:openmct.MCT# - * @name conductor + * @type {TimeAPI} */ this.time = new TimeAPI(this); @@ -117,9 +120,7 @@ export class MCT extends EventEmitter { * `composition` may be called as a function, in which case it acts * as [`composition.get`]{@link module:openmct.CompositionAPI#get}. * - * @type {module:openmct.CompositionAPI} - * @memberof module:openmct.MCT# - * @name composition + * @type {CompositionAPI} */ this.composition = new CompositionAPI(this); @@ -127,9 +128,7 @@ export class MCT extends EventEmitter { * Registry for views of domain objects which should appear in the * main viewing area. * - * @type {module:openmct.ViewRegistry} - * @memberof module:openmct.MCT# - * @name objectViews + * @type {ViewRegistry} */ this.objectViews = new ViewRegistry(); @@ -137,9 +136,7 @@ export class MCT extends EventEmitter { * Registry for views which should appear in the Inspector area. * These views will be chosen based on the selection state. * - * @type {module:openmct.InspectorViewRegistry} - * @memberof module:openmct.MCT# - * @name inspectorViews + * @type {InspectorViewRegistry} */ this.inspectorViews = new InspectorViewRegistry(); @@ -148,9 +145,7 @@ export class MCT extends EventEmitter { * dialogs, and similar user interface elements used for * modifying domain objects external to its regular views. * - * @type {module:openmct.ViewRegistry} - * @memberof module:openmct.MCT# - * @name propertyEditors + * @type {ViewRegistry} */ this.propertyEditors = new ViewRegistry(); @@ -158,9 +153,7 @@ export class MCT extends EventEmitter { * Registry for views which should appear in the toolbar area while * editing. These views will be chosen based on the selection state. * - * @type {module:openmct.ToolbarRegistry} - * @memberof module:openmct.MCT# - * @name toolbars + * @type {ToolbarRegistry} */ this.toolbars = new ToolbarRegistry(); @@ -168,9 +161,7 @@ export class MCT extends EventEmitter { * Registry for domain object types which may exist within this * instance of Open MCT. * - * @type {module:openmct.TypeRegistry} - * @memberof module:openmct.MCT# - * @name types + * @type {TypeRegistry} */ this.types = new TypeRegistry(); @@ -178,9 +169,7 @@ export class MCT extends EventEmitter { * An interface for interacting with domain objects and the domain * object hierarchy. * - * @type {module:openmct.ObjectAPI} - * @memberof module:openmct.MCT# - * @name objects + * @type {ObjectAPI} */ this.objects = new ObjectAPI(this.types, this); @@ -188,49 +177,100 @@ export class MCT extends EventEmitter { * An interface for retrieving and interpreting telemetry data associated * with a domain object. * - * @type {module:openmct.TelemetryAPI} - * @memberof module:openmct.MCT# - * @name telemetry + * @type {TelemetryAPI} */ this.telemetry = new TelemetryAPI(this); /** * An interface for creating new indicators and changing them dynamically. * - * @type {module:openmct.IndicatorAPI} - * @memberof module:openmct.MCT# - * @name indicators + * @type {IndicatorAPI} */ this.indicators = new IndicatorAPI(this); /** * MCT's user awareness management, to enable user and * role specific functionality. - * @type {module:openmct.UserAPI} - * @memberof module:openmct.MCT# - * @name user + * @type {UserAPI} */ this.user = new UserAPI(this); + /** + * An interface for managing notifications and alerts. + * @type {NotificationAPI} + */ this.notifications = new NotificationAPI(); + + /** + * An interface for editing domain objects. + * @type {EditorAPI} + */ this.editor = new EditorAPI(this); + + /** + * An interface for managing overlays. + * @type {OverlayAPI} + */ this.overlays = new OverlayAPI(); + + /** + * An interface for managing tooltips. + * @type {ToolTipAPI} + */ this.tooltips = new ToolTipAPI(); + + /** + * An interface for managing menus. + * @type {MenuAPI} + */ this.menus = new MenuAPI(this); + + /** + * An interface for managing menu actions. + * @type {ActionsAPI} + */ this.actions = new ActionsAPI(this); + + /** + * An interface for managing statuses. + * @type {StatusAPI} + */ this.status = new StatusAPI(this); + + /** + * An object defining constants for priority levels. + * @type {PriorityAPI} + */ this.priority = PriorityAPI; + + /** + * An interface for routing application traffic. + * @type {ApplicationRouter} + */ this.router = new ApplicationRouter(this); + + /** + * An interface for managing faults. + * @type {FaultManagementAPI} + */ this.faults = new FaultManagementAPI(this); + + /** + * An interface for managing forms. + * @type {FormsAPI} + */ this.forms = new FormsAPI(this); + + /** + * An interface for branding the application. + * @type {BrandingAPI} + */ this.branding = BrandingAPI; /** * MCT's annotation API that enables * human-created comments and categorization linked to data products - * @type {module:openmct.AnnotationAPI} - * @memberof module:openmct.MCT# - * @name annotation + * @type {AnnotationAPI} */ this.annotation = new AnnotationAPI(this); @@ -269,7 +309,6 @@ export class MCT extends EventEmitter { } /** * Set path to where assets are hosted. This should be the path to main.js. - * @memberof module:openmct.MCT# * @method setAssetPath */ setAssetPath(assetPath) { @@ -277,7 +316,6 @@ export class MCT extends EventEmitter { } /** * Get path to where assets are hosted. - * @memberof module:openmct.MCT# * @method getAssetPath */ getAssetPath() { @@ -296,9 +334,8 @@ export class MCT extends EventEmitter { * Start running Open MCT. This should be called only after any plugins * have been installed. * @fires module:openmct.MCT~start - * @memberof module:openmct.MCT# * @method start - * @param {HTMLElement} [domElement] the DOM element in which to run + * @param {Element?} domElement the DOM element in which to run * MCT; if undefined, MCT will be run in the body of the document */ start(domElement = document.body.firstElementChild, isHeadlessMode = false) { @@ -331,7 +368,6 @@ export class MCT extends EventEmitter { * Fired by [MCT]{@link module:openmct.MCT} when the application * is started. * @event start - * @memberof module:openmct.MCT~ */ if (!isHeadlessMode) { const appLayout = createApp(Layout); @@ -362,7 +398,6 @@ export class MCT extends EventEmitter { * * @param {Function} plugin a plugin install function which will be * invoked with the mct instance. - * @memberof module:openmct.MCT# */ install(plugin) { plugin(this); @@ -371,6 +406,9 @@ export class MCT extends EventEmitter { destroy() { window.removeEventListener('beforeunload', this.destroy); this.emit('destroy'); - this.router.destroy(); } } + +/** + * @typedef {import('../openmct.js').OpenMCTPlugin} OpenMCTPlugin + */ diff --git a/src/api/Editor.js b/src/api/Editor.js index 218ec4dd04..7bf981e179 100644 --- a/src/api/Editor.js +++ b/src/api/Editor.js @@ -20,7 +20,7 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -import EventEmitter from 'EventEmitter'; +import { EventEmitter } from 'eventemitter3'; export default class Editor extends EventEmitter { constructor(openmct) { diff --git a/src/api/actions/ActionCollection.js b/src/api/actions/ActionCollection.js index d099edb25d..73a1d690ee 100644 --- a/src/api/actions/ActionCollection.js +++ b/src/api/actions/ActionCollection.js @@ -20,10 +20,22 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -import EventEmitter from 'EventEmitter'; +import { EventEmitter } from 'eventemitter3'; import _ from 'lodash'; +/** + * A collection of actions applicable to a domain object. + * @extends EventEmitter + */ class ActionCollection extends EventEmitter { + /** + * Creates an instance of ActionCollection. + * @param {Object.} applicableActions - The actions applicable to the domain object. + * @param {import('openmct').ObjectPath} objectPath - The path to the domain object. + * @param {import('openmct').View} view - The view displaying the domain object. + * @param {import('openmct').OpenMCT} openmct - The Open MCT API. + * @param {boolean} skipEnvironmentObservers - Whether to skip setting up environment observers. + */ constructor(applicableActions, objectPath, view, openmct, skipEnvironmentObservers) { super(); @@ -48,6 +60,10 @@ class ActionCollection extends EventEmitter { } } + /** + * Disables the specified actions. + * @param {string[]} actionKeys - The keys of the actions to disable. + */ disable(actionKeys) { actionKeys.forEach((actionKey) => { if (this.applicableActions[actionKey]) { @@ -57,6 +73,10 @@ class ActionCollection extends EventEmitter { this._update(); } + /** + * Enables the specified actions. + * @param {string[]} actionKeys - The keys of the actions to enable. + */ enable(actionKeys) { actionKeys.forEach((actionKey) => { if (this.applicableActions[actionKey]) { @@ -66,6 +86,10 @@ class ActionCollection extends EventEmitter { this._update(); } + /** + * Hides the specified actions. + * @param {string[]} actionKeys - The keys of the actions to hide. + */ hide(actionKeys) { actionKeys.forEach((actionKey) => { if (this.applicableActions[actionKey]) { @@ -75,6 +99,10 @@ class ActionCollection extends EventEmitter { this._update(); } + /** + * Shows the specified actions. + * @param {string[]} actionKeys - The keys of the actions to show. + */ show(actionKeys) { actionKeys.forEach((actionKey) => { if (this.applicableActions[actionKey]) { @@ -84,6 +112,9 @@ class ActionCollection extends EventEmitter { this._update(); } + /** + * Destroys the action collection, removing all listeners and observers. + */ destroy() { if (!this.skipEnvironmentObservers) { this.objectUnsubscribes.forEach((unsubscribe) => { @@ -97,6 +128,10 @@ class ActionCollection extends EventEmitter { this.removeAllListeners(); } + /** + * Gets all visible actions. + * @returns {Action[]} An array of visible actions. + */ getVisibleActions() { let actionsArray = Object.keys(this.applicableActions); let visibleActions = []; @@ -112,6 +147,10 @@ class ActionCollection extends EventEmitter { return visibleActions; } + /** + * Gets all actions that should be shown in the status bar. + * @returns {Action[]} An array of status bar actions. + */ getStatusBarActions() { let actionsArray = Object.keys(this.applicableActions); let statusBarActions = []; @@ -127,17 +166,34 @@ class ActionCollection extends EventEmitter { return statusBarActions; } + /** + * Gets the object containing all applicable actions. + * @returns {Object.} The object of applicable actions. + */ getActionsObject() { return this.applicableActions; } + /** + * Emits an update event with the current applicable actions. + * @private + */ _update() { this.emit('update', this.applicableActions); } + /** + * Sets up observers for the object path. + * @private + */ _observeObjectPath() { let actionCollection = this; + /** + * Updates an object with new properties. + * @param {Object} oldObject - The object to update. + * @param {Object} newObject - The object containing new properties. + */ function updateObject(oldObject, newObject) { Object.assign(oldObject, newObject); @@ -157,6 +213,10 @@ class ActionCollection extends EventEmitter { }); } + /** + * Updates the applicable actions. + * @private + */ _updateActions() { let newApplicableActions = this.openmct.actions._applicableActions(this.objectPath, this.view); @@ -167,6 +227,13 @@ class ActionCollection extends EventEmitter { this._update(); } + /** + * Merges old and new actions, preserving existing action states. + * @param {Object.} oldActions - The existing actions. + * @param {Object.} newActions - The new actions. + * @returns {Object.} The merged actions. + * @private + */ _mergeOldAndNewActions(oldActions, newActions) { let mergedActions = {}; Object.keys(newActions).forEach((key) => { @@ -182,3 +249,7 @@ class ActionCollection extends EventEmitter { } export default ActionCollection; + +/** + * @typedef {import('openmct').Action} Action + */ diff --git a/src/api/actions/ActionsAPI.js b/src/api/actions/ActionsAPI.js index fdb984a328..9ca37194f6 100644 --- a/src/api/actions/ActionsAPI.js +++ b/src/api/actions/ActionsAPI.js @@ -19,19 +19,30 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ -import EventEmitter from 'EventEmitter'; +import { EventEmitter } from 'eventemitter3'; import _ from 'lodash'; import ActionCollection from './ActionCollection.js'; +/** + * The ActionsAPI manages the registration and retrieval of actions in Open MCT. + * @extends EventEmitter + */ class ActionsAPI extends EventEmitter { + /** + * @param {import('openmct').OpenMCT} openmct - The Open MCT instance + */ constructor(openmct) { super(); + /** @type {Object} */ this._allActions = {}; + /** @type {WeakMap} */ this._actionCollections = new WeakMap(); + /** @type {import('openmct').OpenMCT} */ this._openmct = openmct; + /** @type {string[]} */ this._groupOrder = ['windowing', 'undefined', 'view', 'action', 'export', 'import']; this.register = this.register.bind(this); @@ -40,14 +51,29 @@ class ActionsAPI extends EventEmitter { this._updateCachedActionCollections = this._updateCachedActionCollections.bind(this); } + /** + * Register an action with the API. + * @param {Action} actionDefinition - The definition of the action to register + */ register(actionDefinition) { this._allActions[actionDefinition.key] = actionDefinition; } + /** + * Get an action by its key. + * @param {string} key - The key of the action to retrieve + * @returns {Action|undefined} The action definition, or undefined if not found + */ getAction(key) { return this._allActions[key]; } + /** + * Get or create an ActionCollection for a given object path and view. + * @param {import('openmct').ObjectPath} objectPath - The path of the object + * @param {import('openmct').View} [view] - The view object + * @returns {ActionCollection} The ActionCollection for the given object path and view + */ getActionsCollection(objectPath, view) { if (view) { return ( @@ -59,14 +85,31 @@ class ActionsAPI extends EventEmitter { } } + /** + * Update the order in which action groups are displayed. + * @param {string[]} groupArray - An array of group names in the desired order + */ updateGroupOrder(groupArray) { this._groupOrder = groupArray; } + /** + * Get a cached ActionCollection for a given view. + * @param {import('openmct').ObjectPath} objectPath - The path of the object + * @param {Object} view - The view object + * @returns {ActionCollection|undefined} The cached ActionCollection, or undefined if not found + */ _getCachedActionCollection(objectPath, view) { return this._actionCollections.get(view); } + /** + * Create a new ActionCollection. + * @param {import('openmct').ObjectPath} objectPath - The path of the object + * @param {import('openmct').View} [view] - The view object + * @param {boolean} skipEnvironmentObservers - Whether to skip environment observers + * @returns {ActionCollection} The new ActionCollection + */ _newActionCollection(objectPath, view, skipEnvironmentObservers) { let applicableActions = this._applicableActions(objectPath, view); @@ -84,20 +127,35 @@ class ActionsAPI extends EventEmitter { return actionCollection; } + /** + * Cache an ActionCollection for a given view. + * @param {import('openmct').View} view - The view object + * @param {ActionCollection} actionCollection - The ActionCollection to cache + */ _cacheActionCollection(view, actionCollection) { this._actionCollections.set(view, actionCollection); actionCollection.on('destroy', this._updateCachedActionCollections); } - _updateCachedActionCollections(key) { - if (this._actionCollections.has(key)) { - let actionCollection = this._actionCollections.get(key); + /** + * Update cached ActionCollections when destroyed. + * @param {import('openmct').View} view - The key (View object)of the destroyed ActionCollection + */ + _updateCachedActionCollections(view) { + if (this._actionCollections.has(view)) { + let actionCollection = this._actionCollections.get(view); actionCollection.off('destroy', this._updateCachedActionCollections); delete actionCollection.applicableActions; - this._actionCollections.delete(key); + this._actionCollections.delete(view); } } + /** + * Get applicable actions for a given object path and view. + * @param {import('openmct').ObjectPath} objectPath - The path of the object + * @param {import('openmct').View} [view] - The view object + * @returns {Object} A dictionary of applicable actions keyed by action key + */ _applicableActions(objectPath, view) { let actionsObject = {}; @@ -120,6 +178,11 @@ class ActionsAPI extends EventEmitter { return actionsObject; } + /** + * Group and sort actions based on their group and priority. + * @param {Action[]|Object} actionsArray - An array or object of actions to group and sort + * @returns {Action[][]} An array of grouped and sorted action arrays + */ _groupAndSortActions(actionsArray = []) { if (!Array.isArray(actionsArray) && typeof actionsArray === 'object') { actionsArray = Object.keys(actionsArray).map((key) => actionsArray[key]); @@ -153,3 +216,19 @@ class ActionsAPI extends EventEmitter { } export default ActionsAPI; + +/** + * @typedef {Object} Action + * @property {string} name - The display name of the action. + * @property {string} key - A unique identifier for the action. + * @property {string} description - A brief description of what the action does. + * @property {string} cssClass - The CSS class for the action's icon. + * @property {string} [group] - The group this action belongs to (e.g., 'action', 'import'). + * @property {number} [priority] - The priority of the action within its group (controls the order of the actions in the menu). + * @property {boolean} [isHidden] - Whether the action should be hidden from menus. + * @property {(objectPath: ObjectPath, view: View) => void} invoke - Executes the action. + * @property {(objectPath: ObjectPath, view: View) => boolean} appliesTo - Determines if the action is applicable to the given object path. + */ + +/** @typedef {import('openmct').ObjectPath} ObjectPath */ +/** @typedef {import('openmct').View} View */ diff --git a/src/api/annotation/AnnotationAPI.js b/src/api/annotation/AnnotationAPI.js index 7f2ba5a99e..3ca5889b1b 100644 --- a/src/api/annotation/AnnotationAPI.js +++ b/src/api/annotation/AnnotationAPI.js @@ -20,7 +20,7 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -import EventEmitter from 'EventEmitter'; +import { EventEmitter } from 'eventemitter3'; import _ from 'lodash'; import { v4 as uuid } from 'uuid'; @@ -41,8 +41,14 @@ const ANNOTATION_TYPES = Object.freeze({ PLOT_SPATIAL: 'PLOT_SPATIAL' }); +/** + * @type {string} + */ const ANNOTATION_TYPE = 'annotation'; +/** + * @type {string} + */ const ANNOTATION_LAST_CREATED = 'annotationLastCreated'; /** @@ -53,15 +59,15 @@ const ANNOTATION_LAST_CREATED = 'annotationLastCreated'; */ /** - * @typedef {import('../objects/ObjectAPI').DomainObject} DomainObject + * @typedef {import('openmct').DomainObject} DomainObject */ /** - * @typedef {import('../objects/ObjectAPI').Identifier} Identifier + * @typedef {import('openmct').Identifier} Identifier */ /** - * @typedef {import('../../../openmct').OpenMCT} OpenMCT + * @typedef {import('openmct').OpenMCT} OpenMCT */ /** @@ -73,7 +79,8 @@ const ANNOTATION_LAST_CREATED = 'annotationLastCreated'; * about rationals behind why the robot has taken a certain path. * Annotations are discoverable using search, and are typically rendered in OpenMCT views to bring attention * to other users. - * @constructor + * @class AnnotationAPI + * @extends {EventEmitter} */ export default class AnnotationAPI extends EventEmitter { /** @type {Map boolean >>} */ @@ -120,10 +127,9 @@ export default class AnnotationAPI extends EventEmitter { * @property {Array} targets The targets ID keystrings and their specific properties. * For plots, this will be a bounding box, e.g.: {keyString: "d8385009-789d-457b-acc7-d50ba2fd55ea", maxY: 100, minY: 0, maxX: 100, minX: 0} * For notebooks, this will be an entry ID, e.g.: {entryId: "entry-ecb158f5-d23c-45e1-a704-649b382622ba"} - * @property {DomainObject>[]} targetDomainObjects the domain objects this annotation points to (e.g., telemetry objects for a plot) + * @property {DomainObject[]} targetDomainObjects the domain objects this annotation points to (e.g., telemetry objects for a plot) */ /** - * @method create * @param {CreateAnnotationOptions} options * @returns {Promise} a promise which will resolve when the domain object * has been created, or be rejected if it cannot be saved @@ -195,6 +201,10 @@ export default class AnnotationAPI extends EventEmitter { } } + /** + * Updates the annotation modified timestamp for a target domain object + * @param {DomainObject} targetDomainObject The target domain object to update + */ #updateAnnotationModified(targetDomainObject) { // As certain telemetry objects are immutable, we'll need to check here first // to see if we can add the annotation last created property. @@ -207,8 +217,8 @@ export default class AnnotationAPI extends EventEmitter { } /** - * @method defineTag - * @param {string} key a unique identifier for the tag + * Defines a new tag + * @param {string} tagKey a unique identifier for the tag * @param {Tag} tagsDefinition the definition of the tag to add */ defineTag(tagKey, tagsDefinition) { @@ -216,7 +226,7 @@ export default class AnnotationAPI extends EventEmitter { } /** - * @method setNamespaceToSaveAnnotations + * Sets the namespace to save new annotations to * @param {string} namespace the namespace to save new annotations to */ setNamespaceToSaveAnnotations(namespace) { @@ -224,7 +234,7 @@ export default class AnnotationAPI extends EventEmitter { } /** - * @method isAnnotation + * Checks if a domain object is an annotation * @param {DomainObject} domainObject the domainObject in question * @returns {boolean} Returns true if the domain object is an annotation */ @@ -233,7 +243,7 @@ export default class AnnotationAPI extends EventEmitter { } /** - * @method getAvailableTags + * Gets the available tags that have been loaded * @returns {Tag[]} Returns an array of the available tags that have been loaded */ getAvailableTags() { @@ -252,10 +262,10 @@ export default class AnnotationAPI extends EventEmitter { } /** - * @method getAnnotations + * Gets annotations for a given domain object identifier * @param {Identifier} domainObjectIdentifier - The domain object identifier to use to search for annotations. For example, a telemetry object identifier. - * @param {AbortSignal} abortSignal - An abort signal to cancel the search - * @returns {DomainObject[]} Returns an array of annotations that match the search query + * @param {AbortSignal} [abortSignal] - An abort signal to cancel the search + * @returns {Promise} Returns a promise that resolves to an array of annotations that match the search query */ async getAnnotations(domainObjectIdentifier, abortSignal = null) { const keyStringQuery = this.openmct.objects.makeKeyString(domainObjectIdentifier); @@ -273,8 +283,8 @@ export default class AnnotationAPI extends EventEmitter { } /** - * @method deleteAnnotations - * @param {DomainObject[]} existingAnnotation - An array of annotations to delete (set _deleted to true) + * Deletes (marks as deleted) the given annotations + * @param {DomainObject[]} annotations - An array of annotations to delete (set _deleted to true) */ deleteAnnotations(annotations) { if (!annotations) { @@ -289,7 +299,7 @@ export default class AnnotationAPI extends EventEmitter { } /** - * @method deleteAnnotations + * Undeletes (marks as not deleted) the given annotation * @param {DomainObject} annotation - An annotation to undelete (set _deleted to false) */ unDeleteAnnotation(annotation) { @@ -300,6 +310,12 @@ export default class AnnotationAPI extends EventEmitter { this.openmct.objects.mutate(annotation, '_deleted', false); } + /** + * Gets tags from the given annotations + * @param {DomainObject[]} annotations - The annotations to get tags from + * @param {boolean} [filterDuplicates=true] - Whether to filter out duplicate tags + * @returns {Tag[]} An array of tags from the given annotations + */ getTagsFromAnnotations(annotations, filterDuplicates = true) { if (!annotations) { return []; @@ -324,6 +340,11 @@ export default class AnnotationAPI extends EventEmitter { return fullTagModels; } + /** + * Adds meta information to the given tags + * @param {string[]} tags - The tags to add meta information to + * @returns {Tag[]} An array of tags with meta information added + */ #addTagMetaInformationToTags(tags) { // Convert to Set and back to Array to remove duplicates const uniqueTags = [...new Set(tags)]; @@ -336,6 +357,11 @@ export default class AnnotationAPI extends EventEmitter { }); } + /** + * Gets tags that match the given query + * @param {string} query - The query to match tags against + * @returns {string[]} An array of tag keys that match the query + */ #getMatchingTags(query) { if (!query) { return []; @@ -352,6 +378,88 @@ export default class AnnotationAPI extends EventEmitter { return matchingTags; } + /** + * @typedef {Object} AnnotationTarget + * @property {string} keyString - The key string of the target + * @property {*} [additionalProperties] - Additional properties depending on the annotation type + */ + + /** + * @typedef {Object} TargetModel + * @property {import('openmct').DomainObject[]} originalPath - The original path of the target object + * @property {*} [additionalProperties] - Additional properties of the target domain object + */ + + /** + * @typedef {Object} AnnotationResult + * @property {string} name - The name of the annotation + * @property {string} type - The type of the object (always 'annotation') + * @property {{key: string, namespace: string}} identifier - The identifier of the annotation + * @property {string[]} tags - Array of tag keys associated with the annotation + * @property {boolean} _deleted - Whether the annotation is marked as deleted + * @property {ANNOTATION_TYPES} annotationType - The type of the annotation + * @property {string} contentText - The text content of the annotation + * @property {string} originalContextPath - The original context path of the annotation + * @property {AnnotationTarget[]} targets - Array of targets for the annotation + * @property {Tag[]} fullTagModels - Full tag models including metadata + * @property {string[]} matchingTagKeys - Array of tag keys that matched the search query + * @property {TargetModel[]} targetModels - Array of target models with additional information + */ + + /** + * Combines annotations with the same targets + * @param {AnnotationResult[]} results - The results to combine + * @returns {AnnotationResult[]} The combined results + */ + #combineSameTargets(results) { + const combinedResults = []; + results.forEach((currentAnnotation) => { + const existingAnnotation = combinedResults.find((annotationToFind) => { + const { annotationType, targets } = currentAnnotation; + return this.areAnnotationTargetsEqual(annotationType, targets, annotationToFind.targets); + }); + if (!existingAnnotation) { + combinedResults.push(currentAnnotation); + } else { + existingAnnotation.tags.push(...currentAnnotation.tags); + } + }); + + return combinedResults; + } + + /** + * Breaks apart annotations with multiple targets into separate results + * @param {AnnotationResult[]} results - The results to break apart + * @returns {AnnotationResult[]} The separated results + */ + #breakApartSeparateTargets(results) { + const separateResults = []; + results.forEach((result) => { + result.targets.forEach((target) => { + const targetID = target.keyString; + const separatedResult = { + ...result + }; + separatedResult.targets = [target]; + separatedResult.targetModels = result.targetModels.filter((targetModel) => { + const targetKeyString = this.openmct.objects.makeKeyString(targetModel.identifier); + + return targetKeyString === targetID; + }); + separateResults.push(separatedResult); + }); + }); + + return separateResults; + } + + /** + * Adds tag meta information to the given results + * @param {AnnotationResult[]} results - The results to add tag meta information to + * @param {string[]} matchingTagKeys - The matching tag keys + * @returns {AnnotationResult[]} The results with tag meta information added + */ #addTagMetaInformationToResults(results, matchingTagKeys) { const tagsAddedToResults = results.map((result) => { const fullTagModels = this.#addTagMetaInformationToTags(result.tags); @@ -366,6 +474,12 @@ export default class AnnotationAPI extends EventEmitter { return tagsAddedToResults; } + /** + * Adds target models to the results + * @param {AnnotationResult[]} results - The results to add target models to + * @param {AbortSignal} abortSignal - The abort signal + * @returns {Promise} The results with target models added + */ async #addTargetModelsToResults(results, abortSignal) { const modelAddedToResults = await Promise.all( results.map(async (result) => { @@ -397,54 +511,11 @@ export default class AnnotationAPI extends EventEmitter { return modelAddedToResults; } - #combineSameTargets(results) { - const combinedResults = []; - results.forEach((currentAnnotation) => { - const existingAnnotation = combinedResults.find((annotationToFind) => { - const { annotationType, targets } = currentAnnotation; - return this.areAnnotationTargetsEqual(annotationType, targets, annotationToFind.targets); - }); - if (!existingAnnotation) { - combinedResults.push(currentAnnotation); - } else { - existingAnnotation.tags.push(...currentAnnotation.tags); - } - }); - - return combinedResults; - } - /** - * @method #breakApartSeparateTargets - * @param {Array} results A set of search results that could have the multiple targets for the same result - * @returns {Array} The same set of results, but with each target separated out into its own result - */ - #breakApartSeparateTargets(results) { - const separateResults = []; - results.forEach((result) => { - result.targets.forEach((target) => { - const targetID = target.keyString; - const separatedResult = { - ...result - }; - separatedResult.targets = [target]; - separatedResult.targetModels = result.targetModels.filter((targetModel) => { - const targetKeyString = this.openmct.objects.makeKeyString(targetModel.identifier); - - return targetKeyString === targetID; - }); - separateResults.push(separatedResult); - }); - }); - - return separateResults; - } - - /** - * @method searchForTags - * @param {string} query A query to match against tags. E.g., "dr" will match the tags "drilling" and "driving" - * @param {Object} [abortController] An optional abort method to stop the query - * @returns {Promise} returns a model of matching tags with their target domain objects attached + * Searches for tags matching the given query + * @param {string} query - A query to match against tags + * @param {AbortSignal} [abortSignal] - An optional abort signal to stop the query + * @returns {Promise} A promise that resolves to an array of matching annotation results */ async searchForTags(query, abortSignal) { const matchingTagKeys = this.#getMatchingTags(query); diff --git a/src/api/composition/CompositionAPI.js b/src/api/composition/CompositionAPI.js index 3420e94c0f..cfe3f8ab7f 100644 --- a/src/api/composition/CompositionAPI.js +++ b/src/api/composition/CompositionAPI.js @@ -28,7 +28,7 @@ import DefaultCompositionProvider from './DefaultCompositionProvider.js'; */ /** - * @typedef {import('../objects/ObjectAPI').DomainObject} DomainObject + * @typedef {import('openmct').DomainObject} DomainObject */ /** @@ -72,7 +72,7 @@ export default class CompositionAPI { * * @method get * @param {DomainObject} domainObject - * @returns {CompositionCollection} + * @returns {CompositionCollection | undefined} */ get(domainObject) { const provider = this.registry.find((p) => { diff --git a/src/api/composition/CompositionCollection.js b/src/api/composition/CompositionCollection.js index 6699845059..e4da621344 100644 --- a/src/api/composition/CompositionCollection.js +++ b/src/api/composition/CompositionCollection.js @@ -21,7 +21,7 @@ *****************************************************************************/ /** - * @typedef {import('../objects/ObjectAPI').DomainObject} DomainObject + * @typedef {import('openmct').DomainObject} DomainObject */ /** @@ -200,10 +200,9 @@ export default class CompositionCollection { /** * Load the domain objects in this composition. * - * @param {AbortSignal} abortSignal + * @param {AbortSignal} [abortSignal] * @returns {Promise.>} a promise for * the domain objects in this composition - * @memberof {module:openmct.CompositionCollection#} * @name load */ async load(abortSignal) { @@ -280,7 +279,7 @@ export default class CompositionCollection { /** * Handle adds from provider. * @private - * @param {import('../objects/ObjectAPI').Identifier} childId + * @param {import('openmct').Identifier} childId * @returns {DomainObject} */ #onProviderAdd(childId) { diff --git a/src/api/composition/CompositionProvider.js b/src/api/composition/CompositionProvider.js index ec68648a68..c663352198 100644 --- a/src/api/composition/CompositionProvider.js +++ b/src/api/composition/CompositionProvider.js @@ -24,11 +24,11 @@ import _ from 'lodash'; import { makeKeyString, parseKeyString } from '../objects/object-utils.js'; /** - * @typedef {import('../objects/ObjectAPI').DomainObject} DomainObject + * @typedef {import('openmct').DomainObject} DomainObject */ /** - * @typedef {import('../objects/ObjectAPI').Identifier} Identifier + * @typedef {import('openmct').Identifier} Identifier */ /** @@ -36,7 +36,7 @@ import { makeKeyString, parseKeyString } from '../objects/object-utils.js'; */ /** - * @typedef {import('../../../openmct').OpenMCT} OpenMCT + * @typedef {import('openmct').OpenMCT} OpenMCT */ /** @@ -84,7 +84,7 @@ export default class CompositionProvider { * Check if this provider should be used to load composition for a * particular domain object. * @method appliesTo - * @param {import('../objects/ObjectAPI').DomainObject} domainObject the domain object + * @param {DomainObject} domainObject the domain object * to check * @returns {boolean} true if this provider can provide composition for a given domain object */ @@ -98,7 +98,6 @@ export default class CompositionProvider { * for which to load composition * @returns {Promise} a promise for * the Identifiers in this composition - * @method load */ load(domainObject) { throw new Error('This method must be implemented by a subclass.'); @@ -137,7 +136,6 @@ export default class CompositionProvider { * @param {DomainObject} domainObject the domain object * which should have its composition modified * @param {Identifier} childId the domain object to remove - * @method remove */ remove(domainObject, childId) { throw new Error('This method must be implemented by a subclass.'); @@ -151,7 +149,6 @@ export default class CompositionProvider { * @param {DomainObject} parent the domain object * which should have its composition modified * @param {Identifier} childId the domain object to add - * @method add */ add(parent, childId) { throw new Error('This method must be implemented by a subclass.'); @@ -179,7 +176,6 @@ export default class CompositionProvider { /** * Listens on general mutation topic, using injector to fetch to avoid * circular dependencies. - * @private */ #establishTopicListener() { if (this.topicListener) { @@ -194,7 +190,6 @@ export default class CompositionProvider { } /** - * @private * @param {DomainObject} parent * @param {DomainObject} child * @returns {boolean} @@ -207,7 +202,6 @@ export default class CompositionProvider { } /** - * @private * @param {DomainObject} parent * @returns {boolean} */ @@ -219,7 +213,6 @@ export default class CompositionProvider { * Handles mutation events. If there are active listeners for the mutated * object, detects changes to composition and triggers necessary events. * - * @private * @param {DomainObject} oldDomainObject */ #onMutation(newDomainObject, oldDomainObject) { @@ -230,6 +223,10 @@ export default class CompositionProvider { return; } + if (oldDomainObject.composition === undefined || newDomainObject.composition === undefined) { + return; + } + const oldComposition = oldDomainObject.composition.map(makeKeyString); const newComposition = newDomainObject.composition.map(makeKeyString); diff --git a/src/api/composition/DefaultCompositionProvider.js b/src/api/composition/DefaultCompositionProvider.js index 05a6603505..91567c2fe8 100644 --- a/src/api/composition/DefaultCompositionProvider.js +++ b/src/api/composition/DefaultCompositionProvider.js @@ -25,11 +25,11 @@ import { makeKeyString } from '../objects/object-utils.js'; import CompositionProvider from './CompositionProvider.js'; /** - * @typedef {import('../objects/ObjectAPI').DomainObject} DomainObject + * @typedef {import('openmct').DomainObject} DomainObject */ /** - * @typedef {import('../objects/ObjectAPI').Identifier} Identifier + * @typedef {import('openmct').Identifier} Identifier */ /** diff --git a/src/api/faultmanagement/FaultManagementAPI.js b/src/api/faultmanagement/FaultManagementAPI.js index 3be3e3be71..07eef4f7cb 100644 --- a/src/api/faultmanagement/FaultManagementAPI.js +++ b/src/api/faultmanagement/FaultManagementAPI.js @@ -45,7 +45,7 @@ export default class FaultManagementAPI { } /** - * @param {import("../objects/ObjectAPI").DomainObject} domainObject + * @param {import('openmct').DomainObject} domainObject * @returns {Promise.} */ request(domainObject) { @@ -57,7 +57,7 @@ export default class FaultManagementAPI { } /** - * @param {import("../objects/ObjectAPI").DomainObject} domainObject + * @param {import('openmct').DomainObject} domainObject * @param {Function} callback * @returns {Function} unsubscribe */ diff --git a/src/api/forms/FormController.js b/src/api/forms/FormController.js index 4c946573c9..f69970c1dc 100644 --- a/src/api/forms/FormController.js +++ b/src/api/forms/FormController.js @@ -1,3 +1,25 @@ +/***************************************************************************** + * 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. + *****************************************************************************/ + import mount from 'utils/mount'; import AutoCompleteField from './components/controls/AutoCompleteField.vue'; @@ -11,6 +33,8 @@ import SelectField from './components/controls/SelectField.vue'; import TextAreaField from './components/controls/TextAreaField.vue'; import TextField from './components/controls/TextField.vue'; import ToggleSwitchField from './components/controls/ToggleSwitchField.vue'; + +/** @type {Record} */ export const DEFAULT_CONTROLS_MAP = { autocomplete: AutoCompleteField, checkbox: CheckBoxField, @@ -26,6 +50,12 @@ export const DEFAULT_CONTROLS_MAP = { }; export default class FormControl { + /** @type {Record} */ + controls; + + /** + * @param {OpenMCT} openmct + */ constructor(openmct) { this.openmct = openmct; this.controls = {}; @@ -33,6 +63,10 @@ export default class FormControl { this._addDefaultFormControls(); } + /** + * @param {string} controlName + * @param {ControlViewProvider} controlViewProvider + */ addControl(controlName, controlViewProvider) { const control = this.controls[controlName]; if (control) { @@ -44,6 +78,10 @@ export default class FormControl { this.controls[controlName] = controlViewProvider; } + /** + * @param {string} controlName + * @returns {ControlViewProvider | undefined} + */ getControl(controlName) { const control = this.controls[controlName]; if (!control) { @@ -65,6 +103,8 @@ export default class FormControl { /** * @private + * @param {string} control + * @returns {ControlViewProvider} */ _getControlViewProvider(control) { const self = this; @@ -106,3 +146,13 @@ export default class FormControl { }; } } + +/** + * @typedef {import('openmct')} OpenMCT + */ + +/** + * @typedef {Object} ControlViewProvider + * @property {(element: HTMLElement, model: any, onChange: Function) => any} show + * @property {() => void} destroy + */ diff --git a/src/api/forms/FormsAPI.js b/src/api/forms/FormsAPI.js index f43c18b625..aba7b32286 100644 --- a/src/api/forms/FormsAPI.js +++ b/src/api/forms/FormsAPI.js @@ -26,7 +26,14 @@ import mount from 'utils/mount'; import FormProperties from './components/FormProperties.vue'; import FormController from './FormController.js'; +/** + * The FormsAPI provides methods for creating and managing forms in Open MCT. + */ export default class FormsAPI { + /** + * Creates an instance of FormsAPI. + * @param {import('openmct').OpenMCT} openmct - The Open MCT API + */ constructor(openmct) { this.openmct = openmct; this.formController = new FormController(openmct); @@ -47,7 +54,6 @@ export default class FormsAPI { * Create a new form control definition with a formControlViewProvider * this formControlViewProvider is used inside form overlay to show/render a form row * - * @public * @param {string} controlName a form structure, array of section * @param {ControlViewProvider} controlViewProvider */ @@ -58,7 +64,6 @@ export default class FormsAPI { /** * Get a ControlViewProvider for a given/stored form controlName * - * @public * @param {string} controlName a form structure, array of section * @return {ControlViewProvider} */ @@ -80,20 +85,20 @@ export default class FormsAPI { * @property {string} control represents type of row to render * eg:autocomplete,composite,datetime,file-input,locator,numberfield,select,textarea,textfield * @property {string} cssClass class name for styling this row - * @property {module:openmct.DomainObject} domainObject object to be used by row + * @property {import('openmct').DomainObject} domainObject object to be used by row * @property {string} key id for this row * @property {string} name Name of the row to display on Form - * @property {module:openmct.DomainObject} parent parent object to be used by row + * @property {import('openmct').DomainObject} parent parent object to be used by row * @property {boolean} required is this row mandatory * @property {function} validate a function to validate this row on any changes */ /** * Show form inside an Overlay dialog with given form structure - * @public * @param {Array
} formStructure a form structure, array of section * @param {Object} options - * @property {function} onChange a callback function when any changes detected + * @param {() => void} [options.onChange] a callback function when any changes detected + * @returns {Promise} A promise that resolves with the form data when saved, or rejects when cancelled */ showForm(formStructure, { onChange } = {}) { let overlay; @@ -134,11 +139,11 @@ export default class FormsAPI { /** * Show form as a child of the element provided with given form structure * - * @public * @param {Array
} formStructure a form structure, array of section * @param {Object} options - * @property {HTMLElement} element Parent Element to render a Form - * @property {function} onChange a callback function when any changes detected + * @param {HTMLElement} options.element Parent Element to render a Form + * @param {() => void} [options.onChange] a callback function when any changes detected + * @returns {Promise} A promise that resolves with the form data when saved, or rejects when cancelled */ showCustomForm(formStructure, { element, onChange } = {}) { if (element === undefined) { @@ -179,6 +184,10 @@ export default class FormsAPI { } ); + /** + * Handles form property changes + * @param {Object} data - The changed form data + */ function onFormPropertyChange(data) { if (onChange) { onChange(data); @@ -196,6 +205,11 @@ export default class FormsAPI { } } + /** + * Creates a form action handler + * @param {() => void} callback - The callback to be called when the form action is triggered + * @returns {(...args: any[]) => void} The form action handler + */ function onFormAction(callback) { return () => { destroy(); diff --git a/src/api/forms/components/FormProperties.vue b/src/api/forms/components/FormProperties.vue index f4ac6b23af..1e4bdf30bb 100644 --- a/src/api/forms/components/FormProperties.vue +++ b/src/api/forms/components/FormProperties.vue @@ -115,7 +115,7 @@ export default { return this.model.buttons.submit.label; } - return 'OK'; + return 'Ok'; }, cancelLabel() { if (this.model.buttons && this.model.buttons.cancel && this.model.buttons.cancel.label) { diff --git a/src/api/forms/components/controls/FileInput.vue b/src/api/forms/components/controls/FileInput.vue index 911fdb945a..dd27d6ea3a 100644 --- a/src/api/forms/components/controls/FileInput.vue +++ b/src/api/forms/components/controls/FileInput.vue @@ -29,6 +29,7 @@ type="file" :accept="acceptableFileTypes" style="display: none" + aria-labelledby="fileSelect" />