Compare commits
171 Commits
omm-large-
...
vue-3-memo
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6dbdc5dbe0 | ||
|
|
04adb790a0 | ||
|
|
99a3e3fc32 | ||
|
|
2d92223e16 | ||
|
|
f21685e216 | ||
|
|
6c92e31036 | ||
|
|
82b1760b0e | ||
|
|
87feb0db34 | ||
|
|
c53073b339 | ||
|
|
57743e5918 | ||
|
|
f3b819a786 | ||
|
|
50694f600c | ||
|
|
10f3e13e4d | ||
|
|
9be9c5e28e | ||
|
|
58aeac94ac | ||
|
|
1e3097f54b | ||
|
|
6a9ff91d93 | ||
|
|
accfbc96ab | ||
|
|
9942bbbc0f | ||
|
|
4287cd5413 | ||
|
|
ee6ca11558 | ||
|
|
676bb81eab | ||
|
|
c6305697c0 | ||
|
|
0421936874 | ||
|
|
95e686038d | ||
|
|
f705bf9a61 | ||
|
|
50559ac502 | ||
|
|
f0ef93dd3f | ||
|
|
3ae14cf786 | ||
|
|
194eb43607 | ||
|
|
3c2b032526 | ||
|
|
d4e51cbaf1 | ||
|
|
7c58b19c3e | ||
|
|
16e1ac2529 | ||
|
|
4885c816dc | ||
|
|
42b545917c | ||
|
|
85974fc5f1 | ||
|
|
761d4ce7e4 | ||
|
|
5b1298f221 | ||
|
|
662d14354c | ||
|
|
e386036dbf | ||
|
|
6e79e5e2b0 | ||
|
|
32529ff6b2 | ||
|
|
92329b3d8e | ||
|
|
cde8fbbb0d | ||
|
|
795d7a7ec7 | ||
|
|
5031010a00 | ||
|
|
ac22bebe76 | ||
|
|
d08ea62932 | ||
|
|
293f25df19 | ||
|
|
9c22bcfb3e | ||
|
|
6f46b4d87e | ||
|
|
4fff6b035b | ||
|
|
3b0e05ed14 | ||
|
|
ff7f55574d | ||
|
|
58f869b21b | ||
|
|
834a19f996 | ||
|
|
1d7cd64652 | ||
|
|
68ed7bf0e5 | ||
|
|
4b39ef3235 | ||
|
|
b685b9582e | ||
|
|
d8ac209a96 | ||
|
|
f254d4f078 | ||
|
|
c75a82dca5 | ||
|
|
9423591e4d | ||
|
|
5a7174bf2a | ||
|
|
d305443445 | ||
|
|
bd5cb8139c | ||
|
|
022dffd419 | ||
|
|
4c5de37cff | ||
|
|
fb5bbde154 | ||
|
|
9a01cee5fa | ||
|
|
8b2d3b0622 | ||
|
|
60df9e79c1 | ||
|
|
5a1e544a4c | ||
|
|
040ef0b998 | ||
|
|
f77287530b | ||
|
|
3cc93c0656 | ||
|
|
d48e11bbf7 | ||
|
|
8cc4eca3e8 | ||
|
|
d71287b318 | ||
|
|
943a40680f | ||
|
|
351e6a0fbf | ||
|
|
1f514dde3d | ||
|
|
47121cfbe8 | ||
|
|
44c4d4ff47 | ||
|
|
dc1d046822 | ||
|
|
cdb20b9950 | ||
|
|
a9158a90d5 | ||
|
|
07373817b0 | ||
|
|
9247951456 | ||
|
|
47c5863edf | ||
|
|
295bfe9294 | ||
|
|
1c6214fe79 | ||
|
|
4cab97cb4b | ||
|
|
0bafdad605 | ||
|
|
4d375ec765 | ||
|
|
47b44cebba | ||
|
|
fea68381a7 | ||
|
|
356c90ca45 | ||
|
|
7e12a45960 | ||
|
|
804dbf0cab | ||
|
|
caa7bc6fae | ||
|
|
172e0b23fd | ||
|
|
5df7971438 | ||
|
|
b39d5e8bcc | ||
|
|
c5188397e4 | ||
|
|
225fa22c72 | ||
|
|
2c3b6fa540 | ||
|
|
496ab4d5a3 | ||
|
|
aad9e51262 | ||
|
|
ba4353aacb | ||
|
|
9f079255f1 | ||
|
|
f5eacc504b | ||
|
|
26fa1653e3 | ||
|
|
b7c68f715b | ||
|
|
549a579bf3 | ||
|
|
fe677fa359 | ||
|
|
1bbc3789ec | ||
|
|
636849885b | ||
|
|
6f2b20eee9 | ||
|
|
e38821cc1f | ||
|
|
4345d216f7 | ||
|
|
84a12c7833 | ||
|
|
ad8445114f | ||
|
|
bcd50dfa35 | ||
|
|
a798ddf05e | ||
|
|
7af7e68779 | ||
|
|
c200999659 | ||
|
|
ddeeff4822 | ||
|
|
5610846147 | ||
|
|
88fde47932 | ||
|
|
2a0faba35f | ||
|
|
a47abf5f96 | ||
|
|
968eee6698 | ||
|
|
43d56a68bb | ||
|
|
f055a8a0c7 | ||
|
|
2820237d60 | ||
|
|
dbdc9bb4e2 | ||
|
|
a9a98380f2 | ||
|
|
e3ab085dd5 | ||
|
|
519135527b | ||
|
|
fc37f6e05b | ||
|
|
ab1df89396 | ||
|
|
9ee5ab96f3 | ||
|
|
8b2c6e3fb3 | ||
|
|
b8b0a08eeb | ||
|
|
633b6be2fd | ||
|
|
4963aff8a0 | ||
|
|
6786be54fa | ||
|
|
b081389e68 | ||
|
|
7a3ec3a241 | ||
|
|
c0c383bf18 | ||
|
|
fe1c99de12 | ||
|
|
2e60da0401 | ||
|
|
bc3a5408b4 | ||
|
|
344bf8eed3 | ||
|
|
cbb3368937 | ||
|
|
b7a671d392 | ||
|
|
4f10a93ef5 | ||
|
|
f8186e4b4e | ||
|
|
4e0c364d89 | ||
|
|
f3bed9c651 | ||
|
|
4d93907d58 | ||
|
|
6f656a6783 | ||
|
|
767fb6c5fd | ||
|
|
b0a0b4bb58 | ||
|
|
340f4a9e79 | ||
|
|
3007b28b0f | ||
|
|
20789601b4 | ||
|
|
a56cfed732 |
@@ -2,19 +2,23 @@ version: 2.1
|
|||||||
executors:
|
executors:
|
||||||
pw-focal-development:
|
pw-focal-development:
|
||||||
docker:
|
docker:
|
||||||
- image: mcr.microsoft.com/playwright:v1.29.0-focal
|
- image: mcr.microsoft.com/playwright:v1.36.2-focal
|
||||||
environment:
|
environment:
|
||||||
NODE_ENV: development # Needed to ensure 'dist' folder created and devDependencies installed
|
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_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_LOGLEVEL: 'debug' # Enable DEBUG level logging for Percy (Issue: https://github.com/nasa/openmct/issues/5742)
|
||||||
|
ubuntu:
|
||||||
|
machine:
|
||||||
|
image: ubuntu-2204:current
|
||||||
|
docker_layer_caching: true
|
||||||
parameters:
|
parameters:
|
||||||
BUST_CACHE:
|
BUST_CACHE:
|
||||||
description: "Set this with the CircleCI UI Trigger Workflow button (boolean = true) to bust the cache!"
|
description: 'Set this with the CircleCI UI Trigger Workflow button (boolean = true) to bust the cache!'
|
||||||
default: false
|
default: false
|
||||||
type: boolean
|
type: boolean
|
||||||
commands:
|
commands:
|
||||||
build_and_install:
|
build_and_install:
|
||||||
description: "All steps used to build and install. Will use cache if found"
|
description: 'All steps used to build and install. Will use cache if found'
|
||||||
parameters:
|
parameters:
|
||||||
node-version:
|
node-version:
|
||||||
type: string
|
type: string
|
||||||
@@ -23,11 +27,10 @@ commands:
|
|||||||
- restore_cache_cmd:
|
- restore_cache_cmd:
|
||||||
node-version: << parameters.node-version >>
|
node-version: << parameters.node-version >>
|
||||||
- node/install:
|
- node/install:
|
||||||
install-npm: true
|
|
||||||
node-version: << parameters.node-version >>
|
node-version: << parameters.node-version >>
|
||||||
- run: npm install --prefer-offline --no-audit --progress=false
|
- run: npm install --no-audit --progress=false
|
||||||
restore_cache_cmd:
|
restore_cache_cmd:
|
||||||
description: "Custom command for restoring cache with the ability to bust cache. When BUST_CACHE is set to true, jobs will not restore cache"
|
description: 'Custom command for restoring cache with the ability to bust cache. When BUST_CACHE is set to true, jobs will not restore cache'
|
||||||
parameters:
|
parameters:
|
||||||
node-version:
|
node-version:
|
||||||
type: string
|
type: string
|
||||||
@@ -37,31 +40,31 @@ commands:
|
|||||||
equal: [false, << pipeline.parameters.BUST_CACHE >>]
|
equal: [false, << pipeline.parameters.BUST_CACHE >>]
|
||||||
steps:
|
steps:
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
key: deps-{{ .Branch }}--<< parameters.node-version >>--{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }}
|
key: deps--{{ arch }}--{{ .Branch }}--<< parameters.node-version >>--{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }}
|
||||||
save_cache_cmd:
|
save_cache_cmd:
|
||||||
description: "Custom command for saving cache."
|
description: 'Custom command for saving cache.'
|
||||||
parameters:
|
parameters:
|
||||||
node-version:
|
node-version:
|
||||||
type: string
|
type: string
|
||||||
steps:
|
steps:
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: deps-{{ .Branch }}--<< parameters.node-version >>--{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }}
|
key: deps--{{ arch }}--{{ .Branch }}--<< parameters.node-version >>--{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }}
|
||||||
paths:
|
paths:
|
||||||
- ~/.npm
|
- ~/.npm
|
||||||
- node_modules
|
- node_modules
|
||||||
generate_and_store_version_and_filesystem_artifacts:
|
generate_and_store_version_and_filesystem_artifacts:
|
||||||
description: "Track important packages and files"
|
description: 'Track important packages and files'
|
||||||
steps:
|
steps:
|
||||||
- run: |
|
- run: |
|
||||||
mkdir /tmp/artifacts
|
[[ $EUID -ne 0 ]] && (sudo mkdir -p /tmp/artifacts && sudo chmod 777 /tmp/artifacts) || (mkdir -p /tmp/artifacts && chmod 777 /tmp/artifacts)
|
||||||
printenv NODE_ENV >> /tmp/artifacts/NODE_ENV.txt
|
printenv NODE_ENV >> /tmp/artifacts/NODE_ENV.txt || true
|
||||||
npm -v >> /tmp/artifacts/npm-version.txt
|
npm -v >> /tmp/artifacts/npm-version.txt
|
||||||
node -v >> /tmp/artifacts/node-version.txt
|
node -v >> /tmp/artifacts/node-version.txt
|
||||||
ls -latR >> /tmp/artifacts/dir.txt
|
ls -latR >> /tmp/artifacts/dir.txt
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: /tmp/artifacts/
|
path: /tmp/artifacts/
|
||||||
generate_e2e_code_cov_report:
|
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:
|
parameters:
|
||||||
suite:
|
suite:
|
||||||
type: string
|
type: string
|
||||||
@@ -69,7 +72,7 @@ commands:
|
|||||||
- run: npm run cov:e2e:report || true
|
- run: npm run cov:e2e:report || true
|
||||||
- run: npm run cov:e2e:<<parameters.suite>>:publish
|
- run: npm run cov:e2e:<<parameters.suite>>:publish
|
||||||
orbs:
|
orbs:
|
||||||
node: circleci/node@4.9.0
|
node: circleci/node@5.1.0
|
||||||
browser-tools: circleci/browser-tools@1.3.0
|
browser-tools: circleci/browser-tools@1.3.0
|
||||||
jobs:
|
jobs:
|
||||||
npm-audit:
|
npm-audit:
|
||||||
@@ -91,6 +94,7 @@ jobs:
|
|||||||
- build_and_install:
|
- build_and_install:
|
||||||
node-version: <<parameters.node-version>>
|
node-version: <<parameters.node-version>>
|
||||||
- run: npm run lint
|
- run: npm run lint
|
||||||
|
- run: npm run lint:spelling
|
||||||
- generate_and_store_version_and_filesystem_artifacts
|
- generate_and_store_version_and_filesystem_artifacts
|
||||||
unit-test:
|
unit-test:
|
||||||
parameters:
|
parameters:
|
||||||
@@ -110,6 +114,10 @@ jobs:
|
|||||||
path: dist/reports/tests/
|
path: dist/reports/tests/
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: coverage
|
path: coverage
|
||||||
|
- when:
|
||||||
|
condition:
|
||||||
|
equal: [42, 42] # Always generate version artifacts regardless of test failure https://discuss.circleci.com/t/make-custom-command-run-always-with-when-always/38957/2
|
||||||
|
steps:
|
||||||
- generate_and_store_version_and_filesystem_artifacts
|
- generate_and_store_version_and_filesystem_artifacts
|
||||||
e2e-test:
|
e2e-test:
|
||||||
parameters:
|
parameters:
|
||||||
@@ -124,10 +132,14 @@ jobs:
|
|||||||
node-version: <<parameters.node-version>>
|
node-version: <<parameters.node-version>>
|
||||||
- when: #Only install chrome-beta when running the 'full' suite to save $$$
|
- when: #Only install chrome-beta when running the 'full' suite to save $$$
|
||||||
condition:
|
condition:
|
||||||
equal: [ "full", <<parameters.suite>> ]
|
equal: ['full', <<parameters.suite>>]
|
||||||
steps:
|
steps:
|
||||||
- run: npx playwright install chrome-beta
|
- run: npx playwright install chrome-beta
|
||||||
- run: SHARD="$((${CIRCLE_NODE_INDEX}+1))"; npm run test:e2e:<<parameters.suite>> -- --shard=${SHARD}/${CIRCLE_NODE_TOTAL}
|
- run: SHARD="$((${CIRCLE_NODE_INDEX}+1))"; npm run test:e2e:<<parameters.suite>> -- --shard=${SHARD}/${CIRCLE_NODE_TOTAL}
|
||||||
|
- when:
|
||||||
|
condition:
|
||||||
|
equal: [42, 42] # Always run codecov reports regardless of test failure https://discuss.circleci.com/t/make-custom-command-run-always-with-when-always/38957/2
|
||||||
|
steps:
|
||||||
- generate_e2e_code_cov_report:
|
- generate_e2e_code_cov_report:
|
||||||
suite: <<parameters.suite>>
|
suite: <<parameters.suite>>
|
||||||
- store_test_results:
|
- store_test_results:
|
||||||
@@ -138,6 +150,45 @@ jobs:
|
|||||||
path: coverage
|
path: coverage
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: html-test-results
|
path: html-test-results
|
||||||
|
- when:
|
||||||
|
condition:
|
||||||
|
equal: [42, 42] # Always generate version artifacts regardless of test failure https://discuss.circleci.com/t/make-custom-command-run-always-with-when-always/38957/2
|
||||||
|
steps:
|
||||||
|
- generate_and_store_version_and_filesystem_artifacts
|
||||||
|
e2e-couchdb:
|
||||||
|
parameters:
|
||||||
|
node-version:
|
||||||
|
type: string
|
||||||
|
executor: ubuntu
|
||||||
|
steps:
|
||||||
|
- build_and_install:
|
||||||
|
node-version: <<parameters.node-version>>
|
||||||
|
- run: npx playwright@1.36.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
|
||||||
|
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
|
||||||
|
- run: npm run test:e2e:couchdb
|
||||||
|
- when:
|
||||||
|
condition:
|
||||||
|
equal: [42, 42] # Always run codecov reports regardless of test failure https://discuss.circleci.com/t/make-custom-command-run-always-with-when-always/38957/2
|
||||||
|
steps:
|
||||||
|
- generate_e2e_code_cov_report:
|
||||||
|
suite: full #add to full suite
|
||||||
|
- store_test_results:
|
||||||
|
path: test-results/results.xml
|
||||||
|
- store_artifacts:
|
||||||
|
path: test-results
|
||||||
|
- store_artifacts:
|
||||||
|
path: coverage
|
||||||
|
- store_artifacts:
|
||||||
|
path: html-test-results
|
||||||
|
- when:
|
||||||
|
condition:
|
||||||
|
equal: [42, 42] # Always generate version artifacts regardless of test failure https://discuss.circleci.com/t/make-custom-command-run-always-with-when-always/38957/2
|
||||||
|
steps:
|
||||||
- generate_and_store_version_and_filesystem_artifacts
|
- generate_and_store_version_and_filesystem_artifacts
|
||||||
perf-test:
|
perf-test:
|
||||||
parameters:
|
parameters:
|
||||||
@@ -154,65 +205,78 @@ jobs:
|
|||||||
path: test-results
|
path: test-results
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: html-test-results
|
path: html-test-results
|
||||||
|
- when:
|
||||||
|
condition:
|
||||||
|
equal: [42, 42] # Always run codecov reports regardless of test failure https://discuss.circleci.com/t/make-custom-command-run-always-with-when-always/38957/2
|
||||||
|
steps:
|
||||||
- generate_and_store_version_and_filesystem_artifacts
|
- generate_and_store_version_and_filesystem_artifacts
|
||||||
visual-test:
|
visual-test:
|
||||||
parameters:
|
parameters:
|
||||||
node-version:
|
node-version:
|
||||||
type: string
|
type: string
|
||||||
|
suite:
|
||||||
|
type: string # ci or full
|
||||||
executor: pw-focal-development
|
executor: pw-focal-development
|
||||||
steps:
|
steps:
|
||||||
- build_and_install:
|
- build_and_install:
|
||||||
node-version: <<parameters.node-version>>
|
node-version: <<parameters.node-version>>
|
||||||
- run: npm run test:e2e:visual
|
- run: npm run test:e2e:visual:<<parameters.suite>>
|
||||||
- store_test_results:
|
- store_test_results:
|
||||||
path: test-results/results.xml
|
path: test-results/results.xml
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: test-results
|
path: test-results
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: html-test-results
|
path: html-test-results
|
||||||
|
- when:
|
||||||
|
condition:
|
||||||
|
equal: [42, 42] # Always generate version artifacts regardless of test failure https://discuss.circleci.com/t/make-custom-command-run-always-with-when-always/38957/2
|
||||||
|
steps:
|
||||||
- generate_and_store_version_and_filesystem_artifacts
|
- generate_and_store_version_and_filesystem_artifacts
|
||||||
workflows:
|
workflows:
|
||||||
overall-circleci-commit-status: #These jobs run on every commit
|
overall-circleci-commit-status: #These jobs run on every commit
|
||||||
jobs:
|
jobs:
|
||||||
- lint:
|
- lint:
|
||||||
name: node14-lint
|
name: node16-lint
|
||||||
node-version: lts/fermium
|
node-version: lts/gallium
|
||||||
- unit-test:
|
- unit-test:
|
||||||
name: node18-chrome
|
name: node18-chrome
|
||||||
node-version: "18"
|
node-version: lts/hydrogen
|
||||||
- e2e-test:
|
- e2e-test:
|
||||||
name: e2e-stable
|
name: e2e-stable
|
||||||
node-version: lts/gallium
|
node-version: lts/hydrogen
|
||||||
suite: stable
|
suite: stable
|
||||||
- perf-test:
|
- perf-test:
|
||||||
node-version: lts/gallium
|
node-version: lts/hydrogen
|
||||||
- visual-test:
|
- visual-test:
|
||||||
node-version: lts/gallium
|
name: visual-test-ci
|
||||||
|
suite: ci
|
||||||
|
node-version: lts/hydrogen
|
||||||
|
|
||||||
the-nightly: #These jobs do not run on PRs, but against master at night
|
the-nightly: #These jobs do not run on PRs, but against master at night
|
||||||
jobs:
|
jobs:
|
||||||
- unit-test:
|
|
||||||
name: node14-chrome-nightly
|
|
||||||
node-version: lts/fermium
|
|
||||||
- unit-test:
|
- unit-test:
|
||||||
name: node16-chrome-nightly
|
name: node16-chrome-nightly
|
||||||
node-version: lts/gallium
|
node-version: lts/gallium
|
||||||
- unit-test:
|
- unit-test:
|
||||||
name: node18-chrome
|
name: node18-chrome
|
||||||
node-version: "18"
|
node-version: lts/hydrogen
|
||||||
- npm-audit:
|
- npm-audit:
|
||||||
node-version: lts/gallium
|
node-version: lts/hydrogen
|
||||||
- e2e-test:
|
- e2e-test:
|
||||||
name: e2e-full-nightly
|
name: e2e-full-nightly
|
||||||
node-version: lts/gallium
|
node-version: lts/hydrogen
|
||||||
suite: full
|
suite: full
|
||||||
- perf-test:
|
- perf-test:
|
||||||
node-version: lts/gallium
|
node-version: lts/hydrogen
|
||||||
- visual-test:
|
- visual-test:
|
||||||
node-version: lts/gallium
|
name: visual-test-nightly
|
||||||
|
suite: full
|
||||||
|
node-version: lts/hydrogen
|
||||||
|
- e2e-couchdb:
|
||||||
|
node-version: lts/hydrogen
|
||||||
triggers:
|
triggers:
|
||||||
- schedule:
|
- schedule:
|
||||||
cron: "0 0 * * *"
|
cron: '0 0 * * *'
|
||||||
filters:
|
filters:
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
|
|||||||
495
.cspell.json
Normal file
@@ -0,0 +1,495 @@
|
|||||||
|
{
|
||||||
|
"version": "0.2",
|
||||||
|
"language": "en,en-us",
|
||||||
|
"words": [
|
||||||
|
"gress",
|
||||||
|
"doctoc",
|
||||||
|
"minmax",
|
||||||
|
"openmct",
|
||||||
|
"datasources",
|
||||||
|
"recieved",
|
||||||
|
"evalute",
|
||||||
|
"Sinewave",
|
||||||
|
"deregistration",
|
||||||
|
"unregisters",
|
||||||
|
"configutation",
|
||||||
|
"configuation",
|
||||||
|
"codecov",
|
||||||
|
"carryforward",
|
||||||
|
"Chacon",
|
||||||
|
"Straub",
|
||||||
|
"OWASP",
|
||||||
|
"Testathon",
|
||||||
|
"exploratorily",
|
||||||
|
"Testathons",
|
||||||
|
"testathon",
|
||||||
|
"npmjs",
|
||||||
|
"publishj",
|
||||||
|
"treeitem",
|
||||||
|
"timespan",
|
||||||
|
"Timespan",
|
||||||
|
"spinbutton",
|
||||||
|
"popout",
|
||||||
|
"textbox",
|
||||||
|
"tablist",
|
||||||
|
"Telem",
|
||||||
|
"codecoverage",
|
||||||
|
"browserless",
|
||||||
|
"networkidle",
|
||||||
|
"nums",
|
||||||
|
"mgmt",
|
||||||
|
"faultname",
|
||||||
|
"gantt",
|
||||||
|
"sharded",
|
||||||
|
"perfromance",
|
||||||
|
"MMOC",
|
||||||
|
"deploysentinel",
|
||||||
|
"codegen",
|
||||||
|
"Unfortuantely",
|
||||||
|
"viewports",
|
||||||
|
"updatesnapshots",
|
||||||
|
"excercised",
|
||||||
|
"Circel",
|
||||||
|
"browsercontexts",
|
||||||
|
"miminum",
|
||||||
|
"testcase",
|
||||||
|
"testsuite",
|
||||||
|
"domcontentloaded",
|
||||||
|
"Tracefile",
|
||||||
|
"lcov",
|
||||||
|
"linecov",
|
||||||
|
"Browserless",
|
||||||
|
"webserver",
|
||||||
|
"yamcs",
|
||||||
|
"quickstart",
|
||||||
|
"subobject",
|
||||||
|
"autosize",
|
||||||
|
"Horz",
|
||||||
|
"vehicula",
|
||||||
|
"Praesent",
|
||||||
|
"pharetra",
|
||||||
|
"Duis",
|
||||||
|
"eget",
|
||||||
|
"arcu",
|
||||||
|
"elementum",
|
||||||
|
"mauris",
|
||||||
|
"Donec",
|
||||||
|
"nunc",
|
||||||
|
"quis",
|
||||||
|
"Proin",
|
||||||
|
"elit",
|
||||||
|
"Nunc",
|
||||||
|
"Aenean",
|
||||||
|
"mollis",
|
||||||
|
"hendrerit",
|
||||||
|
"Vestibulum",
|
||||||
|
"placerat",
|
||||||
|
"velit",
|
||||||
|
"augue",
|
||||||
|
"Quisque",
|
||||||
|
"mattis",
|
||||||
|
"lectus",
|
||||||
|
"rutrum",
|
||||||
|
"Fusce",
|
||||||
|
"tincidunt",
|
||||||
|
"nibh",
|
||||||
|
"blandit",
|
||||||
|
"urna",
|
||||||
|
"Nullam",
|
||||||
|
"congue",
|
||||||
|
"enim",
|
||||||
|
"Morbi",
|
||||||
|
"bibendum",
|
||||||
|
"Vivamus",
|
||||||
|
"imperdiet",
|
||||||
|
"Pellentesque",
|
||||||
|
"cursus",
|
||||||
|
"Aliquam",
|
||||||
|
"orci",
|
||||||
|
"Suspendisse",
|
||||||
|
"amet",
|
||||||
|
"justo",
|
||||||
|
"Etiam",
|
||||||
|
"vestibulum",
|
||||||
|
"ullamcorper",
|
||||||
|
"Cras",
|
||||||
|
"aliquet",
|
||||||
|
"Mauris",
|
||||||
|
"Nulla",
|
||||||
|
"scelerisque",
|
||||||
|
"viverra",
|
||||||
|
"metus",
|
||||||
|
"condimentum",
|
||||||
|
"varius",
|
||||||
|
"nulla",
|
||||||
|
"sapien",
|
||||||
|
"Curabitur",
|
||||||
|
"tristique",
|
||||||
|
"Nonsectetur",
|
||||||
|
"convallis",
|
||||||
|
"accumsan",
|
||||||
|
"lacus",
|
||||||
|
"posuere",
|
||||||
|
"turpis",
|
||||||
|
"egestas",
|
||||||
|
"feugiat",
|
||||||
|
"tortor",
|
||||||
|
"faucibus",
|
||||||
|
"euismod",
|
||||||
|
"pratices",
|
||||||
|
"pathing",
|
||||||
|
"pases",
|
||||||
|
"testcases",
|
||||||
|
"Noneditable",
|
||||||
|
"listitem",
|
||||||
|
"Gantt",
|
||||||
|
"timelist",
|
||||||
|
"timestrip",
|
||||||
|
"networkevents",
|
||||||
|
"fetchpriority",
|
||||||
|
"persistable",
|
||||||
|
"Persistable",
|
||||||
|
"persistability",
|
||||||
|
"Persistability",
|
||||||
|
"testdata",
|
||||||
|
"Testdata",
|
||||||
|
"metdata",
|
||||||
|
"timeconductor",
|
||||||
|
"contenteditable",
|
||||||
|
"autoscale",
|
||||||
|
"Autoscale",
|
||||||
|
"prepan",
|
||||||
|
"sinewave",
|
||||||
|
"cyanish",
|
||||||
|
"driv",
|
||||||
|
"searchbox",
|
||||||
|
"datetime",
|
||||||
|
"timeframe",
|
||||||
|
"recents",
|
||||||
|
"recentobjects",
|
||||||
|
"gsearch",
|
||||||
|
"Disp",
|
||||||
|
"Cloc",
|
||||||
|
"noselect",
|
||||||
|
"requestfailed",
|
||||||
|
"viewlarge",
|
||||||
|
"Imageurl",
|
||||||
|
"thumbstrip",
|
||||||
|
"checkmark",
|
||||||
|
"Unshelve",
|
||||||
|
"autosized",
|
||||||
|
"chacskaylo",
|
||||||
|
"numberfield",
|
||||||
|
"OPENMCT",
|
||||||
|
"Autoflow",
|
||||||
|
"Timelist",
|
||||||
|
"faultmanagement",
|
||||||
|
"GEOSPATIAL",
|
||||||
|
"geospatial",
|
||||||
|
"plotspatial",
|
||||||
|
"annnotation",
|
||||||
|
"keystrings",
|
||||||
|
"undelete",
|
||||||
|
"sometag",
|
||||||
|
"containee",
|
||||||
|
"composability",
|
||||||
|
"mutables",
|
||||||
|
"Mutables",
|
||||||
|
"composee",
|
||||||
|
"handleoutsideclick",
|
||||||
|
"Datetime",
|
||||||
|
"Perc",
|
||||||
|
"autodismiss",
|
||||||
|
"filetree",
|
||||||
|
"deeptailor",
|
||||||
|
"keystring",
|
||||||
|
"reindex",
|
||||||
|
"unlisten",
|
||||||
|
"symbolsfont",
|
||||||
|
"ellipsize",
|
||||||
|
"dismissable",
|
||||||
|
"TIMESYSTEM",
|
||||||
|
"Metadatas",
|
||||||
|
"stalenes",
|
||||||
|
"receieves",
|
||||||
|
"unsub",
|
||||||
|
"callbacktwo",
|
||||||
|
"unsubscribetwo",
|
||||||
|
"telem",
|
||||||
|
"Telemetery",
|
||||||
|
"unemitted",
|
||||||
|
"granually",
|
||||||
|
"timesystem",
|
||||||
|
"metadatas",
|
||||||
|
"iteratees",
|
||||||
|
"metadatum",
|
||||||
|
"printj",
|
||||||
|
"sprintf",
|
||||||
|
"unlisteners",
|
||||||
|
"amts",
|
||||||
|
"reregistered",
|
||||||
|
"hudsonfoo",
|
||||||
|
"onclone",
|
||||||
|
"autoflow",
|
||||||
|
"xdescribe",
|
||||||
|
"mockmct",
|
||||||
|
"Autoflowed",
|
||||||
|
"plotly",
|
||||||
|
"relayout",
|
||||||
|
"Plotly",
|
||||||
|
"Yaxis",
|
||||||
|
"showlegend",
|
||||||
|
"textposition",
|
||||||
|
"xaxis",
|
||||||
|
"automargin",
|
||||||
|
"fixedrange",
|
||||||
|
"yaxis",
|
||||||
|
"Axistype",
|
||||||
|
"showline",
|
||||||
|
"bglayer",
|
||||||
|
"autorange",
|
||||||
|
"hoverinfo",
|
||||||
|
"dotful",
|
||||||
|
"Dotful",
|
||||||
|
"cartesianlayer",
|
||||||
|
"scatterlayer",
|
||||||
|
"textfont",
|
||||||
|
"ampm",
|
||||||
|
"cdef",
|
||||||
|
"horz",
|
||||||
|
"STYLEABLE",
|
||||||
|
"styleable",
|
||||||
|
"afff",
|
||||||
|
"shdw",
|
||||||
|
"braintree",
|
||||||
|
"vals",
|
||||||
|
"Subobject",
|
||||||
|
"Shdw",
|
||||||
|
"Movebar",
|
||||||
|
"inspectable",
|
||||||
|
"Stringformatter",
|
||||||
|
"sclk",
|
||||||
|
"Objectpath",
|
||||||
|
"Keystring",
|
||||||
|
"duplicatable",
|
||||||
|
"composees",
|
||||||
|
"Composees",
|
||||||
|
"Composee",
|
||||||
|
"callthrough",
|
||||||
|
"objectpath",
|
||||||
|
"createable",
|
||||||
|
"noneditable",
|
||||||
|
"Classname",
|
||||||
|
"classname",
|
||||||
|
"selectedfaults",
|
||||||
|
"accum",
|
||||||
|
"newpersisted",
|
||||||
|
"Metadatum",
|
||||||
|
"MCWS",
|
||||||
|
"YAMCS",
|
||||||
|
"frameid",
|
||||||
|
"containerid",
|
||||||
|
"mmgis",
|
||||||
|
"PERC",
|
||||||
|
"curval",
|
||||||
|
"viewbox",
|
||||||
|
"mutablegauge",
|
||||||
|
"Flatbush",
|
||||||
|
"flatbush",
|
||||||
|
"Indicies",
|
||||||
|
"Marqueed",
|
||||||
|
"NSEW",
|
||||||
|
"nsew",
|
||||||
|
"vrover",
|
||||||
|
"gimbled",
|
||||||
|
"Pannable",
|
||||||
|
"unsynced",
|
||||||
|
"Unsynced",
|
||||||
|
"pannable",
|
||||||
|
"autoscroll",
|
||||||
|
"TIMESTRIP",
|
||||||
|
"TWENTYFOUR",
|
||||||
|
"FULLSIZE",
|
||||||
|
"intialize",
|
||||||
|
"Timestrip",
|
||||||
|
"spyon",
|
||||||
|
"Unlistener",
|
||||||
|
"multipane",
|
||||||
|
"DATESTRING",
|
||||||
|
"akhenry",
|
||||||
|
"Niklas",
|
||||||
|
"Hertzen",
|
||||||
|
"Kash",
|
||||||
|
"Nouroozi",
|
||||||
|
"Bostock",
|
||||||
|
"BOSTOCK",
|
||||||
|
"Arnout",
|
||||||
|
"Kazemier",
|
||||||
|
"Karolis",
|
||||||
|
"Narkevicius",
|
||||||
|
"Ashkenas",
|
||||||
|
"Madhavan",
|
||||||
|
"Iskren",
|
||||||
|
"Ivov",
|
||||||
|
"Chernev",
|
||||||
|
"Borshchov",
|
||||||
|
"painterro",
|
||||||
|
"sheetjs",
|
||||||
|
"Yuxi",
|
||||||
|
"ACITON",
|
||||||
|
"localstorage",
|
||||||
|
"Linkto",
|
||||||
|
"Painterro",
|
||||||
|
"Editability",
|
||||||
|
"filteredsnapshots",
|
||||||
|
"Fromimage",
|
||||||
|
"muliple",
|
||||||
|
"notebookstorage",
|
||||||
|
"Andpage",
|
||||||
|
"pixelize",
|
||||||
|
"Quickstart",
|
||||||
|
"indexhtml",
|
||||||
|
"youradminpassword",
|
||||||
|
"chttpd",
|
||||||
|
"sourcefiles",
|
||||||
|
"USERPASS",
|
||||||
|
"XPUT",
|
||||||
|
"adipiscing",
|
||||||
|
"eiusmod",
|
||||||
|
"tempor",
|
||||||
|
"incididunt",
|
||||||
|
"labore",
|
||||||
|
"dolore",
|
||||||
|
"aliqua",
|
||||||
|
"perspiciatis",
|
||||||
|
"iteree",
|
||||||
|
"submodels",
|
||||||
|
"symlog",
|
||||||
|
"Plottable",
|
||||||
|
"antisymlog",
|
||||||
|
"docstrings",
|
||||||
|
"webglcontextlost",
|
||||||
|
"gridlines",
|
||||||
|
"Xaxis",
|
||||||
|
"Crosshairs",
|
||||||
|
"telemetrylimit",
|
||||||
|
"xscale",
|
||||||
|
"yscale",
|
||||||
|
"untracks",
|
||||||
|
"swatched",
|
||||||
|
"NULLVALUE",
|
||||||
|
"unobserver",
|
||||||
|
"unsubscriber",
|
||||||
|
"drap",
|
||||||
|
"Averager",
|
||||||
|
"averager",
|
||||||
|
"movecolumnfromindex",
|
||||||
|
"callout",
|
||||||
|
"Konqueror",
|
||||||
|
"unmark",
|
||||||
|
"hitarea",
|
||||||
|
"Hitarea",
|
||||||
|
"Unmark",
|
||||||
|
"controlbar",
|
||||||
|
"reactified",
|
||||||
|
"perc",
|
||||||
|
"DHMS",
|
||||||
|
"timespans",
|
||||||
|
"timeframes",
|
||||||
|
"Timesystems",
|
||||||
|
"Hilite",
|
||||||
|
"datetimes",
|
||||||
|
"momentified",
|
||||||
|
"ucontents",
|
||||||
|
"TIMELIST",
|
||||||
|
"Timeframe",
|
||||||
|
"Guirk",
|
||||||
|
"resizeable",
|
||||||
|
"iframing",
|
||||||
|
"Btns",
|
||||||
|
"Ctrls",
|
||||||
|
"Chakra",
|
||||||
|
"Petch",
|
||||||
|
"propor",
|
||||||
|
"phoneandtablet",
|
||||||
|
"desktopandtablet",
|
||||||
|
"Imgs",
|
||||||
|
"UNICODES",
|
||||||
|
"datatable",
|
||||||
|
"csvg",
|
||||||
|
"cpath",
|
||||||
|
"cellipse",
|
||||||
|
"xlink",
|
||||||
|
"cstyle",
|
||||||
|
"bfill",
|
||||||
|
"ctitle",
|
||||||
|
"eicon",
|
||||||
|
"interactability",
|
||||||
|
"AFFORDANCES",
|
||||||
|
"affordance",
|
||||||
|
"scrollcontainer",
|
||||||
|
"Icomoon",
|
||||||
|
"icomoon",
|
||||||
|
"configurability",
|
||||||
|
"btns",
|
||||||
|
"AUTOFLOW",
|
||||||
|
"DATETIME",
|
||||||
|
"infobubble",
|
||||||
|
"thumbsbubble",
|
||||||
|
"codehilite",
|
||||||
|
"vscroll",
|
||||||
|
"bgsize",
|
||||||
|
"togglebutton",
|
||||||
|
"Hacskaylo",
|
||||||
|
"noie",
|
||||||
|
"fullscreen",
|
||||||
|
"horiz",
|
||||||
|
"menubutton",
|
||||||
|
"SNAPSHOTTING",
|
||||||
|
"snapshotting",
|
||||||
|
"PAINTERRO",
|
||||||
|
"ptro",
|
||||||
|
"PLOTLY",
|
||||||
|
"gridlayer",
|
||||||
|
"xtick",
|
||||||
|
"ytick",
|
||||||
|
"subobjects",
|
||||||
|
"Ucontents",
|
||||||
|
"Userand",
|
||||||
|
"Userbefore",
|
||||||
|
"brdr",
|
||||||
|
"pushs",
|
||||||
|
"ALPH",
|
||||||
|
"Recents",
|
||||||
|
"Qbert",
|
||||||
|
"Infobubble",
|
||||||
|
"haslink",
|
||||||
|
"VPID",
|
||||||
|
"vpid",
|
||||||
|
"updatedtest",
|
||||||
|
"KHTML",
|
||||||
|
"Chromezilla",
|
||||||
|
"Safarifox",
|
||||||
|
"deregistering",
|
||||||
|
"hundredtized",
|
||||||
|
"dhms",
|
||||||
|
"unthrottled",
|
||||||
|
"Codecov",
|
||||||
|
"dont",
|
||||||
|
"mediump",
|
||||||
|
"sinonjs",
|
||||||
|
"generatedata",
|
||||||
|
"grandsearch"
|
||||||
|
],
|
||||||
|
"dictionaries": ["npm", "softwareTerms", "node", "html", "css", "bash", "en_US"],
|
||||||
|
"ignorePaths": [
|
||||||
|
"package.json",
|
||||||
|
"dist/**",
|
||||||
|
"package-lock.json",
|
||||||
|
"node_modules",
|
||||||
|
"coverage",
|
||||||
|
"*.log",
|
||||||
|
"html-test-results",
|
||||||
|
"test-results"
|
||||||
|
]
|
||||||
|
}
|
||||||
323
.eslintrc.js
@@ -1,270 +1,169 @@
|
|||||||
const LEGACY_FILES = ["example/**"];
|
const LEGACY_FILES = ['example/**'];
|
||||||
module.exports = {
|
module.exports = {
|
||||||
"env": {
|
env: {
|
||||||
"browser": true,
|
browser: true,
|
||||||
"es6": true,
|
es6: true,
|
||||||
"jasmine": true,
|
jasmine: true,
|
||||||
"amd": true
|
amd: true
|
||||||
},
|
},
|
||||||
"globals": {
|
globals: {
|
||||||
"_": "readonly"
|
_: 'readonly'
|
||||||
},
|
},
|
||||||
"extends": [
|
plugins: ['prettier'],
|
||||||
"eslint:recommended",
|
extends: [
|
||||||
"plugin:compat/recommended",
|
'eslint:recommended',
|
||||||
"plugin:vue/recommended",
|
'plugin:compat/recommended',
|
||||||
"plugin:you-dont-need-lodash-underscore/compatible"
|
'plugin:vue/vue3-recommended',
|
||||||
|
'plugin:you-dont-need-lodash-underscore/compatible',
|
||||||
|
'plugin:prettier/recommended'
|
||||||
],
|
],
|
||||||
"parser": "vue-eslint-parser",
|
parser: 'vue-eslint-parser',
|
||||||
"parserOptions": {
|
parserOptions: {
|
||||||
"parser": "@babel/eslint-parser",
|
parser: '@babel/eslint-parser',
|
||||||
"requireConfigFile": false,
|
requireConfigFile: false,
|
||||||
"allowImportExportEverywhere": true,
|
allowImportExportEverywhere: true,
|
||||||
"ecmaVersion": 2015,
|
ecmaVersion: 2015,
|
||||||
"ecmaFeatures": {
|
ecmaFeatures: {
|
||||||
"impliedStrict": true
|
impliedStrict: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"rules": {
|
rules: {
|
||||||
"you-dont-need-lodash-underscore/omit": "off",
|
'vue/no-deprecated-dollar-listeners-api': 'warn',
|
||||||
"you-dont-need-lodash-underscore/throttle": "off",
|
'vue/no-deprecated-events-api': 'warn',
|
||||||
"you-dont-need-lodash-underscore/flatten": "off",
|
'vue/no-v-for-template-key': 'off',
|
||||||
"you-dont-need-lodash-underscore/get": "off",
|
'vue/no-v-for-template-key-on-child': 'error',
|
||||||
"no-bitwise": "error",
|
'prettier/prettier': 'error',
|
||||||
"curly": "error",
|
'you-dont-need-lodash-underscore/omit': 'off',
|
||||||
"eqeqeq": "error",
|
'you-dont-need-lodash-underscore/throttle': 'off',
|
||||||
"guard-for-in": "error",
|
'you-dont-need-lodash-underscore/flatten': 'off',
|
||||||
"no-extend-native": "error",
|
'you-dont-need-lodash-underscore/get': 'off',
|
||||||
"no-inner-declarations": "off",
|
'no-bitwise': 'error',
|
||||||
"no-use-before-define": ["error", "nofunc"],
|
curly: 'error',
|
||||||
"no-caller": "error",
|
eqeqeq: 'error',
|
||||||
"no-irregular-whitespace": "error",
|
'guard-for-in': 'error',
|
||||||
"no-new": "error",
|
'no-extend-native': 'error',
|
||||||
"no-shadow": "error",
|
'no-inner-declarations': 'off',
|
||||||
"no-undef": "error",
|
'no-use-before-define': ['error', 'nofunc'],
|
||||||
"no-unused-vars": [
|
'no-caller': 'error',
|
||||||
"error",
|
'no-irregular-whitespace': 'error',
|
||||||
|
'no-new': 'error',
|
||||||
|
'no-shadow': 'error',
|
||||||
|
'no-undef': 'error',
|
||||||
|
'no-unused-vars': [
|
||||||
|
'error',
|
||||||
{
|
{
|
||||||
"vars": "all",
|
vars: 'all',
|
||||||
"args": "none"
|
args: 'none'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"no-console": "off",
|
'no-console': 'off',
|
||||||
"no-trailing-spaces": "error",
|
'new-cap': [
|
||||||
"space-before-function-paren": [
|
'error',
|
||||||
"error",
|
|
||||||
{
|
{
|
||||||
"anonymous": "always",
|
capIsNew: false,
|
||||||
"asyncArrow": "always",
|
properties: false
|
||||||
"named": "never"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"array-bracket-spacing": "error",
|
'dot-notation': 'error',
|
||||||
"space-in-parens": "error",
|
|
||||||
"space-before-blocks": "error",
|
|
||||||
"comma-dangle": "error",
|
|
||||||
"eol-last": "error",
|
|
||||||
"new-cap": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
"capIsNew": false,
|
|
||||||
"properties": false
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"dot-notation": "error",
|
|
||||||
"indent": ["error", 4],
|
|
||||||
|
|
||||||
// https://eslint.org/docs/rules/no-case-declarations
|
// https://eslint.org/docs/rules/no-case-declarations
|
||||||
"no-case-declarations": "error",
|
'no-case-declarations': 'error',
|
||||||
// https://eslint.org/docs/rules/max-classes-per-file
|
// https://eslint.org/docs/rules/max-classes-per-file
|
||||||
"max-classes-per-file": ["error", 1],
|
'max-classes-per-file': ['error', 1],
|
||||||
// https://eslint.org/docs/rules/no-eq-null
|
// https://eslint.org/docs/rules/no-eq-null
|
||||||
"no-eq-null": "error",
|
'no-eq-null': 'error',
|
||||||
// https://eslint.org/docs/rules/no-eval
|
// https://eslint.org/docs/rules/no-eval
|
||||||
"no-eval": "error",
|
'no-eval': 'error',
|
||||||
// https://eslint.org/docs/rules/no-floating-decimal
|
|
||||||
"no-floating-decimal": "error",
|
|
||||||
// https://eslint.org/docs/rules/no-implicit-globals
|
// https://eslint.org/docs/rules/no-implicit-globals
|
||||||
"no-implicit-globals": "error",
|
'no-implicit-globals': 'error',
|
||||||
// https://eslint.org/docs/rules/no-implied-eval
|
// https://eslint.org/docs/rules/no-implied-eval
|
||||||
"no-implied-eval": "error",
|
'no-implied-eval': 'error',
|
||||||
// https://eslint.org/docs/rules/no-lone-blocks
|
// https://eslint.org/docs/rules/no-lone-blocks
|
||||||
"no-lone-blocks": "error",
|
'no-lone-blocks': 'error',
|
||||||
// https://eslint.org/docs/rules/no-loop-func
|
// https://eslint.org/docs/rules/no-loop-func
|
||||||
"no-loop-func": "error",
|
'no-loop-func': 'error',
|
||||||
// https://eslint.org/docs/rules/no-new-func
|
// https://eslint.org/docs/rules/no-new-func
|
||||||
"no-new-func": "error",
|
'no-new-func': 'error',
|
||||||
// https://eslint.org/docs/rules/no-new-wrappers
|
// https://eslint.org/docs/rules/no-new-wrappers
|
||||||
"no-new-wrappers": "error",
|
'no-new-wrappers': 'error',
|
||||||
// https://eslint.org/docs/rules/no-octal-escape
|
// https://eslint.org/docs/rules/no-octal-escape
|
||||||
"no-octal-escape": "error",
|
'no-octal-escape': 'error',
|
||||||
// https://eslint.org/docs/rules/no-proto
|
// https://eslint.org/docs/rules/no-proto
|
||||||
"no-proto": "error",
|
'no-proto': 'error',
|
||||||
// https://eslint.org/docs/rules/no-return-await
|
// https://eslint.org/docs/rules/no-return-await
|
||||||
"no-return-await": "error",
|
'no-return-await': 'error',
|
||||||
// https://eslint.org/docs/rules/no-script-url
|
// https://eslint.org/docs/rules/no-script-url
|
||||||
"no-script-url": "error",
|
'no-script-url': 'error',
|
||||||
// https://eslint.org/docs/rules/no-self-compare
|
// https://eslint.org/docs/rules/no-self-compare
|
||||||
"no-self-compare": "error",
|
'no-self-compare': 'error',
|
||||||
// https://eslint.org/docs/rules/no-sequences
|
// https://eslint.org/docs/rules/no-sequences
|
||||||
"no-sequences": "error",
|
'no-sequences': 'error',
|
||||||
// https://eslint.org/docs/rules/no-unmodified-loop-condition
|
// https://eslint.org/docs/rules/no-unmodified-loop-condition
|
||||||
"no-unmodified-loop-condition": "error",
|
'no-unmodified-loop-condition': 'error',
|
||||||
// https://eslint.org/docs/rules/no-useless-call
|
// https://eslint.org/docs/rules/no-useless-call
|
||||||
"no-useless-call": "error",
|
'no-useless-call': 'error',
|
||||||
// https://eslint.org/docs/rules/wrap-iife
|
|
||||||
"wrap-iife": "error",
|
|
||||||
// https://eslint.org/docs/rules/no-nested-ternary
|
// https://eslint.org/docs/rules/no-nested-ternary
|
||||||
"no-nested-ternary": "error",
|
'no-nested-ternary': 'error',
|
||||||
// https://eslint.org/docs/rules/switch-colon-spacing
|
|
||||||
"switch-colon-spacing": "error",
|
|
||||||
// https://eslint.org/docs/rules/no-useless-computed-key
|
// https://eslint.org/docs/rules/no-useless-computed-key
|
||||||
"no-useless-computed-key": "error",
|
'no-useless-computed-key': 'error',
|
||||||
// https://eslint.org/docs/rules/rest-spread-spacing
|
|
||||||
"rest-spread-spacing": ["error"],
|
|
||||||
// https://eslint.org/docs/rules/no-var
|
// https://eslint.org/docs/rules/no-var
|
||||||
"no-var": "error",
|
'no-var': 'error',
|
||||||
// https://eslint.org/docs/rules/one-var
|
// https://eslint.org/docs/rules/one-var
|
||||||
"one-var": ["error", "never"],
|
'one-var': ['error', 'never'],
|
||||||
// https://eslint.org/docs/rules/default-case-last
|
// https://eslint.org/docs/rules/default-case-last
|
||||||
"default-case-last": "error",
|
'default-case-last': 'error',
|
||||||
// https://eslint.org/docs/rules/default-param-last
|
// https://eslint.org/docs/rules/default-param-last
|
||||||
"default-param-last": "error",
|
'default-param-last': 'error',
|
||||||
// https://eslint.org/docs/rules/grouped-accessor-pairs
|
// https://eslint.org/docs/rules/grouped-accessor-pairs
|
||||||
"grouped-accessor-pairs": "error",
|
'grouped-accessor-pairs': 'error',
|
||||||
// https://eslint.org/docs/rules/no-constructor-return
|
// https://eslint.org/docs/rules/no-constructor-return
|
||||||
"no-constructor-return": "error",
|
'no-constructor-return': 'error',
|
||||||
// https://eslint.org/docs/rules/array-callback-return
|
// https://eslint.org/docs/rules/array-callback-return
|
||||||
"array-callback-return": "error",
|
'array-callback-return': 'error',
|
||||||
// https://eslint.org/docs/rules/no-invalid-this
|
// https://eslint.org/docs/rules/no-invalid-this
|
||||||
"no-invalid-this": "error", // Believe this one actually surfaces some bugs
|
'no-invalid-this': 'error', // Believe this one actually surfaces some bugs
|
||||||
// https://eslint.org/docs/rules/func-style
|
// https://eslint.org/docs/rules/func-style
|
||||||
"func-style": ["error", "declaration"],
|
'func-style': ['error', 'declaration'],
|
||||||
// https://eslint.org/docs/rules/no-unused-expressions
|
// https://eslint.org/docs/rules/no-unused-expressions
|
||||||
"no-unused-expressions": "error",
|
'no-unused-expressions': 'error',
|
||||||
// https://eslint.org/docs/rules/no-useless-concat
|
// https://eslint.org/docs/rules/no-useless-concat
|
||||||
"no-useless-concat": "error",
|
'no-useless-concat': 'error',
|
||||||
// https://eslint.org/docs/rules/radix
|
// https://eslint.org/docs/rules/radix
|
||||||
"radix": "error",
|
radix: 'error',
|
||||||
// https://eslint.org/docs/rules/require-await
|
// https://eslint.org/docs/rules/require-await
|
||||||
"require-await": "error",
|
'require-await': 'error',
|
||||||
// https://eslint.org/docs/rules/no-alert
|
// https://eslint.org/docs/rules/no-alert
|
||||||
"no-alert": "error",
|
'no-alert': 'error',
|
||||||
// https://eslint.org/docs/rules/no-useless-constructor
|
// https://eslint.org/docs/rules/no-useless-constructor
|
||||||
"no-useless-constructor": "error",
|
'no-useless-constructor': 'error',
|
||||||
// https://eslint.org/docs/rules/no-duplicate-imports
|
// https://eslint.org/docs/rules/no-duplicate-imports
|
||||||
"no-duplicate-imports": "error",
|
'no-duplicate-imports': 'error',
|
||||||
|
|
||||||
// https://eslint.org/docs/rules/no-implicit-coercion
|
// https://eslint.org/docs/rules/no-implicit-coercion
|
||||||
"no-implicit-coercion": "error",
|
'no-implicit-coercion': 'error',
|
||||||
//https://eslint.org/docs/rules/no-unneeded-ternary
|
//https://eslint.org/docs/rules/no-unneeded-ternary
|
||||||
"no-unneeded-ternary": "error",
|
'no-unneeded-ternary': 'error',
|
||||||
// https://eslint.org/docs/rules/semi
|
'vue/first-attribute-linebreak': 'error',
|
||||||
"semi": ["error", "always"],
|
'vue/multiline-html-element-content-newline': 'off',
|
||||||
// https://eslint.org/docs/rules/no-multi-spaces
|
'vue/singleline-html-element-content-newline': 'off',
|
||||||
"no-multi-spaces": "error",
|
'vue/multi-word-component-names': 'off', // TODO enable, align with conventions
|
||||||
// https://eslint.org/docs/rules/key-spacing
|
'vue/no-mutating-props': 'off'
|
||||||
"key-spacing": ["error", {
|
|
||||||
"afterColon": true
|
|
||||||
}],
|
|
||||||
// https://eslint.org/docs/rules/keyword-spacing
|
|
||||||
"keyword-spacing": ["error", {
|
|
||||||
"before": true,
|
|
||||||
"after": true
|
|
||||||
}],
|
|
||||||
// https://eslint.org/docs/rules/comma-spacing
|
|
||||||
// Also requires one line code fix
|
|
||||||
"comma-spacing": ["error", {
|
|
||||||
"after": true
|
|
||||||
}],
|
|
||||||
//https://eslint.org/docs/rules/no-whitespace-before-property
|
|
||||||
"no-whitespace-before-property": "error",
|
|
||||||
// https://eslint.org/docs/rules/object-curly-newline
|
|
||||||
"object-curly-newline": ["error", {
|
|
||||||
"consistent": true,
|
|
||||||
"multiline": true
|
|
||||||
}],
|
|
||||||
// https://eslint.org/docs/rules/object-property-newline
|
|
||||||
"object-property-newline": "error",
|
|
||||||
// https://eslint.org/docs/rules/brace-style
|
|
||||||
"brace-style": "error",
|
|
||||||
// https://eslint.org/docs/rules/no-multiple-empty-lines
|
|
||||||
"no-multiple-empty-lines": ["error", {"max": 1}],
|
|
||||||
// https://eslint.org/docs/rules/operator-linebreak
|
|
||||||
"operator-linebreak": ["error", "before", {"overrides": {"=": "after"}}],
|
|
||||||
// https://eslint.org/docs/rules/padding-line-between-statements
|
|
||||||
"padding-line-between-statements": ["error", {
|
|
||||||
"blankLine": "always",
|
|
||||||
"prev": "multiline-block-like",
|
|
||||||
"next": "*"
|
|
||||||
}, {
|
|
||||||
"blankLine": "always",
|
|
||||||
"prev": "*",
|
|
||||||
"next": "return"
|
|
||||||
}],
|
|
||||||
// https://eslint.org/docs/rules/space-infix-ops
|
|
||||||
"space-infix-ops": "error",
|
|
||||||
// https://eslint.org/docs/rules/space-unary-ops
|
|
||||||
"space-unary-ops": ["error", {
|
|
||||||
"words": true,
|
|
||||||
"nonwords": false
|
|
||||||
}],
|
|
||||||
// https://eslint.org/docs/rules/arrow-spacing
|
|
||||||
"arrow-spacing": "error",
|
|
||||||
// https://eslint.org/docs/rules/semi-spacing
|
|
||||||
"semi-spacing": ["error", {
|
|
||||||
"before": false,
|
|
||||||
"after": true
|
|
||||||
}],
|
|
||||||
|
|
||||||
"vue/html-indent": [
|
|
||||||
"error",
|
|
||||||
4,
|
|
||||||
{
|
|
||||||
"attribute": 1,
|
|
||||||
"baseIndent": 0,
|
|
||||||
"closeBracket": 0,
|
|
||||||
"alignAttributesVertically": true,
|
|
||||||
"ignores": []
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"vue/html-self-closing": ["error",
|
|
||||||
{
|
|
||||||
"html": {
|
|
||||||
"void": "never",
|
|
||||||
"normal": "never",
|
|
||||||
"component": "always"
|
|
||||||
},
|
},
|
||||||
"svg": "always",
|
overrides: [
|
||||||
"math": "always"
|
{
|
||||||
|
files: LEGACY_FILES,
|
||||||
|
rules: {
|
||||||
|
'no-unused-vars': [
|
||||||
|
'warn',
|
||||||
|
{
|
||||||
|
vars: 'all',
|
||||||
|
args: 'none',
|
||||||
|
varsIgnorePattern: 'controller'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"vue/max-attributes-per-line": ["error", {
|
'no-nested-ternary': 'off',
|
||||||
"singleline": 1,
|
'no-var': 'off',
|
||||||
"multiline": 1,
|
'one-var': 'off'
|
||||||
}],
|
|
||||||
"vue/first-attribute-linebreak": "error",
|
|
||||||
"vue/multiline-html-element-content-newline": "off",
|
|
||||||
"vue/singleline-html-element-content-newline": "off",
|
|
||||||
"vue/multi-word-component-names": "off", // TODO enable, align with conventions
|
|
||||||
"vue/no-mutating-props": "off"
|
|
||||||
|
|
||||||
},
|
|
||||||
"overrides": [
|
|
||||||
{
|
|
||||||
"files": LEGACY_FILES,
|
|
||||||
"rules": {
|
|
||||||
"no-unused-vars": [
|
|
||||||
"warn",
|
|
||||||
{
|
|
||||||
"vars": "all",
|
|
||||||
"args": "none",
|
|
||||||
"varsIgnorePattern": "controller"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"no-nested-ternary": "off",
|
|
||||||
"no-var": "off",
|
|
||||||
"one-var": "off"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
12
.git-blame-ignore-revs
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# git-blame ignored revisions
|
||||||
|
# To configure, run:
|
||||||
|
# git config blame.ignoreRevsFile .git-blame-ignore-revs
|
||||||
|
# Requires Git > 2.23
|
||||||
|
# See https://git-scm.com/docs/git-blame#Documentation/git-blame.txt---ignore-revs-fileltfilegt
|
||||||
|
|
||||||
|
# Copyright year update 2022
|
||||||
|
4a9744e916d24122a81092f6b7950054048ba860
|
||||||
|
# Copyright year update 2023
|
||||||
|
8040b275fcf2ba71b42cd72d4daa64bb25c19c2d
|
||||||
|
# Apply `prettier` formatting
|
||||||
|
caa7bc6faebc204f67aedae3e35fb0d0d3ce27a7
|
||||||
53
.github/dependabot.yml
vendored
@@ -1,35 +1,38 @@
|
|||||||
|
|
||||||
version: 2
|
version: 2
|
||||||
updates:
|
updates:
|
||||||
- package-ecosystem: "npm"
|
- package-ecosystem: 'npm'
|
||||||
directory: "/"
|
directory: '/'
|
||||||
schedule:
|
schedule:
|
||||||
interval: "daily"
|
interval: 'weekly'
|
||||||
open-pull-requests-limit: 10
|
open-pull-requests-limit: 10
|
||||||
labels:
|
labels:
|
||||||
- "pr:e2e"
|
- 'pr:daveit'
|
||||||
- "type:maintenance"
|
- 'pr:e2e'
|
||||||
- "dependencies"
|
- 'type:maintenance'
|
||||||
- "pr:daveit"
|
- 'dependencies'
|
||||||
- "pr:platform"
|
- 'pr:platform'
|
||||||
ignore:
|
ignore:
|
||||||
#We have to source the playwright container which is not detected by Dependabot
|
#We have to source the playwright container which is not detected by Dependabot
|
||||||
- dependency-name: "@playwright/test"
|
- dependency-name: '@playwright/test'
|
||||||
- dependency-name: "playwright-core"
|
- dependency-name: 'playwright-core'
|
||||||
#Lots of noise in these type patch releases.
|
#Lots of noise in these type patch releases.
|
||||||
- dependency-name: "@babel/eslint-parser"
|
- dependency-name: '@babel/eslint-parser'
|
||||||
update-types: ["version-update:semver-patch"]
|
update-types: ['version-update:semver-patch']
|
||||||
- dependency-name: "eslint-plugin-vue"
|
- dependency-name: 'eslint-plugin-vue'
|
||||||
update-types: ["version-update:semver-patch"]
|
update-types: ['version-update:semver-patch']
|
||||||
- dependency-name: "babel-loader"
|
- dependency-name: 'babel-loader'
|
||||||
update-types: ["version-update:semver-patch"]
|
update-types: ['version-update:semver-patch']
|
||||||
- dependency-name: "sinon"
|
- dependency-name: 'sinon'
|
||||||
update-types: ["version-update:semver-patch"]
|
update-types: ['version-update:semver-patch']
|
||||||
- package-ecosystem: "github-actions"
|
- dependency-name: 'moment-timezone'
|
||||||
directory: "/"
|
update-types: ['version-update:semver-patch']
|
||||||
|
- dependency-name: '@types/lodash'
|
||||||
|
update-types: ['version-update:semver-patch']
|
||||||
|
- package-ecosystem: 'github-actions'
|
||||||
|
directory: '/'
|
||||||
schedule:
|
schedule:
|
||||||
interval: "daily"
|
interval: 'daily'
|
||||||
labels:
|
labels:
|
||||||
- "type:maintenance"
|
- 'pr:daveit'
|
||||||
- "dependencies"
|
- 'type:maintenance'
|
||||||
- "pr:daveit"
|
- 'dependencies'
|
||||||
|
|||||||
85
.github/workflows/e2e-couchdb.yml
vendored
@@ -1,38 +1,89 @@
|
|||||||
name: "e2e-couchdb"
|
name: 'e2e-couchdb'
|
||||||
on:
|
on:
|
||||||
|
push:
|
||||||
|
branches: master
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
- labeled
|
- labeled
|
||||||
- opened
|
- opened
|
||||||
env:
|
schedule:
|
||||||
OPENMCT_DATABASE_NAME: openmct
|
- cron: '0 0 * * *'
|
||||||
COUCH_ADMIN_USER: admin
|
|
||||||
COUCH_ADMIN_PASSWORD: password
|
|
||||||
COUCH_BASE_LOCAL: http://localhost:5984
|
|
||||||
COUCH_NODE_NAME: nonode@nohost
|
|
||||||
jobs:
|
jobs:
|
||||||
e2e-couchdb:
|
e2e-couchdb:
|
||||||
if: ${{ github.event.label.name == 'pr:e2e:couchdb' }}
|
if: contains(github.event.pull_request.labels.*.name, 'pr:e2e:couchdb') || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.event.action == 'opened'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 60
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- run : docker-compose -f src/plugins/persistence/couch/couchdb-compose.yaml up --detach
|
|
||||||
- run : sleep 3 # wait until CouchDB has started (TODO: there must be a better way)
|
|
||||||
- run : bash src/plugins/persistence/couch/setup-couchdb.sh
|
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: '16'
|
node-version: 'lts/hydrogen'
|
||||||
- run: npx playwright@1.29.0 install
|
|
||||||
- run: npm install
|
- name: Cache NPM dependencies
|
||||||
- run: sh src/plugins/persistence/couch/replace-localstorage-with-couchdb-indexhtml.sh
|
uses: actions/cache@v3
|
||||||
- run: npm run test:e2e:couchdb
|
with:
|
||||||
- run: ls -latr
|
path: ~/.npm
|
||||||
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-node-
|
||||||
|
|
||||||
|
- run: npm install --cache ~/.npm --no-audit --progress=false
|
||||||
|
|
||||||
|
- name: Login to DockerHub
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
continue-on-error: true
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
|
- run: npx playwright@1.36.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
|
||||||
|
sleep 3
|
||||||
|
bash src/plugins/persistence/couch/setup-couchdb.sh
|
||||||
|
bash src/plugins/persistence/couch/replace-localstorage-with-couchdb-indexhtml.sh
|
||||||
|
|
||||||
|
- name: Run CouchDB Tests and publish to deploysentinel
|
||||||
|
env:
|
||||||
|
DEPLOYSENTINEL_API_KEY: ${{ secrets.DEPLOYSENTINEL_API_KEY }}
|
||||||
|
COMMIT_INFO_SHA: ${{github.event.pull_request.head.sha }}
|
||||||
|
run: npm run test:e2e:couchdb
|
||||||
|
|
||||||
|
- name: Publish Results to Codecov.io
|
||||||
|
env:
|
||||||
|
SUPER_SECRET: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
run: npm run cov:e2e:full:publish
|
||||||
|
|
||||||
- name: Archive test results
|
- name: Archive test results
|
||||||
|
if: success() || failure()
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
path: test-results
|
path: test-results
|
||||||
|
|
||||||
- name: Archive html test results
|
- name: Archive html test results
|
||||||
|
if: success() || failure()
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
path: html-test-results
|
path: html-test-results
|
||||||
|
|
||||||
|
- name: Remove pr:e2e:couchdb label (if present)
|
||||||
|
if: always()
|
||||||
|
uses: actions/github-script@v6
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const { owner, repo, number } = context.issue;
|
||||||
|
const labelToRemove = 'pr:e2e:couchdb';
|
||||||
|
try {
|
||||||
|
await github.rest.issues.removeLabel({
|
||||||
|
owner,
|
||||||
|
repo,
|
||||||
|
issue_number: number,
|
||||||
|
name: labelToRemove
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
core.warning(`Failed to remove ' + labelToRemove + ' label: ${error.message}`);
|
||||||
|
}
|
||||||
|
|||||||
78
.github/workflows/e2e-pr.yml
vendored
@@ -1,62 +1,68 @@
|
|||||||
name: "e2e-pr"
|
name: 'e2e-pr'
|
||||||
on:
|
on:
|
||||||
|
push:
|
||||||
|
branches: master
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
- labeled
|
- labeled
|
||||||
- opened
|
- opened
|
||||||
|
schedule:
|
||||||
|
- cron: '0 0 * * *'
|
||||||
jobs:
|
jobs:
|
||||||
e2e-full:
|
e2e-full:
|
||||||
if: ${{ github.event.label.name == 'pr:e2e' }}
|
if: contains(github.event.pull_request.labels.*.name, 'pr:e2e') || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
timeout-minutes: 60
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os:
|
os:
|
||||||
- ubuntu-latest
|
- ubuntu-latest
|
||||||
- windows-latest
|
- windows-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Trigger Success
|
|
||||||
uses: actions/github-script@v6
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
github.rest.issues.createComment({
|
|
||||||
issue_number: context.issue.number,
|
|
||||||
owner: "nasa",
|
|
||||||
repo: "openmct",
|
|
||||||
body: 'Started e2e Run. Follow along: https://github.com/nasa/openmct/actions/runs/' + context.runId
|
|
||||||
})
|
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: '16'
|
node-version: 'lts/hydrogen'
|
||||||
- run: npx playwright@1.29.0 install
|
|
||||||
|
- name: Cache NPM dependencies
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: ~/.npm
|
||||||
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-node-
|
||||||
|
|
||||||
|
- run: npx playwright@1.36.2 install
|
||||||
- run: npx playwright install chrome-beta
|
- run: npx playwright install chrome-beta
|
||||||
- run: npm install
|
- run: npm install --cache ~/.npm --no-audit --progress=false
|
||||||
- run: npm run test:e2e:full
|
- run: npm run test:e2e:full -- --max-failures=40
|
||||||
|
- run: npm run cov:e2e:report || true
|
||||||
|
- shell: bash
|
||||||
|
env:
|
||||||
|
SUPER_SECRET: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
run: |
|
||||||
|
npm run cov:e2e:full:publish
|
||||||
- name: Archive test results
|
- name: Archive test results
|
||||||
|
if: success() || failure()
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
path: test-results
|
path: test-results
|
||||||
- name: Test success
|
|
||||||
if: ${{ success() }}
|
- name: Remove pr:e2e label (if present)
|
||||||
|
if: always()
|
||||||
uses: actions/github-script@v6
|
uses: actions/github-script@v6
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
github.rest.issues.createComment({
|
const { owner, repo, number } = context.issue;
|
||||||
issue_number: context.issue.number,
|
const labelToRemove = 'pr:e2e';
|
||||||
owner: "nasa",
|
try {
|
||||||
repo: "openmct",
|
await github.rest.issues.removeLabel({
|
||||||
body: 'Success ✅ ! Build artifacts are here: https://github.com/nasa/openmct/actions/runs/' + context.runId
|
owner,
|
||||||
})
|
repo,
|
||||||
- name: Test failure
|
issue_number: number,
|
||||||
if: ${{ failure() }}
|
name: labelToRemove
|
||||||
uses: actions/github-script@v6
|
});
|
||||||
with:
|
} catch (error) {
|
||||||
script: |
|
core.warning(`Failed to remove ' + labelToRemove + ' label: ${error.message}`);
|
||||||
github.rest.issues.createComment({
|
}
|
||||||
issue_number: context.issue.number,
|
|
||||||
owner: "nasa",
|
|
||||||
repo: "openmct",
|
|
||||||
body: 'Failure ❌ ! Build artifacts are here: https://github.com/nasa/openmct/actions/runs/' + context.runId
|
|
||||||
})
|
|
||||||
21
.github/workflows/e2e.yml
vendored
@@ -1,21 +0,0 @@
|
|||||||
name: "e2e"
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
version:
|
|
||||||
description: 'Which branch do you want to test?' # Limited to branch for now
|
|
||||||
required: false
|
|
||||||
default: 'master'
|
|
||||||
jobs:
|
|
||||||
e2e:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
ref: ${{ github.event.inputs.version }}
|
|
||||||
- uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: '16'
|
|
||||||
- run: npm install
|
|
||||||
- name: Run the e2e tests
|
|
||||||
run: npm run test:e2e:ci
|
|
||||||
4
.github/workflows/npm-prerelease.yml
vendored
@@ -14,7 +14,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: lts/hydrogen
|
||||||
- run: npm install
|
- run: npm install
|
||||||
- run: |
|
- run: |
|
||||||
echo "//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN" >> ~/.npmrc
|
echo "//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN" >> ~/.npmrc
|
||||||
@@ -29,7 +29,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: lts/hydrogen
|
||||||
registry-url: https://registry.npmjs.org/
|
registry-url: https://registry.npmjs.org/
|
||||||
- run: npm install
|
- run: npm install
|
||||||
- run: npm publish --access=public --tag unstable
|
- run: npm publish --access=public --tag unstable
|
||||||
|
|||||||
54
.github/workflows/pr-platform.yml
vendored
@@ -1,13 +1,19 @@
|
|||||||
name: "pr-platform"
|
name: 'pr-platform'
|
||||||
on:
|
on:
|
||||||
|
push:
|
||||||
|
branches: master
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [ labeled ]
|
types:
|
||||||
|
- labeled
|
||||||
|
- opened
|
||||||
|
schedule:
|
||||||
|
- cron: '0 0 * * *'
|
||||||
jobs:
|
jobs:
|
||||||
e2e-full:
|
pr-platform:
|
||||||
if: ${{ github.event.label.name == 'pr:platform' }}
|
if: contains(github.event.pull_request.labels.*.name, 'pr:platform') || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
timeout-minutes: 60
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -16,19 +22,49 @@ jobs:
|
|||||||
- macos-latest
|
- macos-latest
|
||||||
- windows-latest
|
- windows-latest
|
||||||
node_version:
|
node_version:
|
||||||
- 14
|
- lts/gallium
|
||||||
- 16
|
- lts/hydrogen
|
||||||
- 18
|
|
||||||
architecture:
|
architecture:
|
||||||
- x64
|
- x64
|
||||||
|
|
||||||
name: Node ${{ matrix.node_version }} - ${{ matrix.architecture }} on ${{ matrix.os }}
|
name: Node ${{ matrix.node_version }} - ${{ matrix.architecture }} on ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup node
|
- name: Setup node
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node_version }}
|
node-version: ${{ matrix.node_version }}
|
||||||
architecture: ${{ matrix.architecture }}
|
architecture: ${{ matrix.architecture }}
|
||||||
- run: npm install
|
|
||||||
|
- name: Cache NPM dependencies
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: ~/.npm
|
||||||
|
key: ${{ runner.os }}-${{ matrix.node_version }}-${{ hashFiles('**/package.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-${{ matrix.node_version }}-
|
||||||
|
|
||||||
|
- run: npm install --cache ~/.npm --no-audit --progress=false
|
||||||
|
|
||||||
- run: npm test
|
- run: npm test
|
||||||
|
|
||||||
- run: npm run lint -- --quiet
|
- run: npm run lint -- --quiet
|
||||||
|
|
||||||
|
- name: Remove pr:platform label (if present)
|
||||||
|
if: always()
|
||||||
|
uses: actions/github-script@v6
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const { owner, repo, number } = context.issue;
|
||||||
|
const labelToRemove = 'pr:platform';
|
||||||
|
try {
|
||||||
|
await github.rest.issues.removeLabel({
|
||||||
|
owner,
|
||||||
|
repo,
|
||||||
|
issue_number: number,
|
||||||
|
name: labelToRemove
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
core.warning(`Failed to remove ' + labelToRemove + ' label: ${error.message}`);
|
||||||
|
}
|
||||||
|
|||||||
2
.github/workflows/prcop.yml
vendored
@@ -22,5 +22,5 @@ jobs:
|
|||||||
- name: Linting Pull Request
|
- name: Linting Pull Request
|
||||||
uses: makaroni4/prcop@v1.0.35
|
uses: makaroni4/prcop@v1.0.35
|
||||||
with:
|
with:
|
||||||
config-file: ".github/workflows/prcop-config.json"
|
config-file: '.github/workflows/prcop-config.json'
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
27
.prettierignore
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
# Docs
|
||||||
|
*.md
|
||||||
|
|
||||||
|
# Build output
|
||||||
|
target
|
||||||
|
dist
|
||||||
|
|
||||||
|
# Mac OS X Finder
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
|
# Node dependencies
|
||||||
|
node_modules
|
||||||
|
|
||||||
|
# npm-debug log
|
||||||
|
npm-debug.log
|
||||||
|
|
||||||
|
# karma reports
|
||||||
|
report.*.json
|
||||||
|
|
||||||
|
# e2e test artifacts
|
||||||
|
test-results
|
||||||
|
html-test-results
|
||||||
|
|
||||||
|
# codecov artifacts
|
||||||
|
.nyc_output
|
||||||
|
coverage
|
||||||
|
codecov
|
||||||
6
.prettierrc
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"trailingComma": "none",
|
||||||
|
"singleQuote": true,
|
||||||
|
"printWidth": 100,
|
||||||
|
"endOfLine": "auto"
|
||||||
|
}
|
||||||
@@ -8,80 +8,67 @@ This is the OpenMCT common webpack file. It is imported by the other three webpa
|
|||||||
There are separate npm scripts to use these configurations, though simply running `npm install`
|
There are separate npm scripts to use these configurations, though simply running `npm install`
|
||||||
will use the default production configuration.
|
will use the default production configuration.
|
||||||
*/
|
*/
|
||||||
const path = require("path");
|
const path = require('path');
|
||||||
const packageDefinition = require("../package.json");
|
const packageDefinition = require('../package.json');
|
||||||
const CopyWebpackPlugin = require("copy-webpack-plugin");
|
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||||
const webpack = require("webpack");
|
const webpack = require('webpack');
|
||||||
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||||
|
|
||||||
const { VueLoaderPlugin } = require("vue-loader");
|
const { VueLoaderPlugin } = require('vue-loader');
|
||||||
let gitRevision = "error-retrieving-revision";
|
let gitRevision = 'error-retrieving-revision';
|
||||||
let gitBranch = "error-retrieving-branch";
|
let gitBranch = 'error-retrieving-branch';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
gitRevision = require("child_process")
|
gitRevision = require('child_process').execSync('git rev-parse HEAD').toString().trim();
|
||||||
.execSync("git rev-parse HEAD")
|
gitBranch = require('child_process')
|
||||||
.toString()
|
.execSync('git rev-parse --abbrev-ref HEAD')
|
||||||
.trim();
|
|
||||||
gitBranch = require("child_process")
|
|
||||||
.execSync("git rev-parse --abbrev-ref HEAD")
|
|
||||||
.toString()
|
.toString()
|
||||||
.trim();
|
.trim();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.warn(err);
|
console.warn(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
const projectRootDir = path.resolve(__dirname, "..");
|
const projectRootDir = path.resolve(__dirname, '..');
|
||||||
|
|
||||||
/** @type {import('webpack').Configuration} */
|
/** @type {import('webpack').Configuration} */
|
||||||
const config = {
|
const config = {
|
||||||
context: projectRootDir,
|
context: projectRootDir,
|
||||||
entry: {
|
entry: {
|
||||||
openmct: "./openmct.js",
|
openmct: './openmct.js',
|
||||||
generatorWorker: "./example/generator/generatorWorker.js",
|
generatorWorker: './example/generator/generatorWorker.js',
|
||||||
couchDBChangesFeed:
|
couchDBChangesFeed: './src/plugins/persistence/couch/CouchChangesFeed.js',
|
||||||
"./src/plugins/persistence/couch/CouchChangesFeed.js",
|
inMemorySearchWorker: './src/api/objects/InMemorySearchWorker.js',
|
||||||
inMemorySearchWorker: "./src/api/objects/InMemorySearchWorker.js",
|
espressoTheme: './src/plugins/themes/espresso-theme.scss',
|
||||||
espressoTheme: "./src/plugins/themes/espresso-theme.scss",
|
snowTheme: './src/plugins/themes/snow-theme.scss'
|
||||||
snowTheme: "./src/plugins/themes/snow-theme.scss"
|
|
||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
globalObject: "this",
|
globalObject: 'this',
|
||||||
filename: "[name].js",
|
filename: '[name].js',
|
||||||
path: path.resolve(projectRootDir, "dist"),
|
path: path.resolve(projectRootDir, 'dist'),
|
||||||
library: "openmct",
|
library: 'openmct',
|
||||||
libraryTarget: "umd",
|
libraryTarget: 'umd',
|
||||||
publicPath: "",
|
publicPath: '',
|
||||||
hashFunction: "xxhash64",
|
hashFunction: 'xxhash64',
|
||||||
clean: true
|
clean: true
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
"@": path.join(projectRootDir, "src"),
|
'@': path.join(projectRootDir, 'src'),
|
||||||
legacyRegistry: path.join(projectRootDir, "src/legacyRegistry"),
|
legacyRegistry: path.join(projectRootDir, 'src/legacyRegistry'),
|
||||||
saveAs: "file-saver/src/FileSaver.js",
|
//saveAs: 'file-saver/src/FileSaver.js',
|
||||||
csv: "comma-separated-values",
|
csv: 'comma-separated-values',
|
||||||
EventEmitter: "eventemitter3",
|
EventEmitter: 'eventemitter3',
|
||||||
bourbon: "bourbon.scss",
|
bourbon: 'bourbon.scss',
|
||||||
"plotly-basic": "plotly.js-basic-dist",
|
'plotly-basic': 'plotly.js-basic-dist',
|
||||||
"plotly-gl2d": "plotly.js-gl2d-dist",
|
'plotly-gl2d': 'plotly.js-gl2d-dist',
|
||||||
"d3-scale": path.join(
|
'd3-scale': path.join(projectRootDir, 'node_modules/d3-scale/dist/d3-scale.min.js'),
|
||||||
projectRootDir,
|
printj: path.join(projectRootDir, 'node_modules/printj/dist/printj.min.js'),
|
||||||
"node_modules/d3-scale/dist/d3-scale.min.js"
|
styles: path.join(projectRootDir, 'src/styles'),
|
||||||
),
|
MCT: path.join(projectRootDir, 'src/MCT'),
|
||||||
printj: path.join(
|
testUtils: path.join(projectRootDir, 'src/utils/testUtils.js'),
|
||||||
projectRootDir,
|
objectUtils: path.join(projectRootDir, 'src/api/objects/object-utils.js'),
|
||||||
"node_modules/printj/dist/printj.min.js"
|
utils: path.join(projectRootDir, 'src/utils'),
|
||||||
),
|
vue: path.join(projectRootDir, 'node_modules/@vue/compat/dist/vue.esm-bundler.js'),
|
||||||
styles: path.join(projectRootDir, "src/styles"),
|
|
||||||
MCT: path.join(projectRootDir, "src/MCT"),
|
|
||||||
testUtils: path.join(projectRootDir, "src/utils/testUtils.js"),
|
|
||||||
objectUtils: path.join(
|
|
||||||
projectRootDir,
|
|
||||||
"src/api/objects/object-utils.js"
|
|
||||||
),
|
|
||||||
"kdbush": path.join(projectRootDir, "node_modules/kdbush/kdbush.min.js"),
|
|
||||||
utils: path.join(projectRootDir, "src/utils")
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
@@ -95,24 +82,24 @@ const config = {
|
|||||||
new CopyWebpackPlugin({
|
new CopyWebpackPlugin({
|
||||||
patterns: [
|
patterns: [
|
||||||
{
|
{
|
||||||
from: "src/images/favicons",
|
from: 'src/images/favicons',
|
||||||
to: "favicons"
|
to: 'favicons'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
from: "./index.html",
|
from: './index.html',
|
||||||
transform: function (content) {
|
transform: function (content) {
|
||||||
return content.toString().replace(/dist\//g, "");
|
return content.toString().replace(/dist\//g, '');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
from: "src/plugins/imagery/layers",
|
from: 'src/plugins/imagery/layers',
|
||||||
to: "imagery"
|
to: 'imagery'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}),
|
}),
|
||||||
new MiniCssExtractPlugin({
|
new MiniCssExtractPlugin({
|
||||||
filename: "[name].css",
|
filename: '[name].css',
|
||||||
chunkFilename: "[name].css"
|
chunkFilename: '[name].css'
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
module: {
|
module: {
|
||||||
@@ -122,49 +109,58 @@ const config = {
|
|||||||
use: [
|
use: [
|
||||||
MiniCssExtractPlugin.loader,
|
MiniCssExtractPlugin.loader,
|
||||||
{
|
{
|
||||||
loader: "css-loader"
|
loader: 'css-loader'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
loader: "resolve-url-loader"
|
loader: 'resolve-url-loader'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
loader: "sass-loader",
|
loader: 'sass-loader',
|
||||||
options: { sourceMap: true }
|
options: { sourceMap: true }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.vue$/,
|
test: /\.vue$/,
|
||||||
use: "vue-loader"
|
loader: 'vue-loader',
|
||||||
|
options: {
|
||||||
|
hotReload: false,
|
||||||
|
compilerOptions: {
|
||||||
|
whitespace: 'preserve',
|
||||||
|
compatConfig: {
|
||||||
|
MODE: 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.html$/,
|
test: /\.html$/,
|
||||||
type: "asset/source"
|
type: 'asset/source'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.(jpg|jpeg|png|svg)$/,
|
test: /\.(jpg|jpeg|png|svg)$/,
|
||||||
type: "asset/resource",
|
type: 'asset/resource',
|
||||||
generator: {
|
generator: {
|
||||||
filename: "images/[name][ext]"
|
filename: 'images/[name][ext]'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.ico$/,
|
test: /\.ico$/,
|
||||||
type: "asset/resource",
|
type: 'asset/resource',
|
||||||
generator: {
|
generator: {
|
||||||
filename: "icons/[name][ext]"
|
filename: 'icons/[name][ext]'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.(woff|woff2?|eot|ttf)$/,
|
test: /\.(woff|woff2?|eot|ttf)$/,
|
||||||
type: "asset/resource",
|
type: 'asset/resource',
|
||||||
generator: {
|
generator: {
|
||||||
filename: "fonts/[name][ext]"
|
filename: 'fonts/[name][ext]'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
stats: "errors-warnings",
|
stats: 'errors-warnings',
|
||||||
performance: {
|
performance: {
|
||||||
// We should eventually consider chunking to decrease
|
// We should eventually consider chunking to decrease
|
||||||
// these values
|
// these values
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ OpenMCT Continuous Integration servers use this configuration to add code covera
|
|||||||
information to pull requests.
|
information to pull requests.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const config = require("./webpack.dev");
|
const config = require('./webpack.dev');
|
||||||
// eslint-disable-next-line no-undef
|
// eslint-disable-next-line no-undef
|
||||||
const CI = process.env.CI === "true";
|
const CI = process.env.CI === 'true';
|
||||||
|
|
||||||
config.devtool = CI ? false : undefined;
|
config.devtool = CI ? false : undefined;
|
||||||
|
|
||||||
@@ -18,15 +18,15 @@ config.module.rules.push({
|
|||||||
test: /\.js$/,
|
test: /\.js$/,
|
||||||
exclude: /(Spec\.js$)|(node_modules)/,
|
exclude: /(Spec\.js$)|(node_modules)/,
|
||||||
use: {
|
use: {
|
||||||
loader: "babel-loader",
|
loader: 'babel-loader',
|
||||||
options: {
|
options: {
|
||||||
retainLines: true,
|
retainLines: true,
|
||||||
// eslint-disable-next-line no-undef
|
// eslint-disable-next-line no-undef
|
||||||
plugins: [
|
plugins: [
|
||||||
[
|
[
|
||||||
"babel-plugin-istanbul",
|
'babel-plugin-istanbul',
|
||||||
{
|
{
|
||||||
extension: [".js", ".vue"]
|
extension: ['.js', '.vue']
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -5,55 +5,56 @@ This configuration should be used for development purposes. It contains full sou
|
|||||||
devServer (which be invoked using by `npm start`), and a non-minified Vue.js distribution.
|
devServer (which be invoked using by `npm start`), and a non-minified Vue.js distribution.
|
||||||
If OpenMCT is to be used for a production server, use webpack.prod.js instead.
|
If OpenMCT is to be used for a production server, use webpack.prod.js instead.
|
||||||
*/
|
*/
|
||||||
const path = require("path");
|
const path = require('path');
|
||||||
const webpack = require("webpack");
|
const webpack = require('webpack');
|
||||||
const { merge } = require("webpack-merge");
|
const { merge } = require('webpack-merge');
|
||||||
|
|
||||||
const common = require("./webpack.common");
|
const common = require('./webpack.common');
|
||||||
const projectRootDir = path.resolve(__dirname, "..");
|
const projectRootDir = path.resolve(__dirname, '..');
|
||||||
|
|
||||||
module.exports = merge(common, {
|
module.exports = merge(common, {
|
||||||
mode: "development",
|
cache: false,
|
||||||
|
mode: 'development',
|
||||||
watchOptions: {
|
watchOptions: {
|
||||||
// Since we use require.context, webpack is watching the entire directory.
|
// Since we use require.context, webpack is watching the entire directory.
|
||||||
// We need to exclude any files we don't want webpack to watch.
|
// We need to exclude any files we don't want webpack to watch.
|
||||||
// See: https://webpack.js.org/configuration/watch/#watchoptions-exclude
|
// See: https://webpack.js.org/configuration/watch/#watchoptions-exclude
|
||||||
ignored: [
|
ignored: [
|
||||||
"**/{node_modules,dist,docs,e2e}", // All files in node_modules, dist, docs, e2e,
|
'**/{node_modules,dist,docs,e2e}', // All files in node_modules, dist, docs, e2e,
|
||||||
"**/{*.yml,Procfile,webpack*.js,babel*.js,package*.json,tsconfig.json}", // Config files
|
'**/{*.yml,Procfile,webpack*.js,babel*.js,package*.json,tsconfig.json}', // Config files
|
||||||
"**/*.{sh,md,png,ttf,woff,svg}", // Non source files
|
'**/*.{sh,md,png,ttf,woff,svg}', // Non source files
|
||||||
"**/.*" // dotfiles and dotfolders
|
'**/.*' // dotfiles and dotfolders
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
resolve: {
|
|
||||||
alias: {
|
|
||||||
vue: path.join(projectRootDir, "node_modules/vue/dist/vue.js")
|
|
||||||
}
|
|
||||||
},
|
|
||||||
plugins: [
|
plugins: [
|
||||||
new webpack.DefinePlugin({
|
new webpack.DefinePlugin({
|
||||||
__OPENMCT_ROOT_RELATIVE__: '"dist/"'
|
__OPENMCT_ROOT_RELATIVE__: '"dist/"'
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
devtool: "eval-source-map",
|
devtool: 'eval-source-map',
|
||||||
devServer: {
|
devServer: {
|
||||||
|
hot: false,
|
||||||
devMiddleware: {
|
devMiddleware: {
|
||||||
writeToDisk: (filePathString) => {
|
writeToDisk: (filePathString) => {
|
||||||
const filePath = path.parse(filePathString);
|
const filePath = path.parse(filePathString);
|
||||||
const shouldWrite = !filePath.base.includes("hot-update");
|
const shouldWrite = !filePath.base.includes('hot-update');
|
||||||
|
|
||||||
return shouldWrite;
|
return shouldWrite;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watchFiles: ["**/*.css"],
|
watchFiles: ['**/*.css'],
|
||||||
static: {
|
static: {
|
||||||
directory: path.join(__dirname, "..", "/dist"),
|
directory: path.join(__dirname, '..', '/dist'),
|
||||||
publicPath: "/dist",
|
publicPath: '/dist',
|
||||||
watch: false
|
watch: false
|
||||||
},
|
},
|
||||||
client: {
|
client: {
|
||||||
progress: true,
|
progress: true,
|
||||||
overlay: true
|
overlay: {
|
||||||
|
// Disable overlay for runtime errors.
|
||||||
|
// See: https://github.com/webpack/webpack-dev-server/issues/4771
|
||||||
|
runtimeErrors: false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4,24 +4,19 @@
|
|||||||
This configuration should be used for production installs.
|
This configuration should be used for production installs.
|
||||||
It is the default webpack configuration.
|
It is the default webpack configuration.
|
||||||
*/
|
*/
|
||||||
const path = require("path");
|
const path = require('path');
|
||||||
const webpack = require("webpack");
|
const webpack = require('webpack');
|
||||||
const { merge } = require("webpack-merge");
|
const { merge } = require('webpack-merge');
|
||||||
|
|
||||||
const common = require("./webpack.common");
|
const common = require('./webpack.common');
|
||||||
const projectRootDir = path.resolve(__dirname, "..");
|
const projectRootDir = path.resolve(__dirname, '..');
|
||||||
|
|
||||||
module.exports = merge(common, {
|
module.exports = merge(common, {
|
||||||
mode: "production",
|
mode: 'production',
|
||||||
resolve: {
|
|
||||||
alias: {
|
|
||||||
vue: path.join(projectRootDir, "node_modules/vue/dist/vue.min.js")
|
|
||||||
}
|
|
||||||
},
|
|
||||||
plugins: [
|
plugins: [
|
||||||
new webpack.DefinePlugin({
|
new webpack.DefinePlugin({
|
||||||
__OPENMCT_ROOT_RELATIVE__: '""'
|
__OPENMCT_ROOT_RELATIVE__: '""'
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
devtool: "source-map"
|
devtool: 'source-map'
|
||||||
});
|
});
|
||||||
|
|||||||
6
API.md
@@ -2,7 +2,7 @@
|
|||||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||||
**Table of Contents**
|
**Table of Contents**
|
||||||
|
|
||||||
- [Building Applications With Open MCT](#developing-applications-with-open-mct)
|
- [Developing Applications With Open MCT](#developing-applications-with-open-mct)
|
||||||
- [Scope and purpose of this document](#scope-and-purpose-of-this-document)
|
- [Scope and purpose of this document](#scope-and-purpose-of-this-document)
|
||||||
- [Building From Source](#building-from-source)
|
- [Building From Source](#building-from-source)
|
||||||
- [Starting an Open MCT application](#starting-an-open-mct-application)
|
- [Starting an Open MCT application](#starting-an-open-mct-application)
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
- [Value Hints](#value-hints)
|
- [Value Hints](#value-hints)
|
||||||
- [The Time Conductor and Telemetry](#the-time-conductor-and-telemetry)
|
- [The Time Conductor and Telemetry](#the-time-conductor-and-telemetry)
|
||||||
- [Telemetry Providers](#telemetry-providers)
|
- [Telemetry Providers](#telemetry-providers)
|
||||||
- [Telemetry Requests and Responses.](#telemetry-requests-and-responses)
|
- [Telemetry Requests and Responses](#telemetry-requests-and-responses)
|
||||||
- [Request Strategies **draft**](#request-strategies-draft)
|
- [Request Strategies **draft**](#request-strategies-draft)
|
||||||
- [`latest` request strategy](#latest-request-strategy)
|
- [`latest` request strategy](#latest-request-strategy)
|
||||||
- [`minmax` request strategy](#minmax-request-strategy)
|
- [`minmax` request strategy](#minmax-request-strategy)
|
||||||
@@ -873,6 +873,8 @@ function without any arguments.
|
|||||||
|
|
||||||
#### Stopping an active clock
|
#### Stopping an active clock
|
||||||
|
|
||||||
|
_As of July 2023, this method will be deprecated. Open MCT will always have a ticking clock._
|
||||||
|
|
||||||
The `stopClock` method can be used to stop an active clock, and to clear it. It
|
The `stopClock` method can be used to stop an active clock, and to clear it. It
|
||||||
will stop the clock from ticking, and set the active clock to `undefined`.
|
will stop the clock from ticking, and set the active clock to `undefined`.
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ The short version:
|
|||||||
|
|
||||||
Open MCT uses git for software version control, and for branching and
|
Open MCT uses git for software version control, and for branching and
|
||||||
merging. The central repository is at
|
merging. The central repository is at
|
||||||
https://github.com/nasa/openmct.git.
|
<https://github.com/nasa/openmct.git>.
|
||||||
|
|
||||||
### Roles
|
### Roles
|
||||||
|
|
||||||
@@ -116,6 +116,7 @@ the pull request containing the reviewer checklist (from below) and complete
|
|||||||
the merge back to the master branch.
|
the merge back to the master branch.
|
||||||
|
|
||||||
Additionally:
|
Additionally:
|
||||||
|
|
||||||
* Every pull request must link to the issue that it addresses. Eg. “Addresses #1234” or “Closes #1234”. This is the responsibility of the pull request’s __author__. If no issue exists, [create one](https://github.com/nasa/openmct/issues/new/choose).
|
* Every pull request must link to the issue that it addresses. Eg. “Addresses #1234” or “Closes #1234”. This is the responsibility of the pull request’s __author__. If no issue exists, [create one](https://github.com/nasa/openmct/issues/new/choose).
|
||||||
* Every __author__ must include testing instructions. These instructions should identify the areas of code affected, and some minimal test steps. If addressing a bug, reproduction steps should be included, if they were not included in the original issue. If reproduction steps were included on the original issue, and are sufficient, refer to them.
|
* Every __author__ must include testing instructions. These instructions should identify the areas of code affected, and some minimal test steps. If addressing a bug, reproduction steps should be included, if they were not included in the original issue. If reproduction steps were included on the original issue, and are sufficient, refer to them.
|
||||||
* A pull request that closes an issue should say so in the description. Including the text “Closes #1234” will cause the linked issue to be automatically closed when the pull request is merged. This is the responsibility of the pull request’s __author__.
|
* A pull request that closes an issue should say so in the description. Including the text “Closes #1234” will cause the linked issue to be automatically closed when the pull request is merged. This is the responsibility of the pull request’s __author__.
|
||||||
@@ -132,14 +133,15 @@ changes.
|
|||||||
|
|
||||||
### Code Standards
|
### Code Standards
|
||||||
|
|
||||||
JavaScript sources in Open MCT must satisfy the ESLint rules defined in
|
JavaScript sources in Open MCT must satisfy the [ESLint](https://eslint.org/) rules defined in
|
||||||
this repository. This is verified by the command line build.
|
this repository. [Prettier](https://prettier.io/) is used in conjunction with ESLint to enforce code style
|
||||||
|
via automated formatting. These are verified by the command line build.
|
||||||
|
|
||||||
#### Code Guidelines
|
#### Code Guidelines
|
||||||
|
|
||||||
The following guidelines are provided for anyone contributing source code to the Open MCT project:
|
The following guidelines are provided for anyone contributing source code to the Open MCT project:
|
||||||
|
|
||||||
1. Write clean code. Here’s a good summary - https://github.com/ryanmcdermott/clean-code-javascript.
|
1. Write clean code. Here’s a good summary - <https://github.com/ryanmcdermott/clean-code-javascript>.
|
||||||
1. Include JSDoc for any exposed API (e.g. public methods, classes).
|
1. Include JSDoc for any exposed API (e.g. public methods, classes).
|
||||||
1. Include non-JSDoc comments as-needed for explaining private variables,
|
1. Include non-JSDoc comments as-needed for explaining private variables,
|
||||||
methods, or algorithms when they are non-obvious. Otherwise code
|
methods, or algorithms when they are non-obvious. Otherwise code
|
||||||
@@ -159,17 +161,21 @@ The following guidelines are provided for anyone contributing source code to the
|
|||||||
(e.g. as arguments to a forEach call). Anonymous functions should always be arrow functions.
|
(e.g. as arguments to a forEach call). Anonymous functions should always be arrow functions.
|
||||||
1. Named functions are preferred over functions assigned to variables.
|
1. Named functions are preferred over functions assigned to variables.
|
||||||
eg.
|
eg.
|
||||||
|
|
||||||
```JavaScript
|
```JavaScript
|
||||||
function renameObject(object, newName) {
|
function renameObject(object, newName) {
|
||||||
Object.name = newName;
|
Object.name = newName;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
is preferable to
|
is preferable to
|
||||||
|
|
||||||
```JavaScript
|
```JavaScript
|
||||||
const rename = (object, newName) => {
|
const rename = (object, newName) => {
|
||||||
Object.name = newName;
|
Object.name = newName;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
1. Avoid deep nesting (especially of functions), except where necessary
|
1. Avoid deep nesting (especially of functions), except where necessary
|
||||||
(e.g. due to closure scope).
|
(e.g. due to closure scope).
|
||||||
1. End with a single new-line character.
|
1. End with a single new-line character.
|
||||||
@@ -182,19 +188,24 @@ The following guidelines are provided for anyone contributing source code to the
|
|||||||
* Finally, the returned value. A single return statement at the end of the function should be used, except where an early return would improve code clarity.
|
* Finally, the returned value. A single return statement at the end of the function should be used, except where an early return would improve code clarity.
|
||||||
1. Avoid the use of "magic" values.
|
1. Avoid the use of "magic" values.
|
||||||
eg.
|
eg.
|
||||||
|
|
||||||
```JavaScript
|
```JavaScript
|
||||||
const UNAUTHORIZED = 401;
|
const UNAUTHORIZED = 401;
|
||||||
if (responseCode === UNAUTHORIZED)
|
if (responseCode === UNAUTHORIZED)
|
||||||
```
|
```
|
||||||
|
|
||||||
is preferable to
|
is preferable to
|
||||||
|
|
||||||
```JavaScript
|
```JavaScript
|
||||||
if (responseCode === 401)
|
if (responseCode === 401)
|
||||||
```
|
```
|
||||||
|
|
||||||
1. Use the ternary operator only for simple cases such as variable assignment. Nested ternaries should be avoided in all cases.
|
1. Use the ternary operator only for simple cases such as variable assignment. Nested ternaries should be avoided in all cases.
|
||||||
1. Test specs should reside alongside the source code they test, not in a separate directory.
|
1. Unit Test specs should reside alongside the source code they test, not in a separate directory.
|
||||||
1. Organize code by feature, not by type.
|
1. Organize code by feature, not by type.
|
||||||
eg.
|
eg.
|
||||||
```
|
|
||||||
|
```txt
|
||||||
- telemetryTable
|
- telemetryTable
|
||||||
- row
|
- row
|
||||||
TableRow.js
|
TableRow.js
|
||||||
@@ -206,8 +217,10 @@ The following guidelines are provided for anyone contributing source code to the
|
|||||||
plugin.js
|
plugin.js
|
||||||
pluginSpec.js
|
pluginSpec.js
|
||||||
```
|
```
|
||||||
|
|
||||||
is preferable to
|
is preferable to
|
||||||
```
|
|
||||||
|
```txt
|
||||||
- telemetryTable
|
- telemetryTable
|
||||||
- components
|
- components
|
||||||
TableRow.vue
|
TableRow.vue
|
||||||
@@ -219,47 +232,10 @@ The following guidelines are provided for anyone contributing source code to the
|
|||||||
plugin.js
|
plugin.js
|
||||||
pluginSpec.js
|
pluginSpec.js
|
||||||
```
|
```
|
||||||
|
|
||||||
Deviations from Open MCT code style guidelines require two-party agreement,
|
Deviations from Open MCT code style guidelines require two-party agreement,
|
||||||
typically from the author of the change and its reviewer.
|
typically from the author of the change and its reviewer.
|
||||||
|
|
||||||
### Test Standards
|
|
||||||
|
|
||||||
Automated testing shall occur whenever changes are merged into the main
|
|
||||||
development branch and must be confirmed alongside any pull request.
|
|
||||||
|
|
||||||
Automated tests are tests which exercise plugins, API, and utility classes.
|
|
||||||
Tests are subject to code review along with the actual implementation, to
|
|
||||||
ensure that tests are applicable and useful.
|
|
||||||
|
|
||||||
Examples of useful tests:
|
|
||||||
* Tests which replicate bugs (or their root causes) to verify their
|
|
||||||
resolution.
|
|
||||||
* Tests which reflect details from software specifications.
|
|
||||||
* Tests which exercise edge or corner cases among inputs.
|
|
||||||
* Tests which verify expected interactions with other components in the
|
|
||||||
system.
|
|
||||||
|
|
||||||
#### Guidelines
|
|
||||||
* 100% statement coverage is achievable and desirable.
|
|
||||||
* Do blackbox testing. Test external behaviors, not internal details. Write tests that describe what your plugin is supposed to do. How it does this doesn't matter, so don't test it.
|
|
||||||
* Unit test specs for plugins should be defined at the plugin level. Start with one test spec per plugin named pluginSpec.js, and as this test spec grows too big, break it up into multiple test specs that logically group related tests.
|
|
||||||
* Unit tests for API or for utility functions and classes may be defined at a per-source file level.
|
|
||||||
* Wherever possible only use and mock public API, builtin functions, and UI in your test specs. Do not directly invoke any private functions. ie. only call or mock functions and objects exposed by openmct.* (eg. openmct.telemetry, openmct.objectView, etc.), and builtin browser functions (fetch, requestAnimationFrame, setTimeout, etc.).
|
|
||||||
* Where builtin functions have been mocked, be sure to clear them between tests.
|
|
||||||
* Test at an appropriate level of isolation. Eg.
|
|
||||||
* If you’re testing a view, you do not need to test the whole application UI, you can just fetch the view provider using the public API and render the view into an element that you have created.
|
|
||||||
* You do not need to test that the view switcher works, there should be separate tests for that.
|
|
||||||
* You do not need to test that telemetry providers work, you can mock openmct.telemetry.request() to feed test data to the view.
|
|
||||||
* Use your best judgement when deciding on appropriate scope.
|
|
||||||
* Automated tests for plugins should start by actually installing the plugin being tested, and then test that installing the plugin adds the desired features and behavior to Open MCT, observing the above rules.
|
|
||||||
* All variables used in a test spec, including any instances of the Open MCT API should be declared inside of an appropriate block scope (not at the root level of the source file), and should be initialized in the relevant beforeEach block. `beforeEach` is preferable to `beforeAll` to avoid leaking of state between tests.
|
|
||||||
* A `afterEach` or `afterAll` should be used to do any clean up necessary to prevent leakage of state between test specs. This can happen when functions on `window` are wrapped, or when the URL is changed. [A convenience function](https://github.com/nasa/openmct/blob/master/src/utils/testing.js#L59) is provided for resetting the URL and clearing builtin spies between tests.
|
|
||||||
* If writing unit tests for legacy Angular code be sure to follow [best practices in order to avoid memory leaks](https://www.thecodecampus.de/blog/avoid-memory-leaks-angularjs-unit-tests/).
|
|
||||||
|
|
||||||
#### Examples
|
|
||||||
* [Example of an automated test spec for an object view plugin](https://github.com/nasa/openmct/blob/master/src/plugins/telemetryTable/pluginSpec.js)
|
|
||||||
* [Example of an automated test spec for API](https://github.com/nasa/openmct/blob/master/src/api/time/TimeAPISpec.js)
|
|
||||||
|
|
||||||
### Commit Message Standards
|
### Commit Message Standards
|
||||||
|
|
||||||
Commit messages should:
|
Commit messages should:
|
||||||
@@ -295,13 +271,13 @@ these standards.
|
|||||||
|
|
||||||
## Issue Reporting
|
## Issue Reporting
|
||||||
|
|
||||||
Issues are tracked at https://github.com/nasa/openmct/issues.
|
Issues are tracked at <https://github.com/nasa/openmct/issues>.
|
||||||
|
|
||||||
Issue severity is categorized as follows (in ascending order):
|
Issue severity is categorized as follows (in ascending order):
|
||||||
|
|
||||||
* _Trivial_: Minimal impact on the usefulness and functionality of the software; a "nice-to-have." Visual impact without functional impact,
|
* _Trivial_: Minimal impact on the usefulness and functionality of the software; a "nice-to-have." Visual impact without functional impact,
|
||||||
* _Medium_: Some impairment of use, but simple workarounds exist
|
* _Medium_: Some impairment of use, but simple workarounds exist
|
||||||
* _Critical_: Significant loss of functionality or impairment of use. Display of telemetry data is not affected though.
|
* _Critical_: Significant loss of functionality or impairment of use. Display of telemetry data is not affected though. Complex workarounds exist.
|
||||||
* _Blocker_: Major functionality is impaired or lost, threatening mission success. Display of telemetry data is impaired or blocked by the bug, which could lead to loss of situational awareness.
|
* _Blocker_: Major functionality is impaired or lost, threatening mission success. Display of telemetry data is impaired or blocked by the bug, which could lead to loss of situational awareness.
|
||||||
|
|
||||||
## Check Lists
|
## Check Lists
|
||||||
@@ -310,22 +286,4 @@ The following check lists should be completed and attached to pull requests
|
|||||||
when they are filed (author checklist) and when they are merged (reviewer
|
when they are filed (author checklist) and when they are merged (reviewer
|
||||||
checklist).
|
checklist).
|
||||||
|
|
||||||
### Author Checklist
|
|
||||||
|
|
||||||
[Within PR Template](.github/PULL_REQUEST_TEMPLATE.md)
|
[Within PR Template](.github/PULL_REQUEST_TEMPLATE.md)
|
||||||
|
|
||||||
### Reviewer Checklist
|
|
||||||
|
|
||||||
* [ ] Changes appear to address issue?
|
|
||||||
* [ ] Changes appear not to be breaking changes?
|
|
||||||
* [ ] Appropriate unit tests included?
|
|
||||||
* [ ] Code style and in-line documentation are appropriate?
|
|
||||||
* [ ] Commit messages meet standards?
|
|
||||||
* [ ] Has associated issue been labelled `unverified`? (only applicable if this PR closes the issue)
|
|
||||||
* [ ] Has associated issue been labelled `bug`? (only applicable if this PR is for a bug fix)
|
|
||||||
* [ ] List of Acceptance Tests Performed.
|
|
||||||
|
|
||||||
Write out a small list of tests performed with just enough detail for another developer on the team
|
|
||||||
to execute.
|
|
||||||
|
|
||||||
i.e. ```When Clicking on Add button, new `object` appears in dropdown.```
|
|
||||||
|
|||||||
@@ -95,10 +95,10 @@ To run the performance tests:
|
|||||||
|
|
||||||
`npm run test:perf`
|
`npm run test:perf`
|
||||||
|
|
||||||
The test suite is configured to all tests localed in `e2e/tests/` ending in `*.e2e.spec.js`. For more about the e2e test suite, please see the [README](./e2e/README.md)
|
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)
|
||||||
|
|
||||||
### Security Tests
|
### 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 avaiable 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).
|
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
|
### Test Reporting and Code Coverage
|
||||||
|
|
||||||
|
|||||||
50
TESTING.md
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
# Testing
|
||||||
|
Open MCT Testing is iterating and improving at a rapid pace. This document serves to capture and index existing testing documentation and house documentation which no other obvious location as our testing evolves.
|
||||||
|
|
||||||
|
## General Testing Process
|
||||||
|
Documentation located [here](./docs/src/process/testing/plan.md)
|
||||||
|
|
||||||
|
## Unit Testing
|
||||||
|
Unit testing is essential part of our test strategy and complements our e2e testing strategy.
|
||||||
|
|
||||||
|
#### Unit Test Guidelines
|
||||||
|
* Unit Test specs should reside alongside the source code they test, not in a separate directory.
|
||||||
|
* Unit test specs for plugins should be defined at the plugin level. Start with one test spec per plugin named pluginSpec.js, and as this test spec grows too big, break it up into multiple test specs that logically group related tests.
|
||||||
|
* Unit tests for API or for utility functions and classes may be defined at a per-source file level.
|
||||||
|
* Wherever possible only use and mock public API, builtin functions, and UI in your test specs. Do not directly invoke any private functions. ie. only call or mock functions and objects exposed by openmct.* (eg. openmct.telemetry, openmct.objectView, etc.), and builtin browser functions (fetch, requestAnimationFrame, setTimeout, etc.).
|
||||||
|
* Where builtin functions have been mocked, be sure to clear them between tests.
|
||||||
|
* Test at an appropriate level of isolation. Eg.
|
||||||
|
* If you’re testing a view, you do not need to test the whole application UI, you can just fetch the view provider using the public API and render the view into an element that you have created.
|
||||||
|
* You do not need to test that the view switcher works, there should be separate tests for that.
|
||||||
|
* You do not need to test that telemetry providers work, you can mock openmct.telemetry.request() to feed test data to the view.
|
||||||
|
* Use your best judgement when deciding on appropriate scope.
|
||||||
|
* Automated tests for plugins should start by actually installing the plugin being tested, and then test that installing the plugin adds the desired features and behavior to Open MCT, observing the above rules.
|
||||||
|
* All variables used in a test spec, including any instances of the Open MCT API should be declared inside of an appropriate block scope (not at the root level of the source file), and should be initialized in the relevant beforeEach block. `beforeEach` is preferable to `beforeAll` to avoid leaking of state between tests.
|
||||||
|
* A `afterEach` or `afterAll` should be used to do any clean up necessary to prevent leakage of state between test specs. This can happen when functions on `window` are wrapped, or when the URL is changed. [A convenience function](https://github.com/nasa/openmct/blob/master/src/utils/testing.js#L59) is provided for resetting the URL and clearing builtin spies between tests.
|
||||||
|
|
||||||
|
#### Unit Test Examples
|
||||||
|
* [Example of an automated test spec for an object view plugin](https://github.com/nasa/openmct/blob/master/src/plugins/telemetryTable/pluginSpec.js)
|
||||||
|
* [Example of an automated test spec for API](https://github.com/nasa/openmct/blob/master/src/api/time/TimeAPISpec.js)
|
||||||
|
|
||||||
|
#### Unit Testing Execution
|
||||||
|
|
||||||
|
The unit tests can be executed in one of two ways:
|
||||||
|
`npm run test` which runs the entire suite against headless chrome
|
||||||
|
`npm run test:debug` for debugging the tests in realtime in an active chrome session.
|
||||||
|
|
||||||
|
## e2e, performance, and visual testing
|
||||||
|
Documentation located [here](./e2e/README.md)
|
||||||
|
|
||||||
|
## Code Coverage
|
||||||
|
|
||||||
|
* 100% statement coverage is achievable and desirable.
|
||||||
|
|
||||||
|
Codecov.io will combine each of the above commands with [Codecov.io Flags](https://docs.codecov.com/docs/flags). Effectively, this allows us to combine multiple reports which are run at various stages of our CI Pipeline or run as part of a parallel process.
|
||||||
|
|
||||||
|
This e2e coverage is combined with our unit test report to give a comprehensive (if flawed) view of line coverage.
|
||||||
|
|
||||||
|
### Limitations in our code coverage reporting
|
||||||
|
|
||||||
|
Our code coverage implementation has two known limitations:
|
||||||
|
- [Variability and accuracy](https://github.com/nasa/openmct/issues/5811)
|
||||||
|
- [Vue instrumentation](https://github.com/nasa/openmct/issues/4973)
|
||||||
10
codecov.yml
@@ -11,18 +11,18 @@ coverage:
|
|||||||
informational: true
|
informational: true
|
||||||
precision: 2
|
precision: 2
|
||||||
round: down
|
round: down
|
||||||
range: "66...100"
|
range: '66...100'
|
||||||
|
|
||||||
flags:
|
flags:
|
||||||
unit:
|
unit:
|
||||||
carryforward: true
|
carryforward: false
|
||||||
e2e-ci:
|
e2e-stable:
|
||||||
carryforward: true
|
carryforward: false
|
||||||
e2e-full:
|
e2e-full:
|
||||||
carryforward: true
|
carryforward: true
|
||||||
|
|
||||||
comment:
|
comment:
|
||||||
layout: "reach,diff,flags,files,footer"
|
layout: 'diff,flags,files,footer'
|
||||||
behavior: default
|
behavior: default
|
||||||
require_changes: false
|
require_changes: false
|
||||||
show_carryforward_flags: true
|
show_carryforward_flags: true
|
||||||
@@ -53,7 +53,7 @@ requirements.
|
|||||||
|
|
||||||
Additionally, the following project-specific standards will be used:
|
Additionally, the following project-specific standards will be used:
|
||||||
|
|
||||||
* During development, a "-SNAPSHOT" suffix shall be appended to the
|
* During development, a "-next" suffix shall be appended to the
|
||||||
version number. The version number before the suffix shall reflect
|
version number. The version number before the suffix shall reflect
|
||||||
the next expected version number for release.
|
the next expected version number for release.
|
||||||
* Prior to a 1.0.0 release, the _minor_ version will be incremented
|
* Prior to a 1.0.0 release, the _minor_ version will be incremented
|
||||||
@@ -93,7 +93,7 @@ numbers by the following process:
|
|||||||
|
|
||||||
1. Update version number in `package.json`
|
1. Update version number in `package.json`
|
||||||
1. Checkout branch created for the last sprint that has been successfully tested.
|
1. Checkout branch created for the last sprint that has been successfully tested.
|
||||||
2. Remove a `-SNAPSHOT` suffix from the version in `package.json`.
|
2. Remove a `-next` suffix from the version in `package.json`.
|
||||||
3. Verify that resulting version number meets semantic versioning
|
3. Verify that resulting version number meets semantic versioning
|
||||||
requirements relative to previous stable version. Increment the
|
requirements relative to previous stable version. Increment the
|
||||||
version number if necessary.
|
version number if necessary.
|
||||||
@@ -138,7 +138,7 @@ numbers by the following process:
|
|||||||
1. Create a new branch off the `master` branch.
|
1. Create a new branch off the `master` branch.
|
||||||
2. Remove any suffix from the version number,
|
2. Remove any suffix from the version number,
|
||||||
or increment the _patch_ version if there is no suffix.
|
or increment the _patch_ version if there is no suffix.
|
||||||
3. Append a `-SNAPSHOT` suffix.
|
3. Append a `-next` suffix.
|
||||||
4. Commit changes to `package.json` on the `master` branch.
|
4. Commit changes to `package.json` on the `master` branch.
|
||||||
The commit message should reference the sprint being opened,
|
The commit message should reference the sprint being opened,
|
||||||
preferably by a URL reference to the associated Milestone in
|
preferably by a URL reference to the associated Milestone in
|
||||||
@@ -150,6 +150,6 @@ numbers by the following process:
|
|||||||
Projects dependent on Open MCT being co-developed by the Open MCT
|
Projects dependent on Open MCT being co-developed by the Open MCT
|
||||||
team should follow a similar process, except that they should
|
team should follow a similar process, except that they should
|
||||||
additionally update their dependency on Open MCT to point to the
|
additionally update their dependency on Open MCT to point to the
|
||||||
latest archive when removing their `-SNAPSHOT` status, and
|
latest archive when removing their `-next` status, and
|
||||||
that they should be pointed back to the `master` branch after
|
that they should be pointed back to the `master` branch after
|
||||||
this has completed.
|
this has completed.
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
/* eslint-disable no-undef */
|
/* eslint-disable no-undef */
|
||||||
module.exports = {
|
module.exports = {
|
||||||
"extends": ["plugin:playwright/playwright-test"],
|
extends: ['plugin:playwright/playwright-test'],
|
||||||
"rules": {
|
rules: {
|
||||||
"playwright/max-nested-describe": ["error", { "max": 1 }]
|
'playwright/max-nested-describe': ['error', { max: 1 }]
|
||||||
},
|
},
|
||||||
"overrides": [
|
overrides: [
|
||||||
{
|
{
|
||||||
"files": ["tests/visual/*.spec.js"],
|
files: ['tests/visual/*.spec.js'],
|
||||||
"rules": {
|
rules: {
|
||||||
"playwright/no-wait-for-timeout": "off"
|
'playwright/no-wait-for-timeout': 'off'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
17
e2e/.percy.ci.yml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
version: 2
|
||||||
|
snapshot:
|
||||||
|
widths: [1024]
|
||||||
|
min-height: 1440 # px
|
||||||
|
percyCSS: |
|
||||||
|
.t-indicator-clock > .label {
|
||||||
|
opacity: 0 !important;
|
||||||
|
}
|
||||||
|
.c-input--datetime {
|
||||||
|
opacity: 0 !important;
|
||||||
|
}
|
||||||
|
div.c-conductor-axis.c-conductor__ticks > svg {
|
||||||
|
opacity: 0 !important;
|
||||||
|
}
|
||||||
|
div.c-inspector__properties.c-inspect-properties > ul > li:nth-child(3) {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
17
e2e/.percy.nightly.yml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
version: 2
|
||||||
|
snapshot:
|
||||||
|
widths: [1024, 2000]
|
||||||
|
min-height: 1440 # px
|
||||||
|
percyCSS: |
|
||||||
|
.t-indicator-clock > .label {
|
||||||
|
opacity: 0 !important;
|
||||||
|
}
|
||||||
|
.c-input--datetime {
|
||||||
|
opacity: 0 !important;
|
||||||
|
}
|
||||||
|
div.c-conductor-axis.c-conductor__ticks > svg {
|
||||||
|
opacity: 0 !important;
|
||||||
|
}
|
||||||
|
div.c-inspector__properties.c-inspect-properties > ul > li:nth-child(3) {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
version: 2
|
|
||||||
snapshot:
|
|
||||||
widths: [1024, 2000]
|
|
||||||
min-height: 1440 # px
|
|
||||||
discovery:
|
|
||||||
concurrency: 2 # https://github.com/percy/cli/discussions/1067
|
|
||||||
127
e2e/README.md
@@ -72,11 +72,15 @@ Visual Testing is an essential part of our e2e strategy as it ensures that the a
|
|||||||
For a better understanding of the visual issues which affect Open MCT, please see our bug tracker with the `label:visual` filter applied [here](https://github.com/nasa/openmct/issues?q=label%3Abug%3Avisual+)
|
For a better understanding of the visual issues which affect Open MCT, please see our bug tracker with the `label:visual` filter applied [here](https://github.com/nasa/openmct/issues?q=label%3Abug%3Avisual+)
|
||||||
To read about how to write a good visual test, please see [How to write a great Visual Test](#how-to-write-a-great-visual-test).
|
To read about how to write a good visual test, please see [How to write a great Visual Test](#how-to-write-a-great-visual-test).
|
||||||
|
|
||||||
`npm run test:e2e:visual` will run all of the visual tests against a local instance of Open MCT. If no `PERCY_TOKEN` API key is found in the terminal or command line environment variables, no visual comparisons will be made.
|
`npm run test:e2e:visual` commands will run all of the visual tests against a local instance of Open MCT. If no `PERCY_TOKEN` API key is found in the terminal or command line environment variables, no visual comparisons will be made.
|
||||||
|
|
||||||
|
- `npm run test:e2e:visual:ci` will run against every commit and PR.
|
||||||
|
- `npm run test:e2e:visual:full` will run every night with additional comparisons made for Larger Displays and with the `snow` theme.
|
||||||
#### Percy.io
|
#### Percy.io
|
||||||
|
|
||||||
To make this possible, we're leveraging a 3rd party service, [Percy](https://percy.io/). This service maintains a copy of all changes, users, scm-metadata, and baselines to verify that the application looks and feels the same _unless approved by a Open MCT developer_. To request a Percy API token, please reach out to the Open MCT Dev team on GitHub. For more information, please see the official [Percy documentation](https://docs.percy.io/docs/visual-testing-basics)
|
To make this possible, we're leveraging a 3rd party service, [Percy](https://percy.io/). This service maintains a copy of all changes, users, scm-metadata, and baselines to verify that the application looks and feels the same _unless approved by a Open MCT developer_. To request a Percy API token, please reach out to the Open MCT Dev team on GitHub. For more information, please see the official [Percy documentation](https://docs.percy.io/docs/visual-testing-basics).
|
||||||
|
|
||||||
|
At present, we are using percy with two configuration files: `./e2e/.percy.nightly.yml` and `./e2e/.percy.ci.yml`. This is mainly to reduce the number of snapshots.
|
||||||
|
|
||||||
### (Advanced) Snapshot Testing
|
### (Advanced) Snapshot Testing
|
||||||
|
|
||||||
@@ -133,22 +137,24 @@ These tests are expected to become blocking and gating with assertions as we ext
|
|||||||
|
|
||||||
## Test Architecture and CI
|
## Test Architecture and CI
|
||||||
|
|
||||||
### Architecture (TODO)
|
### Architecture
|
||||||
|
|
||||||
### File Structure
|
### 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 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.
|
||||||
|
|
||||||
- `./helper` - contains helper functions or scripts which are leveraged directly within the testsuites. i.e. non-default plugin scripts injected into DOM
|
|File Path|Description|
|
||||||
- `./test-data` - contains test data which is leveraged or generated in the functional, performance, or visual test suites. i.e. localStorage data
|
|:-:|-|
|
||||||
- `./tests/functional` - the bulk of the tests are contained within this folder to verify the functionality of open mct
|
|`./helper` | Contains helper functions or scripts which are leveraged directly within the test suites (e.g.: non-default plugin scripts injected into the DOM)|
|
||||||
- `./tests/functional/example/` - tests which specifically verify the example plugins
|
|`./test-data` | Contains test data which is leveraged or generated in the functional, performance, or visual test suites (e.g.: localStorage data).|
|
||||||
- `./tests/functional/plugins/` - tests which loosely test each plugin. This folder is the most likely to change. Note: some @snapshot tests are still contained within this structure
|
|`./tests/functional` | The bulk of the tests are contained within this folder to verify the functionality of Open MCT.|
|
||||||
- `./tests/framework/` - tests which verify that our testframework functionality and assumptions will continue to work based on further refactoring or playwright version changes
|
|`./tests/functional/example/` | Tests which specifically verify the example plugins (e.g.: Sine Wave Generator).|
|
||||||
- `./tests/performance/` - performance tests
|
|`./tests/functional/plugins/` | Tests which loosely test each plugin. This folder is the most likely to change. Note: some `@snapshot` tests are still contained within this structure.|
|
||||||
- `./tests/visual/` - Visual tests
|
|`./tests/framework/` | Tests which verify that our testing framework's functionality and assumptions will continue to work based on further refactoring or Playwright version changes (e.g.: verifying custom fixtures and appActions).|
|
||||||
- `./appActions.js` - Contains common fixtures which can be leveraged by testcase authors to quickly move through the application when writing new tests.
|
|`./tests/performance/` | Performance tests.|
|
||||||
- `./baseFixture.js` - Contains base fixtures which only extend default `@playwright/test` functionality. The goal is to remove these fixtures as native Playwright APIs improve.
|
|`./tests/visual/` | Visual tests.|
|
||||||
|
|`./appActions.js` | Contains common methods which can be leveraged by test case authors to quickly move through the application when writing new tests.|
|
||||||
|
|`./baseFixture.js` | Contains base fixtures which only extend default `@playwright/test` functionality. The expectation is that these fixtures will be removed as the native Playwright API improves|
|
||||||
|
|
||||||
Our functional tests end in `*.e2e.spec.js`, visual tests in `*.visual.spec.js` and performance tests in `*.perf.spec.js`.
|
Our functional tests end in `*.e2e.spec.js`, visual tests in `*.visual.spec.js` and performance tests in `*.perf.spec.js`.
|
||||||
|
|
||||||
@@ -158,10 +164,12 @@ Where possible, we try to run Open MCT without modification or configuration cha
|
|||||||
|
|
||||||
Open MCT is leveraging the [config file](https://playwright.dev/docs/test-configuration) pattern to describe the capabilities of Open MCT e2e _where_ it's run
|
Open MCT is leveraging the [config file](https://playwright.dev/docs/test-configuration) pattern to describe the capabilities of Open MCT e2e _where_ it's run
|
||||||
|
|
||||||
- `./playwright-ci.config.js` - Used when running in CI or to debug CI issues locally
|
|Config File|Description|
|
||||||
- `./playwright-local.config.js` - Used when running locally
|
|:-:|-|
|
||||||
- `./playwright-performance.config.js` - Used when running performance tests in CI or locally
|
|`./playwright-ci.config.js` | Used when running in CI or to debug CI issues locally|
|
||||||
- `./playwright-visual.config.js` - Used to run the visual tests in CI or locally
|
|`./playwright-local.config.js` | Used when running locally|
|
||||||
|
|`./playwright-performance.config.js` | Used when running performance tests in CI or locally|
|
||||||
|
|`./playwright-visual.config.js` | Used to run the visual tests in CI or locally|
|
||||||
|
|
||||||
#### Test Tags
|
#### Test Tags
|
||||||
|
|
||||||
@@ -169,13 +177,16 @@ Test tags are a great way of organizing tests outside of a file structure. To le
|
|||||||
|
|
||||||
Current list of test tags:
|
Current list of test tags:
|
||||||
|
|
||||||
- `@ipad` - 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).
|
|Test Tag|Description|
|
||||||
- `@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`.
|
|`@ipad` | 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).|
|
||||||
- `@localStorage` - Captures or generates session storage to manipulate browser state. Useful for excluding in tests which require a persistent backend (i.e. CouchDB).
|
|`@gds` | Denotes a GDS Test Case used in the VIPER Mission.|
|
||||||
- `@snapshot` - Uses Playwright's snapshot functionality to record a copy of the DOM for direct comparison. Must be run inside of the playwright container.
|
|`@addInit` | Initializes the browser with an injected and artificial state. Useful for loading non-default plugins. Likely will not work outside of `npm start`.|
|
||||||
- `@unstable` - A new test or test which is known to be flaky.
|
|`@localStorage` | Captures or generates session storage to manipulate browser state. Useful for excluding in tests which require a persistent backend (i.e. CouchDB).|
|
||||||
- `@2p` - Indicates that multiple users are involved, or multiple tabs/pages are used. Useful for testing multi-user interactivity.
|
|`@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.|
|
||||||
|
|
||||||
### Continuous Integration
|
### Continuous Integration
|
||||||
|
|
||||||
@@ -194,24 +205,27 @@ CircleCI
|
|||||||
- Stable e2e tests against ubuntu and chrome
|
- Stable e2e tests against ubuntu and chrome
|
||||||
- Performance tests against ubuntu and chrome
|
- Performance tests against ubuntu and chrome
|
||||||
- e2e tests are linted
|
- e2e tests are linted
|
||||||
|
- Visual tests are run in a single resolution on the default `espresso` theme
|
||||||
|
|
||||||
#### 2. Per-Merge Testing
|
#### 2. Per-Merge Testing
|
||||||
|
|
||||||
Github Actions / Workflow
|
Github Actions / Workflow
|
||||||
|
|
||||||
- Full suite against all browsers/projects. Triggered with Github Label Event 'pr:e2e'
|
- Full suite against all browsers/projects. Triggered with Github Label Event 'pr:e2e'
|
||||||
- Visual Tests. Triggered with Github Label Event 'pr:visual'
|
- CouchDB Tests. Triggered on PR Create and again with Github Label Event 'pr:e2e:couchdb'
|
||||||
|
|
||||||
#### 3. Scheduled / Batch Testing
|
#### 3. Scheduled / Batch Testing
|
||||||
|
|
||||||
Nightly Testing in Circle CI
|
Nightly Testing in Circle CI
|
||||||
|
|
||||||
- Full e2e suite against ubuntu and chrome
|
- Full e2e suite against ubuntu and chrome, firefox, and an MMOC resolution profile
|
||||||
- Performance tests against ubuntu and chrome
|
- Performance tests against ubuntu and chrome
|
||||||
|
- CouchDB suite
|
||||||
|
- Visual Tests are run in the full profile
|
||||||
|
|
||||||
Github Actions / Workflow
|
Github Actions / Workflow
|
||||||
|
|
||||||
- Visual Test baseline generation.
|
- None at the moment
|
||||||
|
|
||||||
#### Parallelism and Fast Feedback
|
#### Parallelism and Fast Feedback
|
||||||
|
|
||||||
@@ -231,7 +245,8 @@ At the same time, we don't want to waste CI resources on parallel runs, so we've
|
|||||||
|
|
||||||
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.
|
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.
|
- 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:
|
A testcase and testsuite are to be unmarked as @unstable when:
|
||||||
|
|
||||||
@@ -242,7 +257,7 @@ A testcase and testsuite are to be unmarked as @unstable when:
|
|||||||
|
|
||||||
#### **What's supported:**
|
#### **What's supported:**
|
||||||
|
|
||||||
We are leveraging the `browserslist` project to declare our supported list of browsers.
|
We are leveraging the `browserslist` project to declare our supported list of browsers. We support macOS, Windows, and ubuntu 20+.
|
||||||
|
|
||||||
#### **Where it's tested:**
|
#### **Where it's tested:**
|
||||||
|
|
||||||
@@ -256,11 +271,17 @@ We also have the need to execute our e2e tests across this published list of bro
|
|||||||
- A stable version of Chromium from the official chromium channels. This is always at least 1 version ahead of desktop chrome.
|
- A stable version of Chromium from the official chromium channels. This is always at least 1 version ahead of desktop chrome.
|
||||||
- `playwright-chrome`
|
- `playwright-chrome`
|
||||||
- The stable channel of Chrome from the official chrome channels. This is always 2 versions behind chromium.
|
- The stable channel of Chrome from the official chrome channels. This is always 2 versions behind chromium.
|
||||||
|
- `playwright-firefox`
|
||||||
|
- Firefox Latest Stable. Modified slightly by the playwright team to support a CDP Shim.
|
||||||
|
|
||||||
|
In terms of operating system testing, we're only limited by what the CI providers are able to support. The bulk of our testing is performed on the official playwright container which is based on ubuntu. Github Actions allows us to use `windows-latest` and `mac-latest` and is run as needed.
|
||||||
|
|
||||||
#### **Mobile**
|
#### **Mobile**
|
||||||
|
|
||||||
We have the Mission-need to support iPad. To run our iPad suite, please see our `playwright-*.config.js` with the 'iPad' project.
|
We have the Mission-need to support iPad. To run our iPad suite, please see our `playwright-*.config.js` with the 'iPad' project.
|
||||||
|
|
||||||
|
In general, our test suite is not designed to run against mobile devices as the mobile experience is a focused version of the application. Core functionality is missing (chiefly the 'Create' button) and so this will likely turn into a separate suite.
|
||||||
|
|
||||||
#### **Skipping or executing tests based on browser, os, and/os browser version:**
|
#### **Skipping or executing tests based on browser, os, and/os browser version:**
|
||||||
|
|
||||||
Conditionally skipping tests based on browser (**RECOMMENDED**):
|
Conditionally skipping tests based on browser (**RECOMMENDED**):
|
||||||
@@ -292,13 +313,24 @@ Skipping based on browser version (Rarely used): <https://github.com/microsoft/p
|
|||||||
- How to make tests robust to function in other contexts (VISTA, VIPER, etc.)
|
- How to make tests robust to function in other contexts (VISTA, VIPER, etc.)
|
||||||
- Leverage the use of `appActions.js` methods such as `createDomainObjectWithDefaults()`
|
- Leverage the use of `appActions.js` methods such as `createDomainObjectWithDefaults()`
|
||||||
- How to make tests faster and more resilient
|
- How to make tests faster and more resilient
|
||||||
- When possible, navigate directly by URL
|
- When possible, navigate directly by URL:
|
||||||
- Leverage `await page.goto('./', { waitUntil: 'networkidle' });`
|
|
||||||
|
```javascript
|
||||||
|
// You can capture the CreatedObjectInfo returned from this appAction:
|
||||||
|
const clock = await createDomainObjectWithDefaults(page, { type: 'Clock' });
|
||||||
|
|
||||||
|
// ...and use its `url` property to navigate directly to it later in the test:
|
||||||
|
await page.goto(clock.url);
|
||||||
|
```
|
||||||
|
|
||||||
|
- Leverage `await page.goto('./', { waitUntil: 'domcontentloaded' });`
|
||||||
|
- Initial navigation should _almost_ always use the `{ waitUntil: 'domcontentloaded' }` option.
|
||||||
- Avoid repeated setup to test to test a single assertion. Write longer tests with multiple soft assertions.
|
- Avoid repeated setup to test to test a single assertion. Write longer tests with multiple soft assertions.
|
||||||
|
|
||||||
### How to write a great test (WIP)
|
### How to write a great test
|
||||||
|
|
||||||
- Use our [App Actions](./appActions.js) for performing common actions whenever applicable.
|
- Use our [App Actions](./appActions.js) for performing common actions whenever applicable.
|
||||||
|
- Use `waitForPlotsToRender()` before asserting against anything that is dependent upon plot series data being loaded and drawn.
|
||||||
- If you create an object outside of using the `createDomainObjectWithDefaults` App Action, make sure to fill in the 'Notes' section of your object with `page.testNotes`:
|
- If you create an object outside of using the `createDomainObjectWithDefaults` App Action, make sure to fill in the 'Notes' section of your object with `page.testNotes`:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
@@ -309,7 +341,26 @@ Skipping based on browser version (Rarely used): <https://github.com/microsoft/p
|
|||||||
await notesInput.fill(testNotes);
|
await notesInput.fill(testNotes);
|
||||||
```
|
```
|
||||||
|
|
||||||
#### How to write a great visual test (TODO)
|
#### How to write a great visual test
|
||||||
|
|
||||||
|
- Generally speaking, you should avoid being "specific" in what you hope to find in the diff. Visual tests are best suited for finding unknown unknowns.
|
||||||
|
- These should only use functional expect statements to verify assumptions about the state
|
||||||
|
in a test and not for functional verification of correctness. Visual tests are not supposed
|
||||||
|
to "fail" on assertions. Instead, they should be used to detect changes between builds or branches.
|
||||||
|
- A great visual test controls for the variation inherent to working with time-based telemetry and clocks. We do our best to remove this variation by using `percyCSS` to ignore all possible time-based components. For more, please see our [percyCSS file](./.percy.ci.yml).
|
||||||
|
- Additionally, you should try the following:
|
||||||
|
- Use fixed-time mode of Open MCT
|
||||||
|
- Use the `createExampleTelemetryObject` appAction to source telemetry
|
||||||
|
- When using the `createDomainObjectWithDefaults` appAction, make sure to specify a `name` which is explicit to avoid the autogenerated name
|
||||||
|
- Very likely, your test will not need to compare changes on the tree. Keep it out of the comparison with the following
|
||||||
|
- `await page.goto('./#/browse/mine')` will go to the root of the main view with the tree collapsed.
|
||||||
|
- If you only want to compare changes on a specific component, use the /visual/component/ folder and limit the scope of the comparison to the object like so:
|
||||||
|
- ```
|
||||||
|
await percySnapshot(page, `Tree Pane w/ single level expanded (theme: ${theme})`, {
|
||||||
|
scope: treePane
|
||||||
|
});
|
||||||
|
```js
|
||||||
|
- The `scope` variable can be any valid css selector
|
||||||
|
|
||||||
#### How to write a great network test
|
#### How to write a great network test
|
||||||
|
|
||||||
@@ -345,12 +396,16 @@ We leverage the following official Playwright reporters:
|
|||||||
- Tracefile
|
- Tracefile
|
||||||
- Screenshots
|
- Screenshots
|
||||||
|
|
||||||
When running the tests locally with the `npm run test:local` command, the html report will open automatically on failure. Inside this HTML report will be a complete summary of the finished tests. If the tests failed, you'll see embedded links to screenshot failure, execution logs, and the Tracefile.
|
When running the tests locally with the `npm run test:e2e:local` command, the html report will open automatically on failure. Inside this HTML report will be a complete summary of the finished tests. If the tests failed, you'll see embedded links to screenshot failure, execution logs, and the Tracefile.
|
||||||
|
|
||||||
When looking at the reports run in CI, you'll leverage this same HTML Report which is hosted either in CircleCI or Github Actions as a build artifact.
|
When looking at the reports run in CI, you'll leverage this same HTML Report which is hosted either in CircleCI or Github Actions as a build artifact.
|
||||||
|
|
||||||
### e2e Code Coverage
|
### e2e Code Coverage
|
||||||
|
|
||||||
|
Our e2e code coverage is captured and combined with our unit test coverage. For more information, please see our [code coverage documentation](../TESTING.md)
|
||||||
|
|
||||||
|
#### Generating e2e code coverage
|
||||||
|
|
||||||
Code coverage is collected during test execution using our custom [baseFixture](./baseFixtures.js). The raw coverage files are stored in a `.nyc_report` directory to be converted into a lcov file with the following [nyc](https://github.com/istanbuljs/nyc) command:
|
Code coverage is collected during test execution using our custom [baseFixture](./baseFixtures.js). The raw coverage files are stored in a `.nyc_report` directory to be converted into a lcov file with the following [nyc](https://github.com/istanbuljs/nyc) command:
|
||||||
|
|
||||||
```npm run cov:e2e:report```
|
```npm run cov:e2e:report```
|
||||||
@@ -361,10 +416,6 @@ At this point, the nyc linecov report can be published to [codecov.io](https://a
|
|||||||
or
|
or
|
||||||
```npm run cov:e2e:full:publish``` for the full suite running against all available platforms.
|
```npm run cov:e2e:full:publish``` for the full suite running against all available platforms.
|
||||||
|
|
||||||
Codecov.io will combine each of the above commands with [Codecov.io Flags](https://docs.codecov.com/docs/flags). Effectively, this allows us to combine multiple reports which are run at various stages of our CI Pipeline or run as part of a parallel process.
|
|
||||||
|
|
||||||
This e2e coverage is combined with our unit test report to give a comprehensive (if flawed) view of line coverage.
|
|
||||||
|
|
||||||
## Other
|
## Other
|
||||||
|
|
||||||
### About e2e testing
|
### About e2e testing
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
* @property {string} type the type of domain object to create (e.g.: "Sine Wave Generator").
|
* @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} [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 {string | import('../src/api/objects/ObjectAPI').Identifier} [parent] the Identifier or uuid of the parent object.
|
||||||
|
* @property {Object<string, string>} [customParameters] any additional parameters to be passed to the domain object's form. E.g. '[aria-label="Data Rate (hz)"]': {'0.1'}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -55,6 +56,7 @@
|
|||||||
|
|
||||||
const Buffer = require('buffer').Buffer;
|
const Buffer = require('buffer').Buffer;
|
||||||
const genUuid = require('uuid').v4;
|
const genUuid = require('uuid').v4;
|
||||||
|
const { expect } = require('@playwright/test');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This common function creates a domain object with the default options. It is the preferred way of creating objects
|
* This common function creates a domain object with the default options. It is the preferred way of creating objects
|
||||||
@@ -64,7 +66,10 @@ const genUuid = require('uuid').v4;
|
|||||||
* @param {CreateObjectOptions} options
|
* @param {CreateObjectOptions} options
|
||||||
* @returns {Promise<CreatedObjectInfo>} An object containing information about the newly created domain object.
|
* @returns {Promise<CreatedObjectInfo>} An object containing information about the newly created domain object.
|
||||||
*/
|
*/
|
||||||
async function createDomainObjectWithDefaults(page, { type, name, parent = 'mine' }) {
|
async function createDomainObjectWithDefaults(
|
||||||
|
page,
|
||||||
|
{ type, name, parent = 'mine', customParameters = {} }
|
||||||
|
) {
|
||||||
if (!name) {
|
if (!name) {
|
||||||
name = `${type}:${genUuid()}`;
|
name = `${type}:${genUuid()}`;
|
||||||
}
|
}
|
||||||
@@ -74,7 +79,6 @@ async function createDomainObjectWithDefaults(page, { type, name, parent = 'mine
|
|||||||
// Navigate to the parent object. This is necessary to create the object
|
// Navigate to the parent object. This is necessary to create the object
|
||||||
// in the correct location, such as a folder, layout, or plot.
|
// in the correct location, such as a folder, layout, or plot.
|
||||||
await page.goto(`${parentUrl}?hideTree=true`);
|
await page.goto(`${parentUrl}?hideTree=true`);
|
||||||
await page.waitForLoadState('networkidle');
|
|
||||||
|
|
||||||
//Click the Create button
|
//Click the Create button
|
||||||
await page.click('button:has-text("Create")');
|
await page.click('button:has-text("Create")');
|
||||||
@@ -84,7 +88,7 @@ async function createDomainObjectWithDefaults(page, { type, name, parent = 'mine
|
|||||||
|
|
||||||
// Modify the name input field of the domain object to accept 'name'
|
// Modify the name input field of the domain object to accept 'name'
|
||||||
const nameInput = page.locator('form[name="mctForm"] .first input[type="text"]');
|
const nameInput = page.locator('form[name="mctForm"] .first input[type="text"]');
|
||||||
await nameInput.fill("");
|
await nameInput.fill('');
|
||||||
await nameInput.fill(name);
|
await nameInput.fill(name);
|
||||||
|
|
||||||
if (page.testNotes) {
|
if (page.testNotes) {
|
||||||
@@ -94,6 +98,13 @@ async function createDomainObjectWithDefaults(page, { type, name, parent = 'mine
|
|||||||
await notesInput.fill(page.testNotes);
|
await notesInput.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
|
// Click OK button and wait for Navigate event
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
page.waitForLoadState(),
|
page.waitForLoadState(),
|
||||||
@@ -140,6 +151,7 @@ async function createNotification(page, createNotificationOptions) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Expand an item in the tree by a given object name.
|
||||||
* @param {import('@playwright/test').Page} page
|
* @param {import('@playwright/test').Page} page
|
||||||
* @param {string} name
|
* @param {string} name
|
||||||
*/
|
*/
|
||||||
@@ -176,8 +188,8 @@ async function createPlanFromJSON(page, { name, json, parent = 'mine' }) {
|
|||||||
await page.click(`li:text("Plan")`);
|
await page.click(`li:text("Plan")`);
|
||||||
|
|
||||||
// Modify the name input field of the domain object to accept 'name'
|
// Modify the name input field of the domain object to accept 'name'
|
||||||
const nameInput = page.locator('form[name="mctForm"] .first input[type="text"]');
|
const nameInput = page.getByLabel('Title', { exact: true });
|
||||||
await nameInput.fill("");
|
await nameInput.fill('');
|
||||||
await nameInput.fill(name);
|
await nameInput.fill(name);
|
||||||
|
|
||||||
// Upload buffer from memory
|
// Upload buffer from memory
|
||||||
@@ -207,6 +219,64 @@ async function createPlanFromJSON(page, { name, json, parent = 'mine' }) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a standardized Telemetry Object (Sine Wave Generator) for use in visual tests
|
||||||
|
* and tests against plotting telemetry (e.g. logPlot tests).
|
||||||
|
* @param {import('@playwright/test').Page} page
|
||||||
|
* @param {string | import('../src/api/objects/ObjectAPI').Identifier} [parent] the uuid or identifier of the parent object. Defaults to 'mine'
|
||||||
|
* @returns {Promise<CreatedObjectInfo>} An object containing information about the telemetry object.
|
||||||
|
*/
|
||||||
|
async function createExampleTelemetryObject(page, parent = 'mine') {
|
||||||
|
const parentUrl = await getHashUrlToDomainObject(page, parent);
|
||||||
|
// TODO: Make this field even more accessible
|
||||||
|
const name = 'VIPER Rover Heading';
|
||||||
|
const nameInputLocator = page.getByRole('dialog').locator('input[type="text"]');
|
||||||
|
|
||||||
|
await page.goto(`${parentUrl}?hideTree=true`);
|
||||||
|
|
||||||
|
await page.locator('button:has-text("Create")').click();
|
||||||
|
|
||||||
|
await page.locator('li:has-text("Sine Wave Generator")').click();
|
||||||
|
|
||||||
|
await nameInputLocator.fill(name);
|
||||||
|
|
||||||
|
// Fill out the fields with default values
|
||||||
|
await page.getByRole('spinbutton', { name: 'Period' }).fill('10');
|
||||||
|
await page.getByRole('spinbutton', { name: 'Amplitude' }).fill('1');
|
||||||
|
await page.getByRole('spinbutton', { name: 'Offset' }).fill('0');
|
||||||
|
await page.getByRole('spinbutton', { name: 'Data Rate (hz)' }).fill('1');
|
||||||
|
await page.getByRole('spinbutton', { name: 'Phase (radians)' }).fill('0');
|
||||||
|
await page.getByRole('spinbutton', { name: 'Randomness' }).fill('0');
|
||||||
|
await page.getByRole('spinbutton', { name: 'Loading Delay (ms)' }).fill('0');
|
||||||
|
|
||||||
|
await page.getByRole('button', { name: 'Save' }).click();
|
||||||
|
|
||||||
|
// Wait until the URL is updated
|
||||||
|
await page.waitForURL(`**/${parent}/*`);
|
||||||
|
|
||||||
|
const uuid = await getFocusedObjectUuid(page);
|
||||||
|
const url = await getHashUrlToDomainObject(page, uuid);
|
||||||
|
|
||||||
|
return {
|
||||||
|
name,
|
||||||
|
uuid,
|
||||||
|
url
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Navigates directly to a given object url, in fixed time mode, with the given start and end bounds.
|
||||||
|
* @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
|
||||||
|
* @param {string | number} end The ending time bound in milliseconds since epoch
|
||||||
|
*/
|
||||||
|
async function navigateToObjectWithFixedTimeBounds(page, url, start, end) {
|
||||||
|
await page.goto(
|
||||||
|
`${url}?tc.mode=fixed&tc.timeSystem=utc&tc.startBound=${start}&tc.endBound=${end}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Open the given `domainObject`'s context menu from the object tree.
|
* Open the given `domainObject`'s context menu from the object tree.
|
||||||
* Expands the path to the object and scrolls to it if necessary.
|
* Expands the path to the object and scrolls to it if necessary.
|
||||||
@@ -227,15 +297,17 @@ async function openObjectTreeContextMenu(page, url) {
|
|||||||
* @param {import('@playwright/test').Page} page
|
* @param {import('@playwright/test').Page} page
|
||||||
* @param {"Main Tree" | "Create Modal Tree"} [treeName="Main Tree"]
|
* @param {"Main Tree" | "Create Modal Tree"} [treeName="Main Tree"]
|
||||||
*/
|
*/
|
||||||
async function expandEntireTree(page, treeName = "Main Tree") {
|
async function expandEntireTree(page, treeName = 'Main Tree') {
|
||||||
const treeLocator = page.getByRole('tree', {
|
const treeLocator = page.getByRole('tree', {
|
||||||
name: treeName
|
name: treeName
|
||||||
});
|
});
|
||||||
const collapsedTreeItems = treeLocator.getByRole('treeitem', {
|
const collapsedTreeItems = treeLocator
|
||||||
|
.getByRole('treeitem', {
|
||||||
expanded: false
|
expanded: false
|
||||||
}).locator('span.c-disclosure-triangle.is-enabled');
|
})
|
||||||
|
.locator('span.c-disclosure-triangle.is-enabled');
|
||||||
|
|
||||||
while (await collapsedTreeItems.count() > 0) {
|
while ((await collapsedTreeItems.count()) > 0) {
|
||||||
await collapsedTreeItems.nth(0).click();
|
await collapsedTreeItems.nth(0).click();
|
||||||
|
|
||||||
// FIXME: Replace hard wait with something event-driven.
|
// FIXME: Replace hard wait with something event-driven.
|
||||||
@@ -268,13 +340,17 @@ async function getFocusedObjectUuid(page) {
|
|||||||
* URLs returned will be of the form `'./browse/#/mine/<uuid0>/<uuid1>/...'`
|
* URLs returned will be of the form `'./browse/#/mine/<uuid0>/<uuid1>/...'`
|
||||||
*
|
*
|
||||||
* @param {import('@playwright/test').Page} page
|
* @param {import('@playwright/test').Page} page
|
||||||
* @param {string} uuid the uuid of the object to get the url for
|
* @param {string | import('../src/api/objects/ObjectAPI').Identifier} identifier the uuid or identifier of the object to get the url for
|
||||||
* @returns {Promise<string>} the url of the object
|
* @returns {Promise<string>} the url of the object
|
||||||
*/
|
*/
|
||||||
async function getHashUrlToDomainObject(page, uuid) {
|
async function getHashUrlToDomainObject(page, identifier) {
|
||||||
const hashUrl = await page.evaluate(async (objectUuid) => {
|
await page.waitForLoadState('load');
|
||||||
const path = await window.openmct.objects.getOriginalPath(objectUuid);
|
const hashUrl = await page.evaluate(async (objectIdentifier) => {
|
||||||
let url = './#/browse/' + [...path].reverse()
|
const path = await window.openmct.objects.getOriginalPath(objectIdentifier);
|
||||||
|
let url =
|
||||||
|
'./#/browse/' +
|
||||||
|
[...path]
|
||||||
|
.reverse()
|
||||||
.map((object) => window.openmct.objects.makeKeyString(object.identifier))
|
.map((object) => window.openmct.objects.makeKeyString(object.identifier))
|
||||||
.join('/');
|
.join('/');
|
||||||
|
|
||||||
@@ -284,7 +360,7 @@ async function getHashUrlToDomainObject(page, uuid) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return url;
|
return url;
|
||||||
}, uuid);
|
}, identifier);
|
||||||
|
|
||||||
return hashUrl;
|
return hashUrl;
|
||||||
}
|
}
|
||||||
@@ -293,6 +369,7 @@ async function getHashUrlToDomainObject(page, uuid) {
|
|||||||
* Utilizes the OpenMCT API to detect if the UI is in Edit mode.
|
* Utilizes the OpenMCT API to detect if the UI is in Edit mode.
|
||||||
* @private
|
* @private
|
||||||
* @param {import('@playwright/test').Page} page
|
* @param {import('@playwright/test').Page} page
|
||||||
|
* @param {string | import('../src/api/objects/ObjectAPI').Identifier} identifier
|
||||||
* @return {Promise<boolean>} true if the Open MCT is in Edit Mode
|
* @return {Promise<boolean>} true if the Open MCT is in Edit Mode
|
||||||
*/
|
*/
|
||||||
async function _isInEditMode(page, identifier) {
|
async function _isInEditMode(page, identifier) {
|
||||||
@@ -307,13 +384,13 @@ async function _isInEditMode(page, identifier) {
|
|||||||
*/
|
*/
|
||||||
async function setTimeConductorMode(page, isFixedTimespan = true) {
|
async function setTimeConductorMode(page, isFixedTimespan = true) {
|
||||||
// Click 'mode' button
|
// Click 'mode' button
|
||||||
await page.locator('.c-mode-button').click();
|
await page.getByRole('button', { name: 'Time Conductor Mode', exact: true }).click();
|
||||||
|
await page.getByRole('button', { name: 'Time Conductor Mode Menu' }).click();
|
||||||
// Switch time conductor mode
|
// Switch time conductor mode
|
||||||
if (isFixedTimespan) {
|
if (isFixedTimespan) {
|
||||||
await page.locator('data-testid=conductor-modeOption-fixed').click();
|
await page.getByRole('menuitem', { name: /Fixed Timespan/ }).click();
|
||||||
} else {
|
} else {
|
||||||
await page.locator('data-testid=conductor-modeOption-realtime').click();
|
await page.getByRole('menuitem', { name: /Real-Time/ }).click();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -335,9 +412,12 @@ async function setRealTimeMode(page) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} OffsetValues
|
* @typedef {Object} OffsetValues
|
||||||
* @property {string | undefined} hours
|
* @property {string | undefined} startHours
|
||||||
* @property {string | undefined} mins
|
* @property {string | undefined} startMins
|
||||||
* @property {string | undefined} secs
|
* @property {string | undefined} startSecs
|
||||||
|
* @property {string | undefined} endHours
|
||||||
|
* @property {string | undefined} endMins
|
||||||
|
* @property {string | undefined} endSecs
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -346,23 +426,36 @@ async function setRealTimeMode(page) {
|
|||||||
* @param {OffsetValues} offset
|
* @param {OffsetValues} offset
|
||||||
* @param {import('@playwright/test').Locator} offsetButton
|
* @param {import('@playwright/test').Locator} offsetButton
|
||||||
*/
|
*/
|
||||||
async function setTimeConductorOffset(page, {hours, mins, secs}, offsetButton) {
|
async function setTimeConductorOffset(
|
||||||
await offsetButton.click();
|
page,
|
||||||
|
{ startHours, startMins, startSecs, endHours, endMins, endSecs }
|
||||||
if (hours) {
|
) {
|
||||||
await page.fill('.pr-time-controls__hrs', hours);
|
if (startHours) {
|
||||||
|
await page.getByRole('spinbutton', { name: 'Start offset hours' }).fill(startHours);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mins) {
|
if (startMins) {
|
||||||
await page.fill('.pr-time-controls__mins', mins);
|
await page.getByRole('spinbutton', { name: 'Start offset minutes' }).fill(startMins);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (secs) {
|
if (startSecs) {
|
||||||
await page.fill('.pr-time-controls__secs', secs);
|
await page.getByRole('spinbutton', { name: 'Start offset seconds' }).fill(startSecs);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (endHours) {
|
||||||
|
await page.getByRole('spinbutton', { name: 'End offset hours' }).fill(endHours);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (endMins) {
|
||||||
|
await page.getByRole('spinbutton', { name: 'End offset minutes' }).fill(endMins);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (endSecs) {
|
||||||
|
await page.getByRole('spinbutton', { name: 'End offset seconds' }).fill(endSecs);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Click the check button
|
// Click the check button
|
||||||
await page.locator('.pr-time__buttons .icon-check').click();
|
await page.locator('.pr-time-input--buttons .icon-check').click();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -371,8 +464,9 @@ async function setTimeConductorOffset(page, {hours, mins, secs}, offsetButton) {
|
|||||||
* @param {OffsetValues} offset
|
* @param {OffsetValues} offset
|
||||||
*/
|
*/
|
||||||
async function setStartOffset(page, offset) {
|
async function setStartOffset(page, offset) {
|
||||||
const startOffsetButton = page.locator('data-testid=conductor-start-offset-button');
|
// Click 'mode' button
|
||||||
await setTimeConductorOffset(page, offset, startOffsetButton);
|
await page.getByRole('button', { name: 'Time Conductor Mode', exact: true }).click();
|
||||||
|
await setTimeConductorOffset(page, offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -381,8 +475,73 @@ async function setStartOffset(page, offset) {
|
|||||||
* @param {OffsetValues} offset
|
* @param {OffsetValues} offset
|
||||||
*/
|
*/
|
||||||
async function setEndOffset(page, offset) {
|
async function setEndOffset(page, offset) {
|
||||||
const endOffsetButton = page.locator('data-testid=conductor-end-offset-button');
|
// Click 'mode' button
|
||||||
await setTimeConductorOffset(page, offset, endOffsetButton);
|
await page.getByRole('button', { name: 'Time Conductor Mode', exact: true }).click();
|
||||||
|
await setTimeConductorOffset(page, offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the time conductor bounds in fixed time mode
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
*/
|
||||||
|
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');
|
||||||
|
|
||||||
|
await setTimeBounds(page, startDate, endDate);
|
||||||
|
|
||||||
|
await page.keyboard.press('Enter');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the independent time conductor bounds in fixed time mode
|
||||||
|
* @param {import('@playwright/test').Page} page
|
||||||
|
* @param {string} startDate
|
||||||
|
* @param {string} endDate
|
||||||
|
*/
|
||||||
|
async function setIndependentTimeConductorBounds(page, startDate, endDate) {
|
||||||
|
// Activate Independent Time Conductor in Fixed Time Mode
|
||||||
|
await page.getByRole('switch').click();
|
||||||
|
|
||||||
|
// Bring up the time conductor popup
|
||||||
|
await page.click('.c-conductor-holder--compact .c-compact-tc');
|
||||||
|
await expect(page.locator('.itc-popout')).toBeInViewport();
|
||||||
|
|
||||||
|
await setTimeBounds(page, startDate, endDate);
|
||||||
|
|
||||||
|
await page.keyboard.press('Enter');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the bounds of the visible conductor in fixed time mode
|
||||||
|
* @param {import('@playwright/test').Page} page
|
||||||
|
* @param {string} startDate
|
||||||
|
* @param {string} endDate
|
||||||
|
*/
|
||||||
|
async function setTimeBounds(page, startDate, endDate) {
|
||||||
|
if (startDate) {
|
||||||
|
// Fill start time
|
||||||
|
await page
|
||||||
|
.getByRole('textbox', { name: 'Start date' })
|
||||||
|
.fill(startDate.toString().substring(0, 10));
|
||||||
|
await page
|
||||||
|
.getByRole('textbox', { name: 'Start time' })
|
||||||
|
.fill(startDate.toString().substring(11, 19));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (endDate) {
|
||||||
|
// Fill end time
|
||||||
|
await page.getByRole('textbox', { name: 'End date' }).fill(endDate.toString().substring(0, 10));
|
||||||
|
await page
|
||||||
|
.getByRole('textbox', { name: 'End time' })
|
||||||
|
.fill(endDate.toString().substring(11, 19));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -394,29 +553,128 @@ async function setEndOffset(page, offset) {
|
|||||||
async function selectInspectorTab(page, name) {
|
async function selectInspectorTab(page, name) {
|
||||||
const inspectorTabs = page.getByRole('tablist');
|
const inspectorTabs = page.getByRole('tablist');
|
||||||
const inspectorTab = inspectorTabs.getByTitle(name);
|
const inspectorTab = inspectorTabs.getByTitle(name);
|
||||||
const inspectorTabClass = await inspectorTab.getAttribute('class');
|
|
||||||
const isSelectedInspectorTab = inspectorTabClass.includes('is-current');
|
|
||||||
|
|
||||||
// do not click a tab that is already selected or it will timeout your test
|
|
||||||
// do to a { pointer-events: none; } on selected tabs
|
|
||||||
if (!isSelectedInspectorTab) {
|
|
||||||
await inspectorTab.click();
|
await inspectorTab.click();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Waits and asserts that all plot series data on the page
|
||||||
|
* is loaded and drawn.
|
||||||
|
*
|
||||||
|
* In lieu of a better way to detect when a plot is done rendering,
|
||||||
|
* we [attach a class to the '.gl-plot' element](https://github.com/nasa/openmct/blob/5924d7ea95a0c2d4141c602a3c7d0665cb91095f/src/plugins/plot/MctPlot.vue#L27)
|
||||||
|
* once all pending series data has been loaded. The following appAction retrieves
|
||||||
|
* 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
|
||||||
|
*/
|
||||||
|
async function waitForPlotsToRender(page) {
|
||||||
|
const plotLocator = page.locator('.gl-plot');
|
||||||
|
for (const plot of await plotLocator.all()) {
|
||||||
|
await expect(plot).toHaveClass(/js-series-data-loaded/);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef {Object} PlotPixel
|
||||||
|
* @property {number} r The value of the red channel (0-255)
|
||||||
|
* @property {number} g The value of the green channel (0-255)
|
||||||
|
* @property {number} b The value of the blue channel (0-255)
|
||||||
|
* @property {number} a The value of the alpha channel (0-255)
|
||||||
|
* @property {string} strValue The rgba string value of the pixel
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wait for all plots to render and then retrieve and return an array
|
||||||
|
* of canvas plot pixel data (RGBA values).
|
||||||
|
* @param {import('@playwright/test').Page} page
|
||||||
|
* @param {string} canvasSelector The selector for the canvas element
|
||||||
|
* @return {Promise<PlotPixel[]>}
|
||||||
|
*/
|
||||||
|
async function getCanvasPixels(page, canvasSelector) {
|
||||||
|
const getTelemValuePromise = new Promise((resolve) =>
|
||||||
|
page.exposeFunction('getCanvasValue', resolve)
|
||||||
|
);
|
||||||
|
const canvasHandle = await page.evaluateHandle(
|
||||||
|
(canvas) => document.querySelector(canvas),
|
||||||
|
canvasSelector
|
||||||
|
);
|
||||||
|
const canvasContextHandle = await page.evaluateHandle(
|
||||||
|
(canvas) => canvas.getContext('2d'),
|
||||||
|
canvasHandle
|
||||||
|
);
|
||||||
|
|
||||||
|
await waitForPlotsToRender(page);
|
||||||
|
await 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)
|
||||||
|
/** @type {ImageData} */
|
||||||
|
const data = ctx.getImageData(0, 0, canvas.width, canvas.height).data;
|
||||||
|
/** @type {number[]} */
|
||||||
|
const imageDataValues = Object.values(data);
|
||||||
|
/** @type {PlotPixel[]} */
|
||||||
|
const plotPixels = [];
|
||||||
|
// Each pixel consists of four values within the ImageData.data array. The for loop iterates by multiples of four.
|
||||||
|
// The values associated with each pixel are R (red), G (green), B (blue), and A (alpha), in that order.
|
||||||
|
for (let i = 0; i < imageDataValues.length; ) {
|
||||||
|
if (imageDataValues[i] > 0) {
|
||||||
|
plotPixels.push({
|
||||||
|
r: imageDataValues[i],
|
||||||
|
g: imageDataValues[i + 1],
|
||||||
|
b: imageDataValues[i + 2],
|
||||||
|
a: imageDataValues[i + 3],
|
||||||
|
strValue: `rgb(${imageDataValues[i]}, ${imageDataValues[i + 1]}, ${
|
||||||
|
imageDataValues[i + 2]
|
||||||
|
}, ${imageDataValues[i + 3]})`
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
i = i + 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
window.getCanvasValue(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"]');
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line no-undef
|
// eslint-disable-next-line no-undef
|
||||||
module.exports = {
|
module.exports = {
|
||||||
createDomainObjectWithDefaults,
|
createDomainObjectWithDefaults,
|
||||||
|
createExampleTelemetryObject,
|
||||||
createNotification,
|
createNotification,
|
||||||
expandTreePaneItemByName,
|
|
||||||
expandEntireTree,
|
|
||||||
createPlanFromJSON,
|
createPlanFromJSON,
|
||||||
openObjectTreeContextMenu,
|
expandEntireTree,
|
||||||
|
expandTreePaneItemByName,
|
||||||
|
getCanvasPixels,
|
||||||
getHashUrlToDomainObject,
|
getHashUrlToDomainObject,
|
||||||
getFocusedObjectUuid,
|
getFocusedObjectUuid,
|
||||||
|
navigateToObjectWithFixedTimeBounds,
|
||||||
|
openObjectTreeContextMenu,
|
||||||
setFixedTimeMode,
|
setFixedTimeMode,
|
||||||
setRealTimeMode,
|
setRealTimeMode,
|
||||||
setStartOffset,
|
setStartOffset,
|
||||||
setEndOffset,
|
setEndOffset,
|
||||||
selectInspectorTab
|
setTimeConductorBounds,
|
||||||
|
setIndependentTimeConductorBounds,
|
||||||
|
selectInspectorTab,
|
||||||
|
waitForPlotsToRender,
|
||||||
|
renameObjectFromContextMenu
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const base = require('@playwright/test');
|
const base = require('@playwright/test');
|
||||||
const { expect } = base;
|
const { expect, request } = base;
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const { v4: uuid } = require('uuid');
|
const { v4: uuid } = require('uuid');
|
||||||
@@ -56,12 +56,9 @@ function _consoleMessageToString(msg) {
|
|||||||
* @return {Promise<Animation[]>}
|
* @return {Promise<Animation[]>}
|
||||||
*/
|
*/
|
||||||
function waitForAnimations(locator) {
|
function waitForAnimations(locator) {
|
||||||
return locator
|
return locator.evaluate((element) =>
|
||||||
.evaluate((element) =>
|
Promise.all(element.getAnimations({ subtree: true }).map((animation) => animation.finished))
|
||||||
Promise.all(
|
);
|
||||||
element
|
|
||||||
.getAnimations({ subtree: true })
|
|
||||||
.map((animation) => animation.finished)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -75,8 +72,13 @@ exports.test = base.test.extend({
|
|||||||
/**
|
/**
|
||||||
* This allows the test to manipulate the browser clock. This is useful for Visual and Snapshot tests which need
|
* 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.
|
* 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:
|
* Usage:
|
||||||
* ```
|
* ```js
|
||||||
* test.use({
|
* test.use({
|
||||||
* clockOptions: {
|
* clockOptions: {
|
||||||
* now: 0,
|
* now: 0,
|
||||||
@@ -88,9 +90,11 @@ exports.test = base.test.extend({
|
|||||||
*
|
*
|
||||||
* @see {@link https://github.com/microsoft/playwright/issues/6347 Github RFE}
|
* @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}
|
* @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 }],
|
clockOptions: [undefined, { option: true }],
|
||||||
overrideClock: [async ({ context, clockOptions }, use) => {
|
overrideClock: [
|
||||||
|
async ({ context, clockOptions }, use) => {
|
||||||
if (clockOptions !== undefined) {
|
if (clockOptions !== undefined) {
|
||||||
await context.addInitScript({
|
await context.addInitScript({
|
||||||
path: path.join(__dirname, '../', './node_modules/sinon/pkg/sinon.js')
|
path: path.join(__dirname, '../', './node_modules/sinon/pkg/sinon.js')
|
||||||
@@ -101,10 +105,12 @@ exports.test = base.test.extend({
|
|||||||
}
|
}
|
||||||
|
|
||||||
await use(context);
|
await use(context);
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
auto: true,
|
auto: true,
|
||||||
scope: 'test'
|
scope: 'test'
|
||||||
}],
|
}
|
||||||
|
],
|
||||||
/**
|
/**
|
||||||
* Extends the base context class to add codecoverage shim.
|
* Extends the base context class to add codecoverage shim.
|
||||||
* @see {@link https://github.com/mxschmitt/playwright-test-coverage Github Project}
|
* @see {@link https://github.com/mxschmitt/playwright-test-coverage Github Project}
|
||||||
@@ -112,19 +118,24 @@ exports.test = base.test.extend({
|
|||||||
context: async ({ context }, use) => {
|
context: async ({ context }, use) => {
|
||||||
await context.addInitScript(() =>
|
await context.addInitScript(() =>
|
||||||
window.addEventListener('beforeunload', () =>
|
window.addEventListener('beforeunload', () =>
|
||||||
(window).collectIstanbulCoverage(JSON.stringify((window).__coverage__))
|
window.collectIstanbulCoverage(JSON.stringify(window.__coverage__))
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
await fs.promises.mkdir(istanbulCLIOutput, { recursive: true });
|
await fs.promises.mkdir(istanbulCLIOutput, { recursive: true });
|
||||||
await context.exposeFunction('collectIstanbulCoverage', (coverageJSON) => {
|
await context.exposeFunction('collectIstanbulCoverage', (coverageJSON) => {
|
||||||
if (coverageJSON) {
|
if (coverageJSON) {
|
||||||
fs.writeFileSync(path.join(istanbulCLIOutput, `playwright_coverage_${uuid()}.json`), coverageJSON);
|
fs.writeFileSync(
|
||||||
|
path.join(istanbulCLIOutput, `playwright_coverage_${uuid()}.json`),
|
||||||
|
coverageJSON
|
||||||
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
await use(context);
|
await use(context);
|
||||||
for (const page of context.pages()) {
|
for (const page of context.pages()) {
|
||||||
await page.evaluate(() => (window).collectIstanbulCoverage(JSON.stringify((window).__coverage__)));
|
await page.evaluate(() =>
|
||||||
|
window.collectIstanbulCoverage(JSON.stringify(window.__coverage__))
|
||||||
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@@ -138,7 +149,24 @@ exports.test = base.test.extend({
|
|||||||
* Extends the base page class to enable console log error detection.
|
* Extends the base page class to enable console log error detection.
|
||||||
* @see {@link https://github.com/microsoft/playwright/discussions/11690 Github Discussion}
|
* @see {@link https://github.com/microsoft/playwright/discussions/11690 Github Discussion}
|
||||||
*/
|
*/
|
||||||
page: async ({ page, failOnConsoleError }, use) => {
|
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
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Capture any console errors during test execution
|
// Capture any console errors during test execution
|
||||||
const messages = [];
|
const messages = [];
|
||||||
page.on('console', (msg) => messages.push(msg));
|
page.on('console', (msg) => messages.push(msg));
|
||||||
@@ -147,8 +175,10 @@ exports.test = base.test.extend({
|
|||||||
|
|
||||||
// Assert against console errors during teardown
|
// Assert against console errors during teardown
|
||||||
if (failOnConsoleError) {
|
if (failOnConsoleError) {
|
||||||
messages.forEach(
|
messages.forEach((msg) =>
|
||||||
msg => expect.soft(msg.type(), `Console error detected: ${_consoleMessageToString(msg)}`).not.toEqual('error')
|
expect
|
||||||
|
.soft(msg.type(), `Console error detected: ${_consoleMessageToString(msg)}`)
|
||||||
|
.not.toEqual('error')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -170,5 +200,7 @@ exports.test = base.test.extend({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
exports.expect = expect;
|
exports.expect = expect;
|
||||||
|
exports.request = request;
|
||||||
exports.waitForAnimations = waitForAnimations;
|
exports.waitForAnimations = waitForAnimations;
|
||||||
|
|||||||
9
e2e/constants.js
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
/**
|
||||||
|
* Constants which may be used across all e2e tests.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Time Constants
|
||||||
|
* - Used for overriding the browser clock in tests.
|
||||||
|
*/
|
||||||
|
export const MISSION_TIME = 1732413600000; // Saturday, November 23, 2024 6:00:00 PM GMT-08:00 (Thanksgiving Dinner Time)
|
||||||
@@ -6,8 +6,7 @@ class DomainObjectViewProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
canView(domainObject) {
|
canView(domainObject) {
|
||||||
return domainObject.type === 'imageFileInput'
|
return domainObject.type === 'imageFileInput' || domainObject.type === 'jsonFileInput';
|
||||||
|| domainObject.type === 'jsonFileInput';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
view(domainObject, objectPath) {
|
view(domainObject, objectPath) {
|
||||||
@@ -36,7 +35,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
|
|
||||||
openmct.types.addType('jsonFileInput', {
|
openmct.types.addType('jsonFileInput', {
|
||||||
key: 'jsonFileInput',
|
key: 'jsonFileInput',
|
||||||
name: "JSON File Input Object",
|
name: 'JSON File Input Object',
|
||||||
creatable: true,
|
creatable: true,
|
||||||
form: [
|
form: [
|
||||||
{
|
{
|
||||||
@@ -46,16 +45,14 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
required: true,
|
required: true,
|
||||||
text: 'Select File...',
|
text: 'Select File...',
|
||||||
type: 'application/json',
|
type: 'application/json',
|
||||||
property: [
|
property: ['selectFile']
|
||||||
"selectFile"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
openmct.types.addType('imageFileInput', {
|
openmct.types.addType('imageFileInput', {
|
||||||
key: 'imageFileInput',
|
key: 'imageFileInput',
|
||||||
name: "Image File Input Object",
|
name: 'Image File Input Object',
|
||||||
creatable: true,
|
creatable: true,
|
||||||
form: [
|
form: [
|
||||||
{
|
{
|
||||||
@@ -65,9 +62,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
required: true,
|
required: true,
|
||||||
text: 'Select File...',
|
text: 'Select File...',
|
||||||
type: 'image/*',
|
type: 'image/*',
|
||||||
property: [
|
property: ['selectFile']
|
||||||
"selectFile"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -24,4 +24,4 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}());
|
})();
|
||||||
|
|||||||
@@ -19,14 +19,13 @@
|
|||||||
* this source code distribution or the Licensing information page available
|
* this source code distribution or the Licensing information page available
|
||||||
* at runtime from the About dialog for additional information.
|
* at runtime from the About dialog for additional information.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
/* global __dirname */
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {import('@playwright/test').Page} page
|
* @param {import('@playwright/test').Page} page
|
||||||
*/
|
*/
|
||||||
async function navigateToFaultManagementWithExample(page) {
|
async function navigateToFaultManagementWithExample(page) {
|
||||||
// eslint-disable-next-line no-undef
|
|
||||||
await page.addInitScript({ path: path.join(__dirname, './', 'addInitExampleFaultProvider.js') });
|
await page.addInitScript({ path: path.join(__dirname, './', 'addInitExampleFaultProvider.js') });
|
||||||
|
|
||||||
await navigateToFaultItemInTree(page);
|
await navigateToFaultItemInTree(page);
|
||||||
@@ -36,8 +35,9 @@ async function navigateToFaultManagementWithExample(page) {
|
|||||||
* @param {import('@playwright/test').Page} page
|
* @param {import('@playwright/test').Page} page
|
||||||
*/
|
*/
|
||||||
async function navigateToFaultManagementWithStaticExample(page) {
|
async function navigateToFaultManagementWithStaticExample(page) {
|
||||||
// eslint-disable-next-line no-undef
|
await page.addInitScript({
|
||||||
await page.addInitScript({ path: path.join(__dirname, './', 'addInitExampleFaultProviderStatic.js') });
|
path: path.join(__dirname, './', 'addInitExampleFaultProviderStatic.js')
|
||||||
|
});
|
||||||
|
|
||||||
await navigateToFaultItemInTree(page);
|
await navigateToFaultItemInTree(page);
|
||||||
}
|
}
|
||||||
@@ -46,7 +46,6 @@ async function navigateToFaultManagementWithStaticExample(page) {
|
|||||||
* @param {import('@playwright/test').Page} page
|
* @param {import('@playwright/test').Page} page
|
||||||
*/
|
*/
|
||||||
async function navigateToFaultManagementWithoutExample(page) {
|
async function navigateToFaultManagementWithoutExample(page) {
|
||||||
// eslint-disable-next-line no-undef
|
|
||||||
await page.addInitScript({ path: path.join(__dirname, './', 'addInitFaultManagementPlugin.js') });
|
await page.addInitScript({ path: path.join(__dirname, './', 'addInitFaultManagementPlugin.js') });
|
||||||
|
|
||||||
await navigateToFaultItemInTree(page);
|
await navigateToFaultItemInTree(page);
|
||||||
@@ -58,8 +57,16 @@ async function navigateToFaultManagementWithoutExample(page) {
|
|||||||
async function navigateToFaultItemInTree(page) {
|
async function navigateToFaultItemInTree(page) {
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'networkidle' });
|
||||||
|
|
||||||
// Click text=Fault Management
|
const faultManagementTreeItem = page
|
||||||
await page.click('text=Fault Management'); // this verifies the plugin has been added
|
.getByRole('tree', {
|
||||||
|
name: 'Main Tree'
|
||||||
|
})
|
||||||
|
.getByRole('treeitem', {
|
||||||
|
name: 'Fault Management'
|
||||||
|
});
|
||||||
|
|
||||||
|
// Navigate to "Fault Management" from the tree
|
||||||
|
await faultManagementTreeItem.click();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -70,7 +77,6 @@ async function acknowledgeFault(page, rowNumber) {
|
|||||||
await page.locator('.c-menu >> text="Acknowledge"').click();
|
await page.locator('.c-menu >> text="Acknowledge"').click();
|
||||||
// Click [aria-label="Save"]
|
// Click [aria-label="Save"]
|
||||||
await page.locator('[aria-label="Save"]').click();
|
await page.locator('[aria-label="Save"]').click();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -141,8 +147,7 @@ async function clearSearch(page) {
|
|||||||
* @param {import('@playwright/test').Page} page
|
* @param {import('@playwright/test').Page} page
|
||||||
*/
|
*/
|
||||||
async function selectFaultItem(page, rowNumber) {
|
async function selectFaultItem(page, rowNumber) {
|
||||||
// eslint-disable-next-line playwright/no-force-option
|
await page.locator(`.c-fault-mgmt-item > input >> nth=${rowNumber - 1}`).check();
|
||||||
await page.check(`.c-fault-mgmt-item > input >> nth=${rowNumber - 1}`, { force: true }); // this will not work without force true, saw this may be a pw bug
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -190,7 +195,9 @@ async function getFaultResultCount(page) {
|
|||||||
* @param {import('@playwright/test').Page} page
|
* @param {import('@playwright/test').Page} page
|
||||||
*/
|
*/
|
||||||
function getFault(page, rowNumber) {
|
function getFault(page, rowNumber) {
|
||||||
const fault = page.locator(`.c-faults-list-view-item-body > .c-fault-mgmt__list >> nth=${rowNumber - 1}`);
|
const fault = page.locator(
|
||||||
|
`.c-faults-list-view-item-body > .c-fault-mgmt__list >> nth=${rowNumber - 1}`
|
||||||
|
);
|
||||||
|
|
||||||
return fault;
|
return fault;
|
||||||
}
|
}
|
||||||
@@ -208,7 +215,9 @@ function getFaultByName(page, name) {
|
|||||||
* @param {import('@playwright/test').Page} page
|
* @param {import('@playwright/test').Page} page
|
||||||
*/
|
*/
|
||||||
async function getFaultName(page, rowNumber) {
|
async function getFaultName(page, rowNumber) {
|
||||||
const faultName = await page.locator(`.c-fault-mgmt__list-faultname >> nth=${rowNumber - 1}`).textContent();
|
const faultName = await page
|
||||||
|
.locator(`.c-fault-mgmt__list-faultname >> nth=${rowNumber - 1}`)
|
||||||
|
.textContent();
|
||||||
|
|
||||||
return faultName;
|
return faultName;
|
||||||
}
|
}
|
||||||
@@ -217,7 +226,9 @@ async function getFaultName(page, rowNumber) {
|
|||||||
* @param {import('@playwright/test').Page} page
|
* @param {import('@playwright/test').Page} page
|
||||||
*/
|
*/
|
||||||
async function getFaultSeverity(page, rowNumber) {
|
async function getFaultSeverity(page, rowNumber) {
|
||||||
const faultSeverity = await page.locator(`.c-faults-list-view-item-body .c-fault-mgmt__list-severity >> nth=${rowNumber - 1}`).getAttribute('title');
|
const faultSeverity = await page
|
||||||
|
.locator(`.c-faults-list-view-item-body .c-fault-mgmt__list-severity >> nth=${rowNumber - 1}`)
|
||||||
|
.getAttribute('title');
|
||||||
|
|
||||||
return faultSeverity;
|
return faultSeverity;
|
||||||
}
|
}
|
||||||
@@ -226,7 +237,9 @@ async function getFaultSeverity(page, rowNumber) {
|
|||||||
* @param {import('@playwright/test').Page} page
|
* @param {import('@playwright/test').Page} page
|
||||||
*/
|
*/
|
||||||
async function getFaultNamespace(page, rowNumber) {
|
async function getFaultNamespace(page, rowNumber) {
|
||||||
const faultNamespace = await page.locator(`.c-fault-mgmt__list-path >> nth=${rowNumber - 1}`).textContent();
|
const faultNamespace = await page
|
||||||
|
.locator(`.c-fault-mgmt__list-path >> nth=${rowNumber - 1}`)
|
||||||
|
.textContent();
|
||||||
|
|
||||||
return faultNamespace;
|
return faultNamespace;
|
||||||
}
|
}
|
||||||
@@ -235,7 +248,9 @@ async function getFaultNamespace(page, rowNumber) {
|
|||||||
* @param {import('@playwright/test').Page} page
|
* @param {import('@playwright/test').Page} page
|
||||||
*/
|
*/
|
||||||
async function getFaultTriggerTime(page, rowNumber) {
|
async function getFaultTriggerTime(page, rowNumber) {
|
||||||
const faultTriggerTime = await page.locator(`.c-fault-mgmt__list-trigTime >> nth=${rowNumber - 1} >> .c-fault-mgmt-item__value`).textContent();
|
const faultTriggerTime = await page
|
||||||
|
.locator(`.c-fault-mgmt__list-trigTime >> nth=${rowNumber - 1} >> .c-fault-mgmt-item__value`)
|
||||||
|
.textContent();
|
||||||
|
|
||||||
return faultTriggerTime.toString().trim();
|
return faultTriggerTime.toString().trim();
|
||||||
}
|
}
|
||||||
@@ -245,8 +260,9 @@ async function getFaultTriggerTime(page, rowNumber) {
|
|||||||
*/
|
*/
|
||||||
async function openFaultRowMenu(page, rowNumber) {
|
async function openFaultRowMenu(page, rowNumber) {
|
||||||
// select
|
// select
|
||||||
await page.locator(`.c-fault-mgmt-item > .c-fault-mgmt__list-action-button >> nth=${rowNumber - 1}`).click();
|
await page
|
||||||
|
.locator(`.c-fault-mgmt-item > .c-fault-mgmt__list-action-button >> nth=${rowNumber - 1}`)
|
||||||
|
.click();
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line no-undef
|
// eslint-disable-next-line no-undef
|
||||||
|
|||||||
@@ -20,15 +20,17 @@
|
|||||||
* at runtime from the About dialog for additional information.
|
* at runtime from the About dialog for additional information.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
const { createDomainObjectWithDefaults } = require('../appActions');
|
const { selectInspectorTab, createDomainObjectWithDefaults } = require('../appActions');
|
||||||
|
|
||||||
const NOTEBOOK_DROP_AREA = '.c-notebook__drag-area';
|
const NOTEBOOK_DROP_AREA = '.c-notebook__drag-area';
|
||||||
|
const CUSTOM_NAME = 'CUSTOM_NAME';
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {import('@playwright/test').Page} page
|
* @param {import('@playwright/test').Page} page
|
||||||
*/
|
*/
|
||||||
async function enterTextEntry(page, text) {
|
async function enterTextEntry(page, text) {
|
||||||
// Click .c-notebook__drag-area
|
// Click the 'Add Notebook Entry' area
|
||||||
await page.locator(NOTEBOOK_DROP_AREA).click();
|
await page.locator(NOTEBOOK_DROP_AREA).click();
|
||||||
|
|
||||||
// enter text
|
// enter text
|
||||||
@@ -42,7 +44,7 @@ async function enterTextEntry(page, text) {
|
|||||||
async function dragAndDropEmbed(page, notebookObject) {
|
async function dragAndDropEmbed(page, notebookObject) {
|
||||||
// Create example telemetry object
|
// Create example telemetry object
|
||||||
const swg = await createDomainObjectWithDefaults(page, {
|
const swg = await createDomainObjectWithDefaults(page, {
|
||||||
type: "Sine Wave Generator"
|
type: 'Sine Wave Generator'
|
||||||
});
|
});
|
||||||
// Navigate to notebook
|
// Navigate to notebook
|
||||||
await page.goto(notebookObject.url);
|
await page.goto(notebookObject.url);
|
||||||
@@ -58,11 +60,90 @@ async function dragAndDropEmbed(page, notebookObject) {
|
|||||||
* @param {import('@playwright/test').Page} page
|
* @param {import('@playwright/test').Page} page
|
||||||
*/
|
*/
|
||||||
async function commitEntry(page) {
|
async function commitEntry(page) {
|
||||||
|
//Click the Commit Entry button
|
||||||
await page.locator('.c-ne__save-button > button').click();
|
await page.locator('.c-ne__save-button > button').click();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {import('@playwright/test').Page} page
|
||||||
|
*/
|
||||||
|
async function startAndAddRestrictedNotebookObject(page) {
|
||||||
|
// eslint-disable-next-line no-undef
|
||||||
|
await page.addInitScript({ path: path.join(__dirname, 'addInitRestrictedNotebook.js') });
|
||||||
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
|
return createDomainObjectWithDefaults(page, {
|
||||||
|
type: CUSTOM_NAME,
|
||||||
|
name: 'Restricted Test Notebook'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @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
|
||||||
|
await page.locator('text=Lock Page').click();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a notebook object and adds an entry.
|
||||||
|
* @param {import('@playwright/test').Page} - page to load
|
||||||
|
* @param {number} [iterations = 1] - the number of entries to create
|
||||||
|
*/
|
||||||
|
async function createNotebookAndEntry(page, iterations = 1) {
|
||||||
|
const notebook = createDomainObjectWithDefaults(page, { type: 'Notebook' });
|
||||||
|
|
||||||
|
for (let iteration = 0; iteration < iterations; iteration++) {
|
||||||
|
await enterTextEntry(page, `Entry ${iteration}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
return notebook;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a notebook object, adds an entry, and adds a tag.
|
||||||
|
* @param {import('@playwright/test').Page} page
|
||||||
|
* @param {number} [iterations = 1] - the number of entries (and tags) to create
|
||||||
|
*/
|
||||||
|
async function createNotebookEntryAndTags(page, iterations = 1) {
|
||||||
|
const notebook = await createNotebookAndEntry(page, iterations);
|
||||||
|
await selectInspectorTab(page, 'Annotations');
|
||||||
|
|
||||||
|
for (let iteration = 0; iteration < iterations; iteration++) {
|
||||||
|
// Hover and click "Add Tag" button
|
||||||
|
// Hover is needed here to "slow down" the actions while running in headless mode
|
||||||
|
await page.locator(`[aria-label="Notebook Entry"] >> nth = ${iteration}`).click();
|
||||||
|
await page.hover(`button:has-text("Add Tag")`);
|
||||||
|
await page.locator(`button:has-text("Add Tag")`).click();
|
||||||
|
|
||||||
|
// Click inside the tag search input
|
||||||
|
await page.locator('[placeholder="Type to select tag"]').click();
|
||||||
|
// Select the "Driving" tag
|
||||||
|
await page.locator('[aria-label="Autocomplete Options"] >> text=Driving').click();
|
||||||
|
|
||||||
|
// Hover and click "Add Tag" button
|
||||||
|
// Hover is needed here to "slow down" the actions while running in headless mode
|
||||||
|
await page.hover(`button:has-text("Add Tag")`);
|
||||||
|
await page.locator(`button:has-text("Add Tag")`).click();
|
||||||
|
// Click inside the tag search input
|
||||||
|
await page.locator('[placeholder="Type to select tag"]').click();
|
||||||
|
// Select the "Science" tag
|
||||||
|
await page.locator('[aria-label="Autocomplete Options"] >> text=Science').click();
|
||||||
|
}
|
||||||
|
|
||||||
|
return notebook;
|
||||||
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line no-undef
|
// eslint-disable-next-line no-undef
|
||||||
module.exports = {
|
module.exports = {
|
||||||
enterTextEntry,
|
enterTextEntry,
|
||||||
dragAndDropEmbed
|
dragAndDropEmbed,
|
||||||
|
startAndAddRestrictedNotebookObject,
|
||||||
|
lockPage,
|
||||||
|
createNotebookEntryAndTags,
|
||||||
|
createNotebookAndEntry
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -46,15 +46,20 @@ export async function assertPlanActivities(page, plan, objectUrl) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Switch to fixed time mode with all plan events within the bounds
|
// 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`);
|
await page.goto(
|
||||||
|
`${objectUrl}?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
|
// Assert that the number of activities in the plan view matches the number of
|
||||||
// activities in the plan data within the specified time bounds
|
// activities in the plan data within the specified time bounds
|
||||||
const eventCount = await page.locator('.activity-bounds').count();
|
const eventCount = await page.locator('.activity-bounds').count();
|
||||||
expect(eventCount).toEqual(Object.values(plan)
|
expect(eventCount).toEqual(
|
||||||
|
Object.values(plan)
|
||||||
.flat()
|
.flat()
|
||||||
.filter(event =>
|
.filter((event) =>
|
||||||
activitiesWithinTimeBounds(event.start, event.end, startBound, endBound)).length);
|
activitiesWithinTimeBounds(event.start, event.end, startBound, endBound)
|
||||||
|
).length
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -68,10 +73,12 @@ export async function assertPlanActivities(page, plan, objectUrl) {
|
|||||||
* @returns {boolean} true if the activities overlap, false otherwise
|
* @returns {boolean} true if the activities overlap, false otherwise
|
||||||
*/
|
*/
|
||||||
function activitiesWithinTimeBounds(start1, end1, start2, end2) {
|
function activitiesWithinTimeBounds(start1, end1, start2, end2) {
|
||||||
return (start1 >= start2 && start1 <= end2)
|
return (
|
||||||
|| (end1 >= start2 && end1 <= end2)
|
(start1 >= start2 && start1 <= end2) ||
|
||||||
|| (start2 >= start1 && start2 <= end1)
|
(end1 >= start2 && end1 <= end2) ||
|
||||||
|| (end2 >= start1 && end2 <= end1);
|
(start2 >= start1 && start2 <= end1) ||
|
||||||
|
(end2 >= start1 && end2 <= end1)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -84,9 +91,11 @@ function activitiesWithinTimeBounds(start1, end1, start2, end2) {
|
|||||||
export async function setBoundsToSpanAllActivities(page, planJson, planObjectUrl) {
|
export async function setBoundsToSpanAllActivities(page, planJson, planObjectUrl) {
|
||||||
const activities = Object.values(planJson).flat();
|
const activities = Object.values(planJson).flat();
|
||||||
// Get the earliest start value
|
// Get the earliest start value
|
||||||
const start = Math.min(...activities.map(activity => activity.start));
|
const start = Math.min(...activities.map((activity) => activity.start));
|
||||||
// Get the latest end value
|
// Get the latest end value
|
||||||
const end = Math.max(...activities.map(activity => activity.end));
|
const end = Math.max(...activities.map((activity) => activity.end));
|
||||||
// Set the start and end bounds to the earliest start and latest end
|
// Set the start and end bounds to the earliest start and latest end
|
||||||
await page.goto(`${planObjectUrl}?tc.mode=fixed&tc.startBound=${start}&tc.endBound=${end}&tc.timeSystem=utc&view=plan.view`);
|
await page.goto(
|
||||||
|
`${planObjectUrl}?tc.mode=fixed&tc.startBound=${start}&tc.endBound=${end}&tc.timeSystem=utc&view=plan.view`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ const NUM_WORKERS = 2;
|
|||||||
|
|
||||||
/** @type {import('@playwright/test').PlaywrightTestConfig} */
|
/** @type {import('@playwright/test').PlaywrightTestConfig} */
|
||||||
const config = {
|
const config = {
|
||||||
retries: 2, //Retries 2 times for a total of 3 runs. When running sharded and with maxFailures = 5, this should ensure that flake is managed without failing the full suite
|
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',
|
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-perfromance.config.js
|
||||||
timeout: 60 * 1000,
|
timeout: 60 * 1000,
|
||||||
@@ -69,12 +69,15 @@ const config = {
|
|||||||
],
|
],
|
||||||
reporter: [
|
reporter: [
|
||||||
['list'],
|
['list'],
|
||||||
['html', {
|
[
|
||||||
|
'html',
|
||||||
|
{
|
||||||
open: 'never',
|
open: 'never',
|
||||||
outputFolder: '../html-test-results' //Must be in different location due to https://github.com/microsoft/playwright/issues/12840
|
outputFolder: '../html-test-results' //Must be in different location due to https://github.com/microsoft/playwright/issues/12840
|
||||||
}],
|
}
|
||||||
|
],
|
||||||
['junit', { outputFile: '../test-results/results.xml' }],
|
['junit', { outputFile: '../test-results/results.xml' }],
|
||||||
['github']
|
['@deploysentinel/playwright']
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ const config = {
|
|||||||
},
|
},
|
||||||
workers: 1,
|
workers: 1,
|
||||||
use: {
|
use: {
|
||||||
browserName: "chromium",
|
browserName: 'chromium',
|
||||||
baseURL: 'http://localhost:8080/',
|
baseURL: 'http://localhost:8080/',
|
||||||
headless: false,
|
headless: false,
|
||||||
ignoreHTTPSErrors: true,
|
ignoreHTTPSErrors: true,
|
||||||
@@ -94,10 +94,13 @@ const config = {
|
|||||||
],
|
],
|
||||||
reporter: [
|
reporter: [
|
||||||
['list'],
|
['list'],
|
||||||
['html', {
|
[
|
||||||
|
'html',
|
||||||
|
{
|
||||||
open: 'on-failure',
|
open: 'on-failure',
|
||||||
outputFolder: '../html-test-results' //Must be in different location due to https://github.com/microsoft/playwright/issues/12840
|
outputFolder: '../html-test-results' //Must be in different location due to https://github.com/microsoft/playwright/issues/12840
|
||||||
}]
|
}
|
||||||
|
]
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -17,13 +17,16 @@ const config = {
|
|||||||
reuseExistingServer: !CI
|
reuseExistingServer: !CI
|
||||||
},
|
},
|
||||||
use: {
|
use: {
|
||||||
browserName: "chromium",
|
browserName: 'chromium',
|
||||||
baseURL: 'http://localhost:8080/',
|
baseURL: 'http://localhost:8080/',
|
||||||
headless: CI, //Only if running locally
|
headless: CI, //Only if running locally
|
||||||
ignoreHTTPSErrors: true,
|
ignoreHTTPSErrors: true,
|
||||||
screenshot: 'off',
|
screenshot: 'off',
|
||||||
trace: 'on-first-retry',
|
trace: 'on-first-retry',
|
||||||
video: 'off'
|
video: 'off',
|
||||||
|
launchOptions: {
|
||||||
|
args: ['--js-flags=--expose-gc']
|
||||||
|
}
|
||||||
},
|
},
|
||||||
projects: [
|
projects: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -41,10 +41,13 @@ const config = {
|
|||||||
reporter: [
|
reporter: [
|
||||||
['list'],
|
['list'],
|
||||||
['junit', { outputFile: '../test-results/results.xml' }],
|
['junit', { outputFile: '../test-results/results.xml' }],
|
||||||
['html', {
|
[
|
||||||
|
'html',
|
||||||
|
{
|
||||||
open: 'on-failure',
|
open: 'on-failure',
|
||||||
outputFolder: '../html-test-results' //Must be in different location due to https://github.com/microsoft/playwright/issues/12840
|
outputFolder: '../html-test-results' //Must be in different location due to https://github.com/microsoft/playwright/issues/12840
|
||||||
}]
|
}
|
||||||
|
]
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
* and appActions. These fixtures should be generalized across all plugins.
|
* and appActions. These fixtures should be generalized across all plugins.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const { test, expect } = require('./baseFixtures');
|
const { test, expect, request } = require('./baseFixtures');
|
||||||
// const { createDomainObjectWithDefaults } = require('./appActions');
|
// const { createDomainObjectWithDefaults } = require('./appActions');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
@@ -45,8 +45,6 @@ const path = require('path');
|
|||||||
// const createdObjects = new Map();
|
// const createdObjects = new Map();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* **NOTE: This feature is a work-in-progress and should not currently be used.**
|
|
||||||
*
|
|
||||||
* This action will create a domain object for the test to reference and return the uuid. If an object
|
* This action will create a domain object for the test to reference and return the uuid. If an object
|
||||||
* of a given name already exists, it will return the uuid of that object to the test instead of creating
|
* of a given name already exists, it will return the uuid of that object to the test instead of creating
|
||||||
* a new file. The intent is to move object creation out of test suites which are not explicitly worried
|
* a new file. The intent is to move object creation out of test suites which are not explicitly worried
|
||||||
@@ -65,10 +63,7 @@ const path = require('path');
|
|||||||
|
|
||||||
// await createDomainObjectWithDefaults(page, type, name);
|
// await createDomainObjectWithDefaults(page, type, name);
|
||||||
|
|
||||||
// // Once object is created, get the uuid from the url
|
// const uuid = getHashUrlToDomainObject(page);
|
||||||
// const uuid = await page.evaluate(() => {
|
|
||||||
// return window.location.href.match(/[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/)[0];
|
|
||||||
// });
|
|
||||||
|
|
||||||
// createdObjects.set(objectName, uuid);
|
// createdObjects.set(objectName, uuid);
|
||||||
|
|
||||||
@@ -120,7 +115,7 @@ const theme = 'espresso';
|
|||||||
*
|
*
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
const myItemsFolderName = "My Items";
|
const myItemsFolderName = 'My Items';
|
||||||
|
|
||||||
exports.test = test.extend({
|
exports.test = test.extend({
|
||||||
// This should follow in the Project's configuration. Can be set to 'snow' in playwright config.js
|
// This should follow in the Project's configuration. Can be set to 'snow' in playwright config.js
|
||||||
@@ -136,10 +131,7 @@ exports.test = test.extend({
|
|||||||
// Attach info about the currently running test and its project.
|
// Attach info about the currently running test and its project.
|
||||||
// This will be used by appActions to fill in the created
|
// This will be used by appActions to fill in the created
|
||||||
// domain object's notes.
|
// domain object's notes.
|
||||||
page.testNotes = [
|
page.testNotes = [`${testInfo.titlePath.join('\n')}`, `${testInfo.project.name}`].join('\n');
|
||||||
`${testInfo.titlePath.join('\n')}`,
|
|
||||||
`${testInfo.project.name}`
|
|
||||||
].join('\n');
|
|
||||||
|
|
||||||
await use(page);
|
await use(page);
|
||||||
},
|
},
|
||||||
@@ -149,4 +141,20 @@ exports.test = test.extend({
|
|||||||
await use({ myItemsFolderName });
|
await use({ myItemsFolderName });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
exports.expect = expect;
|
exports.expect = expect;
|
||||||
|
exports.request = request;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Takes a readable stream and returns a string.
|
||||||
|
* @param {ReadableStream} readable - the readable stream
|
||||||
|
* @return {Promise<String>} the stringified stream
|
||||||
|
*/
|
||||||
|
exports.streamToString = async function (readable) {
|
||||||
|
let result = '';
|
||||||
|
for await (const chunk of readable) {
|
||||||
|
result += chunk;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
|||||||
@@ -274,10 +274,7 @@
|
|||||||
"id": "ac0d7eb1-b485-458f-bd2a-a63aa87a3a8a"
|
"id": "ac0d7eb1-b485-458f-bd2a-a63aa87a3a8a"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"layoutGrid": [
|
"layoutGrid": [10, 10],
|
||||||
10,
|
|
||||||
10
|
|
||||||
],
|
|
||||||
"objectStyles": {
|
"objectStyles": {
|
||||||
"ed63cc29-80e2-4e2b-a472-3d6d4adbf310": {
|
"ed63cc29-80e2-4e2b-a472-3d6d4adbf310": {
|
||||||
"staticStyle": {
|
"staticStyle": {
|
||||||
@@ -1455,9 +1452,7 @@
|
|||||||
"id": "64e49fe7-5b36-43db-8347-4550b910de4c",
|
"id": "64e49fe7-5b36-43db-8347-4550b910de4c",
|
||||||
"telemetry": "any",
|
"telemetry": "any",
|
||||||
"operation": "greaterThan",
|
"operation": "greaterThan",
|
||||||
"input": [
|
"input": ["120"],
|
||||||
"120"
|
|
||||||
],
|
|
||||||
"metadata": "sin"
|
"metadata": "sin"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -1475,10 +1470,7 @@
|
|||||||
"id": "59f1c4bf-5d36-450c-9668-6546955fc066",
|
"id": "59f1c4bf-5d36-450c-9668-6546955fc066",
|
||||||
"telemetry": "any",
|
"telemetry": "any",
|
||||||
"operation": "between",
|
"operation": "between",
|
||||||
"input": [
|
"input": ["120", "-20"],
|
||||||
"120",
|
|
||||||
"-20"
|
|
||||||
],
|
|
||||||
"metadata": "sin"
|
"metadata": "sin"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -1496,9 +1488,7 @@
|
|||||||
"id": "6707be12-6a6e-4535-bb97-ab5c86f99934",
|
"id": "6707be12-6a6e-4535-bb97-ab5c86f99934",
|
||||||
"telemetry": "any",
|
"telemetry": "any",
|
||||||
"operation": "lessThan",
|
"operation": "lessThan",
|
||||||
"input": [
|
"input": ["-20"],
|
||||||
"-20"
|
|
||||||
],
|
|
||||||
"metadata": "sin"
|
"metadata": "sin"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -1550,9 +1540,7 @@
|
|||||||
"id": "64e49fe7-5b36-43db-8347-4550b910de4c",
|
"id": "64e49fe7-5b36-43db-8347-4550b910de4c",
|
||||||
"telemetry": "any",
|
"telemetry": "any",
|
||||||
"operation": "greaterThan",
|
"operation": "greaterThan",
|
||||||
"input": [
|
"input": ["120"],
|
||||||
"120"
|
|
||||||
],
|
|
||||||
"metadata": "sin"
|
"metadata": "sin"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -1570,10 +1558,7 @@
|
|||||||
"id": "59f1c4bf-5d36-450c-9668-6546955fc066",
|
"id": "59f1c4bf-5d36-450c-9668-6546955fc066",
|
||||||
"telemetry": "any",
|
"telemetry": "any",
|
||||||
"operation": "between",
|
"operation": "between",
|
||||||
"input": [
|
"input": ["120", "-20"],
|
||||||
"120",
|
|
||||||
"-20"
|
|
||||||
],
|
|
||||||
"metadata": "sin"
|
"metadata": "sin"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -1591,9 +1576,7 @@
|
|||||||
"id": "6707be12-6a6e-4535-bb97-ab5c86f99934",
|
"id": "6707be12-6a6e-4535-bb97-ab5c86f99934",
|
||||||
"telemetry": "any",
|
"telemetry": "any",
|
||||||
"operation": "lessThan",
|
"operation": "lessThan",
|
||||||
"input": [
|
"input": ["-20"],
|
||||||
"-20"
|
|
||||||
],
|
|
||||||
"metadata": "sin"
|
"metadata": "sin"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -1645,9 +1628,7 @@
|
|||||||
"id": "64e49fe7-5b36-43db-8347-4550b910de4c",
|
"id": "64e49fe7-5b36-43db-8347-4550b910de4c",
|
||||||
"telemetry": "any",
|
"telemetry": "any",
|
||||||
"operation": "greaterThan",
|
"operation": "greaterThan",
|
||||||
"input": [
|
"input": ["150"],
|
||||||
"150"
|
|
||||||
],
|
|
||||||
"metadata": "sin"
|
"metadata": "sin"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -1665,10 +1646,7 @@
|
|||||||
"id": "59f1c4bf-5d36-450c-9668-6546955fc066",
|
"id": "59f1c4bf-5d36-450c-9668-6546955fc066",
|
||||||
"telemetry": "any",
|
"telemetry": "any",
|
||||||
"operation": "between",
|
"operation": "between",
|
||||||
"input": [
|
"input": ["50", "-50"],
|
||||||
"50",
|
|
||||||
"-50"
|
|
||||||
],
|
|
||||||
"metadata": "sin"
|
"metadata": "sin"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -1720,9 +1698,7 @@
|
|||||||
"id": "64e49fe7-5b36-43db-8347-4550b910de4c",
|
"id": "64e49fe7-5b36-43db-8347-4550b910de4c",
|
||||||
"telemetry": "any",
|
"telemetry": "any",
|
||||||
"operation": "greaterThan",
|
"operation": "greaterThan",
|
||||||
"input": [
|
"input": ["150"],
|
||||||
"150"
|
|
||||||
],
|
|
||||||
"metadata": "sin"
|
"metadata": "sin"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -1740,10 +1716,7 @@
|
|||||||
"id": "59f1c4bf-5d36-450c-9668-6546955fc066",
|
"id": "59f1c4bf-5d36-450c-9668-6546955fc066",
|
||||||
"telemetry": "any",
|
"telemetry": "any",
|
||||||
"operation": "between",
|
"operation": "between",
|
||||||
"input": [
|
"input": ["50", "-50"],
|
||||||
"50",
|
|
||||||
"-50"
|
|
||||||
],
|
|
||||||
"metadata": "sin"
|
"metadata": "sin"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1 +1,90 @@
|
|||||||
{"openmct":{"b3cee102-86dd-4c0a-8eec-4d5d276f8691":{"identifier":{"key":"b3cee102-86dd-4c0a-8eec-4d5d276f8691","namespace":""},"name":"Performance Display Layout","type":"layout","composition":[{"key":"9666e7b4-be0c-47a5-94b8-99accad7155e","namespace":""}],"configuration":{"items":[{"width":32,"height":18,"x":12,"y":9,"identifier":{"key":"9666e7b4-be0c-47a5-94b8-99accad7155e","namespace":""},"hasFrame":true,"fontSize":"default","font":"default","type":"subobject-view","id":"23ca351d-a67d-46aa-a762-290eb742d2f1"}],"layoutGrid":[10,10]},"modified":1654299875432,"location":"mine","persisted":1654299878751},"9666e7b4-be0c-47a5-94b8-99accad7155e":{"identifier":{"key":"9666e7b4-be0c-47a5-94b8-99accad7155e","namespace":""},"name":"Performance Example Imagery","type":"example.imagery","configuration":{"imageLocation":"","imageLoadDelayInMilliSeconds":20000,"imageSamples":[],"layers":[{"source":"dist/imagery/example-imagery-layer-16x9.png","name":"16:9","visible":false},{"source":"dist/imagery/example-imagery-layer-safe.png","name":"Safe","visible":false},{"source":"dist/imagery/example-imagery-layer-scale.png","name":"Scale","visible":false}]},"telemetry":{"values":[{"name":"Name","key":"name"},{"name":"Time","key":"utc","format":"utc","hints":{"domain":2}},{"name":"Local Time","key":"local","format":"local-format","hints":{"domain":1}},{"name":"Image","key":"url","format":"image","hints":{"image":1},"layers":[{"source":"dist/imagery/example-imagery-layer-16x9.png","name":"16:9"},{"source":"dist/imagery/example-imagery-layer-safe.png","name":"Safe"},{"source":"dist/imagery/example-imagery-layer-scale.png","name":"Scale"}]},{"name":"Image Download Name","key":"imageDownloadName","format":"imageDownloadName","hints":{"imageDownloadName":1}}]},"modified":1654299840077,"location":"b3cee102-86dd-4c0a-8eec-4d5d276f8691","persisted":1654299840078}},"rootId":"b3cee102-86dd-4c0a-8eec-4d5d276f8691"}
|
{
|
||||||
|
"openmct": {
|
||||||
|
"b3cee102-86dd-4c0a-8eec-4d5d276f8691": {
|
||||||
|
"identifier": { "key": "b3cee102-86dd-4c0a-8eec-4d5d276f8691", "namespace": "" },
|
||||||
|
"name": "Performance Display Layout",
|
||||||
|
"type": "layout",
|
||||||
|
"composition": [{ "key": "9666e7b4-be0c-47a5-94b8-99accad7155e", "namespace": "" }],
|
||||||
|
"configuration": {
|
||||||
|
"items": [
|
||||||
|
{
|
||||||
|
"width": 32,
|
||||||
|
"height": 18,
|
||||||
|
"x": 12,
|
||||||
|
"y": 9,
|
||||||
|
"identifier": { "key": "9666e7b4-be0c-47a5-94b8-99accad7155e", "namespace": "" },
|
||||||
|
"hasFrame": true,
|
||||||
|
"fontSize": "default",
|
||||||
|
"font": "default",
|
||||||
|
"type": "subobject-view",
|
||||||
|
"id": "23ca351d-a67d-46aa-a762-290eb742d2f1"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"layoutGrid": [10, 10]
|
||||||
|
},
|
||||||
|
"modified": 1654299875432,
|
||||||
|
"location": "mine",
|
||||||
|
"persisted": 1654299878751
|
||||||
|
},
|
||||||
|
"9666e7b4-be0c-47a5-94b8-99accad7155e": {
|
||||||
|
"identifier": { "key": "9666e7b4-be0c-47a5-94b8-99accad7155e", "namespace": "" },
|
||||||
|
"name": "Performance Example Imagery",
|
||||||
|
"type": "example.imagery",
|
||||||
|
"configuration": {
|
||||||
|
"imageLocation": "",
|
||||||
|
"imageLoadDelayInMilliSeconds": 20000,
|
||||||
|
"imageSamples": [],
|
||||||
|
"layers": [
|
||||||
|
{
|
||||||
|
"source": "dist/imagery/example-imagery-layer-16x9.png",
|
||||||
|
"name": "16:9",
|
||||||
|
"visible": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"source": "dist/imagery/example-imagery-layer-safe.png",
|
||||||
|
"name": "Safe",
|
||||||
|
"visible": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"source": "dist/imagery/example-imagery-layer-scale.png",
|
||||||
|
"name": "Scale",
|
||||||
|
"visible": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"telemetry": {
|
||||||
|
"values": [
|
||||||
|
{ "name": "Name", "key": "name" },
|
||||||
|
{ "name": "Time", "key": "utc", "format": "utc", "hints": { "domain": 2 } },
|
||||||
|
{
|
||||||
|
"name": "Local Time",
|
||||||
|
"key": "local",
|
||||||
|
"format": "local-format",
|
||||||
|
"hints": { "domain": 1 }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Image",
|
||||||
|
"key": "url",
|
||||||
|
"format": "image",
|
||||||
|
"hints": { "image": 1 },
|
||||||
|
"layers": [
|
||||||
|
{ "source": "dist/imagery/example-imagery-layer-16x9.png", "name": "16:9" },
|
||||||
|
{ "source": "dist/imagery/example-imagery-layer-safe.png", "name": "Safe" },
|
||||||
|
{ "source": "dist/imagery/example-imagery-layer-scale.png", "name": "Scale" }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Image Download Name",
|
||||||
|
"key": "imageDownloadName",
|
||||||
|
"format": "imageDownloadName",
|
||||||
|
"hints": { "imageDownloadName": 1 }
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"modified": 1654299840077,
|
||||||
|
"location": "b3cee102-86dd-4c0a-8eec-4d5d276f8691",
|
||||||
|
"persisted": 1654299840078
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"rootId": "b3cee102-86dd-4c0a-8eec-4d5d276f8691"
|
||||||
|
}
|
||||||
|
|||||||
@@ -1 +1,96 @@
|
|||||||
{"openmct":{"6d2fa9fd-f2aa-461a-a1e1-164ac44bec9d":{"identifier":{"key":"6d2fa9fd-f2aa-461a-a1e1-164ac44bec9d","namespace":""},"name":"Performance Notebook","type":"notebook","configuration":{"defaultSort":"oldest","entries":{"3e31c412-33ba-4757-8ade-e9821f6ba321":{"8c8f6035-631c-45af-8c24-786c60295335":[{"id":"entry-1652815305457","createdOn":1652815305457,"createdBy":"","text":"Existing Entry 1","embeds":[]},{"id":"entry-1652815313465","createdOn":1652815313465,"createdBy":"","text":"Existing Entry 2","embeds":[]},{"id":"entry-1652815399955","createdOn":1652815399955,"createdBy":"","text":"Existing Entry 3","embeds":[]}]}},"imageMigrationVer":"v1","pageTitle":"Page","sections":[{"id":"3e31c412-33ba-4757-8ade-e9821f6ba321","isDefault":false,"isSelected":false,"name":"Section1","pages":[{"id":"8c8f6035-631c-45af-8c24-786c60295335","isDefault":false,"isSelected":false,"name":"Page1","pageTitle":"Page"},{"id":"36555942-c9aa-439c-bbdb-0aaf50db50f5","isDefault":false,"isSelected":false,"name":"Page2","pageTitle":"Page"}],"sectionTitle":"Section"},{"id":"dab0bd1d-2c5a-405c-987f-107123d6189a","isDefault":false,"isSelected":true,"name":"Section2","pages":[{"id":"f625a86a-cb99-4898-8082-80543c8de534","isDefault":false,"isSelected":false,"name":"Page1","pageTitle":"Page"},{"id":"e77ef810-f785-42a7-942e-07e999b79c59","isDefault":false,"isSelected":true,"name":"Page2","pageTitle":"Page"}],"sectionTitle":"Section"}],"sectionTitle":"Section","type":"General","showTime":"0"},"modified":1652815915219,"location":"mine","persisted":1652815915222}},"rootId":"6d2fa9fd-f2aa-461a-a1e1-164ac44bec9d"}
|
{
|
||||||
|
"openmct": {
|
||||||
|
"6d2fa9fd-f2aa-461a-a1e1-164ac44bec9d": {
|
||||||
|
"identifier": { "key": "6d2fa9fd-f2aa-461a-a1e1-164ac44bec9d", "namespace": "" },
|
||||||
|
"name": "Performance Notebook",
|
||||||
|
"type": "notebook",
|
||||||
|
"configuration": {
|
||||||
|
"defaultSort": "oldest",
|
||||||
|
"entries": {
|
||||||
|
"3e31c412-33ba-4757-8ade-e9821f6ba321": {
|
||||||
|
"8c8f6035-631c-45af-8c24-786c60295335": [
|
||||||
|
{
|
||||||
|
"id": "entry-1652815305457",
|
||||||
|
"createdOn": 1652815305457,
|
||||||
|
"createdBy": "",
|
||||||
|
"text": "Existing Entry 1",
|
||||||
|
"embeds": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "entry-1652815313465",
|
||||||
|
"createdOn": 1652815313465,
|
||||||
|
"createdBy": "",
|
||||||
|
"text": "Existing Entry 2",
|
||||||
|
"embeds": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "entry-1652815399955",
|
||||||
|
"createdOn": 1652815399955,
|
||||||
|
"createdBy": "",
|
||||||
|
"text": "Existing Entry 3",
|
||||||
|
"embeds": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"imageMigrationVer": "v1",
|
||||||
|
"pageTitle": "Page",
|
||||||
|
"sections": [
|
||||||
|
{
|
||||||
|
"id": "3e31c412-33ba-4757-8ade-e9821f6ba321",
|
||||||
|
"isDefault": false,
|
||||||
|
"isSelected": false,
|
||||||
|
"name": "Section1",
|
||||||
|
"pages": [
|
||||||
|
{
|
||||||
|
"id": "8c8f6035-631c-45af-8c24-786c60295335",
|
||||||
|
"isDefault": false,
|
||||||
|
"isSelected": false,
|
||||||
|
"name": "Page1",
|
||||||
|
"pageTitle": "Page"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "36555942-c9aa-439c-bbdb-0aaf50db50f5",
|
||||||
|
"isDefault": false,
|
||||||
|
"isSelected": false,
|
||||||
|
"name": "Page2",
|
||||||
|
"pageTitle": "Page"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"sectionTitle": "Section"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "dab0bd1d-2c5a-405c-987f-107123d6189a",
|
||||||
|
"isDefault": false,
|
||||||
|
"isSelected": true,
|
||||||
|
"name": "Section2",
|
||||||
|
"pages": [
|
||||||
|
{
|
||||||
|
"id": "f625a86a-cb99-4898-8082-80543c8de534",
|
||||||
|
"isDefault": false,
|
||||||
|
"isSelected": false,
|
||||||
|
"name": "Page1",
|
||||||
|
"pageTitle": "Page"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "e77ef810-f785-42a7-942e-07e999b79c59",
|
||||||
|
"isDefault": false,
|
||||||
|
"isSelected": true,
|
||||||
|
"name": "Page2",
|
||||||
|
"pageTitle": "Page"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"sectionTitle": "Section"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"sectionTitle": "Section",
|
||||||
|
"type": "General",
|
||||||
|
"showTime": "0"
|
||||||
|
},
|
||||||
|
"modified": 1652815915219,
|
||||||
|
"location": "mine",
|
||||||
|
"persisted": 1652815915222
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"rootId": "6d2fa9fd-f2aa-461a-a1e1-164ac44bec9d"
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
{
|
|
||||||
"cookies": [],
|
|
||||||
"origins": [
|
|
||||||
{
|
|
||||||
"origin": "http://localhost:8080",
|
|
||||||
"localStorage": [
|
|
||||||
{
|
|
||||||
"name": "tcHistory",
|
|
||||||
"value": "{\"utc\":[{\"start\":1658617611983,\"end\":1658619411983}]}"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "mct",
|
|
||||||
"value": "{\"mine\":{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"7fa5749b-8969-494c-9d85-c272516d333c\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"persisted\":1658619412848,\"modified\":1658619412848},\"7fa5749b-8969-494c-9d85-c272516d333c\":{\"identifier\":{\"key\":\"7fa5749b-8969-494c-9d85-c272516d333c\",\"namespace\":\"\"},\"name\":\"Unnamed Overlay Plot\",\"type\":\"telemetry.plot.overlay\",\"composition\":[{\"key\":\"67cbb9fc-af46-4148-b9e5-aea11179ae4b\",\"namespace\":\"\"}],\"configuration\":{\"series\":[{\"identifier\":{\"key\":\"67cbb9fc-af46-4148-b9e5-aea11179ae4b\",\"namespace\":\"\"}}]},\"modified\":1658619413566,\"location\":\"mine\",\"persisted\":1658619413567},\"67cbb9fc-af46-4148-b9e5-aea11179ae4b\":{\"name\":\"Unnamed Sine Wave Generator\",\"type\":\"generator\",\"identifier\":{\"key\":\"67cbb9fc-af46-4148-b9e5-aea11179ae4b\",\"namespace\":\"\"},\"telemetry\":{\"period\":10,\"amplitude\":1,\"offset\":0,\"dataRateInHz\":1,\"phase\":0,\"randomness\":0,\"loadDelay\":\"5000\"},\"modified\":1658619413552,\"location\":\"7fa5749b-8969-494c-9d85-c272516d333c\",\"persisted\":1658619413552}}"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "mct-tree-expanded",
|
|
||||||
"value": "[\"/browse/mine\"]"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
1
e2e/test-data/memory-leak-detection.json
Normal file
26
e2e/test-data/overlay_plot_storage.json
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"cookies": [],
|
||||||
|
"origins": [
|
||||||
|
{
|
||||||
|
"origin": "http://localhost:8080",
|
||||||
|
"localStorage": [
|
||||||
|
{
|
||||||
|
"name": "mct",
|
||||||
|
"value": "{\"mine\":{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"8c863964-4640-4db1-8a98-0e546c3c271d\",\"namespace\":\"\"},{\"key\":\"f5c7e86c-a5b4-4c6c-9038-9cf03cd9a99e\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1678741852556,\"created\":1678741830859,\"persisted\":1678741852557},\"8c863964-4640-4db1-8a98-0e546c3c271d\":{\"identifier\":{\"key\":\"8c863964-4640-4db1-8a98-0e546c3c271d\",\"namespace\":\"\"},\"name\":\"Overlay Plot with Telemetry Object\",\"type\":\"telemetry.plot.overlay\",\"composition\":[{\"key\":\"f5c7e86c-a5b4-4c6c-9038-9cf03cd9a99e\",\"namespace\":\"\"}],\"configuration\":{\"series\":[{\"identifier\":{\"key\":\"f5c7e86c-a5b4-4c6c-9038-9cf03cd9a99e\",\"namespace\":\"\"}}]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate Overlay Plot with Telemetry Object\\nchrome\",\"modified\":1678741862011,\"location\":\"mine\",\"created\":1678741839461,\"persisted\":1678741862011},\"f5c7e86c-a5b4-4c6c-9038-9cf03cd9a99e\":{\"name\":\"VIPER Rover Heading\",\"type\":\"generator\",\"identifier\":{\"key\":\"f5c7e86c-a5b4-4c6c-9038-9cf03cd9a99e\",\"namespace\":\"\"},\"telemetry\":{\"period\":\"1\",\"amplitude\":\"1\",\"offset\":\"0\",\"dataRateInHz\":\"1\",\"phase\":\"0\",\"randomness\":\"0\",\"loadDelay\":\"0\",\"infinityValues\":false,\"staleness\":false},\"modified\":1678741852553,\"location\":\"mine\",\"created\":1678741852553,\"persisted\":1678741852553}}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "mct-tree-expanded",
|
||||||
|
"value": "[]"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "tcHistory",
|
||||||
|
"value": "{\"utc\":[{\"start\":1678740030748,\"end\":1678741830748}]}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "mct-recent-objects",
|
||||||
|
"value": "[{\"objectPath\":[{\"identifier\":{\"key\":\"8c863964-4640-4db1-8a98-0e546c3c271d\",\"namespace\":\"\"},\"name\":\"Overlay Plot with Telemetry Object\",\"type\":\"telemetry.plot.overlay\",\"composition\":[{\"key\":\"f5c7e86c-a5b4-4c6c-9038-9cf03cd9a99e\",\"namespace\":\"\"}],\"configuration\":{\"series\":[]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate Overlay Plot with Telemetry Object\\nchrome\",\"modified\":1678741860389,\"location\":\"mine\",\"created\":1678741839461,\"persisted\":1678741860389},{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"8c863964-4640-4db1-8a98-0e546c3c271d\",\"namespace\":\"\"},{\"key\":\"f5c7e86c-a5b4-4c6c-9038-9cf03cd9a99e\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1678741852556,\"created\":1678741830859,\"persisted\":1678741852557},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine/8c863964-4640-4db1-8a98-0e546c3c271d\",\"domainObject\":{\"identifier\":{\"key\":\"8c863964-4640-4db1-8a98-0e546c3c271d\",\"namespace\":\"\"},\"name\":\"Overlay Plot with Telemetry Object\",\"type\":\"telemetry.plot.overlay\",\"composition\":[{\"key\":\"f5c7e86c-a5b4-4c6c-9038-9cf03cd9a99e\",\"namespace\":\"\"}],\"configuration\":{\"series\":[]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate Overlay Plot with Telemetry Object\\nchrome\",\"modified\":1678741860389,\"location\":\"mine\",\"created\":1678741839461,\"persisted\":1678741860389}},{\"objectPath\":[{\"identifier\":{\"key\":\"f5c7e86c-a5b4-4c6c-9038-9cf03cd9a99e\",\"namespace\":\"\"},\"name\":\"VIPER Rover Heading\",\"type\":\"generator\",\"telemetry\":{\"period\":\"1\",\"amplitude\":\"1\",\"offset\":\"0\",\"dataRateInHz\":\"1\",\"phase\":\"0\",\"randomness\":\"0\",\"loadDelay\":\"0\",\"infinityValues\":false,\"staleness\":false},\"modified\":1678741852553,\"location\":\"mine\",\"created\":1678741852553,\"persisted\":1678741852553},{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"8c863964-4640-4db1-8a98-0e546c3c271d\",\"namespace\":\"\"},{\"key\":\"f5c7e86c-a5b4-4c6c-9038-9cf03cd9a99e\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1678741852556,\"created\":1678741830859,\"persisted\":1678741852557},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine/f5c7e86c-a5b4-4c6c-9038-9cf03cd9a99e\",\"domainObject\":{\"identifier\":{\"key\":\"f5c7e86c-a5b4-4c6c-9038-9cf03cd9a99e\",\"namespace\":\"\"},\"name\":\"VIPER Rover Heading\",\"type\":\"generator\",\"telemetry\":{\"period\":\"1\",\"amplitude\":\"1\",\"offset\":\"0\",\"dataRateInHz\":\"1\",\"phase\":\"0\",\"randomness\":\"0\",\"loadDelay\":\"0\",\"infinityValues\":false,\"staleness\":false},\"modified\":1678741852553,\"location\":\"mine\",\"created\":1678741852553,\"persisted\":1678741852553}},{\"objectPath\":[{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"8c863964-4640-4db1-8a98-0e546c3c271d\",\"namespace\":\"\"},{\"key\":\"f5c7e86c-a5b4-4c6c-9038-9cf03cd9a99e\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1678741852556,\"created\":1678741830859,\"persisted\":1678741852557},{\"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\":\"8c863964-4640-4db1-8a98-0e546c3c271d\",\"namespace\":\"\"},{\"key\":\"f5c7e86c-a5b4-4c6c-9038-9cf03cd9a99e\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1678741852556,\"created\":1678741830859,\"persisted\":1678741852557}}]"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
26
e2e/test-data/overlay_plot_with_delay_storage.json
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"cookies": [],
|
||||||
|
"origins": [
|
||||||
|
{
|
||||||
|
"origin": "http://localhost:8080",
|
||||||
|
"localStorage": [
|
||||||
|
{
|
||||||
|
"name": "mct",
|
||||||
|
"value": "{\"mine\":{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"db9fb115-7a72-4c45-81a4-1f6021156b4e\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1678741890986,\"created\":1678741885545,\"persisted\":1678741890987},\"db9fb115-7a72-4c45-81a4-1f6021156b4e\":{\"identifier\":{\"key\":\"db9fb115-7a72-4c45-81a4-1f6021156b4e\",\"namespace\":\"\"},\"name\":\"Overlay Plot with Telemetry Object\",\"type\":\"telemetry.plot.overlay\",\"composition\":[{\"key\":\"4c0b2c16-5f28-4906-abd3-befd16e5a77e\",\"namespace\":\"\"}],\"configuration\":{\"series\":[{\"identifier\":{\"key\":\"4c0b2c16-5f28-4906-abd3-befd16e5a77e\",\"namespace\":\"\"}}]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate Overlay Plot with 5s Delay\\nchrome\",\"modified\":1678741904378,\"location\":\"mine\",\"created\":1678741890983,\"persisted\":1678741904385},\"4c0b2c16-5f28-4906-abd3-befd16e5a77e\":{\"name\":\"Unnamed Sine Wave Generator\",\"type\":\"generator\",\"identifier\":{\"key\":\"4c0b2c16-5f28-4906-abd3-befd16e5a77e\",\"namespace\":\"\"},\"telemetry\":{\"period\":10,\"amplitude\":1,\"offset\":0,\"dataRateInHz\":1,\"phase\":0,\"randomness\":0,\"loadDelay\":\"5000\",\"infinityValues\":false,\"staleness\":false},\"modified\":1678741896800,\"location\":\"db9fb115-7a72-4c45-81a4-1f6021156b4e\",\"created\":1678741896800,\"persisted\":1678741896800}}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "mct-tree-expanded",
|
||||||
|
"value": "[]"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "tcHistory",
|
||||||
|
"value": "{\"utc\":[{\"start\":1678740085436,\"end\":1678741885436}]}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "mct-recent-objects",
|
||||||
|
"value": "[{\"objectPath\":[{\"identifier\":{\"key\":\"db9fb115-7a72-4c45-81a4-1f6021156b4e\",\"namespace\":\"\"},\"name\":\"Overlay Plot with Telemetry Object\",\"type\":\"telemetry.plot.overlay\",\"composition\":[{\"key\":\"4c0b2c16-5f28-4906-abd3-befd16e5a77e\",\"namespace\":\"\"}],\"configuration\":{\"series\":[]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate Overlay Plot with 5s Delay\\nchrome\",\"modified\":1678741896803,\"location\":\"mine\",\"created\":1678741890983,\"persisted\":1678741896803},{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"db9fb115-7a72-4c45-81a4-1f6021156b4e\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1678741890986,\"created\":1678741885545,\"persisted\":1678741890987},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine/db9fb115-7a72-4c45-81a4-1f6021156b4e\",\"domainObject\":{\"identifier\":{\"key\":\"db9fb115-7a72-4c45-81a4-1f6021156b4e\",\"namespace\":\"\"},\"name\":\"Overlay Plot with Telemetry Object\",\"type\":\"telemetry.plot.overlay\",\"composition\":[{\"key\":\"4c0b2c16-5f28-4906-abd3-befd16e5a77e\",\"namespace\":\"\"}],\"configuration\":{\"series\":[]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate Overlay Plot with 5s Delay\\nchrome\",\"modified\":1678741896803,\"location\":\"mine\",\"created\":1678741890983,\"persisted\":1678741896803}},{\"objectPath\":[{\"identifier\":{\"key\":\"4c0b2c16-5f28-4906-abd3-befd16e5a77e\",\"namespace\":\"\"},\"name\":\"Unnamed Sine Wave Generator\",\"type\":\"generator\",\"telemetry\":{\"period\":10,\"amplitude\":1,\"offset\":0,\"dataRateInHz\":1,\"phase\":0,\"randomness\":0,\"loadDelay\":\"5000\",\"infinityValues\":false,\"staleness\":false},\"modified\":1678741896800,\"location\":\"db9fb115-7a72-4c45-81a4-1f6021156b4e\",\"created\":1678741896800,\"persisted\":1678741896800},{\"identifier\":{\"key\":\"db9fb115-7a72-4c45-81a4-1f6021156b4e\",\"namespace\":\"\"},\"name\":\"Overlay Plot with Telemetry Object\",\"type\":\"telemetry.plot.overlay\",\"composition\":[{\"key\":\"4c0b2c16-5f28-4906-abd3-befd16e5a77e\",\"namespace\":\"\"}],\"configuration\":{\"series\":[]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate Overlay Plot with 5s Delay\\nchrome\",\"modified\":1678741896803,\"location\":\"mine\",\"created\":1678741890983,\"persisted\":1678741896803},{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"db9fb115-7a72-4c45-81a4-1f6021156b4e\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1678741890986,\"created\":1678741885545,\"persisted\":1678741890987},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine/db9fb115-7a72-4c45-81a4-1f6021156b4e/4c0b2c16-5f28-4906-abd3-befd16e5a77e\",\"domainObject\":{\"identifier\":{\"key\":\"4c0b2c16-5f28-4906-abd3-befd16e5a77e\",\"namespace\":\"\"},\"name\":\"Unnamed Sine Wave Generator\",\"type\":\"generator\",\"telemetry\":{\"period\":10,\"amplitude\":1,\"offset\":0,\"dataRateInHz\":1,\"phase\":0,\"randomness\":0,\"loadDelay\":\"5000\",\"infinityValues\":false,\"staleness\":false},\"modified\":1678741896800,\"location\":\"db9fb115-7a72-4c45-81a4-1f6021156b4e\",\"created\":1678741896800,\"persisted\":1678741896800}},{\"objectPath\":[{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"db9fb115-7a72-4c45-81a4-1f6021156b4e\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1678741890986,\"created\":1678741885545,\"persisted\":1678741890987},{\"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\":\"db9fb115-7a72-4c45-81a4-1f6021156b4e\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1678741890986,\"created\":1678741885545,\"persisted\":1678741890987}}]"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -4,17 +4,21 @@
|
|||||||
{
|
{
|
||||||
"origin": "http://localhost:8080",
|
"origin": "http://localhost:8080",
|
||||||
"localStorage": [
|
"localStorage": [
|
||||||
{
|
|
||||||
"name": "tcHistory",
|
|
||||||
"value": "{\"utc\":[{\"start\":1658617494563,\"end\":1658619294563},{\"start\":1658617090044,\"end\":1658618890044},{\"start\":1658616460484,\"end\":1658618260484},{\"start\":1658608882159,\"end\":1658610682159},{\"start\":1654537164464,\"end\":1654538964464},{\"start\":1652301954635,\"end\":1652303754635}]}"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "mct",
|
"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\":\"\"}],\"location\":\"ROOT\",\"persisted\":1658619295366,\"modified\":1658619295366},\"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}}"
|
"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\":\"\"}],\"location\":\"ROOT\",\"persisted\":1689710689554,\"modified\":1689710689554},\"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}}"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "mct-tree-expanded",
|
"name": "mct-tree-expanded",
|
||||||
"value": "[]"
|
"value": "[]"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "tcHistory",
|
||||||
|
"value": "{\"utc\":[{\"start\":1658617494563,\"end\":1658619294563},{\"start\":1658617090044,\"end\":1658618890044},{\"start\":1658616460484,\"end\":1658618260484},{\"start\":1658608882159,\"end\":1658610682159},{\"start\":1654537164464,\"end\":1654538964464},{\"start\":1652301954635,\"end\":1652303754635}]}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "mct-recent-objects",
|
||||||
|
"value": "[{\"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\":\"\"}],\"location\":\"ROOT\",\"persisted\":1689710689554,\"modified\":1689710689554},{\"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}},{\"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\":\"\"}],\"location\":\"ROOT\",\"persisted\":1689710689554,\"modified\":1689710689554},{\"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\":\"\"}],\"location\":\"ROOT\",\"persisted\":1689710689554,\"modified\":1689710689554}}]"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,11 +21,15 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
const { test, expect } = require('../../pluginFixtures.js');
|
const { test, expect } = require('../../pluginFixtures.js');
|
||||||
const { createDomainObjectWithDefaults, createNotification, expandEntireTree } = require('../../appActions.js');
|
const {
|
||||||
|
createDomainObjectWithDefaults,
|
||||||
|
createNotification,
|
||||||
|
expandEntireTree
|
||||||
|
} = require('../../appActions.js');
|
||||||
|
|
||||||
test.describe('AppActions', () => {
|
test.describe('AppActions', () => {
|
||||||
test('createDomainObjectsWithDefaults', async ({ page }) => {
|
test('createDomainObjectsWithDefaults', async ({ page }) => {
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
const e2eFolder = await createDomainObjectWithDefaults(page, {
|
const e2eFolder = await createDomainObjectWithDefaults(page, {
|
||||||
type: 'Folder',
|
type: 'Folder',
|
||||||
@@ -85,8 +89,8 @@ test.describe('AppActions', () => {
|
|||||||
expect(folder3.url).toBe(`${e2eFolder.url}/${folder1.uuid}/${folder2.uuid}/${folder3.uuid}`);
|
expect(folder3.url).toBe(`${e2eFolder.url}/${folder1.uuid}/${folder2.uuid}/${folder3.uuid}`);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
test("createNotification", async ({ page }) => {
|
test('createNotification', async ({ page }) => {
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
await createNotification(page, {
|
await createNotification(page, {
|
||||||
message: 'Test info notification',
|
message: 'Test info notification',
|
||||||
severity: 'info'
|
severity: 'info'
|
||||||
@@ -110,7 +114,7 @@ test.describe('AppActions', () => {
|
|||||||
await page.locator('[aria-label="Dismiss"]').click();
|
await page.locator('[aria-label="Dismiss"]').click();
|
||||||
});
|
});
|
||||||
test('expandEntireTree', async ({ page }) => {
|
test('expandEntireTree', async ({ page }) => {
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
const rootFolder = await createDomainObjectWithDefaults(page, {
|
const rootFolder = await createDomainObjectWithDefaults(page, {
|
||||||
type: 'Folder'
|
type: 'Folder'
|
||||||
@@ -144,7 +148,7 @@ test.describe('AppActions', () => {
|
|||||||
await page.goto('./#/browse/mine');
|
await page.goto('./#/browse/mine');
|
||||||
await expandEntireTree(page);
|
await expandEntireTree(page);
|
||||||
const treePane = page.getByRole('tree', {
|
const treePane = page.getByRole('tree', {
|
||||||
name: "Main Tree"
|
name: 'Main Tree'
|
||||||
});
|
});
|
||||||
const treePaneCollapsedItems = treePane.getByRole('treeitem', { expanded: false });
|
const treePaneCollapsedItems = treePane.getByRole('treeitem', { expanded: false });
|
||||||
expect(await treePaneCollapsedItems.count()).toBe(0);
|
expect(await treePaneCollapsedItems.count()).toBe(0);
|
||||||
@@ -155,9 +159,9 @@ test.describe('AppActions', () => {
|
|||||||
|
|
||||||
// Click the object specified by 'type'
|
// Click the object specified by 'type'
|
||||||
await page.click(`li[role='menuitem']:text("Clock")`);
|
await page.click(`li[role='menuitem']:text("Clock")`);
|
||||||
await expandEntireTree(page, "Create Modal Tree");
|
await expandEntireTree(page, 'Create Modal Tree');
|
||||||
const locatorTree = page.getByRole("tree", {
|
const locatorTree = page.getByRole('tree', {
|
||||||
name: "Create Modal Tree"
|
name: 'Create Modal Tree'
|
||||||
});
|
});
|
||||||
const locatorTreeCollapsedItems = locatorTree.locator('role=treeitem[expanded=false]');
|
const locatorTreeCollapsedItems = locatorTree.locator('role=treeitem[expanded=false]');
|
||||||
expect(await locatorTreeCollapsedItems.count()).toBe(0);
|
expect(await locatorTreeCollapsedItems.count()).toBe(0);
|
||||||
|
|||||||
@@ -29,27 +29,26 @@ relates to how we've extended it (i.e. ./e2e/baseFixtures.js) and assumptions ma
|
|||||||
const { test } = require('../../baseFixtures.js');
|
const { test } = require('../../baseFixtures.js');
|
||||||
|
|
||||||
test.describe('baseFixtures tests', () => {
|
test.describe('baseFixtures tests', () => {
|
||||||
test('Verify that tests fail if console.error is thrown', async ({ page }) => {
|
//Skip this test for now https://github.com/nasa/openmct/issues/6785
|
||||||
|
test.fixme('Verify that tests fail if console.error is thrown', async ({ page }) => {
|
||||||
test.fail();
|
test.fail();
|
||||||
//Go to baseURL
|
//Go to baseURL
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
//Verify that ../fixtures.js detects console log errors
|
//Verify that ../fixtures.js detects console log errors
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
page.evaluate(() => console.error('This should result in a failure')),
|
page.evaluate(() => console.error('This should result in a failure')),
|
||||||
page.waitForEvent('console') // always wait for the event to happen while triggering it!
|
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 }) => {
|
test('Verify that tests pass if console.warn is thrown', async ({ page }) => {
|
||||||
//Go to baseURL
|
//Go to baseURL
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
//Verify that ../fixtures.js detects console log errors
|
//Verify that ../fixtures.js detects console log errors
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
page.evaluate(() => console.warn('This should result in a pass')),
|
page.evaluate(() => console.warn('This should result in a pass')),
|
||||||
page.waitForEvent('console') // always wait for the event to happen while triggering it!
|
page.waitForEvent('console') // always wait for the event to happen while triggering it!
|
||||||
]);
|
]);
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ test.describe('Renaming Timer Object', () => {
|
|||||||
let timer;
|
let timer;
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
// Open a browser, navigate to the main page, and wait until all network events to resolve
|
// Open a browser, navigate to the main page, and wait until all network events to resolve
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
// We provide some helper functions in appActions like `createDomainObjectWithDefaults()`.
|
// We provide some helper functions in appActions like `createDomainObjectWithDefaults()`.
|
||||||
// This example will create a Timer object with default properties, under the root folder:
|
// This example will create a Timer object with default properties, under the root folder:
|
||||||
@@ -79,7 +79,7 @@ test.describe('Renaming Timer Object', () => {
|
|||||||
* some hint as to what went wrong if the test fails.
|
* some hint as to what went wrong if the test fails.
|
||||||
*/
|
*/
|
||||||
test('An existing Timer object can be renamed via the 3dot actions menu', async ({ page }) => {
|
test('An existing Timer object can be renamed via the 3dot actions menu', async ({ page }) => {
|
||||||
const newObjectName = "Renamed Timer";
|
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 pases the page and newObjectName values
|
||||||
await renameTimerFrom3DotMenu(page, timer.url, newObjectName);
|
await renameTimerFrom3DotMenu(page, timer.url, newObjectName);
|
||||||
@@ -89,8 +89,8 @@ test.describe('Renaming Timer Object', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('An existing Timer object can be renamed twice', async ({ page }) => {
|
test('An existing Timer object can be renamed twice', async ({ page }) => {
|
||||||
const newObjectName = "Renamed Timer";
|
const newObjectName = 'Renamed Timer';
|
||||||
const newObjectName2 = "Re-Renamed Timer";
|
const newObjectName2 = 'Re-Renamed Timer';
|
||||||
|
|
||||||
await renameTimerFrom3DotMenu(page, timer.url, newObjectName);
|
await renameTimerFrom3DotMenu(page, timer.url, newObjectName);
|
||||||
|
|
||||||
@@ -117,6 +117,35 @@ 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', () => {
|
||||||
|
let displayLayout;
|
||||||
|
test.beforeEach(async ({ page }) => {
|
||||||
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
|
// Create a Display Layout with a meaningful name
|
||||||
|
displayLayout = await createDomainObjectWithDefaults(page, {
|
||||||
|
type: 'Display Layout',
|
||||||
|
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
|
||||||
|
});
|
||||||
|
});
|
||||||
|
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();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Structure:
|
* Structure:
|
||||||
* Custom functions should be declared last.
|
* Custom functions should be declared last.
|
||||||
|
|||||||
260
e2e/tests/framework/generateLocalStorageData.e2e.spec.js
Normal file
@@ -0,0 +1,260 @@
|
|||||||
|
/*****************************************************************************
|
||||||
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
|
* Administration. All rights reserved.
|
||||||
|
*
|
||||||
|
* Open MCT is licensed under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
* License for the specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*
|
||||||
|
* Open MCT includes source code licensed under additional open source
|
||||||
|
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||||
|
* this source code distribution or the Licensing information page available
|
||||||
|
* at runtime from the About dialog for additional information.
|
||||||
|
*****************************************************************************/
|
||||||
|
/* global __dirname */
|
||||||
|
/**
|
||||||
|
* This test suite is dedicated to generating LocalStorage via Session Storage to be used
|
||||||
|
* in some visual test suites like controlledClock.visual.spec.js. This suite should run to completion
|
||||||
|
* and generate an artifact in ./e2e/test-data/<name>_storage.json . This will run
|
||||||
|
* on every commit to ensure that this object still loads into tests correctly and will retain the
|
||||||
|
* *.e2e.spec.js suffix.
|
||||||
|
*
|
||||||
|
* TODO: Provide additional validation of object properties as it grows.
|
||||||
|
* Verification of object properties happens in this file before the test-data is generated,
|
||||||
|
* and is additionally verified in the validation test suites below.
|
||||||
|
*/
|
||||||
|
|
||||||
|
const { test, expect } = require('../../pluginFixtures.js');
|
||||||
|
const {
|
||||||
|
createDomainObjectWithDefaults,
|
||||||
|
createExampleTelemetryObject,
|
||||||
|
selectInspectorTab
|
||||||
|
} = require('../../appActions.js');
|
||||||
|
const { MISSION_TIME } = require('../../constants.js');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
const overlayPlotName = 'Overlay Plot with Telemetry Object';
|
||||||
|
|
||||||
|
test.describe('Generate Visual Test Data @localStorage @generatedata', () => {
|
||||||
|
test.use({
|
||||||
|
clockOptions: {
|
||||||
|
now: MISSION_TIME,
|
||||||
|
shouldAdvanceTime: true
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
test.beforeEach(async ({ page }) => {
|
||||||
|
// Go to baseURL
|
||||||
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
});
|
||||||
|
|
||||||
|
// TODO: Visual test for the generated object here
|
||||||
|
// - Move to using appActions to create the overlay plot
|
||||||
|
// and embedded standard telemetry object
|
||||||
|
test('Generate Overlay Plot with Telemetry Object', async ({ page, context }) => {
|
||||||
|
// Create Overlay Plot
|
||||||
|
const overlayPlot = await createDomainObjectWithDefaults(page, {
|
||||||
|
type: 'Overlay Plot',
|
||||||
|
name: overlayPlotName
|
||||||
|
});
|
||||||
|
|
||||||
|
// Create Telemetry Object
|
||||||
|
const exampleTelemetry = await createExampleTelemetryObject(page);
|
||||||
|
|
||||||
|
// Make Link from Telemetry Object to Overlay Plot
|
||||||
|
await page.locator('button[title="More options"]').click();
|
||||||
|
|
||||||
|
// Select 'Create Link' from dropdown
|
||||||
|
await page.getByRole('menuitem', { name: ' Create Link' }).click();
|
||||||
|
|
||||||
|
// Search and Select for overlay Plot within Create Modal
|
||||||
|
await page.getByRole('dialog').getByRole('searchbox', { name: 'Search Input' }).click();
|
||||||
|
await page
|
||||||
|
.getByRole('dialog')
|
||||||
|
.getByRole('searchbox', { name: 'Search Input' })
|
||||||
|
.fill(overlayPlot.name);
|
||||||
|
await page
|
||||||
|
.getByRole('treeitem', { name: new RegExp(overlayPlot.name) })
|
||||||
|
.locator('a')
|
||||||
|
.click();
|
||||||
|
await page.getByRole('button', { name: 'Save' }).click();
|
||||||
|
|
||||||
|
await page.goto(overlayPlot.url);
|
||||||
|
|
||||||
|
// TODO: Flesh Out Assertions against created Objects
|
||||||
|
await expect(page.locator('.l-browse-bar__object-name')).toContainText(overlayPlotName);
|
||||||
|
await selectInspectorTab(page, 'Config');
|
||||||
|
await page
|
||||||
|
.getByRole('list', { name: 'Plot Series Properties' })
|
||||||
|
.locator('span')
|
||||||
|
.first()
|
||||||
|
.click();
|
||||||
|
|
||||||
|
// TODO: Modify the Overlay Plot to use fixed Scaling
|
||||||
|
// TODO: Verify Autoscaling.
|
||||||
|
|
||||||
|
// TODO: Fix accessibility of Plot Series Properties tables
|
||||||
|
// Assert that the Plot Series properties have the correct values
|
||||||
|
await expect(
|
||||||
|
page.locator('[role=cell]:has-text("Value")~[role=cell]:has-text("sin")')
|
||||||
|
).toBeVisible();
|
||||||
|
await expect(
|
||||||
|
page.locator(
|
||||||
|
'[role=cell]:has-text("Line Method")~[role=cell]:has-text("Linear interpolation")'
|
||||||
|
)
|
||||||
|
).toBeVisible();
|
||||||
|
await expect(
|
||||||
|
page.locator('[role=cell]:has-text("Markers")~[role=cell]:has-text("Point: 2px")')
|
||||||
|
).toBeVisible();
|
||||||
|
await expect(
|
||||||
|
page.locator('[role=cell]:has-text("Alarm Markers")~[role=cell]:has-text("Enabled")')
|
||||||
|
).toBeVisible();
|
||||||
|
await expect(
|
||||||
|
page.locator('[role=cell]:has-text("Limit Lines")~[role=cell]:has-text("Disabled")')
|
||||||
|
).toBeVisible();
|
||||||
|
|
||||||
|
await page.goto(exampleTelemetry.url);
|
||||||
|
await selectInspectorTab(page, 'Properties');
|
||||||
|
|
||||||
|
// TODO: assert Example Telemetry property values
|
||||||
|
// await page.goto(exampleTelemetry.url);
|
||||||
|
|
||||||
|
// Save localStorage for future test execution
|
||||||
|
await context.storageState({
|
||||||
|
path: path.join(__dirname, '../../../e2e/test-data/overlay_plot_storage.json')
|
||||||
|
});
|
||||||
|
});
|
||||||
|
// TODO: Merge this with previous test. Edit object created in previous test.
|
||||||
|
test('Generate Overlay Plot with 5s Delay', async ({ page, context }) => {
|
||||||
|
// add overlay plot with defaults
|
||||||
|
const overlayPlot = await createDomainObjectWithDefaults(page, {
|
||||||
|
type: 'Overlay Plot',
|
||||||
|
name: 'Overlay Plot with 5s Delay'
|
||||||
|
});
|
||||||
|
|
||||||
|
const swgWith5sDelay = await createExampleTelemetryObject(page, overlayPlot.uuid);
|
||||||
|
|
||||||
|
await page.goto(swgWith5sDelay.url);
|
||||||
|
await page.getByTitle('More options').click();
|
||||||
|
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 Promise.all([
|
||||||
|
page.waitForNavigation(),
|
||||||
|
page.locator('text=OK').click(),
|
||||||
|
//Wait for Save Banner to appear
|
||||||
|
page.waitForSelector('.c-message-banner__message')
|
||||||
|
]);
|
||||||
|
|
||||||
|
// focus the overlay plot
|
||||||
|
await page.goto(overlayPlot.url);
|
||||||
|
|
||||||
|
await expect(page.locator('.l-browse-bar__object-name')).toContainText(overlayPlot.name);
|
||||||
|
|
||||||
|
// Clear Recently Viewed
|
||||||
|
await page.getByRole('button', { name: 'Clear Recently Viewed' }).click();
|
||||||
|
await page.getByRole('button', { name: 'OK' }).click();
|
||||||
|
//Save localStorage for future test execution
|
||||||
|
await context.storageState({
|
||||||
|
path: path.join(__dirname, '../../../e2e/test-data/overlay_plot_with_delay_storage.json')
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test.describe('Validate Overlay Plot with Telemetry Object @localStorage @generatedata', () => {
|
||||||
|
test.use({
|
||||||
|
storageState: path.join(__dirname, '../../../e2e/test-data/overlay_plot_storage.json')
|
||||||
|
});
|
||||||
|
test('Validate Overlay Plot with Telemetry Object', async ({ page }) => {
|
||||||
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
|
await page.locator('a').filter({ hasText: overlayPlotName }).click();
|
||||||
|
// TODO: Flesh Out Assertions against created Objects
|
||||||
|
await expect(page.locator('.l-browse-bar__object-name')).toContainText(overlayPlotName);
|
||||||
|
await selectInspectorTab(page, 'Config');
|
||||||
|
await page
|
||||||
|
.getByRole('list', { name: 'Plot Series Properties' })
|
||||||
|
.locator('span')
|
||||||
|
.first()
|
||||||
|
.click();
|
||||||
|
|
||||||
|
// TODO: Modify the Overlay Plot to use fixed Scaling
|
||||||
|
// TODO: Verify Autoscaling.
|
||||||
|
|
||||||
|
// TODO: Fix accessibility of Plot Series Properties tables
|
||||||
|
// Assert that the Plot Series properties have the correct values
|
||||||
|
await expect(
|
||||||
|
page.locator('[role=cell]:has-text("Value")~[role=cell]:has-text("sin")')
|
||||||
|
).toBeVisible();
|
||||||
|
await expect(
|
||||||
|
page.locator(
|
||||||
|
'[role=cell]:has-text("Line Method")~[role=cell]:has-text("Linear interpolation")'
|
||||||
|
)
|
||||||
|
).toBeVisible();
|
||||||
|
await expect(
|
||||||
|
page.locator('[role=cell]:has-text("Markers")~[role=cell]:has-text("Point: 2px")')
|
||||||
|
).toBeVisible();
|
||||||
|
await expect(
|
||||||
|
page.locator('[role=cell]:has-text("Alarm Markers")~[role=cell]:has-text("Enabled")')
|
||||||
|
).toBeVisible();
|
||||||
|
await expect(
|
||||||
|
page.locator('[role=cell]:has-text("Limit Lines")~[role=cell]:has-text("Disabled")')
|
||||||
|
).toBeVisible();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test.describe('Validate Overlay Plot with 5s Delay Telemetry Object @localStorage @generatedata', () => {
|
||||||
|
test.use({
|
||||||
|
storageState: path.join(
|
||||||
|
__dirname,
|
||||||
|
'../../../e2e/test-data/overlay_plot_with_delay_storage.json'
|
||||||
|
)
|
||||||
|
});
|
||||||
|
test('Validate Overlay Plot with Telemetry Object', async ({ page }) => {
|
||||||
|
const plotName = 'Overlay Plot with 5s Delay';
|
||||||
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
|
await page.locator('a').filter({ hasText: plotName }).click();
|
||||||
|
// TODO: Flesh Out Assertions against created Objects
|
||||||
|
await expect(page.locator('.l-browse-bar__object-name')).toContainText(plotName);
|
||||||
|
await selectInspectorTab(page, 'Config');
|
||||||
|
await page
|
||||||
|
.getByRole('list', { name: 'Plot Series Properties' })
|
||||||
|
.locator('span')
|
||||||
|
.first()
|
||||||
|
.click();
|
||||||
|
|
||||||
|
// TODO: Modify the Overlay Plot to use fixed Scaling
|
||||||
|
// TODO: Verify Autoscaling.
|
||||||
|
|
||||||
|
// TODO: Fix accessibility of Plot Series Properties tables
|
||||||
|
// Assert that the Plot Series properties have the correct values
|
||||||
|
await expect(
|
||||||
|
page.locator('[role=cell]:has-text("Value")~[role=cell]:has-text("sin")')
|
||||||
|
).toBeVisible();
|
||||||
|
await expect(
|
||||||
|
page.locator(
|
||||||
|
'[role=cell]:has-text("Line Method")~[role=cell]:has-text("Linear interpolation")'
|
||||||
|
)
|
||||||
|
).toBeVisible();
|
||||||
|
await expect(
|
||||||
|
page.locator('[role=cell]:has-text("Markers")~[role=cell]:has-text("Point: 2px")')
|
||||||
|
).toBeVisible();
|
||||||
|
await expect(
|
||||||
|
page.locator('[role=cell]:has-text("Alarm Markers")~[role=cell]:has-text("Enabled")')
|
||||||
|
).toBeVisible();
|
||||||
|
await expect(
|
||||||
|
page.locator('[role=cell]:has-text("Limit Lines")~[role=cell]:has-text("Disabled")')
|
||||||
|
).toBeVisible();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
/*****************************************************************************
|
|
||||||
* 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.
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
/*
|
|
||||||
This test suite is dedicated to generating LocalStorage via Session Storage to be used
|
|
||||||
in some visual test suites like controlledClock.visual.spec.js. This suite should run to completion
|
|
||||||
and generate an artifact named ./e2e/test-data/VisualTestData_storage.json . This will run
|
|
||||||
on every Commit to ensure that this object still loads into tests correctly and will retain the
|
|
||||||
.e2e.spec.js suffix.
|
|
||||||
|
|
||||||
TODO: Provide additional validation of object properties as it grows.
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
const { createDomainObjectWithDefaults } = require('../../appActions.js');
|
|
||||||
const { test, expect } = require('../../pluginFixtures.js');
|
|
||||||
|
|
||||||
test('Generate Visual Test Data @localStorage', async ({ page, context }) => {
|
|
||||||
//Go to baseURL
|
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
|
||||||
const overlayPlot = await createDomainObjectWithDefaults(page, { type: 'Overlay Plot' });
|
|
||||||
|
|
||||||
// click create button
|
|
||||||
await page.locator('button:has-text("Create")').click();
|
|
||||||
|
|
||||||
// add sine wave generator with defaults
|
|
||||||
await page.locator('li[role="menuitem"]:has-text("Sine Wave Generator")').click();
|
|
||||||
|
|
||||||
//Add a 5000 ms Delay
|
|
||||||
await page.locator('[aria-label="Loading Delay \\(ms\\)"]').fill('5000');
|
|
||||||
|
|
||||||
await Promise.all([
|
|
||||||
page.waitForNavigation(),
|
|
||||||
page.locator('button:has-text("OK")').click(),
|
|
||||||
//Wait for Save Banner to appear
|
|
||||||
page.waitForSelector('.c-message-banner__message')
|
|
||||||
]);
|
|
||||||
|
|
||||||
// focus the overlay plot
|
|
||||||
await page.goto(overlayPlot.url);
|
|
||||||
|
|
||||||
await expect(page.locator('.l-browse-bar__object-name')).toContainText(overlayPlot.name);
|
|
||||||
//Save localStorage for future test execution
|
|
||||||
await context.storageState({ path: './e2e/test-data/VisualTestData_storage.json' });
|
|
||||||
});
|
|
||||||
@@ -31,14 +31,12 @@ const { test } = require('../../pluginFixtures.js');
|
|||||||
test.describe.skip('pluginFixtures tests', () => {
|
test.describe.skip('pluginFixtures tests', () => {
|
||||||
// test.use({ domainObjectName: 'Timer' });
|
// test.use({ domainObjectName: 'Timer' });
|
||||||
// let timerUUID;
|
// let timerUUID;
|
||||||
|
|
||||||
// test('Creates a timer object @framework @unstable', ({ domainObject }) => {
|
// test('Creates a timer object @framework @unstable', ({ domainObject }) => {
|
||||||
// const { uuid } = 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}/;
|
// 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);
|
// expect(uuid).toMatch(uuidRegexp);
|
||||||
// timerUUID = uuid;
|
// timerUUID = uuid;
|
||||||
// });
|
// });
|
||||||
|
|
||||||
// test('Provides same uuid for subsequent uses of the same object @framework', ({ domainObject }) => {
|
// test('Provides same uuid for subsequent uses of the same object @framework', ({ domainObject }) => {
|
||||||
// const { uuid } = domainObject;
|
// const { uuid } = domainObject;
|
||||||
// expect(uuid).toEqual(timerUUID);
|
// expect(uuid).toEqual(timerUUID);
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ const { test, expect } = require('../../baseFixtures.js');
|
|||||||
test.describe('Branding tests', () => {
|
test.describe('Branding tests', () => {
|
||||||
test('About Modal launches with basic branding properties', async ({ page }) => {
|
test('About Modal launches with basic branding properties', async ({ page }) => {
|
||||||
// Go to baseURL
|
// Go to baseURL
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
// Click About button
|
// Click About button
|
||||||
await page.click('.l-shell__app-logo');
|
await page.click('.l-shell__app-logo');
|
||||||
@@ -41,13 +41,15 @@ test.describe('Branding tests', () => {
|
|||||||
const versionInformationLocator = page.locator('ul.t-info.l-info.s-info').first();
|
const versionInformationLocator = page.locator('ul.t-info.l-info.s-info').first();
|
||||||
await expect(versionInformationLocator).toBeEnabled();
|
await expect(versionInformationLocator).toBeEnabled();
|
||||||
await expect.soft(versionInformationLocator).toContainText(/Version: \d/);
|
await expect.soft(versionInformationLocator).toContainText(/Version: \d/);
|
||||||
await expect.soft(versionInformationLocator).toContainText(/Build Date: ((?:Mon|Tue|Wed|Thu|Fri|Sat|Sun))/);
|
await expect
|
||||||
|
.soft(versionInformationLocator)
|
||||||
|
.toContainText(/Build Date: ((?:Mon|Tue|Wed|Thu|Fri|Sat|Sun))/);
|
||||||
await expect.soft(versionInformationLocator).toContainText(/Revision: \b[0-9a-f]{5,40}\b/);
|
await expect.soft(versionInformationLocator).toContainText(/Revision: \b[0-9a-f]{5,40}\b/);
|
||||||
await expect.soft(versionInformationLocator).toContainText(/Branch: ./);
|
await expect.soft(versionInformationLocator).toContainText(/Branch: ./);
|
||||||
});
|
});
|
||||||
test('Verify Links in About Modal @2p', async ({ page }) => {
|
test('Verify Links in About Modal @2p', async ({ page }) => {
|
||||||
// Go to baseURL
|
// Go to baseURL
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
// Click About button
|
// Click About button
|
||||||
await page.click('.l-shell__app-logo');
|
await page.click('.l-shell__app-logo');
|
||||||
|
|||||||
@@ -27,11 +27,11 @@
|
|||||||
|
|
||||||
const { test, expect } = require('../../pluginFixtures');
|
const { test, expect } = require('../../pluginFixtures');
|
||||||
|
|
||||||
test.describe("CouchDB Status Indicator with mocked responses @couchdb", () => {
|
test.describe('CouchDB Status Indicator with mocked responses @couchdb', () => {
|
||||||
test.use({ failOnConsoleError: false });
|
test.use({ failOnConsoleError: false });
|
||||||
//TODO BeforeAll Verify CouchDB Connectivity with APIContext
|
//TODO BeforeAll Verify CouchDB Connectivity with APIContext
|
||||||
test('Shows green if connected', async ({ page }) => {
|
test('Shows green if connected', async ({ page }) => {
|
||||||
await page.route('**/openmct/mine', route => {
|
await page.route('**/openmct/mine', (route) => {
|
||||||
route.fulfill({
|
route.fulfill({
|
||||||
status: 200,
|
status: 200,
|
||||||
contentType: 'application/json',
|
contentType: 'application/json',
|
||||||
@@ -40,11 +40,13 @@ test.describe("CouchDB Status Indicator with mocked responses @couchdb", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
//Go to baseURL
|
//Go to baseURL
|
||||||
await page.goto('./#/browse/mine?hideTree=true&hideInspector=true', { waitUntil: 'networkidle' });
|
await page.goto('./#/browse/mine?hideTree=true&hideInspector=true', {
|
||||||
|
waitUntil: 'networkidle'
|
||||||
|
});
|
||||||
await expect(page.locator('div:has-text("CouchDB is connected")').nth(3)).toBeVisible();
|
await expect(page.locator('div:has-text("CouchDB is connected")').nth(3)).toBeVisible();
|
||||||
});
|
});
|
||||||
test('Shows red if not connected', async ({ page }) => {
|
test('Shows red if not connected', async ({ page }) => {
|
||||||
await page.route('**/openmct/**', route => {
|
await page.route('**/openmct/**', (route) => {
|
||||||
route.fulfill({
|
route.fulfill({
|
||||||
status: 503,
|
status: 503,
|
||||||
contentType: 'application/json',
|
contentType: 'application/json',
|
||||||
@@ -53,11 +55,13 @@ test.describe("CouchDB Status Indicator with mocked responses @couchdb", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
//Go to baseURL
|
//Go to baseURL
|
||||||
await page.goto('./#/browse/mine?hideTree=true&hideInspector=true', { waitUntil: 'networkidle' });
|
await page.goto('./#/browse/mine?hideTree=true&hideInspector=true', {
|
||||||
|
waitUntil: 'networkidle'
|
||||||
|
});
|
||||||
await expect(page.locator('div:has-text("CouchDB is offline")').nth(3)).toBeVisible();
|
await expect(page.locator('div:has-text("CouchDB is offline")').nth(3)).toBeVisible();
|
||||||
});
|
});
|
||||||
test('Shows unknown if it receives an unexpected response code', async ({ page }) => {
|
test('Shows unknown if it receives an unexpected response code', async ({ page }) => {
|
||||||
await page.route('**/openmct/mine', route => {
|
await page.route('**/openmct/mine', (route) => {
|
||||||
route.fulfill({
|
route.fulfill({
|
||||||
status: 418,
|
status: 418,
|
||||||
contentType: 'application/json',
|
contentType: 'application/json',
|
||||||
@@ -66,15 +70,17 @@ test.describe("CouchDB Status Indicator with mocked responses @couchdb", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
//Go to baseURL
|
//Go to baseURL
|
||||||
await page.goto('./#/browse/mine?hideTree=true&hideInspector=true', { waitUntil: 'networkidle' });
|
await page.goto('./#/browse/mine?hideTree=true&hideInspector=true', {
|
||||||
|
waitUntil: 'networkidle'
|
||||||
|
});
|
||||||
await expect(page.locator('div:has-text("CouchDB connectivity unknown")').nth(3)).toBeVisible();
|
await expect(page.locator('div:has-text("CouchDB connectivity unknown")').nth(3)).toBeVisible();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test.describe("CouchDB initialization with mocked responses @couchdb", () => {
|
test.describe('CouchDB initialization with mocked responses @couchdb', () => {
|
||||||
test.use({ failOnConsoleError: false });
|
test.use({ failOnConsoleError: false });
|
||||||
test("'My Items' folder is created if it doesn't exist", async ({ page }) => {
|
test("'My Items' folder is created if it doesn't exist", async ({ page }) => {
|
||||||
const mockedMissingObjectResponsefromCouchDB = {
|
const mockedMissingObjectResponseFromCouchDB = {
|
||||||
status: 404,
|
status: 404,
|
||||||
contentType: 'application/json',
|
contentType: 'application/json',
|
||||||
body: JSON.stringify({})
|
body: JSON.stringify({})
|
||||||
@@ -83,29 +89,30 @@ test.describe("CouchDB initialization with mocked responses @couchdb", () => {
|
|||||||
// Override the first request to GET openmct/mine to return a 404.
|
// Override the first request to GET openmct/mine to return a 404.
|
||||||
// This simulates the case of starting Open MCT with a fresh database
|
// This simulates the case of starting Open MCT with a fresh database
|
||||||
// and no "My Items" folder created yet.
|
// and no "My Items" folder created yet.
|
||||||
await page.route('**/mine', route => {
|
await page.route(
|
||||||
route.fulfill(mockedMissingObjectResponsefromCouchDB);
|
'**/mine',
|
||||||
}, { times: 1 });
|
(route) => {
|
||||||
|
route.fulfill(mockedMissingObjectResponseFromCouchDB);
|
||||||
|
},
|
||||||
|
{ times: 1 }
|
||||||
|
);
|
||||||
|
|
||||||
// Set up promise to verify that a PUT request to create "My Items"
|
// Set up promise to verify that a PUT request to create "My Items"
|
||||||
// folder was made.
|
// folder was made.
|
||||||
const putMineFolderRequest = page.waitForRequest(req =>
|
const putMineFolderRequest = page.waitForRequest(
|
||||||
req.url().endsWith('/mine')
|
(req) => req.url().endsWith('/mine') && req.method() === 'PUT'
|
||||||
&& req.method() === 'PUT');
|
);
|
||||||
|
|
||||||
// Set up promise to verify that a GET request to retrieve "My Items"
|
// Set up promise to verify that a GET request to retrieve "My Items"
|
||||||
// folder was made.
|
// folder was made.
|
||||||
const getMineFolderRequest = page.waitForRequest(req =>
|
const getMineFolderRequest = page.waitForRequest(
|
||||||
req.url().endsWith('/mine')
|
(req) => req.url().endsWith('/mine') && req.method() === 'GET'
|
||||||
&& req.method() === 'GET');
|
);
|
||||||
|
|
||||||
// Go to baseURL.
|
// Go to baseURL.
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
// Wait for both requests to resolve.
|
// Wait for both requests to resolve.
|
||||||
await Promise.all([
|
await Promise.all([putMineFolderRequest, getMineFolderRequest]);
|
||||||
putMineFolderRequest,
|
|
||||||
getMineFolderRequest
|
|
||||||
]);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ const { createDomainObjectWithDefaults } = require('../../../appActions');
|
|||||||
test.describe('Example Event Generator CRUD Operations', () => {
|
test.describe('Example Event Generator CRUD Operations', () => {
|
||||||
test('Can create a Test Event Generator and it results in the table View', async ({ page }) => {
|
test('Can create a Test Event Generator and it results in the table View', async ({ page }) => {
|
||||||
//Go to baseURL
|
//Go to baseURL
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
//Create a name for the object
|
//Create a name for the object
|
||||||
const newObjectName = 'Test Event Generator';
|
const newObjectName = 'Test Event Generator';
|
||||||
@@ -46,8 +46,7 @@ test.describe('Example Event Generator CRUD Operations', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test.describe('Example Event Generator Telemetry Event Verficiation', () => {
|
test.describe('Example Event Generator Telemetry Event Verification', () => {
|
||||||
|
|
||||||
test.fixme('telemetry is coming in for test event', async ({ page }) => {
|
test.fixme('telemetry is coming in for test event', async ({ page }) => {
|
||||||
// Go to object created in step one
|
// Go to object created in step one
|
||||||
// Verify the telemetry table is filled with > 1 row
|
// Verify the telemetry table is filled with > 1 row
|
||||||
|
|||||||
@@ -27,12 +27,15 @@ This test suite is dedicated to tests which verify the basic operations surround
|
|||||||
const { test, expect } = require('../../../../baseFixtures');
|
const { test, expect } = require('../../../../baseFixtures');
|
||||||
|
|
||||||
test.describe('Sine Wave Generator', () => {
|
test.describe('Sine Wave Generator', () => {
|
||||||
test('Create new Sine Wave Generator Object and validate create Form Logic', async ({ page, browserName }) => {
|
test('Create new Sine Wave Generator Object and validate create Form Logic', async ({
|
||||||
|
page,
|
||||||
|
browserName
|
||||||
|
}) => {
|
||||||
// eslint-disable-next-line playwright/no-skipped-test
|
// eslint-disable-next-line playwright/no-skipped-test
|
||||||
test.skip(browserName === 'firefox', 'This test needs to be updated to work with firefox');
|
test.skip(browserName === 'firefox', 'This test needs to be updated to work with firefox');
|
||||||
|
|
||||||
//Go to baseURL
|
//Go to baseURL
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
//Click the Create button
|
//Click the Create button
|
||||||
await page.click('button:has-text("Create")');
|
await page.click('button:has-text("Create")');
|
||||||
@@ -45,7 +48,9 @@ test.describe('Sine Wave Generator', () => {
|
|||||||
await expect(page.locator('.c-form-row__state-indicator').first()).toHaveClass(/req/);
|
await expect(page.locator('.c-form-row__state-indicator').first()).toHaveClass(/req/);
|
||||||
|
|
||||||
// Verify that the Notes row does not have a required indicator
|
// Verify that the Notes row does not have a required indicator
|
||||||
await expect(page.locator('.c-form__section div:nth-child(3) .form-row .c-form-row__state-indicator')).not.toContain('.req');
|
await expect(
|
||||||
|
page.locator('.c-form__section div:nth-child(3) .form-row .c-form-row__state-indicator')
|
||||||
|
).not.toContain('.req');
|
||||||
await page.locator('textarea[type="text"]').fill('Optional Note Text');
|
await page.locator('textarea[type="text"]').fill('Optional Note Text');
|
||||||
|
|
||||||
// Period
|
// Period
|
||||||
@@ -67,20 +72,32 @@ test.describe('Sine Wave Generator', () => {
|
|||||||
await expect(page.locator('div:nth-child(9) .c-form-row__state-indicator')).toHaveClass(/req/);
|
await expect(page.locator('div:nth-child(9) .c-form-row__state-indicator')).toHaveClass(/req/);
|
||||||
|
|
||||||
// Verify that by removing value from required text field shows invalid indicator
|
// Verify that by removing value from required text field shows invalid indicator
|
||||||
await page.locator('text=Properties Title Notes Period Amplitude Offset Data Rate (hz) Phase (radians) Ra >> input[type="text"]').fill('');
|
await page
|
||||||
|
.locator(
|
||||||
|
'text=Properties Title Notes Period Amplitude Offset Data Rate (hz) Phase (radians) Ra >> input[type="text"]'
|
||||||
|
)
|
||||||
|
.fill('');
|
||||||
await expect(page.locator('.c-form-row__state-indicator').first()).toHaveClass(/invalid/);
|
await expect(page.locator('.c-form-row__state-indicator').first()).toHaveClass(/invalid/);
|
||||||
|
|
||||||
// Verify that by adding value to empty required text field changes invalid to valid indicator
|
// Verify that by adding value to empty required text field changes invalid to valid indicator
|
||||||
await page.locator('text=Properties Title Notes Period Amplitude Offset Data Rate (hz) Phase (radians) Ra >> input[type="text"]').fill('New Sine Wave Generator');
|
await page
|
||||||
|
.locator(
|
||||||
|
'text=Properties Title Notes Period Amplitude Offset Data Rate (hz) Phase (radians) Ra >> input[type="text"]'
|
||||||
|
)
|
||||||
|
.fill('New Sine Wave Generator');
|
||||||
await expect(page.locator('.c-form-row__state-indicator').first()).toHaveClass(/valid/);
|
await expect(page.locator('.c-form-row__state-indicator').first()).toHaveClass(/valid/);
|
||||||
|
|
||||||
// Verify that by removing value from required number field shows invalid indicator
|
// Verify that by removing value from required number field shows invalid indicator
|
||||||
await page.locator('.field.control.l-input-sm input').first().fill('');
|
await page.locator('.field.control.l-input-sm input').first().fill('');
|
||||||
await expect(page.locator('div:nth-child(4) .c-form-row__state-indicator')).toHaveClass(/invalid/);
|
await expect(page.locator('div:nth-child(4) .c-form-row__state-indicator')).toHaveClass(
|
||||||
|
/invalid/
|
||||||
|
);
|
||||||
|
|
||||||
// Verify that by adding value to empty required number field changes invalid to valid indicator
|
// Verify that by adding value to empty required number field changes invalid to valid indicator
|
||||||
await page.locator('.field.control.l-input-sm input').first().fill('3');
|
await page.locator('.field.control.l-input-sm input').first().fill('3');
|
||||||
await expect(page.locator('div:nth-child(4) .c-form-row__state-indicator')).toHaveClass(/valid/);
|
await expect(page.locator('div:nth-child(4) .c-form-row__state-indicator')).toHaveClass(
|
||||||
|
/valid/
|
||||||
|
);
|
||||||
|
|
||||||
// Verify that can change value of number field by up/down arrows keys
|
// Verify that can change value of number field by up/down arrows keys
|
||||||
// Click .field.control.l-input-sm input >> nth=0
|
// Click .field.control.l-input-sm input >> nth=0
|
||||||
@@ -94,17 +111,19 @@ test.describe('Sine Wave Generator', () => {
|
|||||||
await expect(value).toBe('6');
|
await expect(value).toBe('6');
|
||||||
|
|
||||||
//Click text=OK
|
//Click text=OK
|
||||||
await Promise.all([
|
await Promise.all([page.waitForNavigation(), page.click('button:has-text("OK")')]);
|
||||||
page.waitForNavigation(),
|
|
||||||
page.click('button:has-text("OK")')
|
|
||||||
]);
|
|
||||||
|
|
||||||
// Verify that the Sine Wave Generator is displayed and correct
|
// Verify that the Sine Wave Generator is displayed and correct
|
||||||
// Verify object properties
|
// Verify object properties
|
||||||
await expect(page.locator('.l-browse-bar__object-name')).toContainText('New Sine Wave Generator');
|
await expect(page.locator('.l-browse-bar__object-name')).toContainText(
|
||||||
|
'New Sine Wave Generator'
|
||||||
|
);
|
||||||
|
|
||||||
// Verify canvas rendered and can be interacted with
|
// Verify canvas rendered and can be interacted with
|
||||||
await page.locator('canvas').nth(1).click({
|
await page
|
||||||
|
.locator('canvas')
|
||||||
|
.nth(1)
|
||||||
|
.click({
|
||||||
position: {
|
position: {
|
||||||
x: 341,
|
x: 341,
|
||||||
y: 28
|
y: 28
|
||||||
@@ -113,7 +132,8 @@ test.describe('Sine Wave Generator', () => {
|
|||||||
|
|
||||||
// Verify that where we click on canvas shows the number we clicked on
|
// Verify that where we click on canvas shows the number we clicked on
|
||||||
// Note that any number will do, we just care that a number exists
|
// Note that any number will do, we just care that a number exists
|
||||||
await expect(page.locator('.value-to-display-nearestValue')).toContainText(/[+-]?([0-9]*[.])?[0-9]+/);
|
await expect(page.locator('.value-to-display-nearestValue')).toContainText(
|
||||||
|
/[+-]?([0-9]*[.])?[0-9]+/
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
* this source code distribution or the Licensing information page available
|
* this source code distribution or the Licensing information page available
|
||||||
* at runtime from the About dialog for additional information.
|
* at runtime from the About dialog for additional information.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
/* global __dirname */
|
||||||
/*
|
/*
|
||||||
This test suite is dedicated to tests which verify form functionality in isolation
|
This test suite is dedicated to tests which verify form functionality in isolation
|
||||||
*/
|
*/
|
||||||
@@ -34,12 +34,14 @@ const jsonFilePath = 'e2e/test-data/ExampleLayouts.json';
|
|||||||
const imageFilePath = 'e2e/test-data/rick.jpg';
|
const imageFilePath = 'e2e/test-data/rick.jpg';
|
||||||
|
|
||||||
test.describe('Form Validation Behavior', () => {
|
test.describe('Form Validation Behavior', () => {
|
||||||
test('Required Field indicators appear if title is empty and can be corrected', async ({ page }) => {
|
test('Required Field indicators appear if title is empty and can be corrected', async ({
|
||||||
|
page
|
||||||
|
}) => {
|
||||||
//Go to baseURL
|
//Go to baseURL
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
await page.click('button:has-text("Create")');
|
await page.click('button:has-text("Create")');
|
||||||
await page.click(':nth-match(:text("Folder"), 2)');
|
await page.getByRole('menuitem', { name: ' Folder' }).click();
|
||||||
|
|
||||||
// Fill in empty string into title and trigger validation with 'Tab'
|
// Fill in empty string into title and trigger validation with 'Tab'
|
||||||
await page.click('text=Properties Title Notes >> input[type="text"]');
|
await page.click('text=Properties Title Notes >> input[type="text"]');
|
||||||
@@ -60,10 +62,7 @@ test.describe('Form Validation Behavior', () => {
|
|||||||
await expect(page.locator('.c-form-row__state-indicator').first()).not.toHaveClass(/invalid/);
|
await expect(page.locator('.c-form-row__state-indicator').first()).not.toHaveClass(/invalid/);
|
||||||
|
|
||||||
//Finish Creating Domain Object
|
//Finish Creating Domain Object
|
||||||
await Promise.all([
|
await Promise.all([page.waitForNavigation(), page.click('button:has-text("OK")')]);
|
||||||
page.waitForNavigation(),
|
|
||||||
page.click('button:has-text("OK")')
|
|
||||||
]);
|
|
||||||
|
|
||||||
//Verify that the Domain Object has been created with the corrected title property
|
//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);
|
await expect(page.locator('.l-browse-bar__object-name')).toContainText(TEST_FOLDER);
|
||||||
@@ -72,12 +71,13 @@ test.describe('Form Validation Behavior', () => {
|
|||||||
|
|
||||||
test.describe('Form File Input Behavior', () => {
|
test.describe('Form File Input Behavior', () => {
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
// eslint-disable-next-line no-undef
|
await page.addInitScript({
|
||||||
await page.addInitScript({ path: path.join(__dirname, '../../helper', 'addInitFileInputObject.js') });
|
path: path.join(__dirname, '../../helper', 'addInitFileInputObject.js')
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Can select a JSON file type', async ({ page }) => {
|
test('Can select a JSON file type', async ({ page }) => {
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
await page.getByRole('button', { name: ' Create ' }).click();
|
await page.getByRole('button', { name: ' Create ' }).click();
|
||||||
await page.getByRole('menuitem', { name: 'JSON File Input Object' }).click();
|
await page.getByRole('menuitem', { name: 'JSON File Input Object' }).click();
|
||||||
@@ -91,7 +91,7 @@ test.describe('Form File Input Behavior', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('Can select an image file type', async ({ page }) => {
|
test('Can select an image file type', async ({ page }) => {
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
await page.getByRole('button', { name: ' Create ' }).click();
|
await page.getByRole('button', { name: ' Create ' }).click();
|
||||||
await page.getByRole('menuitem', { name: 'Image File Input Object' }).click();
|
await page.getByRole('menuitem', { name: 'Image File Input Object' }).click();
|
||||||
@@ -108,8 +108,9 @@ test.describe('Form File Input Behavior', () => {
|
|||||||
test.describe('Persistence operations @addInit', () => {
|
test.describe('Persistence operations @addInit', () => {
|
||||||
// add non persistable root item
|
// add non persistable root item
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
// eslint-disable-next-line no-undef
|
await page.addInitScript({
|
||||||
await page.addInitScript({ path: path.join(__dirname, '../../helper', 'addNoneditableObject.js') });
|
path: path.join(__dirname, '../../helper', 'addNoneditableObject.js')
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Persistability should be respected in the create form location field', async ({ page }) => {
|
test('Persistability should be respected in the create form location field', async ({ page }) => {
|
||||||
@@ -117,7 +118,7 @@ test.describe('Persistence operations @addInit', () => {
|
|||||||
type: 'issue',
|
type: 'issue',
|
||||||
description: 'https://github.com/nasa/openmct/issues/4323'
|
description: 'https://github.com/nasa/openmct/issues/4323'
|
||||||
});
|
});
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
await page.click('button:has-text("Create")');
|
await page.click('button:has-text("Create")');
|
||||||
|
|
||||||
@@ -132,13 +133,15 @@ test.describe('Persistence operations @addInit', () => {
|
|||||||
|
|
||||||
test.describe('Persistence operations @couchdb', () => {
|
test.describe('Persistence operations @couchdb', () => {
|
||||||
test.use({ failOnConsoleError: false });
|
test.use({ failOnConsoleError: false });
|
||||||
test('Editing object properties should generate a single persistence operation', async ({ page }) => {
|
test('Editing object properties should generate a single persistence operation', async ({
|
||||||
|
page
|
||||||
|
}) => {
|
||||||
test.info().annotations.push({
|
test.info().annotations.push({
|
||||||
type: 'issue',
|
type: 'issue',
|
||||||
description: 'https://github.com/nasa/openmct/issues/5616'
|
description: 'https://github.com/nasa/openmct/issues/5616'
|
||||||
});
|
});
|
||||||
|
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
// Create a new 'Clock' object with default settings
|
// Create a new 'Clock' object with default settings
|
||||||
const clock = await createDomainObjectWithDefaults(page, {
|
const clock = await createDomainObjectWithDefaults(page, {
|
||||||
@@ -147,7 +150,7 @@ test.describe('Persistence operations @couchdb', () => {
|
|||||||
|
|
||||||
// Count all persistence operations (PUT requests) for this specific object
|
// Count all persistence operations (PUT requests) for this specific object
|
||||||
let putRequestCount = 0;
|
let putRequestCount = 0;
|
||||||
page.on('request', req => {
|
page.on('request', (req) => {
|
||||||
if (req.method() === 'PUT' && req.url().endsWith(clock.uuid)) {
|
if (req.method() === 'PUT' && req.url().endsWith(clock.uuid)) {
|
||||||
putRequestCount += 1;
|
putRequestCount += 1;
|
||||||
}
|
}
|
||||||
@@ -158,20 +161,28 @@ test.describe('Persistence operations @couchdb', () => {
|
|||||||
await page.click('li[title="Edit properties of this object."]');
|
await page.click('li[title="Edit properties of this object."]');
|
||||||
|
|
||||||
// Modify the display format from default 12hr -> 24hr and click 'Save'
|
// 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
|
||||||
|
.locator('select[aria-label="12 or 24 hour clock"]')
|
||||||
|
.selectOption({ value: 'clock24' });
|
||||||
await page.click('button[aria-label="Save"]');
|
await page.click('button[aria-label="Save"]');
|
||||||
|
|
||||||
await expect.poll(() => putRequestCount, {
|
await expect
|
||||||
|
.poll(() => putRequestCount, {
|
||||||
message: 'Verify a single PUT request was made to persist the object',
|
message: 'Verify a single PUT request was made to persist the object',
|
||||||
timeout: 1000
|
timeout: 1000
|
||||||
}).toEqual(1);
|
})
|
||||||
|
.toEqual(1);
|
||||||
});
|
});
|
||||||
test('Can create an object after a conflict error @couchdb @2p', async ({ page }) => {
|
test('Can create an object after a conflict error @couchdb @2p', async ({
|
||||||
|
page,
|
||||||
|
openmctConfig
|
||||||
|
}) => {
|
||||||
test.info().annotations.push({
|
test.info().annotations.push({
|
||||||
type: 'issue',
|
type: 'issue',
|
||||||
description: 'https://github.com/nasa/openmct/issues/5982'
|
description: 'https://github.com/nasa/openmct/issues/5982'
|
||||||
});
|
});
|
||||||
|
const { myItemsFolderName } = openmctConfig;
|
||||||
|
// Instantiate a second page/tab
|
||||||
const page2 = await page.context().newPage();
|
const page2 = await page.context().newPage();
|
||||||
|
|
||||||
// Both pages: Go to baseURL
|
// Both pages: Go to baseURL
|
||||||
@@ -180,6 +191,14 @@ test.describe('Persistence operations @couchdb', () => {
|
|||||||
page2.goto('./', { waitUntil: 'networkidle' })
|
page2.goto('./', { waitUntil: 'networkidle' })
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
//Slow down the test a bit
|
||||||
|
await expect(
|
||||||
|
page.getByRole('button', { name: `Expand ${myItemsFolderName} folder` })
|
||||||
|
).toBeVisible();
|
||||||
|
await expect(
|
||||||
|
page2.getByRole('button', { name: `Expand ${myItemsFolderName} folder` })
|
||||||
|
).toBeVisible();
|
||||||
|
|
||||||
// Both pages: Click the Create button
|
// Both pages: Click the Create button
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
page.click('button:has-text("Create")'),
|
page.click('button:has-text("Create")'),
|
||||||
@@ -198,9 +217,9 @@ test.describe('Persistence operations @couchdb', () => {
|
|||||||
|
|
||||||
// Both pages: Fill in the 'Name' form field.
|
// Both pages: Fill in the 'Name' form field.
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
nameInput.fill(""),
|
nameInput.fill(''),
|
||||||
nameInput.fill(`Clock:${genUuid()}`),
|
nameInput.fill(`Clock:${genUuid()}`),
|
||||||
nameInput2.fill(""),
|
nameInput2.fill(''),
|
||||||
nameInput2.fill(`Clock:${genUuid()}`)
|
nameInput2.fill(`Clock:${genUuid()}`)
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@@ -209,10 +228,7 @@ test.describe('Persistence operations @couchdb', () => {
|
|||||||
const testNotes = page.testNotes;
|
const testNotes = page.testNotes;
|
||||||
const notesInput = page.locator('form[name="mctForm"] #notes-textarea');
|
const notesInput = page.locator('form[name="mctForm"] #notes-textarea');
|
||||||
const notesInput2 = page2.locator('form[name="mctForm"] #notes-textarea');
|
const notesInput2 = page2.locator('form[name="mctForm"] #notes-textarea');
|
||||||
await Promise.all([
|
await Promise.all([notesInput.fill(testNotes), notesInput2.fill(testNotes)]);
|
||||||
notesInput.fill(testNotes),
|
|
||||||
notesInput2.fill(testNotes)
|
|
||||||
]);
|
|
||||||
|
|
||||||
// Page 2: Click "OK" to create the domain object and wait for navigation.
|
// Page 2: Click "OK" to create the domain object and wait for navigation.
|
||||||
// This will update the composition of the parent folder, setting the
|
// This will update the composition of the parent folder, setting the
|
||||||
@@ -238,9 +254,11 @@ test.describe('Persistence operations @couchdb', () => {
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
// Page 1: Verify that the conflict has occurred and an error notification is displayed.
|
// Page 1: Verify that the conflict has occurred and an error notification is displayed.
|
||||||
await expect(page.locator('.c-message-banner__message', {
|
await expect(
|
||||||
hasText: "Conflict detected while saving mine"
|
page.locator('.c-message-banner__message', {
|
||||||
})).toBeVisible();
|
hasText: 'Conflict detected while saving mine'
|
||||||
|
})
|
||||||
|
).toBeVisible();
|
||||||
|
|
||||||
// Page 1: Start logging console errors from this point on
|
// Page 1: Start logging console errors from this point on
|
||||||
let errors = [];
|
let errors = [];
|
||||||
@@ -256,14 +274,19 @@ test.describe('Persistence operations @couchdb', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Page 1: Wait for save progress dialog to appear/disappear
|
// Page 1: Wait for save progress dialog to appear/disappear
|
||||||
await page.locator('.c-message-banner__message', {
|
await page
|
||||||
hasText: 'Do not navigate away from this page or close this browser tab while this message is displayed.',
|
.locator('.c-message-banner__message', {
|
||||||
|
hasText:
|
||||||
|
'Do not navigate away from this page or close this browser tab while this message is displayed.',
|
||||||
state: 'visible'
|
state: 'visible'
|
||||||
}).waitFor({ state: 'hidden' });
|
})
|
||||||
|
.waitFor({ state: 'hidden' });
|
||||||
|
|
||||||
// Page 1: Navigate to 'My Items' and verify that the second clock was created
|
// Page 1: Navigate to 'My Items' and verify that the second clock was created
|
||||||
await page.goto('./#/browse/mine');
|
await page.goto('./#/browse/mine');
|
||||||
await expect(page.locator(`.c-grid-item__name[title="${clockAfterConflict.name}"]`)).toBeVisible();
|
await expect(
|
||||||
|
page.locator(`.c-grid-item__name[title="${clockAfterConflict.name}"]`)
|
||||||
|
).toBeVisible();
|
||||||
|
|
||||||
// Verify no console errors occurred
|
// Verify no console errors occurred
|
||||||
expect(errors).toHaveLength(0);
|
expect(errors).toHaveLength(0);
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
* this source code distribution or the Licensing information page available
|
* this source code distribution or the Licensing information page available
|
||||||
* at runtime from the About dialog for additional information.
|
* at runtime from the About dialog for additional information.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
/* global __dirname */
|
||||||
/*
|
/*
|
||||||
This test suite is dedicated to tests which verify persistability checks
|
This test suite is dedicated to tests which verify persistability checks
|
||||||
*/
|
*/
|
||||||
@@ -31,12 +31,13 @@ const path = require('path');
|
|||||||
test.describe('Persistence operations @addInit', () => {
|
test.describe('Persistence operations @addInit', () => {
|
||||||
// add non persistable root item
|
// add non persistable root item
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
// eslint-disable-next-line no-undef
|
await page.addInitScript({
|
||||||
await page.addInitScript({ path: path.join(__dirname, '../../helper', 'addNoneditableObject.js') });
|
path: path.join(__dirname, '../../helper', 'addNoneditableObject.js')
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Non-persistable objects should not show persistence related actions', async ({ page }) => {
|
test('Non-persistable objects should not show persistence related actions', async ({ page }) => {
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
await page.locator('text=Persistence Testing').first().click({
|
await page.locator('text=Persistence Testing').first().click({
|
||||||
button: 'right'
|
button: 'right'
|
||||||
@@ -45,6 +46,14 @@ test.describe('Persistence operations @addInit', () => {
|
|||||||
const menuOptions = page.locator('.c-menu li');
|
const menuOptions = page.locator('.c-menu li');
|
||||||
|
|
||||||
await expect.soft(menuOptions).toContainText(['Open In New Tab', 'View', 'Create Link']);
|
await expect.soft(menuOptions).toContainText(['Open In New Tab', 'View', 'Create Link']);
|
||||||
await expect(menuOptions).not.toContainText(['Move', 'Duplicate', 'Remove', 'Add New Folder', 'Edit Properties...', 'Export as JSON', 'Import from JSON']);
|
await expect(menuOptions).not.toContainText([
|
||||||
|
'Move',
|
||||||
|
'Duplicate',
|
||||||
|
'Remove',
|
||||||
|
'Add New Folder',
|
||||||
|
'Edit Properties...',
|
||||||
|
'Export as JSON',
|
||||||
|
'Import from JSON'
|
||||||
|
]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -28,7 +28,10 @@ const { test, expect } = require('../../pluginFixtures');
|
|||||||
const { createDomainObjectWithDefaults } = require('../../appActions');
|
const { createDomainObjectWithDefaults } = require('../../appActions');
|
||||||
|
|
||||||
test.describe('Move & link item tests', () => {
|
test.describe('Move & link item tests', () => {
|
||||||
test('Create a basic object and verify that it can be moved to another folder', async ({ page, openmctConfig }) => {
|
test('Create a basic object and verify that it can be moved to another folder', async ({
|
||||||
|
page,
|
||||||
|
openmctConfig
|
||||||
|
}) => {
|
||||||
const { myItemsFolderName } = openmctConfig;
|
const { myItemsFolderName } = openmctConfig;
|
||||||
|
|
||||||
// Go to Open MCT
|
// Go to Open MCT
|
||||||
@@ -55,18 +58,22 @@ test.describe('Move & link item tests', () => {
|
|||||||
const treePane = page.getByRole('tree', {
|
const treePane = page.getByRole('tree', {
|
||||||
name: 'Main Tree'
|
name: 'Main Tree'
|
||||||
});
|
});
|
||||||
await treePane.getByRole('treeitem', {
|
await treePane
|
||||||
|
.getByRole('treeitem', {
|
||||||
name: 'Parent Folder'
|
name: 'Parent Folder'
|
||||||
}).click({
|
})
|
||||||
|
.click({
|
||||||
button: 'right'
|
button: 'right'
|
||||||
});
|
});
|
||||||
|
|
||||||
await page.getByRole('menuitem', {
|
await page
|
||||||
|
.getByRole('menuitem', {
|
||||||
name: /Move/
|
name: /Move/
|
||||||
}).click();
|
})
|
||||||
|
.click();
|
||||||
|
|
||||||
const createModalTree = page.getByRole('tree', {
|
const createModalTree = page.getByRole('tree', {
|
||||||
name: "Create Modal Tree"
|
name: 'Create Modal Tree'
|
||||||
});
|
});
|
||||||
const myItemsLocatorTreeItem = createModalTree.getByRole('treeitem', {
|
const myItemsLocatorTreeItem = createModalTree.getByRole('treeitem', {
|
||||||
name: myItemsFolderName
|
name: myItemsFolderName
|
||||||
@@ -100,14 +107,18 @@ test.describe('Move & link item tests', () => {
|
|||||||
await page.locator('[aria-label="Cancel"]').click();
|
await page.locator('[aria-label="Cancel"]').click();
|
||||||
|
|
||||||
// Move Child Folder from Parent Folder to My Items
|
// Move Child Folder from Parent Folder to My Items
|
||||||
await treePane.getByRole('treeitem', {
|
await treePane
|
||||||
|
.getByRole('treeitem', {
|
||||||
name: new RegExp(childFolder.name)
|
name: new RegExp(childFolder.name)
|
||||||
}).click({
|
})
|
||||||
|
.click({
|
||||||
button: 'right'
|
button: 'right'
|
||||||
});
|
});
|
||||||
await page.getByRole('menuitem', {
|
await page
|
||||||
|
.getByRole('menuitem', {
|
||||||
name: /Move/
|
name: /Move/
|
||||||
}).click();
|
})
|
||||||
|
.click();
|
||||||
await myItemsLocatorTreeItem.click();
|
await myItemsLocatorTreeItem.click();
|
||||||
|
|
||||||
await page.locator('[aria-label="Save"]').click();
|
await page.locator('[aria-label="Save"]').click();
|
||||||
@@ -118,7 +129,10 @@ test.describe('Move & link item tests', () => {
|
|||||||
// Expect that Child Folder is in My Items, the root folder
|
// Expect that Child Folder is in My Items, the root folder
|
||||||
expect(myItemsPaneTreeItem.locator('nth=0:has(text=Child Folder)')).toBeTruthy();
|
expect(myItemsPaneTreeItem.locator('nth=0:has(text=Child Folder)')).toBeTruthy();
|
||||||
});
|
});
|
||||||
test('Create a basic object and verify that it cannot be moved to telemetry object without Composition Provider', async ({ page, openmctConfig }) => {
|
test('Create a basic object and verify that it cannot be moved to telemetry object without Composition Provider', async ({
|
||||||
|
page,
|
||||||
|
openmctConfig
|
||||||
|
}) => {
|
||||||
const { myItemsFolderName } = openmctConfig;
|
const { myItemsFolderName } = openmctConfig;
|
||||||
|
|
||||||
// Go to Open MCT
|
// Go to Open MCT
|
||||||
@@ -158,11 +172,10 @@ test.describe('Move & link item tests', () => {
|
|||||||
await page.locator(`text=Open MCT ${myItemsFolderName} >> span`).nth(3).click();
|
await page.locator(`text=Open MCT ${myItemsFolderName} >> span`).nth(3).click();
|
||||||
|
|
||||||
// Select Folder Object and select Move from context menu
|
// Select Folder Object and select Move from context menu
|
||||||
await Promise.all([
|
await Promise.all([page.waitForNavigation(), page.locator(`a:has-text("${folder}")`).click()]);
|
||||||
page.waitForNavigation(),
|
await page
|
||||||
page.locator(`a:has-text("${folder}")`).click()
|
.locator('.c-tree__item.is-navigated-object .c-tree__item__label .c-tree__item__type-icon')
|
||||||
]);
|
.click({
|
||||||
await page.locator('.c-tree__item.is-navigated-object .c-tree__item__label .c-tree__item__type-icon').click({
|
|
||||||
button: 'right'
|
button: 'right'
|
||||||
});
|
});
|
||||||
await page.locator('li.icon-move').click();
|
await page.locator('li.icon-move').click();
|
||||||
@@ -175,7 +188,10 @@ test.describe('Move & link item tests', () => {
|
|||||||
expect(okButtonStateDisabled2).toBeTruthy();
|
expect(okButtonStateDisabled2).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Create a basic object and verify that it can be linked to another folder', async ({ page, openmctConfig }) => {
|
test('Create a basic object and verify that it can be linked to another folder', async ({
|
||||||
|
page,
|
||||||
|
openmctConfig
|
||||||
|
}) => {
|
||||||
const { myItemsFolderName } = openmctConfig;
|
const { myItemsFolderName } = openmctConfig;
|
||||||
|
|
||||||
// Go to Open MCT
|
// Go to Open MCT
|
||||||
@@ -202,18 +218,22 @@ test.describe('Move & link item tests', () => {
|
|||||||
const treePane = page.getByRole('tree', {
|
const treePane = page.getByRole('tree', {
|
||||||
name: 'Main Tree'
|
name: 'Main Tree'
|
||||||
});
|
});
|
||||||
await treePane.getByRole('treeitem', {
|
await treePane
|
||||||
|
.getByRole('treeitem', {
|
||||||
name: 'Parent Folder'
|
name: 'Parent Folder'
|
||||||
}).click({
|
})
|
||||||
|
.click({
|
||||||
button: 'right'
|
button: 'right'
|
||||||
});
|
});
|
||||||
|
|
||||||
await page.getByRole('menuitem', {
|
await page
|
||||||
|
.getByRole('menuitem', {
|
||||||
name: /Move/
|
name: /Move/
|
||||||
}).click();
|
})
|
||||||
|
.click();
|
||||||
|
|
||||||
const createModalTree = page.getByRole('tree', {
|
const createModalTree = page.getByRole('tree', {
|
||||||
name: "Create Modal Tree"
|
name: 'Create Modal Tree'
|
||||||
});
|
});
|
||||||
const myItemsLocatorTreeItem = createModalTree.getByRole('treeitem', {
|
const myItemsLocatorTreeItem = createModalTree.getByRole('treeitem', {
|
||||||
name: myItemsFolderName
|
name: myItemsFolderName
|
||||||
@@ -247,14 +267,18 @@ test.describe('Move & link item tests', () => {
|
|||||||
await page.locator('[aria-label="Cancel"]').click();
|
await page.locator('[aria-label="Cancel"]').click();
|
||||||
|
|
||||||
// Move Child Folder from Parent Folder to My Items
|
// Move Child Folder from Parent Folder to My Items
|
||||||
await treePane.getByRole('treeitem', {
|
await treePane
|
||||||
|
.getByRole('treeitem', {
|
||||||
name: new RegExp(childFolder.name)
|
name: new RegExp(childFolder.name)
|
||||||
}).click({
|
})
|
||||||
|
.click({
|
||||||
button: 'right'
|
button: 'right'
|
||||||
});
|
});
|
||||||
await page.getByRole('menuitem', {
|
await page
|
||||||
|
.getByRole('menuitem', {
|
||||||
name: /Link/
|
name: /Link/
|
||||||
}).click();
|
})
|
||||||
|
.click();
|
||||||
await myItemsLocatorTreeItem.click();
|
await myItemsLocatorTreeItem.click();
|
||||||
|
|
||||||
await page.locator('[aria-label="Save"]').click();
|
await page.locator('[aria-label="Save"]').click();
|
||||||
@@ -267,10 +291,13 @@ test.describe('Move & link item tests', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test.fixme('Cannot move a previously created domain object to non-peristable object in Move Modal', async ({ page }) => {
|
test.fixme(
|
||||||
|
'Cannot move a previously created domain object to non-persistable object in Move Modal',
|
||||||
|
async ({ page }) => {
|
||||||
//Create a domain object
|
//Create a domain object
|
||||||
//Save Domain object
|
//Save Domain object
|
||||||
//Move Object and verify that cannot select non-persistable object
|
//Move Object and verify that cannot select non-persistable object
|
||||||
//Move Object to My Items
|
//Move Object to My Items
|
||||||
//Verify successful move
|
//Verify successful move
|
||||||
});
|
}
|
||||||
|
);
|
||||||
|
|||||||
@@ -28,14 +28,14 @@ const { createDomainObjectWithDefaults, createNotification } = require('../../ap
|
|||||||
const { test, expect } = require('../../pluginFixtures');
|
const { test, expect } = require('../../pluginFixtures');
|
||||||
|
|
||||||
test.describe('Notifications List', () => {
|
test.describe('Notifications List', () => {
|
||||||
test('Notifications can be dismissed individually', async ({ page }) => {
|
test.fixme('Notifications can be dismissed individually', async ({ page }) => {
|
||||||
test.info().annotations.push({
|
test.info().annotations.push({
|
||||||
type: 'issue',
|
type: 'issue',
|
||||||
description: 'https://github.com/nasa/openmct/issues/6122'
|
description: 'https://github.com/nasa/openmct/issues/6820'
|
||||||
});
|
});
|
||||||
|
|
||||||
// Go to baseURL
|
// Go to baseURL
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
// Create an error notification with the message "Error message"
|
// Create an error notification with the message "Error message"
|
||||||
await createNotification(page, {
|
await createNotification(page, {
|
||||||
@@ -59,10 +59,14 @@ test.describe('Notifications List', () => {
|
|||||||
await page.click('button[aria-label="Dismiss notification of Error message"]');
|
await page.click('button[aria-label="Dismiss notification of Error message"]');
|
||||||
|
|
||||||
// Verify there is no a notification (listitem) with the text "Error message" since it was dismissed
|
// 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('Error message');
|
expect(await page.locator('div[role="dialog"] div[role="listitem"]').innerText()).not.toContain(
|
||||||
|
'Error message'
|
||||||
|
);
|
||||||
|
|
||||||
// Verify there is still a notification (listitem) with the text "Alert message"
|
// Verify there is still a notification (listitem) with the text "Alert message"
|
||||||
expect(await page.locator('div[role="dialog"] div[role="listitem"]').innerText()).toContain('Alert message');
|
expect(await page.locator('div[role="dialog"] div[role="listitem"]').innerText()).toContain(
|
||||||
|
'Alert message'
|
||||||
|
);
|
||||||
|
|
||||||
// Click on button with aria-label="Dismiss notification of Alert message"
|
// Click on button with aria-label="Dismiss notification of Alert message"
|
||||||
await page.click('button[aria-label="Dismiss notification of Alert message"]');
|
await page.click('button[aria-label="Dismiss notification of Alert message"]');
|
||||||
@@ -73,14 +77,16 @@ test.describe('Notifications List', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test.describe('Notification Overlay', () => {
|
test.describe('Notification Overlay', () => {
|
||||||
test('Closing notification list after notification banner disappeared does not cause it to open automatically', async ({ page }) => {
|
test('Closing notification list after notification banner disappeared does not cause it to open automatically', async ({
|
||||||
|
page
|
||||||
|
}) => {
|
||||||
test.info().annotations.push({
|
test.info().annotations.push({
|
||||||
type: 'issue',
|
type: 'issue',
|
||||||
description: 'https://github.com/nasa/openmct/issues/6130'
|
description: 'https://github.com/nasa/openmct/issues/6130'
|
||||||
});
|
});
|
||||||
|
|
||||||
// Go to baseURL
|
// Go to baseURL
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
// Create a new Display Layout object
|
// Create a new Display Layout object
|
||||||
await createDomainObjectWithDefaults(page, { type: 'Display Layout' });
|
await createDomainObjectWithDefaults(page, { type: 'Display Layout' });
|
||||||
|
|||||||
@@ -20,43 +20,55 @@
|
|||||||
* at runtime from the About dialog for additional information.
|
* at runtime from the About dialog for additional information.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
const { test, expect } = require('../../../pluginFixtures');
|
const { test, expect } = require('../../../pluginFixtures');
|
||||||
const { createPlanFromJSON, createDomainObjectWithDefaults, selectInspectorTab } = require('../../../appActions');
|
const {
|
||||||
|
createPlanFromJSON,
|
||||||
|
createDomainObjectWithDefaults,
|
||||||
|
selectInspectorTab
|
||||||
|
} = require('../../../appActions');
|
||||||
const testPlan1 = require('../../../test-data/examplePlans/ExamplePlan_Small1.json');
|
const testPlan1 = require('../../../test-data/examplePlans/ExamplePlan_Small1.json');
|
||||||
const testPlan2 = require('../../../test-data/examplePlans/ExamplePlan_Small2.json');
|
const testPlan2 = require('../../../test-data/examplePlans/ExamplePlan_Small2.json');
|
||||||
const { assertPlanActivities, setBoundsToSpanAllActivities } = require('../../../helper/planningUtils');
|
const {
|
||||||
|
assertPlanActivities,
|
||||||
|
setBoundsToSpanAllActivities
|
||||||
|
} = require('../../../helper/planningUtils');
|
||||||
const { getPreciseDuration } = require('../../../../src/utils/duration');
|
const { getPreciseDuration } = require('../../../../src/utils/duration');
|
||||||
|
|
||||||
test.describe("Gantt Chart", () => {
|
test.describe('Gantt Chart', () => {
|
||||||
let ganttChart;
|
let ganttChart;
|
||||||
|
let plan;
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
ganttChart = await createDomainObjectWithDefaults(page, {
|
ganttChart = await createDomainObjectWithDefaults(page, {
|
||||||
type: 'Gantt Chart'
|
type: 'Gantt Chart'
|
||||||
});
|
});
|
||||||
await createPlanFromJSON(page, {
|
plan = await createPlanFromJSON(page, {
|
||||||
json: testPlan1,
|
json: testPlan1,
|
||||||
parent: ganttChart.uuid
|
parent: ganttChart.uuid
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test("Displays all plan events", async ({ page }) => {
|
test('Displays all plan events', async ({ page }) => {
|
||||||
await page.goto(ganttChart.url);
|
await page.goto(ganttChart.url);
|
||||||
|
|
||||||
await assertPlanActivities(page, testPlan1, ganttChart.url);
|
await assertPlanActivities(page, testPlan1, ganttChart.url);
|
||||||
});
|
});
|
||||||
test("Replaces a plan with a new plan", async ({ page }) => {
|
test('Replaces a plan with a new plan', async ({ page }) => {
|
||||||
await assertPlanActivities(page, testPlan1, ganttChart.url);
|
await assertPlanActivities(page, testPlan1, ganttChart.url);
|
||||||
await createPlanFromJSON(page, {
|
await createPlanFromJSON(page, {
|
||||||
json: testPlan2,
|
json: testPlan2,
|
||||||
parent: ganttChart.uuid
|
parent: ganttChart.uuid
|
||||||
});
|
});
|
||||||
const replaceModal = page.getByRole('dialog').filter({ hasText: "This action will replace the current Plan. Do you want to continue?" });
|
const replaceModal = page
|
||||||
|
.getByRole('dialog')
|
||||||
|
.filter({ hasText: 'This action will replace the current Plan. Do you want to continue?' });
|
||||||
await expect(replaceModal).toBeVisible();
|
await expect(replaceModal).toBeVisible();
|
||||||
await page.getByRole('button', { name: 'OK' }).click();
|
await page.getByRole('button', { name: 'OK' }).click();
|
||||||
|
|
||||||
await assertPlanActivities(page, testPlan2, ganttChart.url);
|
await assertPlanActivities(page, testPlan2, ganttChart.url);
|
||||||
});
|
});
|
||||||
test("Can select a single activity and display its details in the inspector", async ({ page }) => {
|
test('Can select a single activity and display its details in the inspector', async ({
|
||||||
|
page
|
||||||
|
}) => {
|
||||||
test.slow();
|
test.slow();
|
||||||
await page.goto(ganttChart.url);
|
await page.goto(ganttChart.url);
|
||||||
|
|
||||||
@@ -64,12 +76,23 @@ test.describe("Gantt Chart", () => {
|
|||||||
|
|
||||||
const activities = Object.values(testPlan1).flat();
|
const activities = Object.values(testPlan1).flat();
|
||||||
const activity = activities[0];
|
const activity = activities[0];
|
||||||
await page.locator('g').filter({ hasText: new RegExp(activity.name) }).click();
|
await page
|
||||||
|
.locator('g')
|
||||||
|
.filter({ hasText: new RegExp(activity.name) })
|
||||||
|
.click();
|
||||||
await selectInspectorTab(page, 'Activity');
|
await selectInspectorTab(page, 'Activity');
|
||||||
|
|
||||||
const startDateTime = await page.locator('.c-inspect-properties__label:has-text("Start DateTime")+.c-inspect-properties__value').innerText();
|
const startDateTime = await page
|
||||||
const endDateTime = await page.locator('.c-inspect-properties__label:has-text("End DateTime")+.c-inspect-properties__value').innerText();
|
.locator(
|
||||||
const duration = await page.locator('.c-inspect-properties__label:has-text("duration")+.c-inspect-properties__value').innerText();
|
'.c-inspect-properties__label:has-text("Start DateTime")+.c-inspect-properties__value'
|
||||||
|
)
|
||||||
|
.innerText();
|
||||||
|
const endDateTime = await page
|
||||||
|
.locator('.c-inspect-properties__label:has-text("End DateTime")+.c-inspect-properties__value')
|
||||||
|
.innerText();
|
||||||
|
const duration = await page
|
||||||
|
.locator('.c-inspect-properties__label:has-text("duration")+.c-inspect-properties__value')
|
||||||
|
.innerText();
|
||||||
|
|
||||||
const expectedStartDate = new Date(activity.start).toISOString();
|
const expectedStartDate = new Date(activity.start).toISOString();
|
||||||
const actualStartDate = new Date(startDateTime).toISOString();
|
const actualStartDate = new Date(startDateTime).toISOString();
|
||||||
@@ -82,4 +105,23 @@ test.describe("Gantt Chart", () => {
|
|||||||
expect(expectedEndDate).toEqual(actualEndDate);
|
expect(expectedEndDate).toEqual(actualEndDate);
|
||||||
expect(expectedDuration).toEqual(actualDuration);
|
expect(expectedDuration).toEqual(actualDuration);
|
||||||
});
|
});
|
||||||
|
test("Displays a Plan's draft status", async ({ page }) => {
|
||||||
|
test.info().annotations.push({
|
||||||
|
type: 'issue',
|
||||||
|
description: 'https://github.com/nasa/openmct/issues/6641'
|
||||||
|
});
|
||||||
|
|
||||||
|
// Mark the Plan's status as draft in the OpenMCT API
|
||||||
|
await page.evaluate(async (planObject) => {
|
||||||
|
await window.openmct.status.set(planObject.uuid, 'draft');
|
||||||
|
}, plan);
|
||||||
|
|
||||||
|
// Navigate to the Gantt Chart
|
||||||
|
await page.goto(ganttChart.url);
|
||||||
|
|
||||||
|
// Assert that the Plan's status is displayed as draft
|
||||||
|
expect(await page.locator('.u-contents.c-swimlane.is-status--draft').count()).toBe(
|
||||||
|
Object.keys(testPlan1).length
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -24,16 +24,16 @@ const { createPlanFromJSON } = require('../../../appActions');
|
|||||||
const testPlan1 = require('../../../test-data/examplePlans/ExamplePlan_Small1.json');
|
const testPlan1 = require('../../../test-data/examplePlans/ExamplePlan_Small1.json');
|
||||||
const { assertPlanActivities } = require('../../../helper/planningUtils');
|
const { assertPlanActivities } = require('../../../helper/planningUtils');
|
||||||
|
|
||||||
test.describe("Plan", () => {
|
test.describe('Plan', () => {
|
||||||
let plan;
|
let plan;
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
plan = await createPlanFromJSON(page, {
|
plan = await createPlanFromJSON(page, {
|
||||||
json: testPlan1
|
json: testPlan1
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test("Displays all plan events", async ({ page }) => {
|
test('Displays all plan events', async ({ page }) => {
|
||||||
await assertPlanActivities(page, testPlan1, plan.url);
|
await assertPlanActivities(page, testPlan1, plan.url);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
124
e2e/tests/functional/planning/timelist.e2e.spec.js
Normal file
@@ -0,0 +1,124 @@
|
|||||||
|
/*****************************************************************************
|
||||||
|
* 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.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
const { test, expect } = require('../../../pluginFixtures');
|
||||||
|
const { createDomainObjectWithDefaults, createPlanFromJSON } = require('../../../appActions');
|
||||||
|
|
||||||
|
const testPlan = {
|
||||||
|
TEST_GROUP: [
|
||||||
|
{
|
||||||
|
name: 'Past event 1',
|
||||||
|
start: 1660320408000,
|
||||||
|
end: 1660343797000,
|
||||||
|
type: 'TEST-GROUP',
|
||||||
|
color: 'orange',
|
||||||
|
textColor: 'white'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Past event 2',
|
||||||
|
start: 1660406808000,
|
||||||
|
end: 1660429160000,
|
||||||
|
type: 'TEST-GROUP',
|
||||||
|
color: 'orange',
|
||||||
|
textColor: 'white'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Past event 3',
|
||||||
|
start: 1660493208000,
|
||||||
|
end: 1660503981000,
|
||||||
|
type: 'TEST-GROUP',
|
||||||
|
color: 'orange',
|
||||||
|
textColor: 'white'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Past event 4',
|
||||||
|
start: 1660579608000,
|
||||||
|
end: 1660624108000,
|
||||||
|
type: 'TEST-GROUP',
|
||||||
|
color: 'orange',
|
||||||
|
textColor: 'white'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Past event 5',
|
||||||
|
start: 1660666008000,
|
||||||
|
end: 1660681529000,
|
||||||
|
type: 'TEST-GROUP',
|
||||||
|
color: 'orange',
|
||||||
|
textColor: 'white'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
test.describe('Time List', () => {
|
||||||
|
test('Create a Time List, add a single Plan to it and verify all the activities are displayed with no milliseconds', async ({
|
||||||
|
page
|
||||||
|
}) => {
|
||||||
|
// Goto baseURL
|
||||||
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
|
const timelist = await test.step('Create a Time List', async () => {
|
||||||
|
const createdTimeList = await createDomainObjectWithDefaults(page, { type: 'Time List' });
|
||||||
|
const objectName = await page.locator('.l-browse-bar__object-name').innerText();
|
||||||
|
expect(objectName).toBe(createdTimeList.name);
|
||||||
|
|
||||||
|
return createdTimeList;
|
||||||
|
});
|
||||||
|
|
||||||
|
await test.step('Create a Plan and add it to the timelist', async () => {
|
||||||
|
const createdPlan = await createPlanFromJSON(page, {
|
||||||
|
name: 'Test Plan',
|
||||||
|
json: testPlan
|
||||||
|
});
|
||||||
|
|
||||||
|
await page.goto(timelist.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']");
|
||||||
|
const startBound = testPlan.TEST_GROUP[0].start;
|
||||||
|
const endBound = testPlan.TEST_GROUP[testPlan.TEST_GROUP.length - 1].end;
|
||||||
|
|
||||||
|
await page.goto(timelist.url);
|
||||||
|
|
||||||
|
// 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`
|
||||||
|
);
|
||||||
|
|
||||||
|
// Verify all events are displayed
|
||||||
|
const eventCount = await page.locator('.js-list-item').count();
|
||||||
|
expect(eventCount).toEqual(testPlan.TEST_GROUP.length);
|
||||||
|
});
|
||||||
|
|
||||||
|
await test.step('Does not show milliseconds in times', async () => {
|
||||||
|
// Get the first activity
|
||||||
|
const row = page.locator('.js-list-item').first();
|
||||||
|
// Verify that none fo the times have milliseconds displayed.
|
||||||
|
// Example: 2024-11-17T16:00:00Z is correct and 2024-11-17T16:00:00.000Z is wrong
|
||||||
|
|
||||||
|
await expect(row.locator('.--start')).not.toContainText('.');
|
||||||
|
await expect(row.locator('.--end')).not.toContainText('.');
|
||||||
|
await expect(row.locator('.--duration')).not.toContainText('.');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -21,68 +21,73 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
const { test, expect } = require('../../../pluginFixtures');
|
const { test, expect } = require('../../../pluginFixtures');
|
||||||
const { createDomainObjectWithDefaults, createPlanFromJSON } = require('../../../appActions');
|
const {
|
||||||
|
createDomainObjectWithDefaults,
|
||||||
|
createPlanFromJSON,
|
||||||
|
setIndependentTimeConductorBounds
|
||||||
|
} = require('../../../appActions');
|
||||||
|
|
||||||
const testPlan = {
|
const testPlan = {
|
||||||
"TEST_GROUP": [
|
TEST_GROUP: [
|
||||||
{
|
{
|
||||||
"name": "Past event 1",
|
name: 'Past event 1',
|
||||||
"start": 1660320408000,
|
start: 1660320408000,
|
||||||
"end": 1660343797000,
|
end: 1660343797000,
|
||||||
"type": "TEST-GROUP",
|
type: 'TEST-GROUP',
|
||||||
"color": "orange",
|
color: 'orange',
|
||||||
"textColor": "white"
|
textColor: 'white'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Past event 2",
|
name: 'Past event 2',
|
||||||
"start": 1660406808000,
|
start: 1660406808000,
|
||||||
"end": 1660429160000,
|
end: 1660429160000,
|
||||||
"type": "TEST-GROUP",
|
type: 'TEST-GROUP',
|
||||||
"color": "orange",
|
color: 'orange',
|
||||||
"textColor": "white"
|
textColor: 'white'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Past event 3",
|
name: 'Past event 3',
|
||||||
"start": 1660493208000,
|
start: 1660493208000,
|
||||||
"end": 1660503981000,
|
end: 1660503981000,
|
||||||
"type": "TEST-GROUP",
|
type: 'TEST-GROUP',
|
||||||
"color": "orange",
|
color: 'orange',
|
||||||
"textColor": "white"
|
textColor: 'white'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Past event 4",
|
name: 'Past event 4',
|
||||||
"start": 1660579608000,
|
start: 1660579608000,
|
||||||
"end": 1660624108000,
|
end: 1660624108000,
|
||||||
"type": "TEST-GROUP",
|
type: 'TEST-GROUP',
|
||||||
"color": "orange",
|
color: 'orange',
|
||||||
"textColor": "white"
|
textColor: 'white'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Past event 5",
|
name: 'Past event 5',
|
||||||
"start": 1660666008000,
|
start: 1660666008000,
|
||||||
"end": 1660681529000,
|
end: 1660681529000,
|
||||||
"type": "TEST-GROUP",
|
type: 'TEST-GROUP',
|
||||||
"color": "orange",
|
color: 'orange',
|
||||||
"textColor": "white"
|
textColor: 'white'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
test.describe("Time Strip", () => {
|
test.describe('Time Strip', () => {
|
||||||
test("Create two Time Strips, add a single Plan to both, and verify they can have separate Indepdenent Time Contexts @unstable", async ({ page }) => {
|
test('Create two Time Strips, add a single Plan to both, and verify they can have separate Independent Time Contexts @unstable', async ({
|
||||||
|
page
|
||||||
|
}) => {
|
||||||
test.info().annotations.push({
|
test.info().annotations.push({
|
||||||
type: 'issue',
|
type: 'issue',
|
||||||
description: 'https://github.com/nasa/openmct/issues/5627'
|
description: 'https://github.com/nasa/openmct/issues/5627'
|
||||||
});
|
});
|
||||||
|
|
||||||
// Constant locators
|
// Constant locators
|
||||||
const independentTimeConductorInputs = page.locator('.l-shell__main-independent-time-conductor .c-input--datetime');
|
|
||||||
const activityBounds = page.locator('.activity-bounds');
|
const activityBounds = page.locator('.activity-bounds');
|
||||||
|
|
||||||
// Goto baseURL
|
// Goto baseURL
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
const timestrip = await test.step("Create a Time Strip", async () => {
|
const timestrip = await test.step('Create a Time Strip', async () => {
|
||||||
const createdTimeStrip = await createDomainObjectWithDefaults(page, { type: 'Time Strip' });
|
const createdTimeStrip = await createDomainObjectWithDefaults(page, { type: 'Time Strip' });
|
||||||
const objectName = await page.locator('.l-browse-bar__object-name').innerText();
|
const objectName = await page.locator('.l-browse-bar__object-name').innerText();
|
||||||
expect(objectName).toBe(createdTimeStrip.name);
|
expect(objectName).toBe(createdTimeStrip.name);
|
||||||
@@ -90,7 +95,7 @@ test.describe("Time Strip", () => {
|
|||||||
return createdTimeStrip;
|
return createdTimeStrip;
|
||||||
});
|
});
|
||||||
|
|
||||||
const plan = await test.step("Create a Plan and add it to the timestrip", async () => {
|
const plan = await test.step('Create a Plan and add it to the timestrip', async () => {
|
||||||
const createdPlan = await createPlanFromJSON(page, {
|
const createdPlan = await createPlanFromJSON(page, {
|
||||||
name: 'Test Plan',
|
name: 'Test Plan',
|
||||||
json: testPlan
|
json: testPlan
|
||||||
@@ -106,7 +111,9 @@ test.describe("Time Strip", () => {
|
|||||||
const endBound = testPlan.TEST_GROUP[testPlan.TEST_GROUP.length - 1].end;
|
const endBound = testPlan.TEST_GROUP[testPlan.TEST_GROUP.length - 1].end;
|
||||||
|
|
||||||
// Switch to fixed time mode with all plan events within the bounds
|
// 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 page.goto(
|
||||||
|
`${timestrip.url}?tc.mode=fixed&tc.startBound=${startBound}&tc.endBound=${endBound}&tc.timeSystem=utc&view=time-strip.view`
|
||||||
|
);
|
||||||
|
|
||||||
// Verify all events are displayed
|
// Verify all events are displayed
|
||||||
const eventCount = await page.locator('.activity-bounds').count();
|
const eventCount = await page.locator('.activity-bounds').count();
|
||||||
@@ -115,10 +122,8 @@ test.describe("Time Strip", () => {
|
|||||||
return createdPlan;
|
return createdPlan;
|
||||||
});
|
});
|
||||||
|
|
||||||
await test.step("TimeStrip can use the Independent Time Conductor", async () => {
|
await test.step('TimeStrip can use the Independent Time Conductor', async () => {
|
||||||
// Activate Independent Time Conductor in Fixed Time Mode
|
expect(await activityBounds.count()).toEqual(5);
|
||||||
await page.click('.c-toggle-switch__slider');
|
|
||||||
expect(await activityBounds.count()).toEqual(0);
|
|
||||||
|
|
||||||
// Set the independent time bounds so that only one event is shown
|
// Set the independent time bounds so that only one event is shown
|
||||||
const startBound = testPlan.TEST_GROUP[0].start;
|
const startBound = testPlan.TEST_GROUP[0].start;
|
||||||
@@ -126,20 +131,15 @@ test.describe("Time Strip", () => {
|
|||||||
const startBoundString = new Date(startBound).toISOString().replace('T', ' ');
|
const startBoundString = new Date(startBound).toISOString().replace('T', ' ');
|
||||||
const endBoundString = new Date(endBound).toISOString().replace('T', ' ');
|
const endBoundString = new Date(endBound).toISOString().replace('T', ' ');
|
||||||
|
|
||||||
await independentTimeConductorInputs.nth(0).fill('');
|
await setIndependentTimeConductorBounds(page, startBoundString, endBoundString);
|
||||||
await independentTimeConductorInputs.nth(0).fill(startBoundString);
|
|
||||||
await page.keyboard.press('Enter');
|
|
||||||
await independentTimeConductorInputs.nth(1).fill('');
|
|
||||||
await independentTimeConductorInputs.nth(1).fill(endBoundString);
|
|
||||||
await page.keyboard.press('Enter');
|
|
||||||
expect(await activityBounds.count()).toEqual(1);
|
expect(await activityBounds.count()).toEqual(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
await test.step("Can have multiple TimeStrips with the same plan linked and different Independent Time Contexts", async () => {
|
await test.step('Can have multiple TimeStrips with the same plan linked and different Independent Time Contexts', async () => {
|
||||||
// Create another Time Strip and verify that it has been created
|
// Create another Time Strip and verify that it has been created
|
||||||
const createdTimeStrip = await createDomainObjectWithDefaults(page, {
|
const createdTimeStrip = await createDomainObjectWithDefaults(page, {
|
||||||
type: 'Time Strip',
|
type: 'Time Strip',
|
||||||
name: "Another Time Strip"
|
name: 'Another Time Strip'
|
||||||
});
|
});
|
||||||
|
|
||||||
const objectName = await page.locator('.l-browse-bar__object-name').innerText();
|
const objectName = await page.locator('.l-browse-bar__object-name').innerText();
|
||||||
@@ -150,9 +150,6 @@ test.describe("Time Strip", () => {
|
|||||||
await page.click("button[title='Save']");
|
await page.click("button[title='Save']");
|
||||||
await page.click("li[title='Save and Finish Editing']");
|
await page.click("li[title='Save and Finish Editing']");
|
||||||
|
|
||||||
// Activate Independent Time Conductor in Fixed Time Mode
|
|
||||||
await page.click('.c-toggle-switch__slider');
|
|
||||||
|
|
||||||
// All events should be displayed at this point because the
|
// All events should be displayed at this point because the
|
||||||
// initial independent context bounds will match the global bounds
|
// initial independent context bounds will match the global bounds
|
||||||
expect(await activityBounds.count()).toEqual(5);
|
expect(await activityBounds.count()).toEqual(5);
|
||||||
@@ -163,12 +160,7 @@ test.describe("Time Strip", () => {
|
|||||||
const startBoundString = new Date(startBound).toISOString().replace('T', ' ');
|
const startBoundString = new Date(startBound).toISOString().replace('T', ' ');
|
||||||
const endBoundString = new Date(endBound).toISOString().replace('T', ' ');
|
const endBoundString = new Date(endBound).toISOString().replace('T', ' ');
|
||||||
|
|
||||||
await independentTimeConductorInputs.nth(0).fill('');
|
await setIndependentTimeConductorBounds(page, startBoundString, endBoundString);
|
||||||
await independentTimeConductorInputs.nth(0).fill(startBoundString);
|
|
||||||
await page.keyboard.press('Enter');
|
|
||||||
await independentTimeConductorInputs.nth(1).fill('');
|
|
||||||
await independentTimeConductorInputs.nth(1).fill(endBoundString);
|
|
||||||
await page.keyboard.press('Enter');
|
|
||||||
|
|
||||||
// Verify that two events are displayed
|
// Verify that two events are displayed
|
||||||
expect(await activityBounds.count()).toEqual(2);
|
expect(await activityBounds.count()).toEqual(2);
|
||||||
|
|||||||
@@ -27,40 +27,40 @@ This test suite is dedicated to tests which verify the basic operations surround
|
|||||||
const { test, expect } = require('../../../../baseFixtures');
|
const { test, expect } = require('../../../../baseFixtures');
|
||||||
|
|
||||||
test.describe('Clock Generator CRUD Operations', () => {
|
test.describe('Clock Generator CRUD Operations', () => {
|
||||||
|
test('Timezone dropdown will collapse when clicked outside or on dropdown icon again', async ({
|
||||||
test('Timezone dropdown will collapse when clicked outside or on dropdown icon again', async ({ page }) => {
|
page
|
||||||
|
}) => {
|
||||||
test.info().annotations.push({
|
test.info().annotations.push({
|
||||||
type: 'issue',
|
type: 'issue',
|
||||||
description: 'https://github.com/nasa/openmct/issues/4878'
|
description: 'https://github.com/nasa/openmct/issues/4878'
|
||||||
});
|
});
|
||||||
//Go to baseURL
|
//Go to baseURL
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
//Click the Create button
|
//Click the Create button
|
||||||
await page.click('button:has-text("Create")');
|
await page.click('button:has-text("Create")');
|
||||||
|
|
||||||
// Click Clock
|
// Click Clock
|
||||||
await page.click('text=Clock');
|
await page.getByRole('menuitem').first().click();
|
||||||
|
|
||||||
// Click .icon-arrow-down
|
// Click .icon-arrow-down
|
||||||
await page.locator('.icon-arrow-down').click();
|
await page.locator('.icon-arrow-down').click();
|
||||||
//verify if the autocomplete dropdown is visible
|
//verify if the autocomplete dropdown is visible
|
||||||
await expect(page.locator(".c-input--autocomplete__options")).toBeVisible();
|
await expect(page.locator('.c-input--autocomplete__options')).toBeVisible();
|
||||||
// Click .icon-arrow-down
|
// Click .icon-arrow-down
|
||||||
await page.locator('.icon-arrow-down').click();
|
await page.locator('.icon-arrow-down').click();
|
||||||
|
|
||||||
// Verify clicking on the autocomplete arrow collapses the dropdown
|
// Verify clicking on the autocomplete arrow collapses the dropdown
|
||||||
await expect(page.locator(".c-input--autocomplete__options")).toBeHidden();
|
await expect(page.locator('.c-input--autocomplete__options')).toBeHidden();
|
||||||
|
|
||||||
// Click timezone input to open dropdown
|
// Click timezone input to open dropdown
|
||||||
await page.locator('.c-input--autocomplete__input').click();
|
await page.locator('.c-input--autocomplete__input').click();
|
||||||
//verify if the autocomplete dropdown is visible
|
//verify if the autocomplete dropdown is visible
|
||||||
await expect(page.locator(".c-input--autocomplete__options")).toBeVisible();
|
await expect(page.locator('.c-input--autocomplete__options')).toBeVisible();
|
||||||
|
|
||||||
// Verify clicking outside the autocomplete dropdown collapses it
|
// Verify clicking outside the autocomplete dropdown collapses it
|
||||||
await page.locator('text=Timezone').click();
|
await page.locator('text=Timezone').click();
|
||||||
// Verify clicking on the autocomplete arrow collapses the dropdown
|
// Verify clicking on the autocomplete arrow collapses the dropdown
|
||||||
await expect(page.locator(".c-input--autocomplete__options")).toBeHidden();
|
await expect(page.locator('.c-input--autocomplete__options')).toBeHidden();
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -22,12 +22,15 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
This test suite is dedicated to tests which verify the basic operations surrounding conditionSets. Note: this
|
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. Implimenting in this way to
|
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.
|
demonstrate some playwright for test developers. This pattern should not be re-used in other CRUD suites.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const { test, expect } = require('../../../../pluginFixtures.js');
|
const { test, expect } = require('../../../../pluginFixtures.js');
|
||||||
const { createDomainObjectWithDefaults } = require('../../../../appActions');
|
const {
|
||||||
|
createDomainObjectWithDefaults,
|
||||||
|
createExampleTelemetryObject
|
||||||
|
} = require('../../../../appActions');
|
||||||
|
|
||||||
let conditionSetUrl;
|
let conditionSetUrl;
|
||||||
let getConditionSetIdentifierFromUrl;
|
let getConditionSetIdentifierFromUrl;
|
||||||
@@ -37,15 +40,12 @@ test.describe.serial('Condition Set CRUD Operations on @localStorage', () => {
|
|||||||
//TODO: This needs to be refactored
|
//TODO: This needs to be refactored
|
||||||
const context = await browser.newContext();
|
const context = await browser.newContext();
|
||||||
const page = await context.newPage();
|
const page = await context.newPage();
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
await page.click('button:has-text("Create")');
|
await page.click('button:has-text("Create")');
|
||||||
|
|
||||||
await page.locator('li[role="menuitem"]:has-text("Condition Set")').click();
|
await page.locator('li[role="menuitem"]:has-text("Condition Set")').click();
|
||||||
|
|
||||||
await Promise.all([
|
await Promise.all([page.waitForNavigation(), page.click('button:has-text("OK")')]);
|
||||||
page.waitForNavigation(),
|
|
||||||
page.click('button:has-text("OK")')
|
|
||||||
]);
|
|
||||||
|
|
||||||
//Save localStorage for future test execution
|
//Save localStorage for future test execution
|
||||||
await context.storageState({ path: './e2e/test-data/recycled_local_storage.json' });
|
await context.storageState({ path: './e2e/test-data/recycled_local_storage.json' });
|
||||||
@@ -62,27 +62,29 @@ test.describe.serial('Condition Set CRUD Operations on @localStorage', () => {
|
|||||||
test.use({ storageState: './e2e/test-data/recycled_local_storage.json' });
|
test.use({ storageState: './e2e/test-data/recycled_local_storage.json' });
|
||||||
|
|
||||||
//Begin suite of tests again localStorage
|
//Begin suite of tests again localStorage
|
||||||
test('Condition set object properties persist in main view and inspector @localStorage', async ({ page }) => {
|
test('Condition set object properties persist in main view and inspector @localStorage', async ({
|
||||||
|
page
|
||||||
|
}) => {
|
||||||
//Navigate to baseURL with injected localStorage
|
//Navigate to baseURL with injected localStorage
|
||||||
await page.goto(conditionSetUrl, { waitUntil: 'networkidle' });
|
await page.goto(conditionSetUrl, { waitUntil: 'networkidle' });
|
||||||
|
|
||||||
//Assertions on loaded Condition Set in main view. This is a stateful transition step after page.goto()
|
//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
|
||||||
|
.soft(page.locator('.l-browse-bar__object-name'))
|
||||||
|
.toContainText('Unnamed Condition Set');
|
||||||
|
|
||||||
//Assertions on loaded Condition Set in Inspector
|
//Assertions on loaded Condition Set in Inspector
|
||||||
expect.soft(page.locator('_vue=item.name=Unnamed Condition Set')).toBeTruthy();
|
expect.soft(page.locator('_vue=item.name=Unnamed Condition Set')).toBeTruthy();
|
||||||
|
|
||||||
//Reload Page
|
//Reload Page
|
||||||
await Promise.all([
|
await Promise.all([page.reload(), page.waitForLoadState('networkidle')]);
|
||||||
page.reload(),
|
|
||||||
page.waitForLoadState('networkidle')
|
|
||||||
]);
|
|
||||||
|
|
||||||
//Re-verify after reload
|
//Re-verify after reload
|
||||||
await expect.soft(page.locator('.l-browse-bar__object-name')).toContainText('Unnamed Condition Set');
|
await expect
|
||||||
|
.soft(page.locator('.l-browse-bar__object-name'))
|
||||||
|
.toContainText('Unnamed Condition Set');
|
||||||
//Assertions on loaded Condition Set in Inspector
|
//Assertions on loaded Condition Set in Inspector
|
||||||
expect.soft(page.locator('_vue=item.name=Unnamed Condition Set')).toBeTruthy();
|
expect.soft(page.locator('_vue=item.name=Unnamed Condition Set')).toBeTruthy();
|
||||||
|
|
||||||
});
|
});
|
||||||
test('condition set object can be modified on @localStorage', async ({ page, openmctConfig }) => {
|
test('condition set object can be modified on @localStorage', async ({ page, openmctConfig }) => {
|
||||||
const { myItemsFolderName } = openmctConfig;
|
const { myItemsFolderName } = openmctConfig;
|
||||||
@@ -90,22 +92,37 @@ test.describe.serial('Condition Set CRUD Operations on @localStorage', () => {
|
|||||||
await page.goto(conditionSetUrl, { waitUntil: 'networkidle' });
|
await page.goto(conditionSetUrl, { waitUntil: 'networkidle' });
|
||||||
|
|
||||||
//Assertions on loaded Condition Set in main view. This is a stateful transition step after page.goto()
|
//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
|
||||||
|
.soft(page.locator('.l-browse-bar__object-name'))
|
||||||
|
.toContainText('Unnamed Condition Set');
|
||||||
|
|
||||||
//Update the Condition Set properties
|
//Update the Condition Set properties
|
||||||
// Click Edit Button
|
// Click Edit Button
|
||||||
await page.locator('text=Conditions View Snapshot >> button').nth(3).click();
|
await page.locator('text=Conditions View Snapshot >> button').nth(3).click();
|
||||||
|
|
||||||
//Edit Condition Set Name from main view
|
//Edit Condition Set Name from main view
|
||||||
await page.locator('.l-browse-bar__object-name').filter({ hasText: 'Unnamed Condition Set' }).first().fill('Renamed Condition Set');
|
await page
|
||||||
await page.locator('.l-browse-bar__object-name').filter({ hasText: 'Renamed Condition Set' }).first().press('Enter');
|
.locator('.l-browse-bar__object-name')
|
||||||
|
.filter({ hasText: 'Unnamed Condition Set' })
|
||||||
|
.first()
|
||||||
|
.fill('Renamed Condition Set');
|
||||||
|
await page
|
||||||
|
.locator('.l-browse-bar__object-name')
|
||||||
|
.filter({ hasText: 'Renamed Condition Set' })
|
||||||
|
.first()
|
||||||
|
.press('Enter');
|
||||||
// Click Save Button
|
// Click Save Button
|
||||||
await page.locator('text=Snapshot Save and Finish Editing Save and Continue Editing >> button').nth(1).click();
|
await page
|
||||||
|
.locator('text=Snapshot Save and Finish Editing Save and Continue Editing >> button')
|
||||||
|
.nth(1)
|
||||||
|
.click();
|
||||||
// Click Save and Finish Editing Option
|
// Click Save and Finish Editing Option
|
||||||
await page.locator('text=Save and Finish Editing').click();
|
await page.locator('text=Save and Finish Editing').click();
|
||||||
|
|
||||||
//Verify Main section reflects updated Name Property
|
//Verify Main section reflects updated Name Property
|
||||||
await expect.soft(page.locator('.l-browse-bar__object-name')).toContainText('Renamed Condition Set');
|
await expect
|
||||||
|
.soft(page.locator('.l-browse-bar__object-name'))
|
||||||
|
.toContainText('Renamed Condition Set');
|
||||||
|
|
||||||
// Verify Inspector properties
|
// Verify Inspector properties
|
||||||
// Verify Inspector has updated Name property
|
// Verify Inspector has updated Name property
|
||||||
@@ -113,7 +130,7 @@ test.describe.serial('Condition Set CRUD Operations on @localStorage', () => {
|
|||||||
// Verify Inspector Details has updated Name property
|
// Verify Inspector Details has updated Name property
|
||||||
expect.soft(page.locator('text=Renamed Condition Set').nth(2)).toBeTruthy();
|
expect.soft(page.locator('text=Renamed Condition Set').nth(2)).toBeTruthy();
|
||||||
|
|
||||||
// Verify Tree reflects updated Name proprety
|
// Verify Tree reflects updated Name property
|
||||||
// Expand Tree
|
// Expand Tree
|
||||||
await page.locator(`text=Open MCT ${myItemsFolderName} >> span >> nth=3`).click();
|
await page.locator(`text=Open MCT ${myItemsFolderName} >> span >> nth=3`).click();
|
||||||
// Verify Condition Set Object is renamed in Tree
|
// Verify Condition Set Object is renamed in Tree
|
||||||
@@ -123,13 +140,12 @@ test.describe.serial('Condition Set CRUD Operations on @localStorage', () => {
|
|||||||
expect(page.locator('a:has-text("Renamed Condition Set")')).toBeTruthy();
|
expect(page.locator('a:has-text("Renamed Condition Set")')).toBeTruthy();
|
||||||
|
|
||||||
//Reload Page
|
//Reload Page
|
||||||
await Promise.all([
|
await Promise.all([page.reload(), page.waitForLoadState('networkidle')]);
|
||||||
page.reload(),
|
|
||||||
page.waitForLoadState('networkidle')
|
|
||||||
]);
|
|
||||||
|
|
||||||
//Verify Main section reflects updated Name Property
|
//Verify Main section reflects updated Name Property
|
||||||
await expect.soft(page.locator('.l-browse-bar__object-name')).toContainText('Renamed Condition Set');
|
await expect
|
||||||
|
.soft(page.locator('.l-browse-bar__object-name'))
|
||||||
|
.toContainText('Renamed Condition Set');
|
||||||
|
|
||||||
// Verify Inspector properties
|
// Verify Inspector properties
|
||||||
// Verify Inspector has updated Name property
|
// Verify Inspector has updated Name property
|
||||||
@@ -137,7 +153,7 @@ test.describe.serial('Condition Set CRUD Operations on @localStorage', () => {
|
|||||||
// Verify Inspector Details has updated Name property
|
// Verify Inspector Details has updated Name property
|
||||||
expect.soft(page.locator('text=Renamed Condition Set').nth(2)).toBeTruthy();
|
expect.soft(page.locator('text=Renamed Condition Set').nth(2)).toBeTruthy();
|
||||||
|
|
||||||
// Verify Tree reflects updated Name proprety
|
// Verify Tree reflects updated Name property
|
||||||
// Expand Tree
|
// Expand Tree
|
||||||
await page.locator(`text=Open MCT ${myItemsFolderName} >> span >> nth=3`).click();
|
await page.locator(`text=Open MCT ${myItemsFolderName} >> span >> nth=3`).click();
|
||||||
// Verify Condition Set Object is renamed in Tree
|
// Verify Condition Set Object is renamed in Tree
|
||||||
@@ -146,19 +162,30 @@ test.describe.serial('Condition Set CRUD Operations on @localStorage', () => {
|
|||||||
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').fill('Renamed');
|
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').fill('Renamed');
|
||||||
expect(page.locator('a:has-text("Renamed Condition Set")')).toBeTruthy();
|
expect(page.locator('a:has-text("Renamed Condition Set")')).toBeTruthy();
|
||||||
});
|
});
|
||||||
test('condition set object can be deleted by Search Tree Actions menu on @localStorage', async ({ page }) => {
|
test('condition set object can be deleted by Search Tree Actions menu on @localStorage', async ({
|
||||||
|
page
|
||||||
|
}) => {
|
||||||
//Navigate to baseURL
|
//Navigate to baseURL
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
//Assertions on loaded Condition Set in main view. This is a stateful transition step after page.goto()
|
//Assertions on loaded Condition Set in main view. This is a stateful transition step after page.goto()
|
||||||
await expect(page.locator('a:has-text("Unnamed Condition Set Condition Set") >> nth=0')).toBeVisible();
|
await expect(
|
||||||
|
page.locator('a:has-text("Unnamed Condition Set Condition Set") >> nth=0')
|
||||||
|
).toBeVisible();
|
||||||
|
|
||||||
const numberOfConditionSetsToStart = await page.locator('a:has-text("Unnamed Condition Set Condition Set")').count();
|
const numberOfConditionSetsToStart = await page
|
||||||
|
.locator('a:has-text("Unnamed Condition Set Condition Set")')
|
||||||
|
.count();
|
||||||
|
|
||||||
// Search for Unnamed Condition Set
|
// Search for Unnamed Condition Set
|
||||||
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').fill('Unnamed Condition Set');
|
await page
|
||||||
|
.locator('[aria-label="OpenMCT Search"] input[type="search"]')
|
||||||
|
.fill('Unnamed Condition Set');
|
||||||
// Click Search Result
|
// Click Search Result
|
||||||
await page.locator('[aria-label="OpenMCT Search"] >> text=Unnamed Condition Set').first().click();
|
await page
|
||||||
|
.locator('[aria-label="OpenMCT Search"] >> text=Unnamed Condition Set')
|
||||||
|
.first()
|
||||||
|
.click();
|
||||||
// Click hamburger button
|
// Click hamburger button
|
||||||
await page.locator('[title="More options"]').click();
|
await page.locator('[title="More options"]').click();
|
||||||
|
|
||||||
@@ -167,7 +194,9 @@ test.describe.serial('Condition Set CRUD Operations on @localStorage', () => {
|
|||||||
await page.locator('button:has-text("OK")').click();
|
await page.locator('button:has-text("OK")').click();
|
||||||
|
|
||||||
//Expect Unnamed Condition Set to be removed in Main View
|
//Expect Unnamed Condition Set to be removed in Main View
|
||||||
const numberOfConditionSetsAtEnd = await page.locator('a:has-text("Unnamed Condition Set Condition Set")').count();
|
const numberOfConditionSetsAtEnd = await page
|
||||||
|
.locator('a:has-text("Unnamed Condition Set Condition Set")')
|
||||||
|
.count();
|
||||||
|
|
||||||
expect(numberOfConditionSetsAtEnd).toEqual(numberOfConditionSetsToStart - 1);
|
expect(numberOfConditionSetsAtEnd).toEqual(numberOfConditionSetsToStart - 1);
|
||||||
|
|
||||||
@@ -175,28 +204,35 @@ test.describe.serial('Condition Set CRUD Operations on @localStorage', () => {
|
|||||||
//Domain Object is still available by direct URL after delete
|
//Domain Object is still available by direct URL after delete
|
||||||
await page.goto(conditionSetUrl, { waitUntil: 'networkidle' });
|
await page.goto(conditionSetUrl, { waitUntil: 'networkidle' });
|
||||||
await expect(page.locator('.l-browse-bar__object-name')).toContainText('Unnamed Condition Set');
|
await expect(page.locator('.l-browse-bar__object-name')).toContainText('Unnamed Condition Set');
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test.describe('Basic Condition Set Use', () => {
|
test.describe('Basic Condition Set Use', () => {
|
||||||
|
let conditionSet;
|
||||||
|
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
// Open a browser, navigate to the main page, and wait until all network events to resolve
|
// Open a browser, navigate to the main page, and wait until all network events to resolve
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
});
|
|
||||||
test('Can add a condition', async ({ page }) => {
|
|
||||||
// Create a new condition set
|
// Create a new condition set
|
||||||
await createDomainObjectWithDefaults(page, {
|
conditionSet = await createDomainObjectWithDefaults(page, {
|
||||||
type: 'Condition Set',
|
type: 'Condition Set',
|
||||||
name: "Test 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
|
// Change the object to edit mode
|
||||||
await page.locator('[title="Edit"]').click();
|
await page.locator('[title="Edit"]').click();
|
||||||
|
|
||||||
// Click Add Condition button
|
// Click Add Condition button
|
||||||
await page.locator('#addCondition').click();
|
await page.locator('#addCondition').click();
|
||||||
// Check that the new Unnamed Condition section appears
|
// Check that the new Unnamed Condition section appears
|
||||||
const numOfUnnamedConditions = await page.locator('text=Unnamed Condition').count();
|
const numOfUnnamedConditions = await page
|
||||||
|
.locator('.c-condition__name', { hasText: 'Unnamed Condition' })
|
||||||
|
.count();
|
||||||
expect(numOfUnnamedConditions).toEqual(1);
|
expect(numOfUnnamedConditions).toEqual(1);
|
||||||
});
|
});
|
||||||
test('ConditionSet should display appropriate view options', async ({ page }) => {
|
test('ConditionSet should display appropriate view options', async ({ page }) => {
|
||||||
@@ -207,37 +243,38 @@ test.describe('Basic Condition Set Use', () => {
|
|||||||
|
|
||||||
await createDomainObjectWithDefaults(page, {
|
await createDomainObjectWithDefaults(page, {
|
||||||
type: 'Sine Wave Generator',
|
type: 'Sine Wave Generator',
|
||||||
name: "Alpha Sine Wave Generator"
|
name: 'Alpha Sine Wave Generator'
|
||||||
});
|
});
|
||||||
await createDomainObjectWithDefaults(page, {
|
await createDomainObjectWithDefaults(page, {
|
||||||
type: 'Sine Wave Generator',
|
type: 'Sine Wave Generator',
|
||||||
name: "Beta Sine Wave Generator"
|
name: 'Beta Sine Wave Generator'
|
||||||
});
|
|
||||||
const conditionSet1 = await createDomainObjectWithDefaults(page, {
|
|
||||||
type: 'Condition Set',
|
|
||||||
name: "Test Condition Set"
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
await page.goto(conditionSet.url);
|
||||||
|
|
||||||
// Change the object to edit mode
|
// Change the object to edit mode
|
||||||
await page.locator('[title="Edit"]').click();
|
await page.locator('[title="Edit"]').click();
|
||||||
|
|
||||||
// Expand the 'My Items' folder in the left tree
|
// Expand the 'My Items' folder in the left tree
|
||||||
await page.goto(conditionSet1.url);
|
|
||||||
page.click('button[title="Show selected item in tree"]');
|
page.click('button[title="Show selected item in tree"]');
|
||||||
// Add the Alpha & Beta Sine Wave Generator to the Condition Set and save changes
|
// Add the Alpha & Beta Sine Wave Generator to the Condition Set and save changes
|
||||||
const treePane = page.getByRole('tree', {
|
const treePane = page.getByRole('tree', {
|
||||||
name: 'Main Tree'
|
name: 'Main Tree'
|
||||||
});
|
});
|
||||||
const alphaGeneratorTreeItem = treePane.getByRole('treeitem', { name: "Alpha Sine Wave Generator"});
|
const alphaGeneratorTreeItem = treePane.getByRole('treeitem', {
|
||||||
const betaGeneratorTreeItem = treePane.getByRole('treeitem', { name: "Beta Sine Wave Generator"});
|
name: 'Alpha Sine Wave Generator'
|
||||||
|
});
|
||||||
|
const betaGeneratorTreeItem = treePane.getByRole('treeitem', {
|
||||||
|
name: 'Beta Sine Wave Generator'
|
||||||
|
});
|
||||||
const conditionCollection = page.locator('#conditionCollection');
|
const conditionCollection = page.locator('#conditionCollection');
|
||||||
|
|
||||||
await alphaGeneratorTreeItem.dragTo(conditionCollection);
|
await alphaGeneratorTreeItem.dragTo(conditionCollection);
|
||||||
await betaGeneratorTreeItem.dragTo(conditionCollection);
|
await betaGeneratorTreeItem.dragTo(conditionCollection);
|
||||||
|
|
||||||
const saveButtonLocator = page.locator('button[title="Save"]');
|
await page.locator('button[title="Save"]').click();
|
||||||
await saveButtonLocator.click();
|
|
||||||
await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click();
|
await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click();
|
||||||
|
|
||||||
await page.click('button[title="Change the current view"]');
|
await page.click('button[title="Change the current view"]');
|
||||||
|
|
||||||
await expect(page.getByRole('menuitem', { name: /Lad Table/ })).toBeHidden();
|
await expect(page.getByRole('menuitem', { name: /Lad Table/ })).toBeHidden();
|
||||||
@@ -245,81 +282,89 @@ test.describe('Basic Condition Set Use', () => {
|
|||||||
await expect(page.getByRole('menuitem', { name: /Plot/ })).toBeVisible();
|
await expect(page.getByRole('menuitem', { name: /Plot/ })).toBeVisible();
|
||||||
await expect(page.getByRole('menuitem', { name: /Telemetry Table/ })).toBeVisible();
|
await expect(page.getByRole('menuitem', { name: /Telemetry Table/ })).toBeVisible();
|
||||||
});
|
});
|
||||||
test('ConditionSet should output blank instead of the default value', async ({ page }) => {
|
test('ConditionSet has correct outputs when telemetry is and is not available', async ({
|
||||||
//Navigate to baseURL
|
page
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
}) => {
|
||||||
|
const exampleTelemetry = await createExampleTelemetryObject(page);
|
||||||
|
|
||||||
//Click the Create button
|
await page.getByTitle('Show selected item in tree').click();
|
||||||
await page.click('button:has-text("Create")');
|
await page.goto(conditionSet.url);
|
||||||
|
|
||||||
// Click the object specified by 'type'
|
|
||||||
await page.click(`li[role='menuitem']:text("Sine Wave Generator")`);
|
|
||||||
await page.getByRole('spinbutton', { name: 'Loading Delay (ms)' }).fill('8000');
|
|
||||||
const nameInput = page.locator('form[name="mctForm"] .first input[type="text"]');
|
|
||||||
await nameInput.fill("Delayed Sine Wave Generator");
|
|
||||||
|
|
||||||
// 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')
|
|
||||||
]);
|
|
||||||
|
|
||||||
// Create a new condition set
|
|
||||||
await createDomainObjectWithDefaults(page, {
|
|
||||||
type: 'Condition Set',
|
|
||||||
name: "Test Blank Output of Condition Set"
|
|
||||||
});
|
|
||||||
// Change the object to edit mode
|
// Change the object to edit mode
|
||||||
await page.locator('[title="Edit"]').click();
|
await page.locator('[title="Edit"]').click();
|
||||||
|
|
||||||
// Click Add Condition button twice
|
// Create two conditions
|
||||||
await page.locator('#addCondition').click();
|
await page.locator('#addCondition').click();
|
||||||
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(0).fill('First Condition');
|
||||||
await page.locator('#conditionCollection').getByRole('textbox').nth(1).fill('Second Condition');
|
await page.locator('#conditionCollection').getByRole('textbox').nth(1).fill('Second Condition');
|
||||||
|
|
||||||
// Expand the 'My Items' folder in the left tree
|
// Add Telemetry to ConditionSet
|
||||||
await page.locator('.c-tree__item__view-control.c-disclosure-triangle').first().click();
|
const sineWaveGeneratorTreeItem = page
|
||||||
// Add the Sine Wave Generator to the Condition Set and save changes
|
.getByRole('tree', {
|
||||||
const treePane = page.getByRole('tree', {
|
|
||||||
name: 'Main Tree'
|
name: 'Main Tree'
|
||||||
|
})
|
||||||
|
.getByRole('treeitem', {
|
||||||
|
name: exampleTelemetry.name
|
||||||
});
|
});
|
||||||
const sineWaveGeneratorTreeItem = treePane.getByRole('treeitem', { name: "Delayed Sine Wave Generator"});
|
const conditionCollection = page.locator('#conditionCollection');
|
||||||
const conditionCollection = await page.locator('#conditionCollection');
|
|
||||||
|
|
||||||
await sineWaveGeneratorTreeItem.dragTo(conditionCollection);
|
await sineWaveGeneratorTreeItem.dragTo(conditionCollection);
|
||||||
|
|
||||||
const firstCriterionTelemetry = await page.locator('[aria-label="Criterion Telemetry Selection"] >> nth=0');
|
// Modify First Criterion
|
||||||
firstCriterionTelemetry.selectOption({ label: 'Delayed Sine Wave Generator' });
|
const firstCriterionTelemetry = page.locator(
|
||||||
|
'[aria-label="Criterion Telemetry Selection"] >> nth=0'
|
||||||
const secondCriterionTelemetry = await page.locator('[aria-label="Criterion Telemetry Selection"] >> nth=1');
|
);
|
||||||
secondCriterionTelemetry.selectOption({ label: 'Delayed Sine Wave Generator' });
|
firstCriterionTelemetry.selectOption({ label: exampleTelemetry.name });
|
||||||
|
const firstCriterionMetadata = page.locator(
|
||||||
const firstCriterionMetadata = await page.locator('[aria-label="Criterion Metadata Selection"] >> nth=0');
|
'[aria-label="Criterion Metadata Selection"] >> nth=0'
|
||||||
|
);
|
||||||
firstCriterionMetadata.selectOption({ label: 'Sine' });
|
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');
|
||||||
|
|
||||||
const secondCriterionMetadata = await page.locator('[aria-label="Criterion Metadata Selection"] >> nth=1');
|
// 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' });
|
secondCriterionMetadata.selectOption({ label: 'Sine' });
|
||||||
|
|
||||||
const firstCriterionComparison = await page.locator('[aria-label="Criterion Comparison Selection"] >> nth=0');
|
const secondCriterionComparison = page.locator(
|
||||||
firstCriterionComparison.selectOption({ label: 'is greater than or equal to' });
|
'[aria-label="Criterion Comparison Selection"] >> nth=1'
|
||||||
|
);
|
||||||
const secondCriterionComparison = await page.locator('[aria-label="Criterion Comparison Selection"] >> nth=1');
|
|
||||||
secondCriterionComparison.selectOption({ label: 'is less than' });
|
secondCriterionComparison.selectOption({ label: 'is less than' });
|
||||||
|
|
||||||
const firstCriterionInput = await page.locator('[aria-label="Criterion Input"] >> nth=0');
|
const secondCriterionInput = page.locator('[aria-label="Criterion Input"] >> nth=1');
|
||||||
await firstCriterionInput.fill("0");
|
await secondCriterionInput.fill('0');
|
||||||
|
|
||||||
const secondCriterionInput = await page.locator('[aria-label="Criterion Input"] >> nth=1');
|
// Save ConditionSet
|
||||||
await secondCriterionInput.fill("0");
|
await page.locator('button[title="Save"]').click();
|
||||||
|
|
||||||
const saveButtonLocator = page.locator('button[title="Save"]');
|
|
||||||
await saveButtonLocator.click();
|
|
||||||
await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click();
|
await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click();
|
||||||
|
|
||||||
const outputValue = await page.locator('[aria-label="Current Output Value"]');
|
// 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"]');
|
||||||
|
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 options').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('---');
|
await expect(outputValue).toHaveText('---');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -21,13 +21,19 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
const { test, expect } = require('../../../../pluginFixtures');
|
const { test, expect } = require('../../../../pluginFixtures');
|
||||||
const { createDomainObjectWithDefaults, setStartOffset, setFixedTimeMode, setRealTimeMode } = require('../../../../appActions');
|
const {
|
||||||
|
createDomainObjectWithDefaults,
|
||||||
|
setStartOffset,
|
||||||
|
setFixedTimeMode,
|
||||||
|
setRealTimeMode,
|
||||||
|
setIndependentTimeConductorBounds
|
||||||
|
} = require('../../../../appActions');
|
||||||
|
|
||||||
test.describe('Display Layout', () => {
|
test.describe('Display Layout', () => {
|
||||||
/** @type {import('../../../../appActions').CreatedObjectInfo} */
|
/** @type {import('../../../../appActions').CreatedObjectInfo} */
|
||||||
let sineWaveObject;
|
let sineWaveObject;
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
await setRealTimeMode(page);
|
await setRealTimeMode(page);
|
||||||
|
|
||||||
// Create Sine Wave Generator
|
// Create Sine Wave Generator
|
||||||
@@ -35,11 +41,13 @@ test.describe('Display Layout', () => {
|
|||||||
type: 'Sine Wave Generator'
|
type: 'Sine Wave Generator'
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
test('alpha-numeric widget telemetry value exactly matches latest telemetry value received in real time', async ({ page }) => {
|
test('alpha-numeric widget telemetry value exactly matches latest telemetry value received in real time', async ({
|
||||||
|
page
|
||||||
|
}) => {
|
||||||
// Create a Display Layout
|
// Create a Display Layout
|
||||||
await createDomainObjectWithDefaults(page, {
|
await createDomainObjectWithDefaults(page, {
|
||||||
type: 'Display Layout',
|
type: 'Display Layout',
|
||||||
name: "Test Display Layout"
|
name: 'Test Display Layout'
|
||||||
});
|
});
|
||||||
// Edit Display Layout
|
// Edit Display Layout
|
||||||
await page.locator('[title="Edit"]').click();
|
await page.locator('[title="Edit"]').click();
|
||||||
@@ -63,17 +71,21 @@ test.describe('Display Layout', () => {
|
|||||||
// from the Sine Wave Generator
|
// from the Sine Wave Generator
|
||||||
const getTelemValuePromise = await subscribeToTelemetry(page, sineWaveObject.uuid);
|
const getTelemValuePromise = await subscribeToTelemetry(page, sineWaveObject.uuid);
|
||||||
const formattedTelemetryValue = getTelemValuePromise;
|
const formattedTelemetryValue = getTelemValuePromise;
|
||||||
const displayLayoutValuePromise = await page.waitForSelector(`text="${formattedTelemetryValue}"`);
|
const displayLayoutValuePromise = await page.waitForSelector(
|
||||||
|
`text="${formattedTelemetryValue}"`
|
||||||
|
);
|
||||||
const displayLayoutValue = await displayLayoutValuePromise.textContent();
|
const displayLayoutValue = await displayLayoutValuePromise.textContent();
|
||||||
const trimmedDisplayValue = displayLayoutValue.trim();
|
const trimmedDisplayValue = displayLayoutValue.trim();
|
||||||
|
|
||||||
expect(trimmedDisplayValue).toBe(formattedTelemetryValue);
|
expect(trimmedDisplayValue).toBe(formattedTelemetryValue);
|
||||||
});
|
});
|
||||||
test('alpha-numeric widget telemetry value exactly matches latest telemetry value received in fixed time', async ({ page }) => {
|
test('alpha-numeric widget telemetry value exactly matches latest telemetry value received in fixed time', async ({
|
||||||
|
page
|
||||||
|
}) => {
|
||||||
// Create a Display Layout
|
// Create a Display Layout
|
||||||
await createDomainObjectWithDefaults(page, {
|
await createDomainObjectWithDefaults(page, {
|
||||||
type: 'Display Layout',
|
type: 'Display Layout',
|
||||||
name: "Test Display Layout"
|
name: 'Test Display Layout'
|
||||||
});
|
});
|
||||||
// Edit Display Layout
|
// Edit Display Layout
|
||||||
await page.locator('[title="Edit"]').click();
|
await page.locator('[title="Edit"]').click();
|
||||||
@@ -101,17 +113,21 @@ test.describe('Display Layout', () => {
|
|||||||
// On getting data, check if the value found in the Display Layout is the most recent value
|
// On getting data, check if the value found in the Display Layout is the most recent value
|
||||||
// from the Sine Wave Generator
|
// from the Sine Wave Generator
|
||||||
const formattedTelemetryValue = getTelemValuePromise;
|
const formattedTelemetryValue = getTelemValuePromise;
|
||||||
const displayLayoutValuePromise = await page.waitForSelector(`text="${formattedTelemetryValue}"`);
|
const displayLayoutValuePromise = await page.waitForSelector(
|
||||||
|
`text="${formattedTelemetryValue}"`
|
||||||
|
);
|
||||||
const displayLayoutValue = await displayLayoutValuePromise.textContent();
|
const displayLayoutValue = await displayLayoutValuePromise.textContent();
|
||||||
const trimmedDisplayValue = displayLayoutValue.trim();
|
const trimmedDisplayValue = displayLayoutValue.trim();
|
||||||
|
|
||||||
expect(trimmedDisplayValue).toBe(formattedTelemetryValue);
|
expect(trimmedDisplayValue).toBe(formattedTelemetryValue);
|
||||||
});
|
});
|
||||||
test('items in a display layout can be removed with object tree context menu when viewing the display layout', async ({ page }) => {
|
test('items in a display layout can be removed with object tree context menu when viewing the display layout', async ({
|
||||||
|
page
|
||||||
|
}) => {
|
||||||
// Create a Display Layout
|
// Create a Display Layout
|
||||||
await createDomainObjectWithDefaults(page, {
|
await createDomainObjectWithDefaults(page, {
|
||||||
type: 'Display Layout',
|
type: 'Display Layout',
|
||||||
name: "Test Display Layout"
|
name: 'Test Display Layout'
|
||||||
});
|
});
|
||||||
// Edit Display Layout
|
// Edit Display Layout
|
||||||
await page.locator('[title="Edit"]').click();
|
await page.locator('[title="Edit"]').click();
|
||||||
@@ -144,7 +160,9 @@ test.describe('Display Layout', () => {
|
|||||||
|
|
||||||
expect(await page.locator('.l-layout .l-layout__frame').count()).toEqual(0);
|
expect(await page.locator('.l-layout .l-layout__frame').count()).toEqual(0);
|
||||||
});
|
});
|
||||||
test('items in a display layout can be removed with object tree context menu when viewing another item', async ({ page }) => {
|
test('items in a display layout can be removed with object tree context menu when viewing another item', async ({
|
||||||
|
page
|
||||||
|
}) => {
|
||||||
test.info().annotations.push({
|
test.info().annotations.push({
|
||||||
type: 'issue',
|
type: 'issue',
|
||||||
description: 'https://github.com/nasa/openmct/issues/3117'
|
description: 'https://github.com/nasa/openmct/issues/3117'
|
||||||
@@ -188,6 +206,132 @@ test.describe('Display Layout', () => {
|
|||||||
|
|
||||||
expect(await page.locator('.l-layout .l-layout__frame').count()).toEqual(0);
|
expect(await page.locator('.l-layout .l-layout__frame').count()).toEqual(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('independent time works with display layouts and its children', async ({ page }) => {
|
||||||
|
await setFixedTimeMode(page);
|
||||||
|
// Create Example Imagery
|
||||||
|
const exampleImageryObject = await createDomainObjectWithDefaults(page, {
|
||||||
|
type: 'Example Imagery'
|
||||||
|
});
|
||||||
|
// Create a Display Layout
|
||||||
|
await createDomainObjectWithDefaults(page, {
|
||||||
|
type: 'Display Layout'
|
||||||
|
});
|
||||||
|
// Edit Display Layout
|
||||||
|
await page.locator('[title="Edit"]').click();
|
||||||
|
|
||||||
|
// 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 Display Layout and save changes
|
||||||
|
const treePane = page.getByRole('tree', {
|
||||||
|
name: 'Main Tree'
|
||||||
|
});
|
||||||
|
const exampleImageryTreeItem = treePane.getByRole('treeitem', {
|
||||||
|
name: new RegExp(exampleImageryObject.name)
|
||||||
|
});
|
||||||
|
let layoutGridHolder = page.locator('.l-layout__grid-holder');
|
||||||
|
await exampleImageryTreeItem.dragTo(layoutGridHolder);
|
||||||
|
|
||||||
|
//adjust so that we can see the independent time conductor toggle
|
||||||
|
// Adjust object height
|
||||||
|
await page.locator('div[title="Resize object height"] > input').click();
|
||||||
|
await page.locator('div[title="Resize object height"] > input').fill('70');
|
||||||
|
|
||||||
|
// Adjust object width
|
||||||
|
await page.locator('div[title="Resize object width"] > input').click();
|
||||||
|
await page.locator('div[title="Resize object width"] > input').fill('70');
|
||||||
|
|
||||||
|
await page.locator('button[title="Save"]').click();
|
||||||
|
await page.locator('text=Save and Finish Editing').click();
|
||||||
|
|
||||||
|
const startDate = '2021-12-30 01:01:00.000Z';
|
||||||
|
const endDate = '2021-12-30 01:11:00.000Z';
|
||||||
|
await setIndependentTimeConductorBounds(page, startDate, endDate);
|
||||||
|
|
||||||
|
// check image date
|
||||||
|
await expect(page.getByText('2021-12-30 01:11:00.000Z').first()).toBeVisible();
|
||||||
|
|
||||||
|
// flip it off
|
||||||
|
await page.getByRole('switch').click();
|
||||||
|
// timestamp shouldn't be in the past anymore
|
||||||
|
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 ({
|
||||||
|
page
|
||||||
|
}) => {
|
||||||
|
await setFixedTimeMode(page);
|
||||||
|
// Create another Sine Wave Generator
|
||||||
|
const anotherSineWaveObject = await createDomainObjectWithDefaults(page, {
|
||||||
|
type: 'Sine Wave Generator'
|
||||||
|
});
|
||||||
|
// Create a Display Layout
|
||||||
|
await createDomainObjectWithDefaults(page, {
|
||||||
|
type: 'Display Layout',
|
||||||
|
name: 'Test Display Layout'
|
||||||
|
});
|
||||||
|
// Edit Display Layout
|
||||||
|
await page.locator('[title="Edit"]').click();
|
||||||
|
|
||||||
|
// 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 Display Layout and save changes
|
||||||
|
const treePane = page.getByRole('tree', {
|
||||||
|
name: 'Main Tree'
|
||||||
|
});
|
||||||
|
const sineWaveGeneratorTreeItem = treePane.getByRole('treeitem', {
|
||||||
|
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 page.getByText('View type').click();
|
||||||
|
await page.getByText('Overlay Plot').click();
|
||||||
|
|
||||||
|
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 page.getByText('View type').click();
|
||||||
|
await page.getByText('Overlay Plot').click();
|
||||||
|
|
||||||
|
await page.locator('button[title="Save"]').click();
|
||||||
|
await page.locator('text=Save and Finish Editing').click();
|
||||||
|
|
||||||
|
// Time to inspect some network traffic
|
||||||
|
let networkRequests = [];
|
||||||
|
page.on('request', (request) => {
|
||||||
|
const searchRequest = request.url().endsWith('_find');
|
||||||
|
const fetchRequest = request.resourceType() === 'fetch';
|
||||||
|
if (searchRequest && fetchRequest) {
|
||||||
|
networkRequests.push(request);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
await page.reload();
|
||||||
|
|
||||||
|
// wait for annotations requests to be batched and requested
|
||||||
|
await page.waitForLoadState('networkidle');
|
||||||
|
// Network requests for the composite telemetry with multiple items should be:
|
||||||
|
// 1. a single batched request for annotations
|
||||||
|
expect(networkRequests.length).toBe(1);
|
||||||
|
|
||||||
|
await setRealTimeMode(page);
|
||||||
|
networkRequests = [];
|
||||||
|
|
||||||
|
await page.reload();
|
||||||
|
|
||||||
|
// wait for annotations to not load (if we have any, we've got a problem)
|
||||||
|
await page.waitForLoadState('networkidle');
|
||||||
|
|
||||||
|
// In real time mode, we don't fetch annotations at all
|
||||||
|
expect(networkRequests.length).toBe(0);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -200,7 +344,9 @@ test.describe('Display Layout', () => {
|
|||||||
* @returns {Promise<string>} the formatted sin telemetry value
|
* @returns {Promise<string>} the formatted sin telemetry value
|
||||||
*/
|
*/
|
||||||
async function subscribeToTelemetry(page, objectIdentifier) {
|
async function subscribeToTelemetry(page, objectIdentifier) {
|
||||||
const getTelemValuePromise = new Promise(resolve => page.exposeFunction('getTelemValue', resolve));
|
const getTelemValuePromise = new Promise((resolve) =>
|
||||||
|
page.exposeFunction('getTelemValue', resolve)
|
||||||
|
);
|
||||||
|
|
||||||
await page.evaluate(async (telemetryIdentifier) => {
|
await page.evaluate(async (telemetryIdentifier) => {
|
||||||
const telemetryObject = await window.openmct.objects.get(telemetryIdentifier);
|
const telemetryObject = await window.openmct.objects.get(telemetryIdentifier);
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
const { test, expect } = require('../../../../pluginFixtures');
|
const { test, expect } = require('../../../../pluginFixtures');
|
||||||
const utils = require('../../../../helper/faultUtils');
|
const utils = require('../../../../helper/faultUtils');
|
||||||
|
const { selectInspectorTab } = require('../../../../appActions');
|
||||||
|
|
||||||
test.describe('The Fault Management Plugin using example faults', () => {
|
test.describe('The Fault Management Plugin using example faults', () => {
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
@@ -35,27 +36,45 @@ test.describe('The Fault Management Plugin using example faults', () => {
|
|||||||
expect.soft(faultCount).toEqual(criticalityIconCount);
|
expect.soft(faultCount).toEqual(criticalityIconCount);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('When selecting a fault, it has an "is-selected" class and it\'s information shows in the inspector @unstable', async ({ page }) => {
|
test('When selecting a fault, it has an "is-selected" class and it\'s information shows in the inspector @unstable', async ({
|
||||||
|
page
|
||||||
|
}) => {
|
||||||
await utils.selectFaultItem(page, 1);
|
await utils.selectFaultItem(page, 1);
|
||||||
|
|
||||||
const selectedFaultName = await page.locator('.c-fault-mgmt__list.is-selected .c-fault-mgmt__list-faultname').textContent();
|
await selectInspectorTab(page, 'Fault Management Configuration');
|
||||||
const inspectorFaultNameCount = await page.locator(`.c-inspector__properties >> :text("${selectedFaultName}")`).count();
|
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();
|
||||||
|
|
||||||
await expect.soft(page.locator('.c-faults-list-view-item-body > .c-fault-mgmt__list').first()).toHaveClass(/is-selected/);
|
await expect
|
||||||
|
.soft(page.locator('.c-faults-list-view-item-body > .c-fault-mgmt__list').first())
|
||||||
|
.toHaveClass(/is-selected/);
|
||||||
expect.soft(inspectorFaultNameCount).toEqual(1);
|
expect.soft(inspectorFaultNameCount).toEqual(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('When selecting multiple faults, no specific fault information is shown in the inspector @unstable', async ({ page }) => {
|
test('When selecting multiple faults, no specific fault information is shown in the inspector @unstable', async ({
|
||||||
|
page
|
||||||
|
}) => {
|
||||||
await utils.selectFaultItem(page, 1);
|
await utils.selectFaultItem(page, 1);
|
||||||
await utils.selectFaultItem(page, 2);
|
await utils.selectFaultItem(page, 2);
|
||||||
|
|
||||||
const selectedRows = page.locator('.c-fault-mgmt__list.is-selected .c-fault-mgmt__list-faultname');
|
const selectedRows = page.locator(
|
||||||
|
'.c-fault-mgmt__list.is-selected .c-fault-mgmt__list-faultname'
|
||||||
|
);
|
||||||
expect.soft(await selectedRows.count()).toEqual(2);
|
expect.soft(await selectedRows.count()).toEqual(2);
|
||||||
|
|
||||||
|
await selectInspectorTab(page, 'Fault Management Configuration');
|
||||||
const firstSelectedFaultName = await selectedRows.nth(0).textContent();
|
const firstSelectedFaultName = await selectedRows.nth(0).textContent();
|
||||||
const secondSelectedFaultName = await selectedRows.nth(1).textContent();
|
const secondSelectedFaultName = await selectedRows.nth(1).textContent();
|
||||||
const firstNameInInspectorCount = await page.locator(`.c-inspector__properties >> :text("${firstSelectedFaultName}")`).count();
|
const firstNameInInspectorCount = await page
|
||||||
const secondNameInInspectorCount = await page.locator(`.c-inspector__properties >> :text("${secondSelectedFaultName}")`).count();
|
.locator(`.c-inspector__properties >> :text("${firstSelectedFaultName}")`)
|
||||||
|
.count();
|
||||||
|
const secondNameInInspectorCount = await page
|
||||||
|
.locator(`.c-inspector__properties >> :text("${secondSelectedFaultName}")`)
|
||||||
|
.count();
|
||||||
|
|
||||||
expect.soft(firstNameInInspectorCount).toEqual(0);
|
expect.soft(firstNameInInspectorCount).toEqual(0);
|
||||||
expect.soft(secondNameInInspectorCount).toEqual(0);
|
expect.soft(secondNameInInspectorCount).toEqual(0);
|
||||||
@@ -205,7 +224,6 @@ test.describe('The Fault Management Plugin using example faults', () => {
|
|||||||
expect.soft(sortedHighestSeverity).toEqual(highestSeverity);
|
expect.soft(sortedHighestSeverity).toEqual(highestSeverity);
|
||||||
expect.soft(sortedLowestSeverity).toEqual(lowestSeverity);
|
expect.soft(sortedLowestSeverity).toEqual(lowestSeverity);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test.describe('The Fault Management Plugin without using example faults', () => {
|
test.describe('The Fault Management Plugin without using example faults', () => {
|
||||||
|
|||||||
@@ -21,13 +21,20 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
const { test, expect } = require('../../../../pluginFixtures');
|
const { test, expect } = require('../../../../pluginFixtures');
|
||||||
const { createDomainObjectWithDefaults } = require('../../../../appActions');
|
const {
|
||||||
|
createDomainObjectWithDefaults,
|
||||||
|
setIndependentTimeConductorBounds
|
||||||
|
} = require('../../../../appActions');
|
||||||
|
|
||||||
test.describe('Flexible Layout', () => {
|
test.describe('Flexible Layout', () => {
|
||||||
let sineWaveObject;
|
let sineWaveObject;
|
||||||
let clockObject;
|
let clockObject;
|
||||||
|
let treePane;
|
||||||
|
let sineWaveGeneratorTreeItem;
|
||||||
|
let clockTreeItem;
|
||||||
|
let flexibleLayout;
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
// Create Sine Wave Generator
|
// Create Sine Wave Generator
|
||||||
sineWaveObject = await createDomainObjectWithDefaults(page, {
|
sineWaveObject = await createDomainObjectWithDefaults(page, {
|
||||||
@@ -38,21 +45,27 @@ test.describe('Flexible Layout', () => {
|
|||||||
clockObject = await createDomainObjectWithDefaults(page, {
|
clockObject = await createDomainObjectWithDefaults(page, {
|
||||||
type: 'Clock'
|
type: 'Clock'
|
||||||
});
|
});
|
||||||
});
|
|
||||||
test('panes have the appropriate draggable attribute while in Edit and Browse modes', async ({ page }) => {
|
|
||||||
const treePane = page.getByRole('tree', {
|
|
||||||
name: 'Main Tree'
|
|
||||||
});
|
|
||||||
const sineWaveGeneratorTreeItem = treePane.getByRole('treeitem', {
|
|
||||||
name: new RegExp(sineWaveObject.name)
|
|
||||||
});
|
|
||||||
const clockTreeItem = treePane.getByRole('treeitem', {
|
|
||||||
name: new RegExp(clockObject.name)
|
|
||||||
});
|
|
||||||
// Create a Flexible Layout
|
// Create a Flexible Layout
|
||||||
await createDomainObjectWithDefaults(page, {
|
flexibleLayout = await createDomainObjectWithDefaults(page, {
|
||||||
type: 'Flexible Layout'
|
type: 'Flexible Layout'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Define the Sine Wave Generator and Clock tree items
|
||||||
|
treePane = page.getByRole('tree', {
|
||||||
|
name: 'Main Tree'
|
||||||
|
});
|
||||||
|
sineWaveGeneratorTreeItem = treePane.getByRole('treeitem', {
|
||||||
|
name: new RegExp(sineWaveObject.name)
|
||||||
|
});
|
||||||
|
clockTreeItem = treePane.getByRole('treeitem', {
|
||||||
|
name: new RegExp(clockObject.name)
|
||||||
|
});
|
||||||
|
});
|
||||||
|
test('panes have the appropriate draggable attribute while in Edit and Browse modes', async ({
|
||||||
|
page
|
||||||
|
}) => {
|
||||||
|
await page.goto(flexibleLayout.url);
|
||||||
// Edit Flexible Layout
|
// Edit Flexible Layout
|
||||||
await page.locator('[title="Edit"]').click();
|
await page.locator('[title="Edit"]').click();
|
||||||
|
|
||||||
@@ -62,7 +75,9 @@ test.describe('Flexible Layout', () => {
|
|||||||
await sineWaveGeneratorTreeItem.dragTo(page.locator('.c-fl__container.is-empty').first());
|
await sineWaveGeneratorTreeItem.dragTo(page.locator('.c-fl__container.is-empty').first());
|
||||||
await clockTreeItem.dragTo(page.locator('.c-fl__container.is-empty'));
|
await clockTreeItem.dragTo(page.locator('.c-fl__container.is-empty'));
|
||||||
// Check that panes can be dragged while Flexible Layout is in Edit mode
|
// 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').first();
|
let dragWrapper = page
|
||||||
|
.locator('.c-fl-container__frames-holder .c-fl-frame__drag-wrapper')
|
||||||
|
.first();
|
||||||
await expect(dragWrapper).toHaveAttribute('draggable', 'true');
|
await expect(dragWrapper).toHaveAttribute('draggable', 'true');
|
||||||
// Save Flexible Layout
|
// Save Flexible Layout
|
||||||
await page.locator('button[title="Save"]').click();
|
await page.locator('button[title="Save"]').click();
|
||||||
@@ -71,17 +86,79 @@ test.describe('Flexible Layout', () => {
|
|||||||
dragWrapper = page.locator('.c-fl-container__frames-holder .c-fl-frame__drag-wrapper').first();
|
dragWrapper = page.locator('.c-fl-container__frames-holder .c-fl-frame__drag-wrapper').first();
|
||||||
await expect(dragWrapper).toHaveAttribute('draggable', 'false');
|
await expect(dragWrapper).toHaveAttribute('draggable', 'false');
|
||||||
});
|
});
|
||||||
test('items in a flexible layout can be removed with object tree context menu when viewing the flexible layout', async ({ page }) => {
|
test('changing toolbar settings in edit mode is immediately reflected and persists upon save', async ({
|
||||||
const treePane = page.getByRole('tree', {
|
page
|
||||||
name: 'Main Tree'
|
}) => {
|
||||||
|
test.info().annotations.push({
|
||||||
|
type: 'issue',
|
||||||
|
description: 'https://github.com/nasa/openmct/issues/6942'
|
||||||
});
|
});
|
||||||
const sineWaveGeneratorTreeItem = treePane.getByRole('treeitem', {
|
|
||||||
name: new RegExp(sineWaveObject.name)
|
await page.goto(flexibleLayout.url);
|
||||||
});
|
|
||||||
// Create a Display Layout
|
// Expand the 'My Items' folder in the left tree
|
||||||
await createDomainObjectWithDefaults(page, {
|
await page.locator('.c-tree__item__view-control.c-disclosure-triangle').first().click();
|
||||||
type: 'Flexible Layout'
|
// 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'));
|
||||||
|
|
||||||
|
// Click on the first frame to select it
|
||||||
|
await page.locator('.c-fl-container__frame').first().click();
|
||||||
|
await expect(page.locator('.c-fl-container__frame > .c-frame').first()).toHaveAttribute(
|
||||||
|
's-selected',
|
||||||
|
''
|
||||||
|
);
|
||||||
|
|
||||||
|
// Assert the toolbar is visible
|
||||||
|
await expect(page.locator('.c-toolbar')).toBeInViewport();
|
||||||
|
|
||||||
|
// Assert the layout is in columns orientation
|
||||||
|
expect(await page.locator('.c-fl--rows').count()).toEqual(0);
|
||||||
|
|
||||||
|
// Change the layout to rows orientation
|
||||||
|
await page.getByTitle('Columns layout').click();
|
||||||
|
|
||||||
|
// Assert the layout is in rows orientation
|
||||||
|
expect(await page.locator('.c-fl--rows').count()).toBeGreaterThan(0);
|
||||||
|
|
||||||
|
// Assert the frame of the first item is visible
|
||||||
|
await expect(page.locator('.c-so-view').first()).not.toHaveClass(/c-so-view--no-frame/);
|
||||||
|
|
||||||
|
// Hide the frame of the first item
|
||||||
|
await page.getByTitle('Frame visible').click();
|
||||||
|
|
||||||
|
// Assert the frame is hidden
|
||||||
|
await expect(page.locator('.c-so-view').first()).toHaveClass(/c-so-view--no-frame/);
|
||||||
|
|
||||||
|
// Assert there are 2 containers
|
||||||
|
expect(await page.locator('.c-fl-container').count()).toEqual(2);
|
||||||
|
|
||||||
|
// Add a container
|
||||||
|
await page.getByTitle('Add Container').click();
|
||||||
|
|
||||||
|
// Assert there are 3 containers
|
||||||
|
expect(await page.locator('.c-fl-container').count()).toEqual(3);
|
||||||
|
|
||||||
|
// Save Flexible Layout
|
||||||
|
await page.locator('button[title="Save"]').click();
|
||||||
|
await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click();
|
||||||
|
|
||||||
|
// Nav away and back
|
||||||
|
await page.goto(sineWaveObject.url);
|
||||||
|
await page.goto(flexibleLayout.url);
|
||||||
|
|
||||||
|
// Wait for the first frame to be visible so we know the layout has loaded
|
||||||
|
await expect(page.locator('.c-fl-container').nth(0)).toBeInViewport();
|
||||||
|
|
||||||
|
// Assert the settings have persisted
|
||||||
|
expect(await page.locator('.c-fl-container').count()).toEqual(3);
|
||||||
|
expect(await page.locator('.c-fl--rows').count()).toBeGreaterThan(0);
|
||||||
|
await expect(page.locator('.c-so-view').first()).toHaveClass(/c-so-view--no-frame/);
|
||||||
});
|
});
|
||||||
|
test('items in a flexible layout can be removed with object tree context menu when viewing the flexible layout', async ({
|
||||||
|
page
|
||||||
|
}) => {
|
||||||
|
await page.goto(flexibleLayout.url);
|
||||||
// Edit Flexible Layout
|
// Edit Flexible Layout
|
||||||
await page.locator('[title="Edit"]').click();
|
await page.locator('[title="Edit"]').click();
|
||||||
|
|
||||||
@@ -105,22 +182,14 @@ test.describe('Flexible Layout', () => {
|
|||||||
// Verify that the item has been removed from the layout
|
// Verify that the item has been removed from the layout
|
||||||
expect(await page.locator('.c-fl-container__frame').count()).toEqual(0);
|
expect(await page.locator('.c-fl-container__frame').count()).toEqual(0);
|
||||||
});
|
});
|
||||||
test('items in a flexible layout can be removed with object tree context menu when viewing another item', async ({ page }) => {
|
test('items in a flexible layout can be removed with object tree context menu when viewing another item', async ({
|
||||||
|
page
|
||||||
|
}) => {
|
||||||
test.info().annotations.push({
|
test.info().annotations.push({
|
||||||
type: 'issue',
|
type: 'issue',
|
||||||
description: 'https://github.com/nasa/openmct/issues/3117'
|
description: 'https://github.com/nasa/openmct/issues/3117'
|
||||||
});
|
});
|
||||||
const treePane = page.getByRole('tree', {
|
await page.goto(flexibleLayout.url);
|
||||||
name: 'Main Tree'
|
|
||||||
});
|
|
||||||
const sineWaveGeneratorTreeItem = treePane.getByRole('treeitem', {
|
|
||||||
name: new RegExp(sineWaveObject.name)
|
|
||||||
});
|
|
||||||
|
|
||||||
// Create a Flexible Layout
|
|
||||||
const flexibleLayout = await createDomainObjectWithDefaults(page, {
|
|
||||||
type: 'Flexible Layout'
|
|
||||||
});
|
|
||||||
// Edit Flexible Layout
|
// Edit Flexible Layout
|
||||||
await page.locator('[title="Edit"]').click();
|
await page.locator('[title="Edit"]').click();
|
||||||
|
|
||||||
@@ -150,4 +219,41 @@ test.describe('Flexible Layout', () => {
|
|||||||
// Verify that the item has been removed from the layout
|
// Verify that the item has been removed from the layout
|
||||||
expect(await page.locator('.c-fl-container__frame').count()).toEqual(0);
|
expect(await page.locator('.c-fl-container__frame').count()).toEqual(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('independent time works with flexible layouts and its children', async ({ page }) => {
|
||||||
|
// Create Example Imagery
|
||||||
|
const exampleImageryObject = await createDomainObjectWithDefaults(page, {
|
||||||
|
type: 'Example Imagery'
|
||||||
|
});
|
||||||
|
|
||||||
|
await page.goto(flexibleLayout.url);
|
||||||
|
// Edit Flexible Layout
|
||||||
|
await page.locator('[title="Edit"]').click();
|
||||||
|
|
||||||
|
// Expand the 'My Items' folder in the left tree
|
||||||
|
await page.locator('.c-tree__item__view-control.c-disclosure-triangle').click();
|
||||||
|
const exampleImageryTreeItem = treePane.getByRole('treeitem', {
|
||||||
|
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 page.locator('button[title="Save"]').click();
|
||||||
|
await page.locator('text=Save and Finish Editing').click();
|
||||||
|
|
||||||
|
// flip on independent time conductor
|
||||||
|
await setIndependentTimeConductorBounds(
|
||||||
|
page,
|
||||||
|
'2021-12-30 01:01:00.000Z',
|
||||||
|
'2021-12-30 01:11:00.000Z'
|
||||||
|
);
|
||||||
|
|
||||||
|
// check image date
|
||||||
|
await expect(page.getByText('2021-12-30 01:11:00.000Z').first()).toBeVisible();
|
||||||
|
|
||||||
|
// flip it off
|
||||||
|
await page.getByRole('switch').click();
|
||||||
|
// timestamp shouldn't be in the past anymore
|
||||||
|
await expect(page.getByText('2021-12-30 01:11:00.000Z')).toBeHidden();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ const uuid = require('uuid').v4;
|
|||||||
test.describe('Gauge', () => {
|
test.describe('Gauge', () => {
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
// Open a browser, navigate to the main page, and wait until all networkevents to resolve
|
// Open a browser, navigate to the main page, and wait until all networkevents to resolve
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Can add and remove telemetry sources @unstable', async ({ page }) => {
|
test('Can add and remove telemetry sources @unstable', async ({ page }) => {
|
||||||
@@ -63,7 +63,13 @@ test.describe('Gauge', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Verify that the 'Replace telemetry source' modal appears and accept it
|
// 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?')).toBeVisible();
|
await expect
|
||||||
|
.soft(
|
||||||
|
page.locator(
|
||||||
|
'text=This action will replace the current telemetry source. Do you want to continue?'
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.toBeVisible();
|
||||||
await page.click('text=Ok');
|
await page.click('text=Ok');
|
||||||
|
|
||||||
// Navigate to the gauge and verify that the new SWG
|
// Navigate to the gauge and verify that the new SWG
|
||||||
@@ -81,7 +87,13 @@ test.describe('Gauge', () => {
|
|||||||
await page.locator('li[title="Remove this object from its containing object."]').click();
|
await page.locator('li[title="Remove this object from its containing object."]').click();
|
||||||
|
|
||||||
// Verify that the 'Remove object' confirmation modal appears and accept it
|
// 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?')).toBeVisible();
|
await expect
|
||||||
|
.soft(
|
||||||
|
page.locator(
|
||||||
|
'text=Warning! This action will remove this object. Are you sure you want to continue?'
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.toBeVisible();
|
||||||
await page.click('text=Ok');
|
await page.click('text=Ok');
|
||||||
|
|
||||||
// Verify that the elements pool shows no elements
|
// Verify that the elements pool shows no elements
|
||||||
|
|||||||
@@ -27,9 +27,10 @@ but only assume that example imagery is present.
|
|||||||
/* globals process */
|
/* globals process */
|
||||||
const { waitForAnimations } = require('../../../../baseFixtures');
|
const { waitForAnimations } = require('../../../../baseFixtures');
|
||||||
const { test, expect } = require('../../../../pluginFixtures');
|
const { test, expect } = require('../../../../pluginFixtures');
|
||||||
const { createDomainObjectWithDefaults } = require('../../../../appActions');
|
const { createDomainObjectWithDefaults, setRealTimeMode } = require('../../../../appActions');
|
||||||
const backgroundImageSelector = '.c-imagery__main-image__background-image';
|
const backgroundImageSelector = '.c-imagery__main-image__background-image';
|
||||||
const panHotkey = process.platform === 'linux' ? ['Shift', 'Alt'] : ['Alt'];
|
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 expectedAltText = process.platform === 'linux' ? 'Shift+Alt drag to pan' : 'Alt drag to pan';
|
||||||
const thumbnailUrlParamsRegexp = /\?w=100&h=100/;
|
const thumbnailUrlParamsRegexp = /\?w=100&h=100/;
|
||||||
|
|
||||||
@@ -37,14 +38,15 @@ const thumbnailUrlParamsRegexp = /\?w=100&h=100/;
|
|||||||
test.describe('Example Imagery Object', () => {
|
test.describe('Example Imagery Object', () => {
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
//Go to baseURL
|
//Go to baseURL
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
// Create a default 'Example Imagery' object
|
// Create a default 'Example Imagery' object
|
||||||
const exampleImagery = await createDomainObjectWithDefaults(page, { type: 'Example Imagery' });
|
const exampleImagery = await createDomainObjectWithDefaults(page, { type: 'Example Imagery' });
|
||||||
|
|
||||||
// Verify that the created object is focused
|
// Verify that the created object is focused
|
||||||
await expect(page.locator('.l-browse-bar__object-name')).toContainText(exampleImagery.name);
|
await expect(page.locator('.l-browse-bar__object-name')).toContainText(exampleImagery.name);
|
||||||
await page.locator(backgroundImageSelector).hover({trial: true});
|
await page.locator('.c-imagery__main-image__bg').hover({ trial: true });
|
||||||
|
await page.locator(backgroundImageSelector).waitFor();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Can use Mouse Wheel to zoom in and out of latest image', async ({ page }) => {
|
test('Can use Mouse Wheel to zoom in and out of latest image', async ({ page }) => {
|
||||||
@@ -55,7 +57,10 @@ test.describe('Example Imagery Object', () => {
|
|||||||
await mouseZoomOnImageAndAssert(page, -2);
|
await mouseZoomOnImageAndAssert(page, -2);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Can adjust image brightness/contrast by dragging the sliders', async ({ page, browserName }) => {
|
test('Can adjust image brightness/contrast by dragging the sliders', async ({
|
||||||
|
page,
|
||||||
|
browserName
|
||||||
|
}) => {
|
||||||
// eslint-disable-next-line playwright/no-skipped-test
|
// eslint-disable-next-line playwright/no-skipped-test
|
||||||
test.skip(browserName === 'firefox', 'This test needs to be updated to work with firefox');
|
test.skip(browserName === 'firefox', 'This test needs to be updated to work with firefox');
|
||||||
// Open the image filter menu
|
// Open the image filter menu
|
||||||
@@ -66,14 +71,79 @@ test.describe('Example Imagery Object', () => {
|
|||||||
await dragContrastSliderAndAssertFilterValues(page);
|
await dragContrastSliderAndAssertFilterValues(page);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('Can use independent time conductor to change time', async ({ page }) => {
|
||||||
|
test.info().annotations.push({
|
||||||
|
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();
|
||||||
|
|
||||||
|
// 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 page.getByRole('button', { name: 'Independent Time Conductor Settings' }).click();
|
||||||
|
|
||||||
|
await page.getByRole('textbox', { name: 'Start date' }).fill('2021-12-30');
|
||||||
|
await page.keyboard.press('Tab');
|
||||||
|
await page.getByRole('textbox', { name: 'Start time' }).fill('01:01:00');
|
||||||
|
await page.keyboard.press('Tab');
|
||||||
|
await page.getByRole('textbox', { name: 'End date' }).fill('2021-12-30');
|
||||||
|
await page.keyboard.press('Tab');
|
||||||
|
await page.getByRole('textbox', { name: 'End time' }).fill('01:11:00');
|
||||||
|
await page.keyboard.press('Tab');
|
||||||
|
await page.keyboard.press('Enter');
|
||||||
|
|
||||||
|
// check image date
|
||||||
|
await expect(page.getByText('2021-12-30 01:01:00.000Z').first()).toBeVisible();
|
||||||
|
|
||||||
|
// flip it off
|
||||||
|
await page.getByRole('switch', { name: 'Disable Independent Time Conductor' }).click();
|
||||||
|
// timestamp shouldn't be in the past anymore
|
||||||
|
await expect(page.getByText('2021-12-30 01:11:00.000Z')).toBeHidden();
|
||||||
|
|
||||||
|
// Test independent fixed time with global realtime
|
||||||
|
await setRealTimeMode(page);
|
||||||
|
await expect(
|
||||||
|
page.getByRole('switch', { name: 'Enable Independent Time Conductor' })
|
||||||
|
).toBeEnabled();
|
||||||
|
await page.getByRole('switch', { name: 'Enable Independent Time Conductor' }).click();
|
||||||
|
// check image date to be in the past
|
||||||
|
await expect(page.getByText('2021-12-30 01:01:00.000Z').first()).toBeVisible();
|
||||||
|
// flip it off
|
||||||
|
await page.getByRole('switch', { name: 'Disable Independent Time Conductor' }).click();
|
||||||
|
// timestamp shouldn't be in the past anymore
|
||||||
|
await expect(page.getByText('2021-12-30 01:11:00.000Z')).toBeHidden();
|
||||||
|
|
||||||
|
// Test independent realtime with global realtime
|
||||||
|
await page.getByRole('switch', { name: 'Enable Independent Time Conductor' }).click();
|
||||||
|
// check image date
|
||||||
|
await expect(page.getByText('2021-12-30 01:11:00.000Z').first()).toBeVisible();
|
||||||
|
// change independent time to realtime
|
||||||
|
await page.getByRole('button', { name: 'Independent Time Conductor Settings' }).click();
|
||||||
|
await page.getByRole('button', { name: 'Independent Time Conductor Mode Menu' }).click();
|
||||||
|
await page.getByRole('menuitem', { name: /Real-Time/ }).click();
|
||||||
|
// timestamp shouldn't be in the past anymore
|
||||||
|
await expect(page.getByText('2021-12-30 01:11:00.000Z')).toBeHidden();
|
||||||
|
// back to the past
|
||||||
|
await page.getByRole('button', { name: 'Independent Time Conductor Mode Menu' }).click();
|
||||||
|
await page.getByRole('menuitem', { name: /Real-Time/ }).click();
|
||||||
|
await page.getByRole('button', { name: 'Independent Time Conductor Mode Menu' }).click();
|
||||||
|
await page.getByRole('menuitem', { name: /Fixed Timespan/ }).click();
|
||||||
|
// check image date to be in the past
|
||||||
|
await expect(page.getByText('2021-12-30 01:11:00.000Z').first()).toBeVisible();
|
||||||
|
});
|
||||||
|
|
||||||
test('Can use alt+drag to move around image once zoomed in', async ({ page }) => {
|
test('Can use alt+drag to move around image once zoomed in', async ({ page }) => {
|
||||||
const deltaYStep = 100; //equivalent to 1x zoom
|
const deltaYStep = 100; //equivalent to 1x zoom
|
||||||
|
|
||||||
await page.locator(backgroundImageSelector).hover({trial: true});
|
await page.locator('.c-imagery__main-image__bg').hover({ trial: true });
|
||||||
|
|
||||||
// zoom in
|
// zoom in
|
||||||
await page.mouse.wheel(0, deltaYStep * 2);
|
await page.mouse.wheel(0, deltaYStep * 2);
|
||||||
await page.locator(backgroundImageSelector).hover({trial: true});
|
await page.locator('.c-imagery__main-image__bg').hover({ trial: true });
|
||||||
const zoomedBoundingBox = await page.locator(backgroundImageSelector).boundingBox();
|
const zoomedBoundingBox = await page.locator(backgroundImageSelector).boundingBox();
|
||||||
const imageCenterX = zoomedBoundingBox.x + zoomedBoundingBox.width / 2;
|
const imageCenterX = zoomedBoundingBox.x + zoomedBoundingBox.width / 2;
|
||||||
const imageCenterY = zoomedBoundingBox.y + zoomedBoundingBox.height / 2;
|
const imageCenterY = zoomedBoundingBox.y + zoomedBoundingBox.height / 2;
|
||||||
@@ -91,42 +161,71 @@ test.describe('Example Imagery Object', () => {
|
|||||||
expect(expectedAltText).toEqual(imageryHintsText);
|
expect(expectedAltText).toEqual(imageryHintsText);
|
||||||
|
|
||||||
// pan right
|
// pan right
|
||||||
await Promise.all(panHotkey.map(x => page.keyboard.down(x)));
|
await Promise.all(panHotkey.map((x) => page.keyboard.down(x)));
|
||||||
await page.mouse.down();
|
await page.mouse.down();
|
||||||
await page.mouse.move(imageCenterX - 200, imageCenterY, 10);
|
await page.mouse.move(imageCenterX - 200, imageCenterY, 10);
|
||||||
await page.mouse.up();
|
await page.mouse.up();
|
||||||
await Promise.all(panHotkey.map(x => page.keyboard.up(x)));
|
await Promise.all(panHotkey.map((x) => page.keyboard.up(x)));
|
||||||
const afterRightPanBoundingBox = await page.locator(backgroundImageSelector).boundingBox();
|
const afterRightPanBoundingBox = await page.locator(backgroundImageSelector).boundingBox();
|
||||||
expect(zoomedBoundingBox.x).toBeGreaterThan(afterRightPanBoundingBox.x);
|
expect(zoomedBoundingBox.x).toBeGreaterThan(afterRightPanBoundingBox.x);
|
||||||
|
|
||||||
// pan left
|
// pan left
|
||||||
await Promise.all(panHotkey.map(x => page.keyboard.down(x)));
|
await Promise.all(panHotkey.map((x) => page.keyboard.down(x)));
|
||||||
await page.mouse.down();
|
await page.mouse.down();
|
||||||
await page.mouse.move(imageCenterX, imageCenterY, 10);
|
await page.mouse.move(imageCenterX, imageCenterY, 10);
|
||||||
await page.mouse.up();
|
await page.mouse.up();
|
||||||
await Promise.all(panHotkey.map(x => page.keyboard.up(x)));
|
await Promise.all(panHotkey.map((x) => page.keyboard.up(x)));
|
||||||
const afterLeftPanBoundingBox = await page.locator(backgroundImageSelector).boundingBox();
|
const afterLeftPanBoundingBox = await page.locator(backgroundImageSelector).boundingBox();
|
||||||
expect(afterRightPanBoundingBox.x).toBeLessThan(afterLeftPanBoundingBox.x);
|
expect(afterRightPanBoundingBox.x).toBeLessThan(afterLeftPanBoundingBox.x);
|
||||||
|
|
||||||
// pan up
|
// pan up
|
||||||
await page.mouse.move(imageCenterX, imageCenterY);
|
await page.mouse.move(imageCenterX, imageCenterY);
|
||||||
await Promise.all(panHotkey.map(x => page.keyboard.down(x)));
|
await Promise.all(panHotkey.map((x) => page.keyboard.down(x)));
|
||||||
await page.mouse.down();
|
await page.mouse.down();
|
||||||
await page.mouse.move(imageCenterX, imageCenterY + 200, 10);
|
await page.mouse.move(imageCenterX, imageCenterY + 200, 10);
|
||||||
await page.mouse.up();
|
await page.mouse.up();
|
||||||
await Promise.all(panHotkey.map(x => page.keyboard.up(x)));
|
await Promise.all(panHotkey.map((x) => page.keyboard.up(x)));
|
||||||
const afterUpPanBoundingBox = await page.locator(backgroundImageSelector).boundingBox();
|
const afterUpPanBoundingBox = await page.locator(backgroundImageSelector).boundingBox();
|
||||||
expect(afterUpPanBoundingBox.y).toBeGreaterThan(afterLeftPanBoundingBox.y);
|
expect(afterUpPanBoundingBox.y).toBeGreaterThan(afterLeftPanBoundingBox.y);
|
||||||
|
|
||||||
// pan down
|
// pan down
|
||||||
await Promise.all(panHotkey.map(x => page.keyboard.down(x)));
|
await Promise.all(panHotkey.map((x) => page.keyboard.down(x)));
|
||||||
await page.mouse.down();
|
await page.mouse.down();
|
||||||
await page.mouse.move(imageCenterX, imageCenterY - 200, 10);
|
await page.mouse.move(imageCenterX, imageCenterY - 200, 10);
|
||||||
await page.mouse.up();
|
await page.mouse.up();
|
||||||
await Promise.all(panHotkey.map(x => page.keyboard.up(x)));
|
await Promise.all(panHotkey.map((x) => page.keyboard.up(x)));
|
||||||
const afterDownPanBoundingBox = await page.locator(backgroundImageSelector).boundingBox();
|
const afterDownPanBoundingBox = await page.locator(backgroundImageSelector).boundingBox();
|
||||||
expect(afterDownPanBoundingBox.y).toBeLessThan(afterUpPanBoundingBox.y);
|
expect(afterDownPanBoundingBox.y).toBeLessThan(afterUpPanBoundingBox.y);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Can use alt+shift+drag to create a tag', async ({ page }) => {
|
||||||
|
const canvas = page.locator('canvas');
|
||||||
|
await canvas.hover({ trial: true });
|
||||||
|
|
||||||
|
const canvasBoundingBox = await canvas.boundingBox();
|
||||||
|
const canvasCenterX = canvasBoundingBox.x + canvasBoundingBox.width / 2;
|
||||||
|
const canvasCenterY = canvasBoundingBox.y + canvasBoundingBox.height / 2;
|
||||||
|
|
||||||
|
await Promise.all(tagHotkey.map((x) => page.keyboard.down(x)));
|
||||||
|
await page.mouse.down();
|
||||||
|
// steps not working for me here
|
||||||
|
await page.mouse.move(canvasCenterX - 20, canvasCenterY - 20);
|
||||||
|
await page.mouse.move(canvasCenterX - 100, canvasCenterY - 100);
|
||||||
|
await page.mouse.up();
|
||||||
|
await Promise.all(tagHotkey.map((x) => page.keyboard.up(x)));
|
||||||
|
|
||||||
|
//Wait for canvas to stabilize.
|
||||||
|
await canvas.hover({ trial: true });
|
||||||
|
|
||||||
|
// add some tags
|
||||||
|
await page.getByText('Annotations').click();
|
||||||
|
await page.getByRole('button', { name: /Add Tag/ }).click();
|
||||||
|
await page.getByPlaceholder('Type to select tag').click();
|
||||||
|
await page.getByText('Driving').click();
|
||||||
|
|
||||||
|
await page.getByRole('button', { name: /Add Tag/ }).click();
|
||||||
|
await page.getByPlaceholder('Type to select tag').click();
|
||||||
|
await page.getByText('Science').click();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Can use + - buttons to zoom on the image @unstable', async ({ page }) => {
|
test('Can use + - buttons to zoom on the image @unstable', async ({ page }) => {
|
||||||
@@ -134,7 +233,7 @@ test.describe('Example Imagery Object', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('Can use the reset button to reset the image @unstable', async ({ page }, testInfo) => {
|
test('Can use the reset button to reset the image @unstable', async ({ page }, testInfo) => {
|
||||||
test.slow(testInfo.project === 'chrome-beta', "This test is slow in chrome-beta");
|
test.slow(testInfo.project === 'chrome-beta', 'This test is slow in chrome-beta');
|
||||||
// Get initial image dimensions
|
// Get initial image dimensions
|
||||||
const initialBoundingBox = await page.locator(backgroundImageSelector).boundingBox();
|
const initialBoundingBox = await page.locator(backgroundImageSelector).boundingBox();
|
||||||
|
|
||||||
@@ -156,11 +255,9 @@ test.describe('Example Imagery Object', () => {
|
|||||||
test('Using the zoom features does not pause telemetry', async ({ page }) => {
|
test('Using the zoom features does not pause telemetry', async ({ page }) => {
|
||||||
const pausePlayButton = page.locator('.c-button.pause-play');
|
const pausePlayButton = page.locator('.c-button.pause-play');
|
||||||
|
|
||||||
// open the time conductor drop down
|
// switch to realtime
|
||||||
await page.locator('.c-mode-button').click();
|
await setRealTimeMode(page);
|
||||||
|
|
||||||
// Click local clock
|
|
||||||
await page.locator('[data-testid="conductor-modeOption-realtime"]').click();
|
|
||||||
await expect.soft(pausePlayButton).not.toHaveClass(/is-paused/);
|
await expect.soft(pausePlayButton).not.toHaveClass(/is-paused/);
|
||||||
|
|
||||||
// Zoom in via button
|
// Zoom in via button
|
||||||
@@ -170,7 +267,7 @@ test.describe('Example Imagery Object', () => {
|
|||||||
|
|
||||||
test('Uses low fetch priority', async ({ page }) => {
|
test('Uses low fetch priority', async ({ page }) => {
|
||||||
const priority = await page.locator('.js-imageryView-image').getAttribute('fetchpriority');
|
const priority = await page.locator('.js-imageryView-image').getAttribute('fetchpriority');
|
||||||
await expect(priority).toBe('low');
|
expect(priority).toBe('low');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -178,49 +275,33 @@ test.describe('Example Imagery in Display Layout', () => {
|
|||||||
let displayLayout;
|
let displayLayout;
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
// Go to baseURL
|
// Go to baseURL
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
displayLayout = await createDomainObjectWithDefaults(page, { type: 'Display Layout' });
|
displayLayout = await createDomainObjectWithDefaults(page, { type: 'Display Layout' });
|
||||||
await page.goto(displayLayout.url);
|
await page.goto(displayLayout.url);
|
||||||
|
|
||||||
/* Create Sine Wave Generator with minimum Image Load Delay */
|
await createImageryView(page);
|
||||||
// Click the Create button
|
|
||||||
await page.click('button:has-text("Create")');
|
|
||||||
|
|
||||||
// Click text=Example Imagery
|
await expect(page.locator('.l-browse-bar__object-name')).toContainText(
|
||||||
await page.click('li[role="menuitem"]:has-text("Example Imagery")');
|
'Unnamed 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(displayLayout.url);
|
await page.goto(displayLayout.url);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('View Large action pauses imagery when in realtime and returns to realtime', async ({ page }) => {
|
test('View Large action pauses imagery when in realtime and returns to realtime', async ({
|
||||||
|
page
|
||||||
|
}) => {
|
||||||
test.info().annotations.push({
|
test.info().annotations.push({
|
||||||
type: 'issue',
|
type: 'issue',
|
||||||
description: 'https://github.com/nasa/openmct/issues/3647'
|
description: 'https://github.com/nasa/openmct/issues/3647'
|
||||||
});
|
});
|
||||||
|
|
||||||
// Click time conductor mode button
|
|
||||||
await page.locator('.c-mode-button').click();
|
|
||||||
|
|
||||||
// set realtime mode
|
// set realtime mode
|
||||||
await page.locator('[data-testid="conductor-modeOption-realtime"]').click();
|
await setRealTimeMode(page);
|
||||||
|
|
||||||
// pause/play button
|
// pause/play button
|
||||||
const pausePlayButton = await page.locator('.c-button.pause-play');
|
const pausePlayButton = page.locator('.c-button.pause-play');
|
||||||
|
|
||||||
await expect.soft(pausePlayButton).not.toHaveClass(/is-paused/);
|
await expect.soft(pausePlayButton).not.toHaveClass(/is-paused/);
|
||||||
|
|
||||||
@@ -239,14 +320,11 @@ test.describe('Example Imagery in Display Layout', () => {
|
|||||||
description: 'https://github.com/nasa/openmct/issues/3647'
|
description: 'https://github.com/nasa/openmct/issues/3647'
|
||||||
});
|
});
|
||||||
|
|
||||||
// Click time conductor mode button
|
|
||||||
await page.locator('.c-mode-button').click();
|
|
||||||
|
|
||||||
// set realtime mode
|
// set realtime mode
|
||||||
await page.locator('[data-testid="conductor-modeOption-realtime"]').click();
|
await setRealTimeMode(page);
|
||||||
|
|
||||||
// pause/play button
|
// pause/play button
|
||||||
const pausePlayButton = await page.locator('.c-button.pause-play');
|
const pausePlayButton = page.locator('.c-button.pause-play');
|
||||||
await pausePlayButton.click();
|
await pausePlayButton.click();
|
||||||
await expect.soft(pausePlayButton).toHaveClass(/is-paused/);
|
await expect.soft(pausePlayButton).toHaveClass(/is-paused/);
|
||||||
|
|
||||||
@@ -309,15 +387,53 @@ test.describe('Example Imagery in Display Layout', () => {
|
|||||||
await page.locator('div[title="Resize object height"] > input').click();
|
await page.locator('div[title="Resize object height"] > input').click();
|
||||||
await page.locator('div[title="Resize object height"] > input').fill('100');
|
await page.locator('div[title="Resize object height"] > input').fill('100');
|
||||||
|
|
||||||
expect(thumbsWrapperLocator.isVisible()).toBeTruthy();
|
await expect(thumbsWrapperLocator).toBeVisible();
|
||||||
await expect(thumbsWrapperLocator).not.toHaveClass(/is-small-thumbs/);
|
await expect(thumbsWrapperLocator).not.toHaveClass(/is-small-thumbs/);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Toggle layer visibility checkbox by clicking on checkbox label
|
||||||
|
* - should toggle checkbox and layer visibility for that image view
|
||||||
|
* - should NOT toggle checkbox and layer visibility for the first image view in display
|
||||||
|
*/
|
||||||
|
test('Toggle layer visibility by clicking on label', async ({ page }) => {
|
||||||
|
test.info().annotations.push({
|
||||||
|
type: 'issue',
|
||||||
|
description: 'https://github.com/nasa/openmct/issues/6709'
|
||||||
|
});
|
||||||
|
await createImageryView(page);
|
||||||
|
await page.goto(displayLayout.url);
|
||||||
|
|
||||||
|
const imageElements = page.locator('.c-imagery__main-image-wrapper');
|
||||||
|
|
||||||
|
await expect(imageElements).toHaveCount(2);
|
||||||
|
|
||||||
|
const imageOne = page.locator('.c-imagery__main-image-wrapper').nth(0);
|
||||||
|
const imageTwo = page.locator('.c-imagery__main-image-wrapper').nth(1);
|
||||||
|
const imageOneWrapper = imageOne.locator('.image-wrapper');
|
||||||
|
const imageTwoWrapper = imageTwo.locator('.image-wrapper');
|
||||||
|
|
||||||
|
await imageTwo.hover();
|
||||||
|
|
||||||
|
await imageTwo.locator('button[title="Layers"]').click();
|
||||||
|
|
||||||
|
const imageTwoLayersMenuContent = imageTwo.locator('button[title="Layers"] + div');
|
||||||
|
const imageTwoLayersToggleLabel = imageTwoLayersMenuContent.locator('label').last();
|
||||||
|
|
||||||
|
await imageTwoLayersToggleLabel.click();
|
||||||
|
|
||||||
|
const imageOneLayers = imageOneWrapper.locator('.layer-image');
|
||||||
|
const imageTwoLayers = imageTwoWrapper.locator('.layer-image');
|
||||||
|
|
||||||
|
await expect(imageOneLayers).toHaveCount(0);
|
||||||
|
await expect(imageTwoLayers).toHaveCount(1);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test.describe('Example Imagery in Flexible layout', () => {
|
test.describe('Example Imagery in Flexible layout', () => {
|
||||||
let flexibleLayout;
|
let flexibleLayout;
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
flexibleLayout = await createDomainObjectWithDefaults(page, { type: 'Flexible Layout' });
|
flexibleLayout = await createDomainObjectWithDefaults(page, { type: 'Flexible Layout' });
|
||||||
await page.goto(flexibleLayout.url);
|
await page.goto(flexibleLayout.url);
|
||||||
@@ -341,7 +457,9 @@ test.describe('Example Imagery in Flexible layout', () => {
|
|||||||
page.waitForSelector('.c-message-banner__message')
|
page.waitForSelector('.c-message-banner__message')
|
||||||
]);
|
]);
|
||||||
|
|
||||||
await expect(page.locator('.l-browse-bar__object-name')).toContainText('Unnamed Example Imagery');
|
await expect(page.locator('.l-browse-bar__object-name')).toContainText(
|
||||||
|
'Unnamed Example Imagery'
|
||||||
|
);
|
||||||
|
|
||||||
await page.goto(flexibleLayout.url);
|
await page.goto(flexibleLayout.url);
|
||||||
});
|
});
|
||||||
@@ -359,7 +477,7 @@ test.describe('Example Imagery in Flexible layout', () => {
|
|||||||
test.describe('Example Imagery in Tabs View', () => {
|
test.describe('Example Imagery in Tabs View', () => {
|
||||||
let tabsView;
|
let tabsView;
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
tabsView = await createDomainObjectWithDefaults(page, { type: 'Tabs View' });
|
tabsView = await createDomainObjectWithDefaults(page, { type: 'Tabs View' });
|
||||||
await page.goto(tabsView.url);
|
await page.goto(tabsView.url);
|
||||||
@@ -383,7 +501,9 @@ test.describe('Example Imagery in Tabs View', () => {
|
|||||||
page.waitForSelector('.c-message-banner__message')
|
page.waitForSelector('.c-message-banner__message')
|
||||||
]);
|
]);
|
||||||
|
|
||||||
await expect(page.locator('.l-browse-bar__object-name')).toContainText('Unnamed Example Imagery');
|
await expect(page.locator('.l-browse-bar__object-name')).toContainText(
|
||||||
|
'Unnamed Example Imagery'
|
||||||
|
);
|
||||||
|
|
||||||
await page.goto(tabsView.url);
|
await page.goto(tabsView.url);
|
||||||
});
|
});
|
||||||
@@ -395,7 +515,7 @@ test.describe('Example Imagery in Tabs View', () => {
|
|||||||
test.describe('Example Imagery in Time Strip', () => {
|
test.describe('Example Imagery in Time Strip', () => {
|
||||||
let timeStripObject;
|
let timeStripObject;
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
timeStripObject = await createDomainObjectWithDefaults(page, {
|
timeStripObject = await createDomainObjectWithDefaults(page, {
|
||||||
type: 'Time Strip'
|
type: 'Time Strip'
|
||||||
});
|
});
|
||||||
@@ -417,7 +537,9 @@ test.describe('Example Imagery in Time Strip', () => {
|
|||||||
await page.locator('.c-imagery-tsv-container').hover();
|
await page.locator('.c-imagery-tsv-container').hover();
|
||||||
|
|
||||||
// Get the img src of the hovered image thumbnail
|
// Get the img src of the hovered image thumbnail
|
||||||
const hoveredThumbnailImg = page.locator('.c-imagery-tsv div.c-imagery-tsv__image-wrapper:hover img');
|
const hoveredThumbnailImg = page.locator(
|
||||||
|
'.c-imagery-tsv div.c-imagery-tsv__image-wrapper:hover img'
|
||||||
|
);
|
||||||
const hoveredThumbnailImgSrc = await hoveredThumbnailImg.getAttribute('src');
|
const hoveredThumbnailImgSrc = await hoveredThumbnailImg.getAttribute('src');
|
||||||
|
|
||||||
// Verify that imagery timestrip view uses the thumbnailUrl as img src for thumbnails
|
// Verify that imagery timestrip view uses the thumbnailUrl as img src for thumbnails
|
||||||
@@ -480,11 +602,8 @@ async function performImageryViewOperationsAndAssert(page) {
|
|||||||
const nextImageButton = page.locator('.c-nav--next');
|
const nextImageButton = page.locator('.c-nav--next');
|
||||||
await nextImageButton.click();
|
await nextImageButton.click();
|
||||||
|
|
||||||
// Click time conductor mode button
|
// set realtime mode
|
||||||
await page.locator('.c-mode-button').click();
|
await setRealTimeMode(page);
|
||||||
|
|
||||||
// Select local clock mode
|
|
||||||
await page.locator('[data-testid=conductor-modeOption-realtime]').click();
|
|
||||||
|
|
||||||
// Zoom in on next image
|
// Zoom in on next image
|
||||||
await mouseZoomOnImageAndAssert(page, 2);
|
await mouseZoomOnImageAndAssert(page, 2);
|
||||||
@@ -496,14 +615,19 @@ async function performImageryViewOperationsAndAssert(page) {
|
|||||||
|
|
||||||
// The imagery view should be updated when new images come in
|
// The imagery view should be updated when new images come in
|
||||||
const imageCount = await page.locator('.c-imagery__thumb').count();
|
const imageCount = await page.locator('.c-imagery__thumb').count();
|
||||||
await expect.poll(async () => {
|
await expect
|
||||||
|
.poll(
|
||||||
|
async () => {
|
||||||
const newImageCount = await page.locator('.c-imagery__thumb').count();
|
const newImageCount = await page.locator('.c-imagery__thumb').count();
|
||||||
|
|
||||||
return newImageCount;
|
return newImageCount;
|
||||||
}, {
|
},
|
||||||
message: "verify that old images are discarded",
|
{
|
||||||
|
message: 'verify that old images are discarded',
|
||||||
timeout: 7 * 1000
|
timeout: 7 * 1000
|
||||||
}).toBe(imageCount);
|
}
|
||||||
|
)
|
||||||
|
.toBe(imageCount);
|
||||||
|
|
||||||
// Verify selected image is still displayed
|
// Verify selected image is still displayed
|
||||||
await expect(selectedImage).toBeVisible();
|
await expect(selectedImage).toBeVisible();
|
||||||
@@ -586,24 +710,35 @@ async function assertBackgroundImageBrightness(page, expected) {
|
|||||||
async function assertBackgroundImageUrlFromBackgroundCss(page) {
|
async function assertBackgroundImageUrlFromBackgroundCss(page) {
|
||||||
const backgroundImage = page.locator('.c-imagery__main-image__background-image');
|
const backgroundImage = page.locator('.c-imagery__main-image__background-image');
|
||||||
let backgroundImageUrl = await backgroundImage.evaluate((el) => {
|
let backgroundImageUrl = await backgroundImage.evaluate((el) => {
|
||||||
return window.getComputedStyle(el).getPropertyValue('background-image').match(/url\(([^)]+)\)/)[1];
|
return window
|
||||||
|
.getComputedStyle(el)
|
||||||
|
.getPropertyValue('background-image')
|
||||||
|
.match(/url\(([^)]+)\)/)[1];
|
||||||
});
|
});
|
||||||
let backgroundImageUrl1 = backgroundImageUrl.slice(1, -1); //forgive me, padre
|
let backgroundImageUrl1 = backgroundImageUrl.slice(1, -1); //forgive me, padre
|
||||||
console.log('backgroundImageUrl1 ' + backgroundImageUrl1);
|
console.log('backgroundImageUrl1 ' + backgroundImageUrl1);
|
||||||
|
|
||||||
let backgroundImageUrl2;
|
let backgroundImageUrl2;
|
||||||
await expect.poll(async () => {
|
await expect
|
||||||
|
.poll(
|
||||||
|
async () => {
|
||||||
// Verify next image has updated
|
// Verify next image has updated
|
||||||
let backgroundImageUrlNext = await backgroundImage.evaluate((el) => {
|
let backgroundImageUrlNext = await backgroundImage.evaluate((el) => {
|
||||||
return window.getComputedStyle(el).getPropertyValue('background-image').match(/url\(([^)]+)\)/)[1];
|
return window
|
||||||
|
.getComputedStyle(el)
|
||||||
|
.getPropertyValue('background-image')
|
||||||
|
.match(/url\(([^)]+)\)/)[1];
|
||||||
});
|
});
|
||||||
backgroundImageUrl2 = backgroundImageUrlNext.slice(1, -1); //forgive me, padre
|
backgroundImageUrl2 = backgroundImageUrlNext.slice(1, -1); //forgive me, padre
|
||||||
|
|
||||||
return backgroundImageUrl2;
|
return backgroundImageUrl2;
|
||||||
}, {
|
},
|
||||||
message: "verify next image has updated",
|
{
|
||||||
|
message: 'verify next image has updated',
|
||||||
timeout: 7 * 1000
|
timeout: 7 * 1000
|
||||||
}).not.toBe(backgroundImageUrl1);
|
}
|
||||||
|
)
|
||||||
|
.not.toBe(backgroundImageUrl1);
|
||||||
console.log('backgroundImageUrl2 ' + backgroundImageUrl2);
|
console.log('backgroundImageUrl2 ' + backgroundImageUrl2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -618,39 +753,39 @@ async function panZoomAndAssertImageProperties(page) {
|
|||||||
const imageCenterY = zoomedBoundingBox.y + zoomedBoundingBox.height / 2;
|
const imageCenterY = zoomedBoundingBox.y + zoomedBoundingBox.height / 2;
|
||||||
|
|
||||||
// Pan right
|
// Pan right
|
||||||
await Promise.all(panHotkey.map(x => page.keyboard.down(x)));
|
await Promise.all(panHotkey.map((x) => page.keyboard.down(x)));
|
||||||
await page.mouse.down();
|
await page.mouse.down();
|
||||||
await page.mouse.move(imageCenterX - 200, imageCenterY, 10);
|
await page.mouse.move(imageCenterX - 200, imageCenterY, 10);
|
||||||
await page.mouse.up();
|
await page.mouse.up();
|
||||||
await Promise.all(panHotkey.map(x => page.keyboard.up(x)));
|
await Promise.all(panHotkey.map((x) => page.keyboard.up(x)));
|
||||||
const afterRightPanBoundingBox = await page.locator(backgroundImageSelector).boundingBox();
|
const afterRightPanBoundingBox = await page.locator(backgroundImageSelector).boundingBox();
|
||||||
expect(zoomedBoundingBox.x).toBeGreaterThan(afterRightPanBoundingBox.x);
|
expect(zoomedBoundingBox.x).toBeGreaterThan(afterRightPanBoundingBox.x);
|
||||||
|
|
||||||
// Pan left
|
// Pan left
|
||||||
await Promise.all(panHotkey.map(x => page.keyboard.down(x)));
|
await Promise.all(panHotkey.map((x) => page.keyboard.down(x)));
|
||||||
await page.mouse.down();
|
await page.mouse.down();
|
||||||
await page.mouse.move(imageCenterX, imageCenterY, 10);
|
await page.mouse.move(imageCenterX, imageCenterY, 10);
|
||||||
await page.mouse.up();
|
await page.mouse.up();
|
||||||
await Promise.all(panHotkey.map(x => page.keyboard.up(x)));
|
await Promise.all(panHotkey.map((x) => page.keyboard.up(x)));
|
||||||
const afterLeftPanBoundingBox = await page.locator(backgroundImageSelector).boundingBox();
|
const afterLeftPanBoundingBox = await page.locator(backgroundImageSelector).boundingBox();
|
||||||
expect(afterRightPanBoundingBox.x).toBeLessThan(afterLeftPanBoundingBox.x);
|
expect(afterRightPanBoundingBox.x).toBeLessThan(afterLeftPanBoundingBox.x);
|
||||||
|
|
||||||
// Pan up
|
// Pan up
|
||||||
await page.mouse.move(imageCenterX, imageCenterY);
|
await page.mouse.move(imageCenterX, imageCenterY);
|
||||||
await Promise.all(panHotkey.map(x => page.keyboard.down(x)));
|
await Promise.all(panHotkey.map((x) => page.keyboard.down(x)));
|
||||||
await page.mouse.down();
|
await page.mouse.down();
|
||||||
await page.mouse.move(imageCenterX, imageCenterY + 200, 10);
|
await page.mouse.move(imageCenterX, imageCenterY + 200, 10);
|
||||||
await page.mouse.up();
|
await page.mouse.up();
|
||||||
await Promise.all(panHotkey.map(x => page.keyboard.up(x)));
|
await Promise.all(panHotkey.map((x) => page.keyboard.up(x)));
|
||||||
const afterUpPanBoundingBox = await page.locator(backgroundImageSelector).boundingBox();
|
const afterUpPanBoundingBox = await page.locator(backgroundImageSelector).boundingBox();
|
||||||
expect(afterUpPanBoundingBox.y).toBeGreaterThanOrEqual(afterLeftPanBoundingBox.y);
|
expect(afterUpPanBoundingBox.y).toBeGreaterThanOrEqual(afterLeftPanBoundingBox.y);
|
||||||
|
|
||||||
// Pan down
|
// Pan down
|
||||||
await Promise.all(panHotkey.map(x => page.keyboard.down(x)));
|
await Promise.all(panHotkey.map((x) => page.keyboard.down(x)));
|
||||||
await page.mouse.down();
|
await page.mouse.down();
|
||||||
await page.mouse.move(imageCenterX, imageCenterY - 200, 10);
|
await page.mouse.move(imageCenterX, imageCenterY - 200, 10);
|
||||||
await page.mouse.up();
|
await page.mouse.up();
|
||||||
await Promise.all(panHotkey.map(x => page.keyboard.up(x)));
|
await Promise.all(panHotkey.map((x) => page.keyboard.up(x)));
|
||||||
const afterDownPanBoundingBox = await page.locator(backgroundImageSelector).boundingBox();
|
const afterDownPanBoundingBox = await page.locator(backgroundImageSelector).boundingBox();
|
||||||
expect(afterDownPanBoundingBox.y).toBeLessThanOrEqual(afterUpPanBoundingBox.y);
|
expect(afterDownPanBoundingBox.y).toBeLessThanOrEqual(afterUpPanBoundingBox.y);
|
||||||
}
|
}
|
||||||
@@ -664,7 +799,6 @@ async function panZoomAndAssertImageProperties(page) {
|
|||||||
async function mouseZoomOnImageAndAssert(page, factor = 2) {
|
async function mouseZoomOnImageAndAssert(page, factor = 2) {
|
||||||
// Zoom in
|
// Zoom in
|
||||||
const originalImageDimensions = await page.locator(backgroundImageSelector).boundingBox();
|
const originalImageDimensions = await page.locator(backgroundImageSelector).boundingBox();
|
||||||
await page.locator(backgroundImageSelector).hover({trial: true});
|
|
||||||
const deltaYStep = 100; // equivalent to 1x zoom
|
const deltaYStep = 100; // equivalent to 1x zoom
|
||||||
await page.mouse.wheel(0, deltaYStep * factor);
|
await page.mouse.wheel(0, deltaYStep * factor);
|
||||||
const zoomedBoundingBox = await page.locator(backgroundImageSelector).boundingBox();
|
const zoomedBoundingBox = await page.locator(backgroundImageSelector).boundingBox();
|
||||||
@@ -675,7 +809,7 @@ async function mouseZoomOnImageAndAssert(page, factor = 2) {
|
|||||||
await page.mouse.move(imageCenterX, imageCenterY);
|
await page.mouse.move(imageCenterX, imageCenterY);
|
||||||
|
|
||||||
// Wait for zoom animation to finish
|
// Wait for zoom animation to finish
|
||||||
await page.locator(backgroundImageSelector).hover({trial: true});
|
await page.locator('.c-imagery__main-image__bg').hover({ trial: true });
|
||||||
const imageMouseZoomed = await page.locator(backgroundImageSelector).boundingBox();
|
const imageMouseZoomed = await page.locator(backgroundImageSelector).boundingBox();
|
||||||
|
|
||||||
if (factor > 0) {
|
if (factor > 0) {
|
||||||
@@ -742,7 +876,9 @@ async function assertBackgroundImageContrast(page, expected) {
|
|||||||
*/
|
*/
|
||||||
async function zoomIntoImageryByButton(page) {
|
async function zoomIntoImageryByButton(page) {
|
||||||
// FIXME: There should only be one set of imagery buttons, but there are two?
|
// 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 zoomInBtn = page
|
||||||
|
.locator("[role='toolbar'][aria-label='Image controls'] .t-btn-zoom-in")
|
||||||
|
.nth(0);
|
||||||
const backgroundImage = page.locator(backgroundImageSelector);
|
const backgroundImage = page.locator(backgroundImageSelector);
|
||||||
if (!(await zoomInBtn.isVisible())) {
|
if (!(await zoomInBtn.isVisible())) {
|
||||||
await backgroundImage.hover({ trial: true });
|
await backgroundImage.hover({ trial: true });
|
||||||
@@ -759,7 +895,9 @@ async function zoomIntoImageryByButton(page) {
|
|||||||
*/
|
*/
|
||||||
async function zoomOutOfImageryByButton(page) {
|
async function zoomOutOfImageryByButton(page) {
|
||||||
// FIXME: There should only be one set of imagery buttons, but there are two?
|
// 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 zoomOutBtn = page
|
||||||
|
.locator("[role='toolbar'][aria-label='Image controls'] .t-btn-zoom-out")
|
||||||
|
.nth(0);
|
||||||
const backgroundImage = page.locator(backgroundImageSelector);
|
const backgroundImage = page.locator(backgroundImageSelector);
|
||||||
if (!(await zoomOutBtn.isVisible())) {
|
if (!(await zoomOutBtn.isVisible())) {
|
||||||
await backgroundImage.hover({ trial: true });
|
await backgroundImage.hover({ trial: true });
|
||||||
@@ -776,7 +914,9 @@ async function zoomOutOfImageryByButton(page) {
|
|||||||
*/
|
*/
|
||||||
async function resetImageryPanAndZoom(page) {
|
async function resetImageryPanAndZoom(page) {
|
||||||
// FIXME: There should only be one set of imagery buttons, but there are two?
|
// 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 panZoomResetBtn = page
|
||||||
|
.locator("[role='toolbar'][aria-label='Image controls'] .t-btn-zoom-reset")
|
||||||
|
.nth(0);
|
||||||
const backgroundImage = page.locator(backgroundImageSelector);
|
const backgroundImage = page.locator(backgroundImageSelector);
|
||||||
if (!(await panZoomResetBtn.isVisible())) {
|
if (!(await panZoomResetBtn.isVisible())) {
|
||||||
await backgroundImage.hover({ trial: true });
|
await backgroundImage.hover({ trial: true });
|
||||||
@@ -785,3 +925,26 @@ async function resetImageryPanAndZoom(page) {
|
|||||||
await panZoomResetBtn.click();
|
await panZoomResetBtn.click();
|
||||||
await waitForAnimations(backgroundImage);
|
await waitForAnimations(backgroundImage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {import('@playwright/test').Page} page
|
||||||
|
*/
|
||||||
|
async function createImageryView(page) {
|
||||||
|
// Click the Create button
|
||||||
|
await page.click('button:has-text("Create")');
|
||||||
|
|
||||||
|
// 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')
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|||||||
@@ -29,22 +29,31 @@ This test suite is dedicated to tests which verify the basic operations surround
|
|||||||
const { test, expect } = require('../../../../baseFixtures');
|
const { test, expect } = require('../../../../baseFixtures');
|
||||||
|
|
||||||
test.describe('ExportAsJSON', () => {
|
test.describe('ExportAsJSON', () => {
|
||||||
test.fixme('Create a basic object and verify that it can be exported as JSON from Tree', async ({ page }) => {
|
test.fixme(
|
||||||
|
'Create a basic object and verify that it can be exported as JSON from Tree',
|
||||||
|
async ({ page }) => {
|
||||||
//Create domain object
|
//Create domain object
|
||||||
//Save Domain Object
|
//Save Domain Object
|
||||||
//Verify that the newly created domain object can be exported as JSON from the Tree
|
//Verify that the newly created domain object can be exported as JSON from the Tree
|
||||||
});
|
}
|
||||||
test.fixme('Create a basic object and verify that it can be exported as JSON from 3 dot menu', async ({ page }) => {
|
);
|
||||||
|
test.fixme(
|
||||||
|
'Create a basic object and verify that it can be exported as JSON from 3 dot menu',
|
||||||
|
async ({ page }) => {
|
||||||
//Create domain object
|
//Create domain object
|
||||||
//Save Domain Object
|
//Save Domain Object
|
||||||
//Verify that the newly created domain object can be exported as JSON from the 3 dot menu
|
//Verify that the newly created domain object can be exported as JSON from the 3 dot menu
|
||||||
});
|
}
|
||||||
|
);
|
||||||
test.fixme('Verify that a nested Object can be exported as JSON', async ({ page }) => {
|
test.fixme('Verify that a nested Object can be exported as JSON', async ({ page }) => {
|
||||||
// Create 2 objects with hierarchy
|
// Create 2 objects with hierarchy
|
||||||
// Export as JSON
|
// Export as JSON
|
||||||
// Verify Hiearchy
|
// Verify Hierarchy
|
||||||
});
|
|
||||||
test.fixme('Verify that the ExportAsJSON dropdown does not appear for the item X', async ({ page }) => {
|
|
||||||
// Other than non-persistible objects
|
|
||||||
});
|
});
|
||||||
|
test.fixme(
|
||||||
|
'Verify that the ExportAsJSON dropdown does not appear for the item X',
|
||||||
|
async ({ page }) => {
|
||||||
|
// Other than non-persistable objects
|
||||||
|
}
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -33,16 +33,22 @@ test.describe('ExportAsJSON', () => {
|
|||||||
//Verify that an testdata JSON file can be imported from Tree
|
//Verify that an testdata JSON file can be imported from Tree
|
||||||
//Verify correctness of imported domain object
|
//Verify correctness of imported domain object
|
||||||
});
|
});
|
||||||
test.fixme('Verify that domain object can be importAsJSON from 3 dot menu on folder', async ({ page }) => {
|
test.fixme(
|
||||||
|
'Verify that domain object can be importAsJSON from 3 dot menu on folder',
|
||||||
|
async ({ page }) => {
|
||||||
//Verify that an testdata JSON file can be imported from 3 dot menu on folder domain object
|
//Verify that an testdata JSON file can be imported from 3 dot menu on folder domain object
|
||||||
//Verify correctness of imported domain object
|
//Verify correctness of imported domain object
|
||||||
});
|
}
|
||||||
|
);
|
||||||
test.fixme('Verify that a nested Objects can be importAsJSON', async ({ page }) => {
|
test.fixme('Verify that a nested Objects can be importAsJSON', async ({ page }) => {
|
||||||
// Testdata with hierarchy
|
// Testdata with hierarchy
|
||||||
// ImportAsJSON on Tree
|
// ImportAsJSON on Tree
|
||||||
// Verify Hierarchy
|
// Verify Hierarchy
|
||||||
});
|
});
|
||||||
test.fixme('Verify that the ImportAsJSON dropdown does not appear for the item X', async ({ page }) => {
|
test.fixme(
|
||||||
// Other than non-persistible objects
|
'Verify that the ImportAsJSON dropdown does not appear for the item X',
|
||||||
});
|
async ({ page }) => {
|
||||||
|
// Other than non-persistable objects
|
||||||
|
}
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -21,22 +21,28 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
const { test, expect } = require('../../../../pluginFixtures');
|
const { test, expect } = require('../../../../pluginFixtures');
|
||||||
const { createDomainObjectWithDefaults, setStartOffset, setFixedTimeMode, setRealTimeMode, selectInspectorTab } = require('../../../../appActions');
|
const {
|
||||||
|
createDomainObjectWithDefaults,
|
||||||
|
setStartOffset,
|
||||||
|
setFixedTimeMode,
|
||||||
|
setRealTimeMode,
|
||||||
|
selectInspectorTab
|
||||||
|
} = require('../../../../appActions');
|
||||||
|
|
||||||
test.describe('Testing LAD table configuration', () => {
|
test.describe('Testing LAD table configuration', () => {
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
// Create LAD table
|
// Create LAD table
|
||||||
const ladTable = await createDomainObjectWithDefaults(page, {
|
const ladTable = await createDomainObjectWithDefaults(page, {
|
||||||
type: 'LAD Table',
|
type: 'LAD Table',
|
||||||
name: "Test LAD Table"
|
name: 'Test LAD Table'
|
||||||
});
|
});
|
||||||
|
|
||||||
// Create Sine Wave Generator
|
// Create Sine Wave Generator
|
||||||
await createDomainObjectWithDefaults(page, {
|
await createDomainObjectWithDefaults(page, {
|
||||||
type: 'Sine Wave Generator',
|
type: 'Sine Wave Generator',
|
||||||
name: "Test Sine Wave Generator",
|
name: 'Test Sine Wave Generator',
|
||||||
parent: ladTable.uuid
|
parent: ladTable.uuid
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -117,7 +123,9 @@ test.describe('Testing LAD table configuration', () => {
|
|||||||
await expect(page.getByRole('cell', { name: 'Type' })).toBeVisible();
|
await expect(page.getByRole('cell', { name: 'Type' })).toBeVisible();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('LAD Tables don\'t allow selection of rows but does show context click menus', async ({ page }) => {
|
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 = await page.locator('.js-first-data');
|
||||||
const userSelectable = await cell.evaluate((el) => {
|
const userSelectable = await cell.evaluate((el) => {
|
||||||
return window.getComputedStyle(el).getPropertyValue('user-select');
|
return window.getComputedStyle(el).getPropertyValue('user-select');
|
||||||
@@ -139,20 +147,22 @@ test.describe('Testing LAD table configuration', () => {
|
|||||||
test.describe('Testing LAD table @unstable', () => {
|
test.describe('Testing LAD table @unstable', () => {
|
||||||
let sineWaveObject;
|
let sineWaveObject;
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
await setRealTimeMode(page);
|
await setRealTimeMode(page);
|
||||||
|
|
||||||
// Create Sine Wave Generator
|
// Create Sine Wave Generator
|
||||||
sineWaveObject = await createDomainObjectWithDefaults(page, {
|
sineWaveObject = await createDomainObjectWithDefaults(page, {
|
||||||
type: 'Sine Wave Generator',
|
type: 'Sine Wave Generator',
|
||||||
name: "Test Sine Wave Generator"
|
name: 'Test Sine Wave Generator'
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
test('telemetry value exactly matches latest telemetry value received in real time', async ({ page }) => {
|
test('telemetry value exactly matches latest telemetry value received in real time', async ({
|
||||||
|
page
|
||||||
|
}) => {
|
||||||
// Create LAD table
|
// Create LAD table
|
||||||
await createDomainObjectWithDefaults(page, {
|
await createDomainObjectWithDefaults(page, {
|
||||||
type: 'LAD Table',
|
type: 'LAD Table',
|
||||||
name: "Test LAD Table"
|
name: 'Test LAD Table'
|
||||||
});
|
});
|
||||||
// Edit LAD table
|
// Edit LAD table
|
||||||
await page.locator('[title="Edit"]').click();
|
await page.locator('[title="Edit"]').click();
|
||||||
@@ -174,11 +184,13 @@ test.describe('Testing LAD table @unstable', () => {
|
|||||||
|
|
||||||
expect(ladTableValue).toBe(subscribeTelemValue);
|
expect(ladTableValue).toBe(subscribeTelemValue);
|
||||||
});
|
});
|
||||||
test('telemetry value exactly matches latest telemetry value received in fixed time', async ({ page }) => {
|
test('telemetry value exactly matches latest telemetry value received in fixed time', async ({
|
||||||
|
page
|
||||||
|
}) => {
|
||||||
// Create LAD table
|
// Create LAD table
|
||||||
await createDomainObjectWithDefaults(page, {
|
await createDomainObjectWithDefaults(page, {
|
||||||
type: 'LAD Table',
|
type: 'LAD Table',
|
||||||
name: "Test LAD Table"
|
name: 'Test LAD Table'
|
||||||
});
|
});
|
||||||
// Edit LAD table
|
// Edit LAD table
|
||||||
await page.locator('[title="Edit"]').click();
|
await page.locator('[title="Edit"]').click();
|
||||||
@@ -216,7 +228,9 @@ test.describe('Testing LAD table @unstable', () => {
|
|||||||
* @returns {Promise<string>} the formatted sin telemetry value
|
* @returns {Promise<string>} the formatted sin telemetry value
|
||||||
*/
|
*/
|
||||||
async function subscribeToTelemetry(page, objectIdentifier) {
|
async function subscribeToTelemetry(page, objectIdentifier) {
|
||||||
const getTelemValuePromise = new Promise(resolve => page.exposeFunction('getTelemValue', resolve));
|
const getTelemValuePromise = new Promise((resolve) =>
|
||||||
|
page.exposeFunction('getTelemValue', resolve)
|
||||||
|
);
|
||||||
|
|
||||||
await page.evaluate(async (telemetryIdentifier) => {
|
await page.evaluate(async (telemetryIdentifier) => {
|
||||||
const telemetryObject = await window.openmct.objects.get(telemetryIdentifier);
|
const telemetryObject = await window.openmct.objects.get(telemetryIdentifier);
|
||||||
|
|||||||
@@ -19,12 +19,12 @@
|
|||||||
* this source code distribution or the Licensing information page available
|
* this source code distribution or the Licensing information page available
|
||||||
* at runtime from the About dialog for additional information.
|
* at runtime from the About dialog for additional information.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
/* global __dirname */
|
||||||
/*
|
/*
|
||||||
This test suite is dedicated to tests which verify the basic operations surrounding Notebooks.
|
This test suite is dedicated to tests which verify the basic operations surrounding Notebooks.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const { test, expect } = require('../../../../pluginFixtures');
|
const { test, expect, streamToString } = require('../../../../pluginFixtures');
|
||||||
const { createDomainObjectWithDefaults } = require('../../../../appActions');
|
const { createDomainObjectWithDefaults } = require('../../../../appActions');
|
||||||
const nbUtils = require('../../../../helper/notebookUtils');
|
const nbUtils = require('../../../../helper/notebookUtils');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
@@ -39,7 +39,7 @@ test.describe('Notebook CRUD Operations', () => {
|
|||||||
test.fixme('Can update a Notebook Object', async ({ page }) => {});
|
test.fixme('Can update a Notebook Object', async ({ page }) => {});
|
||||||
test.fixme('Can view a perviously created Notebook Object', async ({ page }) => {});
|
test.fixme('Can view a perviously created Notebook Object', async ({ page }) => {});
|
||||||
test.fixme('Can Delete a Notebook Object', async ({ page }) => {
|
test.fixme('Can Delete a Notebook Object', async ({ page }) => {
|
||||||
// Other than non-persistible objects
|
// Other than non-persistable objects
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -50,50 +50,70 @@ test.describe('Default Notebook', () => {
|
|||||||
// `JSON.parse(localStorage.getItem('notebook-storage'));`
|
// `JSON.parse(localStorage.getItem('notebook-storage'));`
|
||||||
// 1. - Clear default notebook:
|
// 1. - Clear default notebook:
|
||||||
// `localStorage.setItem('notebook-storage', null);`
|
// `localStorage.setItem('notebook-storage', null);`
|
||||||
test.fixme('A newly created Notebook is automatically set as the default notebook if no other notebooks exist', async ({ page }) => {
|
test.fixme(
|
||||||
|
'A newly created Notebook is automatically set as the default notebook if no other notebooks exist',
|
||||||
|
async ({ page }) => {
|
||||||
//Create new notebook
|
//Create new notebook
|
||||||
//Verify Default Notebook Characteristics
|
//Verify Default Notebook Characteristics
|
||||||
});
|
}
|
||||||
test.fixme('A newly created Notebook is automatically set as the default notebook if at least one other notebook exists', async ({ page }) => {
|
);
|
||||||
|
test.fixme(
|
||||||
|
'A newly created Notebook is automatically set as the default notebook if at least one other notebook exists',
|
||||||
|
async ({ page }) => {
|
||||||
//Create new notebook A
|
//Create new notebook A
|
||||||
//Create second notebook B
|
//Create second notebook B
|
||||||
//Verify Non-Default Notebook A Characteristics
|
//Verify Non-Default Notebook A Characteristics
|
||||||
//Verify Default Notebook B Characteristics
|
//Verify Default Notebook B Characteristics
|
||||||
});
|
}
|
||||||
test.fixme('If a default notebook is deleted, the second most recent notebook becomes the default', async ({ page }) => {
|
);
|
||||||
|
test.fixme(
|
||||||
|
'If a default notebook is deleted, the second most recent notebook becomes the default',
|
||||||
|
async ({ page }) => {
|
||||||
//Create new notebook A
|
//Create new notebook A
|
||||||
//Create second notebook B
|
//Create second notebook B
|
||||||
//Delete Notebook B
|
//Delete Notebook B
|
||||||
//Verify Default Notebook A Characteristics
|
//Verify Default Notebook A Characteristics
|
||||||
});
|
}
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.describe('Notebook section tests', () => {
|
test.describe('Notebook section tests', () => {
|
||||||
//The following test cases are associated with Notebook Sections
|
//The following test cases are associated with Notebook Sections
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
//Navigate to baseURL
|
//Navigate to baseURL
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
// Create Notebook
|
// Create Notebook
|
||||||
await createDomainObjectWithDefaults(page, {
|
await createDomainObjectWithDefaults(page, {
|
||||||
type: NOTEBOOK_NAME
|
type: NOTEBOOK_NAME
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
test('Default and new sections are automatically named Unnamed Section with Unnamed Page', async ({ page }) => {
|
test('Default and new sections are automatically named Unnamed Section with Unnamed Page', async ({
|
||||||
|
page
|
||||||
|
}) => {
|
||||||
|
const notebookSectionNames = page.locator('.c-notebook__sections .c-list__item__name');
|
||||||
|
const notebookPageNames = page.locator('.c-notebook__pages .c-list__item__name');
|
||||||
|
await expect(notebookSectionNames).toBeHidden();
|
||||||
|
await expect(notebookPageNames).toBeHidden();
|
||||||
|
// Expand sidebar
|
||||||
|
await page.locator('.c-notebook__toggle-nav-button').click();
|
||||||
// Check that the default section and page are created and the name matches the defaults
|
// Check that the default section and page are created and the name matches the defaults
|
||||||
const defaultSectionName = await page.locator('.c-notebook__sections .c-list__item__name').textContent();
|
const defaultSectionName = await notebookSectionNames.innerText();
|
||||||
|
await expect(notebookSectionNames).toBeVisible();
|
||||||
expect(defaultSectionName).toBe('Unnamed Section');
|
expect(defaultSectionName).toBe('Unnamed Section');
|
||||||
const defaultPageName = await page.locator('.c-notebook__pages .c-list__item__name').textContent();
|
const defaultPageName = await notebookPageNames.innerText();
|
||||||
|
await expect(notebookPageNames).toBeVisible();
|
||||||
expect(defaultPageName).toBe('Unnamed Page');
|
expect(defaultPageName).toBe('Unnamed Page');
|
||||||
|
|
||||||
// Expand sidebar and add a section
|
// Add a section
|
||||||
await page.locator('.c-notebook__toggle-nav-button').click();
|
|
||||||
await page.locator('.js-sidebar-sections .c-icon-button.icon-plus').click();
|
await page.locator('.js-sidebar-sections .c-icon-button.icon-plus').click();
|
||||||
|
|
||||||
// Check that new section and page within the new section match the defaults
|
// Check that new section and page within the new section match the defaults
|
||||||
const newSectionName = await page.locator('.c-notebook__sections .c-list__item__name').nth(1).textContent();
|
const newSectionName = await notebookSectionNames.nth(1).innerText();
|
||||||
|
await expect(notebookSectionNames.nth(1)).toBeVisible();
|
||||||
expect(newSectionName).toBe('Unnamed Section');
|
expect(newSectionName).toBe('Unnamed Section');
|
||||||
const newPageName = await page.locator('.c-notebook__pages .c-list__item__name').textContent();
|
const newPageName = await notebookPageNames.innerText();
|
||||||
|
await expect(notebookPageNames).toBeVisible();
|
||||||
expect(newPageName).toBe('Unnamed Page');
|
expect(newPageName).toBe('Unnamed Page');
|
||||||
});
|
});
|
||||||
test.fixme('Section selection operations and associated behavior', async ({ page }) => {
|
test.fixme('Section selection operations and associated behavior', async ({ page }) => {
|
||||||
@@ -133,7 +153,7 @@ test.describe('Notebook page tests', () => {
|
|||||||
//The following test cases are associated with Notebook Pages
|
//The following test cases are associated with Notebook Pages
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
//Navigate to baseURL
|
//Navigate to baseURL
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
// Create Notebook
|
// Create Notebook
|
||||||
await createDomainObjectWithDefaults(page, {
|
await createDomainObjectWithDefaults(page, {
|
||||||
@@ -142,7 +162,9 @@ test.describe('Notebook page tests', () => {
|
|||||||
});
|
});
|
||||||
//Test will need to be implemented after a refactor in #5713
|
//Test will need to be implemented after a refactor in #5713
|
||||||
// eslint-disable-next-line playwright/no-skipped-test
|
// eslint-disable-next-line playwright/no-skipped-test
|
||||||
test.skip('Delete page popup is removed properly on clicking dropdown again', async ({ page }) => {
|
test.skip('Delete page popup is removed properly on clicking dropdown again', async ({
|
||||||
|
page
|
||||||
|
}) => {
|
||||||
test.info().annotations.push({
|
test.info().annotations.push({
|
||||||
type: 'issue',
|
type: 'issue',
|
||||||
description: 'https://github.com/nasa/openmct/issues/5713'
|
description: 'https://github.com/nasa/openmct/issues/5713'
|
||||||
@@ -198,6 +220,36 @@ test.describe('Notebook page tests', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test.describe('Notebook export tests', () => {
|
||||||
|
test.beforeEach(async ({ page }) => {
|
||||||
|
//Navigate to baseURL
|
||||||
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
|
// Create Notebook
|
||||||
|
await createDomainObjectWithDefaults(page, {
|
||||||
|
type: NOTEBOOK_NAME
|
||||||
|
});
|
||||||
|
});
|
||||||
|
test('can export notebook as text', async ({ page }) => {
|
||||||
|
await nbUtils.enterTextEntry(page, `Foo bar entry`);
|
||||||
|
// Click on 3 Dot Menu
|
||||||
|
await page.locator('button[title="More options"]').click();
|
||||||
|
const downloadPromise = page.waitForEvent('download');
|
||||||
|
|
||||||
|
await page.getByRole('menuitem', { name: /Export Notebook as Text/ }).click();
|
||||||
|
|
||||||
|
await page.getByRole('button', { name: 'Save' }).click();
|
||||||
|
const download = await downloadPromise;
|
||||||
|
const readStream = await download.createReadStream();
|
||||||
|
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 all notebook entry metdata', async ({ page }) => {});
|
||||||
|
test.fixme('can export all notebook tags', async ({ page }) => {});
|
||||||
|
test.fixme('can export all notebook snapshots', async ({ page }) => {});
|
||||||
|
});
|
||||||
|
|
||||||
test.describe('Notebook search tests', () => {
|
test.describe('Notebook search tests', () => {
|
||||||
test.fixme('Can search for a single result', async ({ page }) => {});
|
test.fixme('Can search for a single result', async ({ page }) => {});
|
||||||
test.fixme('Can search for many results', async ({ page }) => {});
|
test.fixme('Can search for many results', async ({ page }) => {});
|
||||||
@@ -212,17 +264,29 @@ test.describe('Notebook entry tests', () => {
|
|||||||
let notebookObject;
|
let notebookObject;
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
// eslint-disable-next-line no-undef
|
// eslint-disable-next-line no-undef
|
||||||
await page.addInitScript({ path: path.join(__dirname, '../../../../helper/', 'addInitNotebookWithUrls.js') });
|
await page.addInitScript({
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
path: path.join(__dirname, '../../../../helper/', 'addInitNotebookWithUrls.js')
|
||||||
|
});
|
||||||
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
notebookObject = await createDomainObjectWithDefaults(page, {
|
notebookObject = await createDomainObjectWithDefaults(page, {
|
||||||
type: NOTEBOOK_NAME
|
type: NOTEBOOK_NAME
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
test.fixme('When a new entry is created, it should be focused', async ({ page }) => {});
|
test('When a new entry is created, it should be focused and selected', async ({ page }) => {
|
||||||
test('When an object is dropped into a notebook, a new entry is created and it should be focused @unstable', async ({ page }) => {
|
// Navigate to the notebook object
|
||||||
|
await page.goto(notebookObject.url);
|
||||||
|
|
||||||
|
// Click .c-notebook__drag-area
|
||||||
|
await page.locator('.c-notebook__drag-area').click();
|
||||||
|
await expect(page.locator('[aria-label="Notebook Entry Input"]')).toBeVisible();
|
||||||
|
await expect(page.locator('[aria-label="Notebook Entry"]')).toHaveClass(/is-selected/);
|
||||||
|
});
|
||||||
|
test('When an object is dropped into a notebook, a new entry is created and it should be focused @unstable', async ({
|
||||||
|
page
|
||||||
|
}) => {
|
||||||
// Create Overlay Plot
|
// Create Overlay Plot
|
||||||
await createDomainObjectWithDefaults(page, {
|
const overlayPlot = await createDomainObjectWithDefaults(page, {
|
||||||
type: 'Overlay Plot'
|
type: 'Overlay Plot'
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -232,17 +296,21 @@ test.describe('Notebook entry tests', () => {
|
|||||||
// Reveal the notebook in the tree
|
// Reveal the notebook in the tree
|
||||||
await page.getByTitle('Show selected item in tree').click();
|
await page.getByTitle('Show selected item in tree').click();
|
||||||
|
|
||||||
await page.dragAndDrop('role=treeitem[name=/Dropped Overlay Plot/]', '.c-notebook__drag-area');
|
await page
|
||||||
|
.getByRole('treeitem', { name: overlayPlot.name })
|
||||||
|
.dragTo(page.locator('.c-notebook__drag-area'));
|
||||||
|
|
||||||
const embed = page.locator('.c-ne__embed__link');
|
const embed = page.locator('.c-ne__embed__link');
|
||||||
const embedName = await embed.textContent();
|
const embedName = await embed.innerText();
|
||||||
|
|
||||||
await expect(embed).toHaveClass(/icon-plot-overlay/);
|
await expect(embed).toHaveClass(/icon-plot-overlay/);
|
||||||
expect(embedName).toBe('Dropped Overlay Plot');
|
expect(embedName).toBe(overlayPlot.name);
|
||||||
});
|
});
|
||||||
test('When an object is dropped into a notebooks existing entry, it should be focused @unstable', async ({ page }) => {
|
test('When an object is dropped into a notebooks existing entry, it should be focused @unstable', async ({
|
||||||
|
page
|
||||||
|
}) => {
|
||||||
// Create Overlay Plot
|
// Create Overlay Plot
|
||||||
await createDomainObjectWithDefaults(page, {
|
const overlayPlot = await createDomainObjectWithDefaults(page, {
|
||||||
type: 'Overlay Plot'
|
type: 'Overlay Plot'
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -253,18 +321,42 @@ test.describe('Notebook entry tests', () => {
|
|||||||
await page.getByTitle('Show selected item in tree').click();
|
await page.getByTitle('Show selected item in tree').click();
|
||||||
|
|
||||||
await nbUtils.enterTextEntry(page, 'Entry to drop into');
|
await nbUtils.enterTextEntry(page, 'Entry to drop into');
|
||||||
await page.dragAndDrop('role=treeitem[name=/Dropped Overlay Plot/]', 'text=Entry to drop into');
|
await page
|
||||||
|
.getByRole('treeitem', { name: overlayPlot.name })
|
||||||
|
.dragTo(page.locator('text=Entry to drop into'));
|
||||||
|
|
||||||
const existingEntry = page.locator('.c-ne__content', { has: page.locator('text="Entry to drop into"') });
|
const existingEntry = page.locator('.c-ne__content', {
|
||||||
|
has: page.locator('text="Entry to drop into"')
|
||||||
|
});
|
||||||
const embed = existingEntry.locator('.c-ne__embed__link');
|
const embed = existingEntry.locator('.c-ne__embed__link');
|
||||||
const embedName = await embed.textContent();
|
const embedName = await embed.innerText();
|
||||||
|
|
||||||
await expect(embed).toHaveClass(/icon-plot-overlay/);
|
await expect(embed).toHaveClass(/icon-plot-overlay/);
|
||||||
expect(embedName).toBe('Dropped Overlay Plot');
|
expect(embedName).toBe(overlayPlot.name);
|
||||||
});
|
});
|
||||||
test.fixme('new entries persist through navigation events without save', async ({ page }) => {});
|
test.fixme('new entries persist through navigation events without save', async ({ page }) => {});
|
||||||
test.fixme('previous and new entries can be deleted', async ({ page }) => {});
|
test('previous and new entries can be deleted', async ({ page }) => {
|
||||||
test('when a valid link is entered into a notebook entry, it becomes clickable when viewing', async ({ page }) => {
|
// Navigate to the notebook object
|
||||||
|
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 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();
|
||||||
|
});
|
||||||
|
test('when a valid link is entered into a notebook entry, it becomes clickable when viewing', async ({
|
||||||
|
page
|
||||||
|
}) => {
|
||||||
const TEST_LINK = 'http://www.google.com';
|
const TEST_LINK = 'http://www.google.com';
|
||||||
|
|
||||||
// Navigate to the notebook object
|
// Navigate to the notebook object
|
||||||
@@ -289,7 +381,9 @@ test.describe('Notebook entry tests', () => {
|
|||||||
|
|
||||||
expect(await validLink.count()).toBe(1);
|
expect(await validLink.count()).toBe(1);
|
||||||
});
|
});
|
||||||
test('when an invalid link is entered into a notebook entry, it does not become clickable when viewing', async ({ page }) => {
|
test('when an invalid link is entered into a notebook entry, it does not become clickable when viewing', async ({
|
||||||
|
page
|
||||||
|
}) => {
|
||||||
const TEST_LINK = 'www.google.com';
|
const TEST_LINK = 'www.google.com';
|
||||||
|
|
||||||
// Navigate to the notebook object
|
// Navigate to the notebook object
|
||||||
@@ -304,7 +398,9 @@ test.describe('Notebook entry tests', () => {
|
|||||||
|
|
||||||
expect(await invalidLink.count()).toBe(0);
|
expect(await invalidLink.count()).toBe(0);
|
||||||
});
|
});
|
||||||
test('when a link is entered, but it is not in the whitelisted urls, it does not become clickable when viewing', async ({ page }) => {
|
test('when a link is entered, but it is not in the whitelisted urls, it does not become clickable when viewing', async ({
|
||||||
|
page
|
||||||
|
}) => {
|
||||||
const TEST_LINK = 'http://www.bing.com';
|
const TEST_LINK = 'http://www.bing.com';
|
||||||
|
|
||||||
// Navigate to the notebook object
|
// Navigate to the notebook object
|
||||||
@@ -319,7 +415,9 @@ test.describe('Notebook entry tests', () => {
|
|||||||
|
|
||||||
expect(await invalidLink.count()).toBe(0);
|
expect(await invalidLink.count()).toBe(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 }) => {
|
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
|
||||||
|
}) => {
|
||||||
const INVALID_TEST_LINK = 'http://bing.google.com';
|
const INVALID_TEST_LINK = 'http://bing.google.com';
|
||||||
|
|
||||||
// Navigate to the notebook object
|
// Navigate to the notebook object
|
||||||
@@ -334,7 +432,9 @@ test.describe('Notebook entry tests', () => {
|
|||||||
|
|
||||||
expect(await validLink.count()).toBe(1);
|
expect(await validLink.count()).toBe(1);
|
||||||
});
|
});
|
||||||
test('when a valid secure link is entered into a notebook entry, it becomes clickable when viewing', async ({ page }) => {
|
test('when a valid secure link is entered into a notebook entry, it becomes clickable when viewing', async ({
|
||||||
|
page
|
||||||
|
}) => {
|
||||||
const TEST_LINK = 'https://www.google.com';
|
const TEST_LINK = 'https://www.google.com';
|
||||||
|
|
||||||
// Navigate to the notebook object
|
// Navigate to the notebook object
|
||||||
@@ -359,7 +459,9 @@ test.describe('Notebook entry tests', () => {
|
|||||||
|
|
||||||
expect(await validLink.count()).toBe(1);
|
expect(await validLink.count()).toBe(1);
|
||||||
});
|
});
|
||||||
test('when a nefarious link is entered into a notebook entry, it is sanitized when viewing', async ({ page }) => {
|
test('when a nefarious link is entered into a notebook entry, it is sanitized when viewing', async ({
|
||||||
|
page
|
||||||
|
}) => {
|
||||||
const TEST_LINK = 'http://www.google.com?bad=';
|
const TEST_LINK = 'http://www.google.com?bad=';
|
||||||
const TEST_LINK_BAD = `http://www.google.com?bad=<script>alert('gimme your cookies')</script>`;
|
const TEST_LINK_BAD = `http://www.google.com?bad=<script>alert('gimme your cookies')</script>`;
|
||||||
|
|
||||||
@@ -369,7 +471,10 @@ test.describe('Notebook entry tests', () => {
|
|||||||
// Reveal the notebook in the tree
|
// Reveal the notebook in the tree
|
||||||
await page.getByTitle('Show selected item in tree').click();
|
await page.getByTitle('Show selected item in tree').click();
|
||||||
|
|
||||||
await nbUtils.enterTextEntry(page, `This should be a link, BUT not a bad link: ${TEST_LINK_BAD} is it?`);
|
await nbUtils.enterTextEntry(
|
||||||
|
page,
|
||||||
|
`This should be a link, BUT not a bad link: ${TEST_LINK_BAD} is it?`
|
||||||
|
);
|
||||||
|
|
||||||
const sanitizedLink = page.locator(`a[href="${TEST_LINK}"]`);
|
const sanitizedLink = page.locator(`a[href="${TEST_LINK}"]`);
|
||||||
const unsanitizedLink = page.locator(`a[href="${TEST_LINK_BAD}"]`);
|
const unsanitizedLink = page.locator(`a[href="${TEST_LINK_BAD}"]`);
|
||||||
|
|||||||
@@ -29,14 +29,19 @@ const { test, expect } = require('../../../../pluginFixtures');
|
|||||||
// const nbUtils = require('../../../../helper/notebookUtils');
|
// const nbUtils = require('../../../../helper/notebookUtils');
|
||||||
|
|
||||||
test.describe('Snapshot Menu tests', () => {
|
test.describe('Snapshot Menu tests', () => {
|
||||||
test.fixme('When no default notebook is selected, Snapshot Menu dropdown should only have a single option', async ({ page }) => {
|
test.fixme(
|
||||||
|
'When no default notebook is selected, Snapshot Menu dropdown should only have a single option',
|
||||||
|
async ({ page }) => {
|
||||||
// There should be no default notebook
|
// There should be no default notebook
|
||||||
// Clear default notebook if exists using `localStorage.setItem('notebook-storage', null);`
|
// Clear default notebook if exists using `localStorage.setItem('notebook-storage', null);`
|
||||||
// refresh page
|
// refresh page
|
||||||
// Click on 'Notebook Snaphot Menu'
|
// Click on 'Notebook Snapshot Menu'
|
||||||
// 'save to Notebook Snapshots' should be only option there
|
// 'save to Notebook Snapshots' should be only option there
|
||||||
});
|
}
|
||||||
test.fixme('When default notebook is updated selected, Snapshot Menu dropdown should list it as the newest option', async ({ page }) => {
|
);
|
||||||
|
test.fixme(
|
||||||
|
'When default notebook is updated selected, Snapshot Menu dropdown should list it as the newest option',
|
||||||
|
async ({ page }) => {
|
||||||
// Create 2a notebooks
|
// Create 2a notebooks
|
||||||
// Set Notebook A as Default
|
// Set Notebook A as Default
|
||||||
// Open Snapshot Menu and note that Notebook A is listed
|
// Open Snapshot Menu and note that Notebook A is listed
|
||||||
@@ -44,7 +49,8 @@ test.describe('Snapshot Menu tests', () => {
|
|||||||
// Set Default Notebook to Notebook B
|
// Set Default Notebook to Notebook B
|
||||||
// Open Snapshot Notebook and note that Notebook B is listed
|
// Open Snapshot Notebook and note that Notebook B is listed
|
||||||
// Select Default Notebook Option and verify that Snapshot is added to Notebook B
|
// Select Default Notebook Option and verify that Snapshot is added to Notebook B
|
||||||
});
|
}
|
||||||
|
);
|
||||||
test.fixme('Can add Snapshots via Snapshot Menu and details are correct', async ({ page }) => {
|
test.fixme('Can add Snapshots via Snapshot Menu and details are correct', async ({ page }) => {
|
||||||
//Note this should be a visual test, too
|
//Note this should be a visual test, too
|
||||||
// Create Telemetry object
|
// Create Telemetry object
|
||||||
@@ -66,7 +72,7 @@ test.describe('Snapshot Menu tests', () => {
|
|||||||
test.describe('Snapshot Container tests', () => {
|
test.describe('Snapshot Container tests', () => {
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
//Navigate to baseURL
|
//Navigate to baseURL
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
// Create Notebook
|
// Create Notebook
|
||||||
// const notebook = await createDomainObjectWithDefaults(page, {
|
// const notebook = await createDomainObjectWithDefaults(page, {
|
||||||
@@ -82,12 +88,19 @@ test.describe('Snapshot Container tests', () => {
|
|||||||
await page.getByRole('button', { name: ' Snapshot ' }).click();
|
await page.getByRole('button', { name: ' Snapshot ' }).click();
|
||||||
await page.getByRole('menuitem', { name: ' Save to Notebook Snapshots' }).click();
|
await page.getByRole('menuitem', { name: ' Save to Notebook Snapshots' }).click();
|
||||||
await page.getByRole('button', { name: 'Show' }).click();
|
await page.getByRole('button', { name: 'Show' }).click();
|
||||||
|
|
||||||
});
|
});
|
||||||
test.fixme('5 Snapshots can be added to a container', async ({ page }) => {});
|
test.fixme('5 Snapshots can be added to a container', async ({ page }) => {});
|
||||||
test.fixme('5 Snapshots can be added to a container and Deleted with Delete All action', async ({ page }) => {});
|
test.fixme(
|
||||||
test.fixme('A snapshot can be Deleted from Container with 3 dot action menu', async ({ page }) => {});
|
'5 Snapshots can be added to a container and Deleted with Delete All action',
|
||||||
test.fixme('A snapshot can be Viewed, Annotated, display deleted, and saved from Container with 3 dot action menu', async ({ page }) => {
|
async ({ page }) => {}
|
||||||
|
);
|
||||||
|
test.fixme(
|
||||||
|
'A snapshot can be Deleted from Container with 3 dot action menu',
|
||||||
|
async ({ page }) => {}
|
||||||
|
);
|
||||||
|
test.fixme(
|
||||||
|
'A snapshot can be Viewed, Annotated, display deleted, and saved from Container with 3 dot action menu',
|
||||||
|
async ({ page }) => {
|
||||||
await page.locator('.c-snapshot.c-ne__embed').first().getByTitle('More options').click();
|
await page.locator('.c-snapshot.c-ne__embed').first().getByTitle('More options').click();
|
||||||
await page.getByRole('menuitem', { name: ' View Snapshot' }).click();
|
await page.getByRole('menuitem', { name: ' View Snapshot' }).click();
|
||||||
await expect(page.locator('.c-overlay__outer')).toBeVisible();
|
await expect(page.locator('.c-overlay__outer')).toBeVisible();
|
||||||
@@ -98,16 +111,25 @@ test.describe('Snapshot Container tests', () => {
|
|||||||
await page.getByRole('button', { name: 'Save' }).click();
|
await page.getByRole('button', { name: 'Save' }).click();
|
||||||
await page.getByRole('button', { name: 'Done' }).click();
|
await page.getByRole('button', { name: 'Done' }).click();
|
||||||
//await expect(await page.locator)
|
//await expect(await page.locator)
|
||||||
});
|
}
|
||||||
|
);
|
||||||
test('A snapshot can be Quick Viewed from Container with 3 dot action menu', async ({ page }) => {
|
test('A snapshot can be Quick Viewed from Container with 3 dot action menu', async ({ page }) => {
|
||||||
await page.locator('.c-snapshot.c-ne__embed').first().getByTitle('More options').click();
|
await page.locator('.c-snapshot.c-ne__embed').first().getByTitle('More options').click();
|
||||||
await page.getByRole('menuitem', { name: 'Quick View' }).click();
|
await page.getByRole('menuitem', { name: 'Quick View' }).click();
|
||||||
await expect(page.locator('.c-overlay__outer')).toBeVisible();
|
await expect(page.locator('.c-overlay__outer')).toBeVisible();
|
||||||
});
|
});
|
||||||
test.fixme('A snapshot can be Navigated To from Container with 3 dot action menu', async ({ page }) => {});
|
test.fixme(
|
||||||
test.fixme('A snapshot can be Navigated To Item in Time from Container with 3 dot action menu', async ({ page }) => {});
|
'A snapshot can be Navigated To from Container with 3 dot action menu',
|
||||||
|
async ({ page }) => {}
|
||||||
|
);
|
||||||
|
test.fixme(
|
||||||
|
'A snapshot can be Navigated To Item in Time from Container with 3 dot action menu',
|
||||||
|
async ({ page }) => {}
|
||||||
|
);
|
||||||
test.fixme('A snapshot Container can be open and closed', async ({ page }) => {});
|
test.fixme('A snapshot Container can be open and closed', async ({ page }) => {});
|
||||||
test.fixme('Can add object to Snapshot container and pull into notebook and create a new entry', async ({ page }) => {
|
test.fixme(
|
||||||
|
'Can add object to Snapshot container and pull into notebook and create a new entry',
|
||||||
|
async ({ page }) => {
|
||||||
//Create Notebook
|
//Create Notebook
|
||||||
//Create Telemetry Object
|
//Create Telemetry Object
|
||||||
//From Telemetry Object, use 'save to Notebook Snapshots'
|
//From Telemetry Object, use 'save to Notebook Snapshots'
|
||||||
@@ -116,8 +138,11 @@ test.describe('Snapshot Container tests', () => {
|
|||||||
//Drag and Drop onto droppable area for new entry
|
//Drag and Drop onto droppable area for new entry
|
||||||
//New Entry created with given snapshot added
|
//New Entry created with given snapshot added
|
||||||
//Snapshot removed from container?
|
//Snapshot removed from container?
|
||||||
});
|
}
|
||||||
test.fixme('Can add object to Snapshot container and pull into notebook and existing entry', async ({ page }) => {
|
);
|
||||||
|
test.fixme(
|
||||||
|
'Can add object to Snapshot container and pull into notebook and existing entry',
|
||||||
|
async ({ page }) => {
|
||||||
//Create Notebook
|
//Create Notebook
|
||||||
//Create Telemetry Object
|
//Create Telemetry Object
|
||||||
//From Telemetry Object, use 'save to Notebook Snapshots'
|
//From Telemetry Object, use 'save to Notebook Snapshots'
|
||||||
@@ -126,9 +151,13 @@ test.describe('Snapshot Container tests', () => {
|
|||||||
//Drag and Drop into exiting entry
|
//Drag and Drop into exiting entry
|
||||||
//Existing Entry updated with given snapshot
|
//Existing Entry updated with given snapshot
|
||||||
//Snapshot removed from container?
|
//Snapshot removed from container?
|
||||||
});
|
}
|
||||||
test.fixme('Verify Embedded options for PNG, JPG, and Annotate work correctly', async ({ page }) => {
|
);
|
||||||
|
test.fixme(
|
||||||
|
'Verify Embedded options for PNG, JPG, and Annotate work correctly',
|
||||||
|
async ({ page }) => {
|
||||||
//Add snapshot to container
|
//Add snapshot to container
|
||||||
//Verify PNG, JPG, and Annotate buttons work correctly
|
//Verify PNG, JPG, and Annotate buttons work correctly
|
||||||
});
|
}
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -26,60 +26,59 @@ This test suite is dedicated to tests which verify the basic operations surround
|
|||||||
|
|
||||||
const { test, expect } = require('../../../../pluginFixtures');
|
const { test, expect } = require('../../../../pluginFixtures');
|
||||||
const { createDomainObjectWithDefaults } = require('../../../../appActions');
|
const { createDomainObjectWithDefaults } = require('../../../../appActions');
|
||||||
|
const nbUtils = require('../../../../helper/notebookUtils');
|
||||||
|
|
||||||
test.describe('Notebook Tests with CouchDB @couchdb', () => {
|
test.describe('Notebook Tests with CouchDB @couchdb', () => {
|
||||||
let testNotebook;
|
let testNotebook;
|
||||||
|
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
//Navigate to baseURL
|
//Navigate to baseURL
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
// Create Notebook
|
// Create Notebook
|
||||||
testNotebook = await createDomainObjectWithDefaults(page, {
|
testNotebook = await createDomainObjectWithDefaults(page, { type: 'Notebook' });
|
||||||
type: 'Notebook',
|
await page.goto(testNotebook.url, { waitUntil: 'networkidle' });
|
||||||
name: "TestNotebook"
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Inspect Notebook Entry Network Requests', async ({ page }) => {
|
test('Inspect Notebook Entry Network Requests', async ({ page }) => {
|
||||||
|
//Ensure we're on the annotations Tab in the inspector
|
||||||
await page.getByText('Annotations').click();
|
await page.getByText('Annotations').click();
|
||||||
// Expand sidebar
|
// Expand sidebar
|
||||||
await page.locator('.c-notebook__toggle-nav-button').click();
|
await page.locator('.c-notebook__toggle-nav-button').click();
|
||||||
|
|
||||||
// Collect all request events to count and assert after notebook action
|
// Collect all request events to count and assert after notebook action
|
||||||
let addingNotebookElementsRequests = [];
|
let notebookElementsRequests = [];
|
||||||
page.on('request', (request) => addingNotebookElementsRequests.push(request));
|
page.on('request', (request) => notebookElementsRequests.push(request));
|
||||||
|
|
||||||
let [notebookUrlRequest, allDocsRequest] = await Promise.all([
|
//Clicking Add Page generates
|
||||||
|
let [notebookUrlRequest] = await Promise.all([
|
||||||
// Waits for the next request with the specified url
|
// Waits for the next request with the specified url
|
||||||
page.waitForRequest(`**/openmct/${testNotebook.uuid}`),
|
page.waitForRequest(`**/openmct/${testNotebook.uuid}`),
|
||||||
page.waitForRequest('**/openmct/_all_docs?include_docs=true'),
|
|
||||||
// Triggers the request
|
// Triggers the request
|
||||||
page.click('[aria-label="Add Page"]'),
|
page.click('[aria-label="Add Page"]')
|
||||||
// Ensures that there are no other network requests
|
|
||||||
page.waitForLoadState('networkidle')
|
|
||||||
]);
|
]);
|
||||||
|
// Ensures that there are no other network requests
|
||||||
|
await page.waitForLoadState('networkidle');
|
||||||
|
|
||||||
// Assert that only two requests are made
|
// Assert that only two requests are made
|
||||||
// Network Requests are:
|
// Network Requests are:
|
||||||
// 1) The actual POST to create the page
|
// 1) The actual POST to create the page
|
||||||
// 2) The shared worker event from 👆 request
|
expect(notebookElementsRequests.length).toBe(1);
|
||||||
expect(addingNotebookElementsRequests.length).toBe(2);
|
|
||||||
|
|
||||||
// Assert on request object
|
// Assert on request object
|
||||||
expect(notebookUrlRequest.postDataJSON().metadata.name).toBe('TestNotebook');
|
expect(notebookUrlRequest.postDataJSON().metadata.name).toBe(testNotebook.name);
|
||||||
expect(notebookUrlRequest.postDataJSON().model.persisted).toBeGreaterThanOrEqual(notebookUrlRequest.postDataJSON().model.modified);
|
expect(notebookUrlRequest.postDataJSON().model.persisted).toBeGreaterThanOrEqual(
|
||||||
expect(allDocsRequest.postDataJSON().keys).toContain(testNotebook.uuid);
|
notebookUrlRequest.postDataJSON().model.modified
|
||||||
|
);
|
||||||
|
|
||||||
// Add an entry
|
// Add an entry
|
||||||
// Network Requests are:
|
// Network Requests are:
|
||||||
// 1) The actual POST to create the entry
|
// 1) The actual POST to create the entry
|
||||||
// 2) The shared worker event from 👆 POST request
|
// 2) The shared worker event from 👆 POST request
|
||||||
addingNotebookElementsRequests = [];
|
notebookElementsRequests = [];
|
||||||
await page.locator('text=To start a new entry, click here or drag and drop any object').click();
|
await nbUtils.enterTextEntry(page, 'First Entry');
|
||||||
await page.locator('[aria-label="Notebook Entry Input"]').click();
|
|
||||||
await page.locator('[aria-label="Notebook Entry Input"]').fill(`First Entry`);
|
|
||||||
await page.locator('[aria-label="Notebook Entry Input"]').press('Enter');
|
|
||||||
await page.waitForLoadState('networkidle');
|
await page.waitForLoadState('networkidle');
|
||||||
expect(addingNotebookElementsRequests.length).toBeLessThanOrEqual(2);
|
expect(notebookElementsRequests.length).toBeLessThanOrEqual(2);
|
||||||
|
|
||||||
// Add some tags
|
// Add some tags
|
||||||
// Network Requests are for each tag creation are:
|
// Network Requests are for each tag creation are:
|
||||||
@@ -95,32 +94,17 @@ test.describe('Notebook Tests with CouchDB @couchdb', () => {
|
|||||||
// 10) Entry is timestamped
|
// 10) Entry is timestamped
|
||||||
// 11) The shared worker event from 👆 POST request
|
// 11) The shared worker event from 👆 POST request
|
||||||
|
|
||||||
addingNotebookElementsRequests = [];
|
notebookElementsRequests = [];
|
||||||
await page.hover(`button:has-text("Add Tag")`);
|
await addTagAndAwaitNetwork(page, 'Driving');
|
||||||
await page.locator(`button:has-text("Add Tag")`).click();
|
expect(filterNonFetchRequests(notebookElementsRequests).length).toBeLessThanOrEqual(11);
|
||||||
await page.locator('[placeholder="Type to select tag"]').click();
|
|
||||||
await page.locator('[aria-label="Autocomplete Options"] >> text=Driving').click();
|
|
||||||
await page.waitForSelector('[aria-label="Tag"]:has-text("Driving")');
|
|
||||||
page.waitForLoadState('networkidle');
|
|
||||||
expect(filterNonFetchRequests(addingNotebookElementsRequests).length).toBeLessThanOrEqual(11);
|
|
||||||
|
|
||||||
addingNotebookElementsRequests = [];
|
notebookElementsRequests = [];
|
||||||
await page.hover(`button:has-text("Add Tag")`);
|
await addTagAndAwaitNetwork(page, 'Drilling');
|
||||||
await page.locator(`button:has-text("Add Tag")`).click();
|
expect(filterNonFetchRequests(notebookElementsRequests).length).toBeLessThanOrEqual(11);
|
||||||
await page.locator('[placeholder="Type to select tag"]').click();
|
|
||||||
await page.locator('[aria-label="Autocomplete Options"] >> text=Drilling').click();
|
|
||||||
await page.waitForSelector('[aria-label="Tag"]:has-text("Drilling")');
|
|
||||||
page.waitForLoadState('networkidle');
|
|
||||||
expect(filterNonFetchRequests(addingNotebookElementsRequests).length).toBeLessThanOrEqual(11);
|
|
||||||
|
|
||||||
addingNotebookElementsRequests = [];
|
notebookElementsRequests = [];
|
||||||
await page.hover(`button:has-text("Add Tag")`);
|
await addTagAndAwaitNetwork(page, 'Science');
|
||||||
await page.locator(`button:has-text("Add Tag")`).click();
|
expect(filterNonFetchRequests(notebookElementsRequests).length).toBeLessThanOrEqual(11);
|
||||||
await page.locator('[placeholder="Type to select tag"]').click();
|
|
||||||
await page.locator('[aria-label="Autocomplete Options"] >> text=Science').click();
|
|
||||||
await page.waitForSelector('[aria-label="Tag"]:has-text("Science")');
|
|
||||||
page.waitForLoadState('networkidle');
|
|
||||||
expect(filterNonFetchRequests(addingNotebookElementsRequests).length).toBeLessThanOrEqual(11);
|
|
||||||
|
|
||||||
// Delete all the tags
|
// Delete all the tags
|
||||||
// Network requests are:
|
// Network requests are:
|
||||||
@@ -129,58 +113,25 @@ test.describe('Notebook Tests with CouchDB @couchdb', () => {
|
|||||||
// 3) Timestamp update on entry
|
// 3) Timestamp update on entry
|
||||||
// 4) The shared worker event from 👆 POST request
|
// 4) The shared worker event from 👆 POST request
|
||||||
// This happens for 3 tags so 12 requests
|
// This happens for 3 tags so 12 requests
|
||||||
addingNotebookElementsRequests = [];
|
notebookElementsRequests = [];
|
||||||
await page.hover('[aria-label="Tag"]:has-text("Driving")');
|
await removeTagAndAwaitNetwork(page, 'Driving');
|
||||||
await page.locator('[aria-label="Remove tag Driving"]').click();
|
await removeTagAndAwaitNetwork(page, 'Drilling');
|
||||||
await page.waitForSelector('[aria-label="Tag"]:has-text("Driving")', {state: 'hidden'});
|
await removeTagAndAwaitNetwork(page, 'Science');
|
||||||
await page.hover('[aria-label="Tag"]:has-text("Drilling")');
|
expect(filterNonFetchRequests(notebookElementsRequests).length).toBeLessThanOrEqual(12);
|
||||||
await page.locator('[aria-label="Remove tag Drilling"]').click();
|
|
||||||
await page.waitForSelector('[aria-label="Tag"]:has-text("Drilling")', {state: 'hidden'});
|
|
||||||
page.hover('[aria-label="Tag"]:has-text("Science")');
|
|
||||||
await page.locator('[aria-label="Remove tag Science"]').click();
|
|
||||||
await page.waitForSelector('[aria-label="Tag"]:has-text("Science")', {state: 'hidden'});
|
|
||||||
page.waitForLoadState('networkidle');
|
|
||||||
expect(filterNonFetchRequests(addingNotebookElementsRequests).length).toBeLessThanOrEqual(12);
|
|
||||||
|
|
||||||
// Add two more pages
|
// Add two more pages
|
||||||
await page.click('[aria-label="Add Page"]');
|
await page.click('[aria-label="Add Page"]');
|
||||||
await page.click('[aria-label="Add Page"]');
|
await page.click('[aria-label="Add Page"]');
|
||||||
|
|
||||||
// Add three entries
|
// Add three entries
|
||||||
await page.locator('text=To start a new entry, click here or drag and drop any object').click();
|
await nbUtils.enterTextEntry(page, 'First Entry');
|
||||||
await page.locator('[aria-label="Notebook Entry Input"]').click();
|
await nbUtils.enterTextEntry(page, 'Second Entry');
|
||||||
await page.locator('[aria-label="Notebook Entry Input"]').fill(`First Entry`);
|
await nbUtils.enterTextEntry(page, 'Third Entry');
|
||||||
await page.locator('[aria-label="Notebook Entry Input"]').press('Enter');
|
|
||||||
|
|
||||||
await page.locator('text=To start a new entry, click here or drag and drop any object').click();
|
|
||||||
await page.locator('[aria-label="Notebook Entry Input"] >> nth=1').click();
|
|
||||||
await page.locator('[aria-label="Notebook Entry Input"] >> nth=1').fill(`Second Entry`);
|
|
||||||
await page.locator('[aria-label="Notebook Entry Input"] >> nth=1').press('Enter');
|
|
||||||
|
|
||||||
await page.locator('text=To start a new entry, click here or drag and drop any object').click();
|
|
||||||
await page.locator('[aria-label="Notebook Entry Input"] >> nth=2').click();
|
|
||||||
await page.locator('[aria-label="Notebook Entry Input"] >> nth=2').fill(`Third Entry`);
|
|
||||||
await page.locator('[aria-label="Notebook Entry Input"] >> nth=2').press('Enter');
|
|
||||||
|
|
||||||
// Add three tags
|
// Add three tags
|
||||||
await page.hover(`button:has-text("Add Tag")`);
|
await addTagAndAwaitNetwork(page, 'Science');
|
||||||
await page.locator(`button:has-text("Add Tag")`).click();
|
await addTagAndAwaitNetwork(page, 'Drilling');
|
||||||
await page.locator('[placeholder="Type to select tag"]').click();
|
await addTagAndAwaitNetwork(page, 'Driving');
|
||||||
await page.locator('[aria-label="Autocomplete Options"] >> text=Science').click();
|
|
||||||
await page.waitForSelector('[aria-label="Tag"]:has-text("Science")');
|
|
||||||
|
|
||||||
await page.hover(`button:has-text("Add Tag")`);
|
|
||||||
await page.locator(`button:has-text("Add Tag")`).click();
|
|
||||||
await page.locator('[placeholder="Type to select tag"]').click();
|
|
||||||
await page.locator('[aria-label="Autocomplete Options"] >> text=Drilling').click();
|
|
||||||
await page.waitForSelector('[aria-label="Tag"]:has-text("Drilling")');
|
|
||||||
|
|
||||||
await page.hover(`button:has-text("Add Tag")`);
|
|
||||||
await page.locator(`button:has-text("Add Tag")`).click();
|
|
||||||
await page.locator('[placeholder="Type to select tag"]').click();
|
|
||||||
await page.locator('[aria-label="Autocomplete Options"] >> text=Driving').click();
|
|
||||||
await page.waitForSelector('[aria-label="Tag"]:has-text("Driving")');
|
|
||||||
page.waitForLoadState('networkidle');
|
|
||||||
|
|
||||||
// Add a fourth entry
|
// Add a fourth entry
|
||||||
// Network requests are:
|
// Network requests are:
|
||||||
@@ -188,14 +139,11 @@ test.describe('Notebook Tests with CouchDB @couchdb', () => {
|
|||||||
// 2) The shared worker event from 👆 POST request
|
// 2) The shared worker event from 👆 POST request
|
||||||
// 3) Timestamp update on entry
|
// 3) Timestamp update on entry
|
||||||
// 4) The shared worker event from 👆 POST request
|
// 4) The shared worker event from 👆 POST request
|
||||||
addingNotebookElementsRequests = [];
|
notebookElementsRequests = [];
|
||||||
await page.locator('text=To start a new entry, click here or drag and drop any object').click();
|
await nbUtils.enterTextEntry(page, 'Fourth Entry');
|
||||||
await page.locator('[aria-label="Notebook Entry Input"] >> nth=3').click();
|
|
||||||
await page.locator('[aria-label="Notebook Entry Input"] >> nth=3').fill(`Fourth Entry`);
|
|
||||||
await page.locator('[aria-label="Notebook Entry Input"] >> nth=3').press('Enter');
|
|
||||||
page.waitForLoadState('networkidle');
|
page.waitForLoadState('networkidle');
|
||||||
|
|
||||||
expect(filterNonFetchRequests(addingNotebookElementsRequests).length).toBeLessThanOrEqual(4);
|
expect(filterNonFetchRequests(notebookElementsRequests).length).toBeLessThanOrEqual(4);
|
||||||
|
|
||||||
// Add a fifth entry
|
// Add a fifth entry
|
||||||
// Network requests are:
|
// Network requests are:
|
||||||
@@ -203,28 +151,22 @@ test.describe('Notebook Tests with CouchDB @couchdb', () => {
|
|||||||
// 2) The shared worker event from 👆 POST request
|
// 2) The shared worker event from 👆 POST request
|
||||||
// 3) Timestamp update on entry
|
// 3) Timestamp update on entry
|
||||||
// 4) The shared worker event from 👆 POST request
|
// 4) The shared worker event from 👆 POST request
|
||||||
addingNotebookElementsRequests = [];
|
notebookElementsRequests = [];
|
||||||
await page.locator('text=To start a new entry, click here or drag and drop any object').click();
|
await nbUtils.enterTextEntry(page, 'Fifth Entry');
|
||||||
await page.locator('[aria-label="Notebook Entry Input"] >> nth=4').click();
|
|
||||||
await page.locator('[aria-label="Notebook Entry Input"] >> nth=4').fill(`Fifth Entry`);
|
|
||||||
await page.locator('[aria-label="Notebook Entry Input"] >> nth=4').press('Enter');
|
|
||||||
page.waitForLoadState('networkidle');
|
page.waitForLoadState('networkidle');
|
||||||
|
|
||||||
expect(filterNonFetchRequests(addingNotebookElementsRequests).length).toBeLessThanOrEqual(4);
|
expect(filterNonFetchRequests(notebookElementsRequests).length).toBeLessThanOrEqual(4);
|
||||||
|
|
||||||
// Add a sixth entry
|
// Add a sixth entry
|
||||||
// 1) Send POST to add new entry
|
// 1) Send POST to add new entry
|
||||||
// 2) The shared worker event from 👆 POST request
|
// 2) The shared worker event from 👆 POST request
|
||||||
// 3) Timestamp update on entry
|
// 3) Timestamp update on entry
|
||||||
// 4) The shared worker event from 👆 POST request
|
// 4) The shared worker event from 👆 POST request
|
||||||
addingNotebookElementsRequests = [];
|
notebookElementsRequests = [];
|
||||||
await page.locator('text=To start a new entry, click here or drag and drop any object').click();
|
await nbUtils.enterTextEntry(page, 'Sixth Entry');
|
||||||
await page.locator('[aria-label="Notebook Entry Input"] >> nth=5').click();
|
|
||||||
await page.locator('[aria-label="Notebook Entry Input"] >> nth=5').fill(`Sixth Entry`);
|
|
||||||
await page.locator('[aria-label="Notebook Entry Input"] >> nth=5').press('Enter');
|
|
||||||
page.waitForLoadState('networkidle');
|
page.waitForLoadState('networkidle');
|
||||||
|
|
||||||
expect(filterNonFetchRequests(addingNotebookElementsRequests).length).toBeLessThanOrEqual(4);
|
expect(filterNonFetchRequests(notebookElementsRequests).length).toBeLessThanOrEqual(4);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Search tests', async ({ page }) => {
|
test('Search tests', async ({ page }) => {
|
||||||
@@ -233,35 +175,23 @@ test.describe('Notebook Tests with CouchDB @couchdb', () => {
|
|||||||
description: 'https://github.com/akhenry/openmct-yamcs/issues/69'
|
description: 'https://github.com/akhenry/openmct-yamcs/issues/69'
|
||||||
});
|
});
|
||||||
await page.getByText('Annotations').click();
|
await page.getByText('Annotations').click();
|
||||||
await page.locator('text=To start a new entry, click here or drag and drop any object').click();
|
await nbUtils.enterTextEntry(page, 'First Entry');
|
||||||
await page.locator('[aria-label="Notebook Entry Input"]').click();
|
|
||||||
await page.locator('[aria-label="Notebook Entry Input"]').fill(`First Entry`);
|
|
||||||
await page.locator('[aria-label="Notebook Entry Input"]').press('Enter');
|
|
||||||
|
|
||||||
// Add three tags
|
// Add three tags
|
||||||
await page.hover(`button:has-text("Add Tag")`);
|
await addTagAndAwaitNetwork(page, 'Science');
|
||||||
await page.locator(`button:has-text("Add Tag")`).click();
|
await addTagAndAwaitNetwork(page, 'Drilling');
|
||||||
await page.locator('[placeholder="Type to select tag"]').click();
|
await addTagAndAwaitNetwork(page, 'Driving');
|
||||||
await page.locator('[aria-label="Autocomplete Options"] >> text=Science').click();
|
|
||||||
await page.waitForSelector('[aria-label="Tag"]:has-text("Science")');
|
|
||||||
|
|
||||||
await page.hover(`button:has-text("Add Tag")`);
|
|
||||||
await page.locator(`button:has-text("Add Tag")`).click();
|
|
||||||
await page.locator('[placeholder="Type to select tag"]').click();
|
|
||||||
await page.locator('[aria-label="Autocomplete Options"] >> text=Drilling').click();
|
|
||||||
await page.waitForSelector('[aria-label="Tag"]:has-text("Drilling")');
|
|
||||||
|
|
||||||
await page.hover(`button:has-text("Add Tag")`);
|
|
||||||
await page.locator(`button:has-text("Add Tag")`).click();
|
|
||||||
await page.locator('[placeholder="Type to select tag"]').click();
|
|
||||||
await page.locator('[aria-label="Autocomplete Options"] >> text=Driving').click();
|
|
||||||
await page.waitForSelector('[aria-label="Tag"]:has-text("Driving")');
|
|
||||||
|
|
||||||
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').click();
|
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').click();
|
||||||
|
//Partial match for "Science" should only return Science
|
||||||
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').fill('Sc');
|
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').fill('Sc');
|
||||||
await expect(page.locator('[aria-label="Search Result"]').first()).toContainText("Science");
|
await expect(page.locator('[aria-label="Search Result"]').first()).toContainText('Science');
|
||||||
await expect(page.locator('[aria-label="Search Result"]').first()).not.toContainText("Driving");
|
await expect(page.locator('[aria-label="Search Result"]').first()).not.toContainText('Driving');
|
||||||
|
await expect(page.locator('[aria-label="Search Result"]').first()).not.toContainText(
|
||||||
|
'Drilling'
|
||||||
|
);
|
||||||
|
|
||||||
|
//Searching for a tag which does not exist should return an empty result
|
||||||
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').click();
|
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').click();
|
||||||
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').fill('Xq');
|
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').fill('Xq');
|
||||||
await expect(page.locator('text=No results found')).toBeVisible();
|
await expect(page.locator('text=No results found')).toBeVisible();
|
||||||
@@ -271,7 +201,46 @@ test.describe('Notebook Tests with CouchDB @couchdb', () => {
|
|||||||
// Try to reduce indeterminism of browser requests by only returning fetch requests.
|
// Try to reduce indeterminism of browser requests by only returning fetch requests.
|
||||||
// Filter out preflight CORS, fetching stylesheets, page icons, etc. that can occur during tests
|
// Filter out preflight CORS, fetching stylesheets, page icons, etc. that can occur during tests
|
||||||
function filterNonFetchRequests(requests) {
|
function filterNonFetchRequests(requests) {
|
||||||
return requests.filter(request => {
|
return requests.filter((request) => {
|
||||||
return (request.resourceType() === 'fetch');
|
return request.resourceType() === 'fetch';
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a tag to a notebook entry by providing a tagName.
|
||||||
|
* Reduces indeterminism by waiting until all necessary requests are completed.
|
||||||
|
* @param {import('@playwright/test').Page} page
|
||||||
|
* @param {string} tagName
|
||||||
|
*/
|
||||||
|
async function addTagAndAwaitNetwork(page, tagName) {
|
||||||
|
await page.hover(`button:has-text("Add Tag")`);
|
||||||
|
await page.locator(`button:has-text("Add Tag")`).click();
|
||||||
|
await page.locator('[placeholder="Type to select tag"]').click();
|
||||||
|
await Promise.all([
|
||||||
|
// Waits for the next request with the specified url
|
||||||
|
page.waitForRequest('**/openmct/_all_docs?include_docs=true'),
|
||||||
|
// Triggers the request
|
||||||
|
page.locator(`[aria-label="Autocomplete Options"] >> text=${tagName}`).click(),
|
||||||
|
expect(page.locator(`[aria-label="Tag"]:has-text("${tagName}")`)).toBeVisible()
|
||||||
|
]);
|
||||||
|
await page.waitForLoadState('networkidle');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove a tag to a notebook entry by providing a tagName.
|
||||||
|
* Reduces indeterminism by waiting until all necessary requests are completed.
|
||||||
|
* @param {import('@playwright/test').Page} page
|
||||||
|
* @param {string} tagName
|
||||||
|
*/
|
||||||
|
async function removeTagAndAwaitNetwork(page, tagName) {
|
||||||
|
await page.hover(`[aria-label="Tag"]:has-text("${tagName}")`);
|
||||||
|
await Promise.all([
|
||||||
|
page.locator(`[aria-label="Remove tag ${tagName}"]`).click(),
|
||||||
|
//With this pattern, we're awaiting the response but asserting on the request payload.
|
||||||
|
page.waitForResponse(
|
||||||
|
(resp) => resp.request().postData().includes(`"_deleted":true`) && resp.status() === 201
|
||||||
|
)
|
||||||
|
]);
|
||||||
|
await expect(page.locator(`[aria-label="Tag"]:has-text("${tagName}")`)).toBeHidden();
|
||||||
|
await page.waitForLoadState('networkidle');
|
||||||
|
}
|
||||||
|
|||||||
@@ -20,14 +20,17 @@
|
|||||||
* at runtime from the About dialog for additional information.
|
* at runtime from the About dialog for additional information.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
const { test, expect } = require('../../../../pluginFixtures');
|
const { test, expect, streamToString } = require('../../../../pluginFixtures');
|
||||||
const { openObjectTreeContextMenu, createDomainObjectWithDefaults } = require('../../../../appActions');
|
const { openObjectTreeContextMenu } = require('../../../../appActions');
|
||||||
const path = require('path');
|
const {
|
||||||
const nbUtils = require('../../../../helper/notebookUtils');
|
lockPage,
|
||||||
|
dragAndDropEmbed,
|
||||||
|
enterTextEntry,
|
||||||
|
startAndAddRestrictedNotebookObject
|
||||||
|
} = require('../../../../helper/notebookUtils');
|
||||||
|
|
||||||
const TEST_TEXT = 'Testing text for entries.';
|
const TEST_TEXT = 'Testing text for entries.';
|
||||||
const TEST_TEXT_NAME = 'Test Page';
|
const TEST_TEXT_NAME = 'Test Page';
|
||||||
const CUSTOM_NAME = 'CUSTOM_NAME';
|
|
||||||
|
|
||||||
test.describe('Restricted Notebook', () => {
|
test.describe('Restricted Notebook', () => {
|
||||||
let notebook;
|
let notebook;
|
||||||
@@ -65,31 +68,33 @@ test.describe('Restricted Notebook', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('Can be locked if at least one page has one entry @addInit', async ({ page }) => {
|
test('Can be locked if at least one page has one entry @addInit', async ({ page }) => {
|
||||||
|
await enterTextEntry(page, TEST_TEXT);
|
||||||
await nbUtils.enterTextEntry(page, TEST_TEXT);
|
|
||||||
|
|
||||||
const commitButton = page.locator('button:has-text("Commit Entries")');
|
const commitButton = page.locator('button:has-text("Commit Entries")');
|
||||||
expect(await commitButton.count()).toEqual(1);
|
expect(await commitButton.count()).toEqual(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test.describe('Restricted Notebook with at least one entry and with the page locked @addInit', () => {
|
test.describe('Restricted Notebook with at least one entry and with the page locked @addInit', () => {
|
||||||
let notebook;
|
let notebook;
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
notebook = await startAndAddRestrictedNotebookObject(page);
|
notebook = await startAndAddRestrictedNotebookObject(page);
|
||||||
await nbUtils.enterTextEntry(page, TEST_TEXT);
|
await enterTextEntry(page, TEST_TEXT);
|
||||||
await lockPage(page);
|
await lockPage(page);
|
||||||
|
|
||||||
// open sidebar
|
// open sidebar
|
||||||
await page.locator('button.c-notebook__toggle-nav-button').click();
|
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 @unstable', async ({
|
||||||
|
page
|
||||||
|
}, testInfo) => {
|
||||||
// eslint-disable-next-line playwright/no-skipped-test
|
// eslint-disable-next-line playwright/no-skipped-test
|
||||||
test.skip(testInfo.project === 'chrome-beta', "Test is unreliable on chrome-beta");
|
test.skip(testInfo.project === 'chrome-beta', 'Test is unreliable on chrome-beta');
|
||||||
// main lock message on page
|
// main lock message on page
|
||||||
const lockMessage = page.locator('text=This page has been committed and cannot be modified or removed');
|
const lockMessage = page.locator(
|
||||||
|
'text=This page has been committed and cannot be modified or removed'
|
||||||
|
);
|
||||||
expect.soft(await lockMessage.count()).toEqual(1);
|
expect.soft(await lockMessage.count()).toEqual(1);
|
||||||
|
|
||||||
// lock icon on page in sidebar
|
// lock icon on page in sidebar
|
||||||
@@ -103,56 +108,51 @@ test.describe('Restricted Notebook with at least one entry and with the page loc
|
|||||||
await expect(menuOptions).not.toContainText('Remove');
|
await expect(menuOptions).not.toContainText('Remove');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Can still: add page, rename, add entry, delete unlocked pages @addInit', async ({ page }) => {
|
test('Can still: add page, rename, add entry, delete unlocked pages @addInit', async ({
|
||||||
// Click text=Page Add >> button
|
page
|
||||||
await Promise.all([
|
}) => {
|
||||||
page.waitForNavigation(),
|
// Add a new page to the section
|
||||||
page.locator('text=Page Add >> button').click()
|
await page.getByRole('button', { name: 'Add Page' }).click();
|
||||||
]);
|
// Focus the new page by clicking it
|
||||||
// Click text=Unnamed Page >> nth=1
|
await page.getByText('Unnamed Page').nth(1).click();
|
||||||
await page.locator('text=Unnamed Page').nth(1).click();
|
// Rename the new page
|
||||||
// Press a with modifiers
|
await page.getByText('Unnamed Page').nth(1).fill(TEST_TEXT_NAME);
|
||||||
await page.locator('text=Unnamed Page').nth(1).fill(TEST_TEXT_NAME);
|
|
||||||
|
|
||||||
// expect to be able to rename unlocked pages
|
// expect to be able to rename unlocked pages
|
||||||
const newPageElement = page.locator(`text=${TEST_TEXT_NAME}`);
|
const newPageElement = page.getByText(TEST_TEXT_NAME);
|
||||||
const newPageCount = await newPageElement.count();
|
const newPageCount = await newPageElement.count();
|
||||||
await newPageElement.press('Enter'); // exit contenteditable state
|
await newPageElement.press('Enter'); // exit contenteditable state
|
||||||
expect.soft(newPageCount).toEqual(1);
|
expect.soft(newPageCount).toEqual(1);
|
||||||
|
|
||||||
// enter test text
|
// enter test text
|
||||||
await nbUtils.enterTextEntry(page, TEST_TEXT);
|
await enterTextEntry(page, TEST_TEXT);
|
||||||
|
|
||||||
// expect new page to be lockable
|
// expect new page to be lockable
|
||||||
const commitButton = page.locator('BUTTON:HAS-TEXT("COMMIT ENTRIES")');
|
const commitButton = page.getByRole('button', { name: ' Commit Entries' });
|
||||||
expect.soft(await commitButton.count()).toEqual(1);
|
expect.soft(await commitButton.count()).toEqual(1);
|
||||||
|
|
||||||
// Click text=Unnamed PageTest Page >> button
|
// Click the context menu button for the new page
|
||||||
await page.locator('text=Unnamed PageTest Page >> button').click();
|
await page.getByTitle('Open context menu').click();
|
||||||
// Click text=Delete Page
|
// Delete the page
|
||||||
await page.locator('text=Delete Page').click();
|
await page.getByRole('menuitem', { name: 'Delete Page' }).click();
|
||||||
// Click text=Ok
|
// Click OK button
|
||||||
await Promise.all([
|
await page.getByRole('button', { name: 'Ok', exact: true }).click();
|
||||||
page.waitForNavigation(),
|
|
||||||
page.locator('button:has-text("OK")').click()
|
|
||||||
]);
|
|
||||||
|
|
||||||
// deleted page, should no longer exist
|
// deleted page, should no longer exist
|
||||||
const deletedPageElement = page.locator(`text=${TEST_TEXT_NAME}`);
|
const deletedPageElement = page.getByText(TEST_TEXT_NAME);
|
||||||
expect(await deletedPageElement.count()).toEqual(0);
|
expect(await deletedPageElement.count()).toEqual(0);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test.describe('Restricted Notebook with a page locked and with an embed @addInit', () => {
|
test.describe('Restricted Notebook with a page locked and with an embed @addInit', () => {
|
||||||
|
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
const notebook = await startAndAddRestrictedNotebookObject(page);
|
const notebook = await startAndAddRestrictedNotebookObject(page);
|
||||||
await nbUtils.dragAndDropEmbed(page, notebook);
|
await dragAndDropEmbed(page, notebook);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Allows embeds to be deleted if page unlocked @addInit', async ({ page }) => {
|
test('Allows embeds to be deleted if page unlocked @addInit', async ({ page }) => {
|
||||||
// Click .c-ne__embed__name .c-popup-menu-button
|
// Click embed popup menu
|
||||||
await page.locator('.c-ne__embed__name .c-icon-button').click(); // embed popup menu
|
await page.locator('.c-ne__embed__name .c-icon-button').click();
|
||||||
|
|
||||||
const embedMenu = page.locator('body >> .c-menu');
|
const embedMenu = page.locator('body >> .c-menu');
|
||||||
await expect(embedMenu).toContainText('Remove This Embed');
|
await expect(embedMenu).toContainText('Remove This Embed');
|
||||||
@@ -160,33 +160,38 @@ test.describe('Restricted Notebook with a page locked and with an embed @addInit
|
|||||||
|
|
||||||
test('Disallows embeds to be deleted if page locked @addInit', async ({ page }) => {
|
test('Disallows embeds to be deleted if page locked @addInit', async ({ page }) => {
|
||||||
await lockPage(page);
|
await lockPage(page);
|
||||||
// Click .c-ne__embed__name .c-popup-menu-button
|
// Click embed popup menu
|
||||||
await page.locator('.c-ne__embed__name .c-icon-button').click(); // embed popup menu
|
await page.locator('.c-ne__embed__name .c-icon-button').click();
|
||||||
|
|
||||||
const embedMenu = page.locator('body >> .c-menu');
|
const embedMenu = page.locator('body >> .c-menu');
|
||||||
await expect(embedMenu).not.toContainText('Remove This Embed');
|
await expect(embedMenu).not.toContainText('Remove This Embed');
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
test.describe('can export restricted notebook as text', () => {
|
||||||
* @param {import('@playwright/test').Page} page
|
test.beforeEach(async ({ page }) => {
|
||||||
*/
|
await startAndAddRestrictedNotebookObject(page);
|
||||||
async function startAndAddRestrictedNotebookObject(page) {
|
});
|
||||||
// eslint-disable-next-line no-undef
|
|
||||||
await page.addInitScript({ path: path.join(__dirname, '../../../../helper/', 'addInitRestrictedNotebook.js') });
|
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
|
||||||
|
|
||||||
return createDomainObjectWithDefaults(page, { type: CUSTOM_NAME });
|
test('basic functionality ', async ({ page }) => {
|
||||||
}
|
await enterTextEntry(page, `Foo bar entry`);
|
||||||
|
// Click on 3 Dot Menu
|
||||||
|
await page.locator('button[title="More options"]').click();
|
||||||
|
const downloadPromise = page.waitForEvent('download');
|
||||||
|
|
||||||
/**
|
await page.getByRole('menuitem', { name: /Export Notebook as Text/ }).click();
|
||||||
* @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
|
await page.getByRole('button', { name: 'Save' }).click();
|
||||||
await page.locator('text=Lock Page').click();
|
|
||||||
}
|
//Verify exported text as a stream of text instead of a file read from the filesystem
|
||||||
|
const download = await downloadPromise;
|
||||||
|
const readStream = await download.createReadStream();
|
||||||
|
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 all notebook entry metdata', async ({ page }) => {});
|
||||||
|
test.fixme('can export all notebook tags', async ({ page }) => {});
|
||||||
|
test.fixme('can export all notebook snapshots', async ({ page }) => {});
|
||||||
|
});
|
||||||
|
|||||||
@@ -21,44 +21,53 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
This test suite is dedicated to tests which verify form functionality.
|
This test suite is dedicated to tests which verify notebook tag functionality.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const { test, expect } = require('../../../../pluginFixtures');
|
const { test, expect } = require('../../../../pluginFixtures');
|
||||||
const { createDomainObjectWithDefaults, selectInspectorTab } = require('../../../../appActions');
|
const { createDomainObjectWithDefaults, selectInspectorTab } = require('../../../../appActions');
|
||||||
const nbUtils = require('../../../../helper/notebookUtils');
|
const {
|
||||||
|
enterTextEntry,
|
||||||
|
createNotebookAndEntry,
|
||||||
|
createNotebookEntryAndTags
|
||||||
|
} = require('../../../../helper/notebookUtils');
|
||||||
|
|
||||||
/**
|
test.describe('Tagging in Notebooks @addInit', () => {
|
||||||
* Creates a notebook object and adds an entry.
|
test.beforeEach(async ({ page }) => {
|
||||||
* @param {import('@playwright/test').Page} - page to load
|
|
||||||
* @param {number} [iterations = 1] - the number of entries to create
|
|
||||||
*/
|
|
||||||
async function createNotebookAndEntry(page, iterations = 1) {
|
|
||||||
//Go to baseURL
|
//Go to baseURL
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
});
|
||||||
|
test('Can load tags', async ({ page }) => {
|
||||||
|
await createNotebookAndEntry(page);
|
||||||
|
|
||||||
const notebook = createDomainObjectWithDefaults(page, { type: 'Notebook' });
|
|
||||||
|
|
||||||
for (let iteration = 0; iteration < iterations; iteration++) {
|
|
||||||
await nbUtils.enterTextEntry(page, `Entry ${iteration}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
return notebook;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a notebook object, adds an entry, and adds a tag.
|
|
||||||
* @param {import('@playwright/test').Page} page
|
|
||||||
* @param {number} [iterations = 1] - the number of entries (and tags) to create
|
|
||||||
*/
|
|
||||||
async function createNotebookEntryAndTags(page, iterations = 1) {
|
|
||||||
const notebook = await createNotebookAndEntry(page, iterations);
|
|
||||||
await selectInspectorTab(page, 'Annotations');
|
await selectInspectorTab(page, 'Annotations');
|
||||||
|
|
||||||
for (let iteration = 0; iteration < iterations; iteration++) {
|
await page.locator('button:has-text("Add Tag")').click();
|
||||||
// Hover and click "Add Tag" button
|
|
||||||
// Hover is needed here to "slow down" the actions while running in headless mode
|
await page.locator('[placeholder="Type to select tag"]').click();
|
||||||
await page.locator(`[aria-label="Notebook Entry"] >> nth = ${iteration}`).click();
|
|
||||||
|
await expect(page.locator('[aria-label="Autocomplete Options"]')).toContainText('Science');
|
||||||
|
await expect(page.locator('[aria-label="Autocomplete Options"]')).toContainText('Drilling');
|
||||||
|
await expect(page.locator('[aria-label="Autocomplete Options"]')).toContainText('Driving');
|
||||||
|
});
|
||||||
|
test('Can add tags', async ({ page }) => {
|
||||||
|
await createNotebookEntryAndTags(page);
|
||||||
|
|
||||||
|
await expect(page.locator('[aria-label="Notebook Entry"]')).toContainText('Science');
|
||||||
|
await expect(page.locator('[aria-label="Notebook Entry"]')).toContainText('Driving');
|
||||||
|
|
||||||
|
await page.locator('button:has-text("Add Tag")').click();
|
||||||
|
await page.locator('[placeholder="Type to select tag"]').click();
|
||||||
|
|
||||||
|
await expect(page.locator('[aria-label="Autocomplete Options"]')).not.toContainText('Science');
|
||||||
|
await expect(page.locator('[aria-label="Autocomplete Options"]')).not.toContainText('Driving');
|
||||||
|
await expect(page.locator('[aria-label="Autocomplete Options"]')).toContainText('Drilling');
|
||||||
|
});
|
||||||
|
test('Can add tags with blank entry', async ({ page }) => {
|
||||||
|
await createDomainObjectWithDefaults(page, { type: 'Notebook' });
|
||||||
|
await selectInspectorTab(page, 'Annotations');
|
||||||
|
|
||||||
|
await enterTextEntry(page, '');
|
||||||
await page.hover(`button:has-text("Add Tag")`);
|
await page.hover(`button:has-text("Add Tag")`);
|
||||||
await page.locator(`button:has-text("Add Tag")`).click();
|
await page.locator(`button:has-text("Add Tag")`).click();
|
||||||
|
|
||||||
@@ -67,55 +76,11 @@ async function createNotebookEntryAndTags(page, iterations = 1) {
|
|||||||
// Select the "Driving" tag
|
// Select the "Driving" tag
|
||||||
await page.locator('[aria-label="Autocomplete Options"] >> text=Driving').click();
|
await page.locator('[aria-label="Autocomplete Options"] >> text=Driving').click();
|
||||||
|
|
||||||
// Hover and click "Add Tag" button
|
await expect(page.locator('[aria-label="Notebook Entry"]')).toContainText('Driving');
|
||||||
// Hover is needed here to "slow down" the actions while running in headless mode
|
|
||||||
await page.hover(`button:has-text("Add Tag")`);
|
|
||||||
await page.locator(`button:has-text("Add Tag")`).click();
|
|
||||||
// Click inside the tag search input
|
|
||||||
await page.locator('[placeholder="Type to select tag"]').click();
|
|
||||||
// Select the "Science" tag
|
|
||||||
await page.locator('[aria-label="Autocomplete Options"] >> text=Science').click();
|
|
||||||
}
|
|
||||||
|
|
||||||
return notebook;
|
|
||||||
}
|
|
||||||
|
|
||||||
test.describe('Tagging in Notebooks @addInit', () => {
|
|
||||||
test('Can load tags', async ({ page }) => {
|
|
||||||
await createNotebookAndEntry(page);
|
|
||||||
|
|
||||||
// TODO can be removed with fix for https://github.com/nasa/openmct/issues/6411
|
|
||||||
await page.locator('[aria-label="Notebook Entry"].is-selected div.c-ne__text').click();
|
|
||||||
|
|
||||||
await selectInspectorTab(page, 'Annotations');
|
|
||||||
|
|
||||||
await page.locator('button:has-text("Add Tag")').click();
|
|
||||||
|
|
||||||
await page.locator('[placeholder="Type to select tag"]').click();
|
|
||||||
|
|
||||||
await expect(page.locator('[aria-label="Autocomplete Options"]')).toContainText("Science");
|
|
||||||
await expect(page.locator('[aria-label="Autocomplete Options"]')).toContainText("Drilling");
|
|
||||||
await expect(page.locator('[aria-label="Autocomplete Options"]')).toContainText("Driving");
|
|
||||||
});
|
|
||||||
test('Can add tags', async ({ page }) => {
|
|
||||||
await createNotebookEntryAndTags(page);
|
|
||||||
|
|
||||||
await expect(page.locator('[aria-label="Notebook Entry"]')).toContainText("Science");
|
|
||||||
await expect(page.locator('[aria-label="Notebook Entry"]')).toContainText("Driving");
|
|
||||||
|
|
||||||
await page.locator('button:has-text("Add Tag")').click();
|
|
||||||
await page.locator('[placeholder="Type to select tag"]').click();
|
|
||||||
|
|
||||||
await expect(page.locator('[aria-label="Autocomplete Options"]')).not.toContainText("Science");
|
|
||||||
await expect(page.locator('[aria-label="Autocomplete Options"]')).not.toContainText("Driving");
|
|
||||||
await expect(page.locator('[aria-label="Autocomplete Options"]')).toContainText("Drilling");
|
|
||||||
});
|
});
|
||||||
test('Can cancel adding tags', async ({ page }) => {
|
test('Can cancel adding tags', async ({ page }) => {
|
||||||
await createNotebookAndEntry(page);
|
await createNotebookAndEntry(page);
|
||||||
|
|
||||||
// TODO can be removed with fix for https://github.com/nasa/openmct/issues/6411
|
|
||||||
await page.locator('[aria-label="Notebook Entry"].is-selected div.c-ne__text').click();
|
|
||||||
|
|
||||||
await selectInspectorTab(page, 'Annotations');
|
await selectInspectorTab(page, 'Annotations');
|
||||||
|
|
||||||
// Test canceling adding a tag after we click "Type to select tag"
|
// Test canceling adding a tag after we click "Type to select tag"
|
||||||
@@ -138,13 +103,13 @@ test.describe('Tagging in Notebooks @addInit', () => {
|
|||||||
await createNotebookEntryAndTags(page);
|
await createNotebookEntryAndTags(page);
|
||||||
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').click();
|
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').click();
|
||||||
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').fill('sc');
|
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').fill('sc');
|
||||||
await expect(page.locator('[aria-label="Search Result"]')).toContainText("Science");
|
await expect(page.locator('[aria-label="Search Result"]')).toContainText('Science');
|
||||||
await expect(page.locator('[aria-label="Search Result"]')).not.toContainText("Driving");
|
await expect(page.locator('[aria-label="Search Result"]')).not.toContainText('Driving');
|
||||||
|
|
||||||
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').click();
|
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').click();
|
||||||
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').fill('Sc');
|
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').fill('Sc');
|
||||||
await expect(page.locator('[aria-label="Search Result"]')).toContainText("Science");
|
await expect(page.locator('[aria-label="Search Result"]')).toContainText('Science');
|
||||||
await expect(page.locator('[aria-label="Search Result"]')).not.toContainText("Driving");
|
await expect(page.locator('[aria-label="Search Result"]')).not.toContainText('Driving');
|
||||||
|
|
||||||
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').click();
|
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').click();
|
||||||
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').fill('Xq');
|
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').fill('Xq');
|
||||||
@@ -159,7 +124,7 @@ test.describe('Tagging in Notebooks @addInit', () => {
|
|||||||
|
|
||||||
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').click();
|
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').click();
|
||||||
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').fill('Sc');
|
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').fill('Sc');
|
||||||
await expect(page.locator('[aria-label="Search Result"]')).toContainText("Science");
|
await expect(page.locator('[aria-label="Search Result"]')).toContainText('Science');
|
||||||
await page.getByText('Entry 0').click();
|
await page.getByText('Entry 0').click();
|
||||||
await expect(page.locator('.js-preview-window')).toBeVisible();
|
await expect(page.locator('.js-preview-window')).toBeVisible();
|
||||||
});
|
});
|
||||||
@@ -170,11 +135,11 @@ test.describe('Tagging in Notebooks @addInit', () => {
|
|||||||
await page.hover('[aria-label="Tag"]:has-text("Driving")');
|
await page.hover('[aria-label="Tag"]:has-text("Driving")');
|
||||||
await page.locator('[aria-label="Remove tag Driving"]').click();
|
await page.locator('[aria-label="Remove tag Driving"]').click();
|
||||||
|
|
||||||
await expect(page.locator('[aria-label="Tags Inspector"]')).toContainText("Science");
|
await expect(page.locator('[aria-label="Tags Inspector"]')).toContainText('Science');
|
||||||
await expect(page.locator('[aria-label="Tags Inspector"]')).not.toContainText("Driving");
|
await expect(page.locator('[aria-label="Tags Inspector"]')).not.toContainText('Driving');
|
||||||
|
|
||||||
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').fill('sc');
|
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').fill('sc');
|
||||||
await expect(page.locator('[aria-label="Search Result"]')).not.toContainText("Driving");
|
await expect(page.locator('[aria-label="Search Result"]')).not.toContainText('Driving');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Can delete entries without tags', async ({ page }) => {
|
test('Can delete entries without tags', async ({ page }) => {
|
||||||
@@ -193,9 +158,13 @@ test.describe('Tagging in Notebooks @addInit', () => {
|
|||||||
|
|
||||||
await page.hover('[aria-label="Notebook Entry Input"] >> nth=1');
|
await page.hover('[aria-label="Notebook Entry Input"] >> nth=1');
|
||||||
await page.locator('button[title="Delete this entry"]').last().click();
|
await page.locator('button[title="Delete this entry"]').last().click();
|
||||||
await expect(page.locator('text=This action will permanently delete this entry. Do you wish to continue?')).toBeVisible();
|
await expect(
|
||||||
|
page.locator('text=This action will permanently delete this entry. Do you wish to continue?')
|
||||||
|
).toBeVisible();
|
||||||
await page.locator('button:has-text("Ok")').click();
|
await page.locator('button:has-text("Ok")').click();
|
||||||
await expect(page.locator('text=This action will permanently delete this entry. Do you wish to continue?')).toBeHidden();
|
await expect(
|
||||||
|
page.locator('text=This action will permanently delete this entry. Do you wish to continue?')
|
||||||
|
).toBeHidden();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Can delete objects with tags and neither return in search', async ({ page }) => {
|
test('Can delete objects with tags and neither return in search', async ({ page }) => {
|
||||||
@@ -204,7 +173,7 @@ test.describe('Tagging in Notebooks @addInit', () => {
|
|||||||
await page.locator('button[title="More options"]').click();
|
await page.locator('button[title="More options"]').click();
|
||||||
await page.locator('li[title="Remove this object from its containing object."]').click();
|
await page.locator('li[title="Remove this object from its containing object."]').click();
|
||||||
await page.locator('button:has-text("OK")').click();
|
await page.locator('button:has-text("OK")').click();
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').fill('Unnamed');
|
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').fill('Unnamed');
|
||||||
await expect(page.locator('text=No results found')).toBeVisible();
|
await expect(page.locator('text=No results found')).toBeVisible();
|
||||||
@@ -215,64 +184,32 @@ test.describe('Tagging in Notebooks @addInit', () => {
|
|||||||
});
|
});
|
||||||
test('Tags persist across reload', async ({ page }) => {
|
test('Tags persist across reload', async ({ page }) => {
|
||||||
//Go to baseURL
|
//Go to baseURL
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
const clock = await createDomainObjectWithDefaults(page, { type: 'Clock' });
|
|
||||||
|
|
||||||
const ITERATIONS = 4;
|
const ITERATIONS = 4;
|
||||||
const notebook = await createNotebookEntryAndTags(page, ITERATIONS);
|
const notebook = await createNotebookEntryAndTags(page, ITERATIONS);
|
||||||
|
await page.goto(notebook.url);
|
||||||
|
|
||||||
|
// Verify tags are present
|
||||||
for (let iteration = 0; iteration < ITERATIONS; iteration++) {
|
for (let iteration = 0; iteration < ITERATIONS; iteration++) {
|
||||||
const entryLocator = `[aria-label="Notebook Entry"] >> nth = ${iteration}`;
|
const entryLocator = `[aria-label="Notebook Entry"] >> nth = ${iteration}`;
|
||||||
await expect(page.locator(entryLocator)).toContainText("Science");
|
await expect(page.locator(entryLocator)).toContainText('Science');
|
||||||
await expect(page.locator(entryLocator)).toContainText("Driving");
|
await expect(page.locator(entryLocator)).toContainText('Driving');
|
||||||
}
|
|
||||||
|
|
||||||
await Promise.all([
|
|
||||||
page.waitForNavigation(),
|
|
||||||
page.goto('./#/browse/mine?hideTree=false'),
|
|
||||||
page.click('.c-disclosure-triangle')
|
|
||||||
]);
|
|
||||||
|
|
||||||
const treePane = page.getByRole('tree', {
|
|
||||||
name: 'Main Tree'
|
|
||||||
});
|
|
||||||
// Click Clock
|
|
||||||
await treePane.getByRole('treeitem', {
|
|
||||||
name: clock.name
|
|
||||||
}).click();
|
|
||||||
// Click Notebook
|
|
||||||
await page.getByRole('treeitem', {
|
|
||||||
name: notebook.name
|
|
||||||
}).click();
|
|
||||||
|
|
||||||
for (let iteration = 0; iteration < ITERATIONS; iteration++) {
|
|
||||||
const entryLocator = `[aria-label="Notebook Entry"] >> nth = ${iteration}`;
|
|
||||||
await expect(page.locator(entryLocator)).toContainText("Science");
|
|
||||||
await expect(page.locator(entryLocator)).toContainText("Driving");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Reload Page
|
//Reload Page
|
||||||
await Promise.all([
|
await page.reload({ waitUntil: 'domcontentloaded' });
|
||||||
page.reload(),
|
|
||||||
page.waitForLoadState('networkidle')
|
|
||||||
]);
|
|
||||||
|
|
||||||
// Click Notebook
|
|
||||||
await page.click(`text="${notebook.name}"`);
|
|
||||||
|
|
||||||
|
// Verify tags persist across reload
|
||||||
for (let iteration = 0; iteration < ITERATIONS; iteration++) {
|
for (let iteration = 0; iteration < ITERATIONS; iteration++) {
|
||||||
const entryLocator = `[aria-label="Notebook Entry"] >> nth = ${iteration}`;
|
const entryLocator = `[aria-label="Notebook Entry"] >> nth = ${iteration}`;
|
||||||
await expect(page.locator(entryLocator)).toContainText("Science");
|
await expect(page.locator(entryLocator)).toContainText('Science');
|
||||||
await expect(page.locator(entryLocator)).toContainText("Driving");
|
await expect(page.locator(entryLocator)).toContainText('Driving');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
test('Can cancel adding a tag', async ({ page }) => {
|
test('Can cancel adding a tag', async ({ page }) => {
|
||||||
await createNotebookAndEntry(page);
|
await createNotebookAndEntry(page);
|
||||||
|
|
||||||
// TODO can be removed with fix for https://github.com/nasa/openmct/issues/6411
|
|
||||||
await page.locator('[aria-label="Notebook Entry"].is-selected div.c-ne__text').click();
|
|
||||||
|
|
||||||
await selectInspectorTab(page, 'Annotations');
|
await selectInspectorTab(page, 'Annotations');
|
||||||
|
|
||||||
// Click on the "Add Tag" button
|
// Click on the "Add Tag" button
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
* this source code distribution or the Licensing information page available
|
* this source code distribution or the Licensing information page available
|
||||||
* at runtime from the About dialog for additional information.
|
* at runtime from the About dialog for additional information.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
/* global __dirname */
|
||||||
/*
|
/*
|
||||||
* This test suite is dedicated to testing the operator status plugin.
|
* This test suite is dedicated to testing the operator status plugin.
|
||||||
*/
|
*/
|
||||||
@@ -40,11 +40,18 @@ STUB (test.fixme) Rolling through each
|
|||||||
test.describe('Operator Status', () => {
|
test.describe('Operator Status', () => {
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
// FIXME: determine if plugins will be added to index.html or need to be injected
|
// FIXME: determine if plugins will be added to index.html or need to be injected
|
||||||
// eslint-disable-next-line no-undef
|
await page.addInitScript({
|
||||||
await page.addInitScript({ path: path.join(__dirname, '../../../../helper/', 'addInitExampleUser.js')});
|
path: path.join(__dirname, '../../../../helper/', 'addInitExampleUser.js')
|
||||||
// eslint-disable-next-line no-undef
|
});
|
||||||
await page.addInitScript({ path: path.join(__dirname, '../../../../helper/', 'addInitOperatorStatus.js')});
|
await page.addInitScript({
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
path: path.join(__dirname, '../../../../helper/', 'addInitOperatorStatus.js')
|
||||||
|
});
|
||||||
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
await expect(page.getByText('Select Role')).toBeVisible();
|
||||||
|
// set role
|
||||||
|
await page.getByRole('button', { name: 'Select' }).click();
|
||||||
|
// dismiss role confirmation popup
|
||||||
|
await page.getByRole('button', { name: 'Dismiss' }).click();
|
||||||
});
|
});
|
||||||
|
|
||||||
// verify that operator status is visible
|
// verify that operator status is visible
|
||||||
@@ -90,8 +97,9 @@ test.describe('Operator Status', () => {
|
|||||||
const rowValuesArr = rowValues.split('\t');
|
const rowValuesArr = rowValues.split('\t');
|
||||||
const COLUMN_STATUS_INDEX = 1;
|
const COLUMN_STATUS_INDEX = 1;
|
||||||
// check initial set value matches status table
|
// check initial set value matches status table
|
||||||
expect(rowValuesArr[COLUMN_STATUS_INDEX].toLowerCase())
|
expect(rowValuesArr[COLUMN_STATUS_INDEX].toLowerCase()).toEqual(
|
||||||
.toEqual(initialStatusValue.toLowerCase());
|
initialStatusValue.toLowerCase()
|
||||||
|
);
|
||||||
|
|
||||||
// change user status
|
// change user status
|
||||||
await statusPollIndicator.click();
|
await statusPollIndicator.click();
|
||||||
@@ -105,9 +113,9 @@ test.describe('Operator Status', () => {
|
|||||||
const updatedRowValues = await updatedRow.innerText();
|
const updatedRowValues = await updatedRow.innerText();
|
||||||
const updatedRowValuesArr = updatedRowValues.split('\t');
|
const updatedRowValuesArr = updatedRowValues.split('\t');
|
||||||
|
|
||||||
expect(updatedRowValuesArr[COLUMN_STATUS_INDEX].toLowerCase())
|
expect(updatedRowValuesArr[COLUMN_STATUS_INDEX].toLowerCase()).toEqual(
|
||||||
.toEqual(updatedStatusValue.toLowerCase());
|
updatedStatusValue.toLowerCase()
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('clear poll button removes poll responses', async ({ page }) => {
|
test('clear poll button removes poll responses', async ({ page }) => {
|
||||||
@@ -134,8 +142,9 @@ test.describe('Operator Status', () => {
|
|||||||
const rowValuesArr = rowValues.split('\t');
|
const rowValuesArr = rowValues.split('\t');
|
||||||
const COLUMN_STATUS_INDEX = 1;
|
const COLUMN_STATUS_INDEX = 1;
|
||||||
// check initial set value matches status table
|
// check initial set value matches status table
|
||||||
expect(rowValuesArr[COLUMN_STATUS_INDEX].toLowerCase())
|
expect(rowValuesArr[COLUMN_STATUS_INDEX].toLowerCase()).toEqual(
|
||||||
.toEqual(initialStatusValue.toLowerCase());
|
initialStatusValue.toLowerCase()
|
||||||
|
);
|
||||||
|
|
||||||
// clear the poll
|
// clear the poll
|
||||||
await page.locator('button[title="Clear the previous poll question"]').click();
|
await page.locator('button[title="Clear the previous poll question"]').click();
|
||||||
@@ -144,13 +153,10 @@ test.describe('Operator Status', () => {
|
|||||||
const updatedRowValues = await updatedRow.innerText();
|
const updatedRowValues = await updatedRow.innerText();
|
||||||
const updatedRowValuesArr = updatedRowValues.split('\t');
|
const updatedRowValuesArr = updatedRowValues.split('\t');
|
||||||
const UNSET_VALUE_LABEL = 'Not set';
|
const UNSET_VALUE_LABEL = 'Not set';
|
||||||
expect(updatedRowValuesArr[COLUMN_STATUS_INDEX])
|
expect(updatedRowValuesArr[COLUMN_STATUS_INDEX]).toEqual(UNSET_VALUE_LABEL);
|
||||||
.toEqual(UNSET_VALUE_LABEL);
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test.fixme('iterate through all possible response values', async ({ page }) => {
|
test.fixme('iterate through all possible response values', async ({ page }) => {
|
||||||
// test all possible respone values for the poll
|
// test all possible response values for the poll
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
Testsuite for plot autoscale.
|
Testsuite for plot autoscale.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const { selectInspectorTab } = require('../../../../appActions');
|
const { selectInspectorTab, createDomainObjectWithDefaults } = require('../../../../appActions');
|
||||||
const { test, expect } = require('../../../../pluginFixtures');
|
const { test, expect } = require('../../../../pluginFixtures');
|
||||||
test.use({
|
test.use({
|
||||||
viewport: {
|
viewport: {
|
||||||
@@ -34,17 +34,26 @@ test.use({
|
|||||||
});
|
});
|
||||||
|
|
||||||
test.describe('Autoscale', () => {
|
test.describe('Autoscale', () => {
|
||||||
test('User can set autoscale with a valid range @snapshot', async ({ page, openmctConfig }) => {
|
test('User can set autoscale with a valid range @snapshot', async ({ page }) => {
|
||||||
const { myItemsFolderName } = openmctConfig;
|
|
||||||
|
|
||||||
//This is necessary due to the size of the test suite.
|
//This is necessary due to the size of the test suite.
|
||||||
test.slow();
|
test.slow();
|
||||||
|
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
await setTimeRange(page);
|
const overlayPlot = await createDomainObjectWithDefaults(page, {
|
||||||
|
name: 'Test Overlay Plot',
|
||||||
|
type: 'Overlay Plot'
|
||||||
|
});
|
||||||
|
await createDomainObjectWithDefaults(page, {
|
||||||
|
name: 'Test Sine Wave Generator',
|
||||||
|
type: 'Sine Wave Generator',
|
||||||
|
parent: overlayPlot.uuid
|
||||||
|
});
|
||||||
|
|
||||||
await createSinewaveOverlayPlot(page, myItemsFolderName);
|
// 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 testYTicks(page, ['-1.00', '-0.50', '0.00', '0.50', '1.00']);
|
await testYTicks(page, ['-1.00', '-0.50', '0.00', '0.50', '1.00']);
|
||||||
|
|
||||||
@@ -67,14 +76,27 @@ test.describe('Autoscale', () => {
|
|||||||
await page.locator('.c-message-banner__close-button').click();
|
await page.locator('.c-message-banner__close-button').click();
|
||||||
await page.waitForSelector('.c-message-banner__message', { state: 'detached' });
|
await page.waitForSelector('.c-message-banner__message', { state: 'detached' });
|
||||||
|
|
||||||
// Make sure that after turning off autoscale, the user entered range values are reflexted in the ticks.
|
// Make sure that after turning off autoscale, the user entered range values are reflected in the ticks.
|
||||||
await testYTicks(page, ['-2.00', '-1.50', '-1.00', '-0.50', '0.00', '0.50', '1.00', '1.50', '2.00']);
|
await testYTicks(page, [
|
||||||
|
'-2.00',
|
||||||
|
'-1.50',
|
||||||
|
'-1.00',
|
||||||
|
'-0.50',
|
||||||
|
'0.00',
|
||||||
|
'0.50',
|
||||||
|
'1.00',
|
||||||
|
'1.50',
|
||||||
|
'2.00'
|
||||||
|
]);
|
||||||
|
|
||||||
const canvas = page.locator('canvas').nth(1);
|
const canvas = page.locator('canvas').nth(1);
|
||||||
|
|
||||||
await canvas.hover({ trial: true });
|
await canvas.hover({ trial: true });
|
||||||
|
await expect(page.locator('.js-series-data-loaded')).toBeVisible();
|
||||||
|
|
||||||
expect.soft(await canvas.screenshot()).toMatchSnapshot('autoscale-canvas-prepan.png', { animations: 'disabled' });
|
expect
|
||||||
|
.soft(await canvas.screenshot())
|
||||||
|
.toMatchSnapshot('autoscale-canvas-prepan.png', { animations: 'disabled' });
|
||||||
|
|
||||||
//Alt Drag Start
|
//Alt Drag Start
|
||||||
await page.keyboard.down('Alt');
|
await page.keyboard.down('Alt');
|
||||||
@@ -94,85 +116,23 @@ test.describe('Autoscale', () => {
|
|||||||
await page.keyboard.up('Alt');
|
await page.keyboard.up('Alt');
|
||||||
|
|
||||||
// Ensure the drag worked.
|
// Ensure the drag worked.
|
||||||
await testYTicks(page, ['0.00', '0.50', '1.00', '1.50', '2.00', '2.50', '3.00', '3.50']);
|
await testYTicks(page, ['-0.50', '0.00', '0.50', '1.00', '1.50', '2.00', '2.50', '3.00']);
|
||||||
|
|
||||||
//Wait for canvas to stablize.
|
//Wait for canvas to stabilize.
|
||||||
await canvas.hover({ trial: true });
|
await canvas.hover({ trial: true });
|
||||||
|
|
||||||
expect.soft(await canvas.screenshot()).toMatchSnapshot('autoscale-canvas-panned.png', { animations: 'disabled' });
|
expect
|
||||||
|
.soft(await canvas.screenshot())
|
||||||
|
.toMatchSnapshot('autoscale-canvas-panned.png', { animations: 'disabled' });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {import('@playwright/test').Page} page
|
|
||||||
* @param {string} start
|
|
||||||
* @param {string} end
|
|
||||||
*/
|
|
||||||
async function setTimeRange(page, start = '2022-03-29 22:00:00.000Z', end = '2022-03-29 22:00:30.000Z') {
|
|
||||||
// Set a specific time range for consistency, otherwise it will change
|
|
||||||
// on every test to a range based on the current time.
|
|
||||||
|
|
||||||
const timeInputs = page.locator('input.c-input--datetime');
|
|
||||||
await timeInputs.first().click();
|
|
||||||
await timeInputs.first().fill(start);
|
|
||||||
|
|
||||||
await timeInputs.nth(1).click();
|
|
||||||
await timeInputs.nth(1).fill(end);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {import('@playwright/test').Page} page
|
|
||||||
* @param {string} myItemsFolderName
|
|
||||||
*/
|
|
||||||
async function createSinewaveOverlayPlot(page, myItemsFolderName) {
|
|
||||||
// click create button
|
|
||||||
await page.locator('button:has-text("Create")').click();
|
|
||||||
|
|
||||||
// add overlay plot with defaults
|
|
||||||
await page.locator('li[role="menuitem"]:has-text("Overlay Plot")').click();
|
|
||||||
await Promise.all([
|
|
||||||
page.waitForNavigation(),
|
|
||||||
page.locator('button:has-text("OK")').click(),
|
|
||||||
//Wait for Save Banner to appear1
|
|
||||||
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'});
|
|
||||||
|
|
||||||
// save (exit edit mode)
|
|
||||||
await page.locator('text=Snapshot Save and Finish Editing Save and Continue Editing >> button').nth(1).click();
|
|
||||||
await page.locator('text=Save and Finish Editing').click();
|
|
||||||
|
|
||||||
// click create button
|
|
||||||
await page.locator('button:has-text("Create")').click();
|
|
||||||
|
|
||||||
// add sine wave generator with defaults
|
|
||||||
await page.locator('li[role="menuitem"]:has-text("Sine Wave Generator")').click();
|
|
||||||
await Promise.all([
|
|
||||||
page.waitForNavigation(),
|
|
||||||
page.locator('button:has-text("OK")').click(),
|
|
||||||
//Wait for Save Banner to appear1
|
|
||||||
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'});
|
|
||||||
|
|
||||||
// focus the overlay plot
|
|
||||||
await page.locator(`text=Open MCT ${myItemsFolderName} >> span`).nth(3).click();
|
|
||||||
await Promise.all([
|
|
||||||
page.waitForNavigation(),
|
|
||||||
page.locator('text=Unnamed Overlay Plot').first().click()
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {import('@playwright/test').Page} page
|
* @param {import('@playwright/test').Page} page
|
||||||
*/
|
*/
|
||||||
async function turnOffAutoscale(page) {
|
async function turnOffAutoscale(page) {
|
||||||
// uncheck autoscale
|
// uncheck autoscale
|
||||||
await page.getByRole('listitem').filter({ hasText: 'Auto scale' }).getByRole('checkbox').uncheck();
|
await page.getByRole('checkbox', { name: 'Auto scale' }).uncheck();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -182,14 +142,9 @@ async function turnOffAutoscale(page) {
|
|||||||
*/
|
*/
|
||||||
async function setUserDefinedMinAndMax(page, min, max) {
|
async function setUserDefinedMinAndMax(page, min, max) {
|
||||||
// set minimum value
|
// set minimum value
|
||||||
const minRangeInput = page.getByRole('listitem').filter({ hasText: 'Minimum Value' }).locator('input[type="number"]');
|
await page.getByRole('spinbutton').first().fill(min);
|
||||||
await minRangeInput.click();
|
|
||||||
await minRangeInput.fill(min);
|
|
||||||
|
|
||||||
// set maximum value
|
// set maximum value
|
||||||
const maxRangeInput = page.getByRole('listitem').filter({ hasText: 'Maximum Value' }).locator('input[type="number"]');
|
await page.getByRole('spinbutton').nth(1).fill(max);
|
||||||
await maxRangeInput.click();
|
|
||||||
await maxRangeInput.fill(max);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -198,7 +153,7 @@ async function setUserDefinedMinAndMax(page, min, max) {
|
|||||||
async function testYTicks(page, values) {
|
async function testYTicks(page, values) {
|
||||||
const yTicks = page.locator('.gl-plot-y-tick-label');
|
const yTicks = page.locator('.gl-plot-y-tick-label');
|
||||||
await page.locator('canvas >> nth=1').hover();
|
await page.locator('canvas >> nth=1').hover();
|
||||||
let promises = [yTicks.count().then(c => expect(c).toBe(values.length))];
|
let promises = [yTicks.count().then((c) => expect(c).toBe(values.length))];
|
||||||
|
|
||||||
for (let i = 0, l = values.length; i < l; i += 1) {
|
for (let i = 0, l = values.length; i < l; i += 1) {
|
||||||
promises.push(expect.soft(yTicks.nth(i)).toHaveText(values[i])); // eslint-disable-line
|
promises.push(expect.soft(yTicks.nth(i)).toHaveText(values[i])); // eslint-disable-line
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 20 KiB |
@@ -26,10 +26,13 @@ necessarily be used for reference when writing new tests in this area.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const { test, expect } = require('../../../../pluginFixtures');
|
const { test, expect } = require('../../../../pluginFixtures');
|
||||||
const { selectInspectorTab } = require('../../../../appActions');
|
const { selectInspectorTab, setTimeConductorBounds } = require('../../../../appActions');
|
||||||
|
|
||||||
test.describe('Log plot tests', () => {
|
test.describe('Log plot tests', () => {
|
||||||
test('Log Plot ticks are functionally correct in regular and log mode and after refresh', async ({ page, openmctConfig }) => {
|
test('Log Plot ticks are functionally correct in regular and log mode and after refresh', async ({
|
||||||
|
page,
|
||||||
|
openmctConfig
|
||||||
|
}) => {
|
||||||
const { myItemsFolderName } = openmctConfig;
|
const { myItemsFolderName } = openmctConfig;
|
||||||
|
|
||||||
//Test.slow decorator is currently broken. Needs to be fixed in https://github.com/nasa/openmct/issues/5374
|
//Test.slow decorator is currently broken. Needs to be fixed in https://github.com/nasa/openmct/issues/5374
|
||||||
@@ -51,7 +54,9 @@ test.describe('Log plot tests', () => {
|
|||||||
|
|
||||||
// Leaving test as 'TODO' for now.
|
// Leaving test as 'TODO' for now.
|
||||||
// NOTE: Not eligible for community contributions.
|
// NOTE: Not eligible for community contributions.
|
||||||
test.fixme('Verify that log mode option is reflected in import/export JSON', async ({ page, openmctConfig }) => {
|
test.fixme(
|
||||||
|
'Verify that log mode option is reflected in import/export JSON',
|
||||||
|
async ({ page, openmctConfig }) => {
|
||||||
const { myItemsFolderName } = openmctConfig;
|
const { myItemsFolderName } = openmctConfig;
|
||||||
|
|
||||||
await makeOverlayPlot(page, myItemsFolderName);
|
await makeOverlayPlot(page, myItemsFolderName);
|
||||||
@@ -66,7 +71,8 @@ test.describe('Log plot tests', () => {
|
|||||||
// TODO, the plot is slightly at different position that in the other test, so this fails.
|
// 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...
|
// ...We can fix it by copying all steps from the first test...
|
||||||
// await testLogPlotPixels(page);
|
// await testLogPlotPixels(page);
|
||||||
});
|
}
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -76,17 +82,15 @@ test.describe('Log plot tests', () => {
|
|||||||
*/
|
*/
|
||||||
async function makeOverlayPlot(page, 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
|
// 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: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
// Set a specific time range for consistency, otherwise it will change
|
// Set a specific time range for consistency, otherwise it will change
|
||||||
// on every test to a range based on the current time.
|
// on every test to a range based on the current time.
|
||||||
|
|
||||||
const timeInputs = page.locator('input.c-input--datetime');
|
const start = '2022-03-29 22:00:00.000Z';
|
||||||
await timeInputs.first().click();
|
const end = '2022-03-29 22:00:30.000Z';
|
||||||
await timeInputs.first().fill('2022-03-29 22:00:00.000Z');
|
|
||||||
|
|
||||||
await timeInputs.nth(1).click();
|
await setTimeConductorBounds(page, start, end);
|
||||||
await timeInputs.nth(1).fill('2022-03-29 22:00:30.000Z');
|
|
||||||
|
|
||||||
// create overlay plot
|
// create overlay plot
|
||||||
|
|
||||||
@@ -147,7 +151,7 @@ async function makeOverlayPlot(page, myItemsFolderName) {
|
|||||||
* @param {import('@playwright/test').Page} page
|
* @param {import('@playwright/test').Page} page
|
||||||
*/
|
*/
|
||||||
async function testRegularTicks(page) {
|
async function testRegularTicks(page) {
|
||||||
const yTicks = await page.locator('.gl-plot-y-tick-label');
|
const yTicks = page.locator('.gl-plot-y-tick-label');
|
||||||
expect(await yTicks.count()).toBe(7);
|
expect(await yTicks.count()).toBe(7);
|
||||||
await expect(yTicks.nth(0)).toHaveText('-2');
|
await expect(yTicks.nth(0)).toHaveText('-2');
|
||||||
await expect(yTicks.nth(1)).toHaveText('0');
|
await expect(yTicks.nth(1)).toHaveText('0');
|
||||||
@@ -162,7 +166,7 @@ async function testRegularTicks(page) {
|
|||||||
* @param {import('@playwright/test').Page} page
|
* @param {import('@playwright/test').Page} page
|
||||||
*/
|
*/
|
||||||
async function testLogTicks(page) {
|
async function testLogTicks(page) {
|
||||||
const yTicks = await page.locator('.gl-plot-y-tick-label');
|
const yTicks = page.locator('.gl-plot-y-tick-label');
|
||||||
expect(await yTicks.count()).toBe(9);
|
expect(await yTicks.count()).toBe(9);
|
||||||
await expect(yTicks.nth(0)).toHaveText('-2.98');
|
await expect(yTicks.nth(0)).toHaveText('-2.98');
|
||||||
await expect(yTicks.nth(1)).toHaveText('-1.51');
|
await expect(yTicks.nth(1)).toHaveText('-1.51');
|
||||||
@@ -180,27 +184,24 @@ async function testLogTicks(page) {
|
|||||||
*/
|
*/
|
||||||
async function enableEditMode(page) {
|
async function enableEditMode(page) {
|
||||||
// turn on edit mode
|
// turn on edit mode
|
||||||
await page.locator('text=Unnamed Overlay Plot Snapshot >> button').nth(3).click();
|
await page.getByRole('button', { name: 'Edit' }).click();
|
||||||
await expect(await page.locator('text=Snapshot Save and Finish Editing Save and Continue Editing >> button').nth(1)).toBeVisible();
|
await expect(page.getByRole('button', { name: 'Save' })).toBeVisible();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {import('@playwright/test').Page} page
|
* @param {import('@playwright/test').Page} page
|
||||||
*/
|
*/
|
||||||
async function enableLogMode(page) {
|
async function enableLogMode(page) {
|
||||||
// turn on log mode
|
await expect(page.getByRole('checkbox', { name: 'Log mode' })).not.toBeChecked();
|
||||||
await expect(page.getByRole('listitem').filter({ hasText: 'Log mode' }).getByRole('checkbox')).not.toBeChecked();
|
await page.getByRole('checkbox', { name: 'Log mode' }).check();
|
||||||
await page.getByRole('listitem').filter({ hasText: 'Log mode' }).getByRole('checkbox').check();
|
|
||||||
// await page.locator('text=Y Axis Label Log mode Auto scale Padding >> input[type="checkbox"]').first().check();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {import('@playwright/test').Page} page
|
* @param {import('@playwright/test').Page} page
|
||||||
*/
|
*/
|
||||||
async function disableLogMode(page) {
|
async function disableLogMode(page) {
|
||||||
// turn off log mode
|
await expect(page.getByRole('checkbox', { name: 'Log mode' })).toBeChecked();
|
||||||
await expect(page.getByRole('listitem').filter({ hasText: 'Log mode' }).getByRole('checkbox')).toBeChecked();
|
await page.getByRole('checkbox', { name: 'Log mode' }).uncheck();
|
||||||
await page.getByRole('listitem').filter({ hasText: 'Log mode' }).getByRole('checkbox').uncheck();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -208,7 +209,10 @@ async function disableLogMode(page) {
|
|||||||
*/
|
*/
|
||||||
async function saveOverlayPlot(page) {
|
async function saveOverlayPlot(page) {
|
||||||
// save overlay plot
|
// save overlay plot
|
||||||
await page.locator('text=Snapshot Save and Finish Editing Save and Continue Editing >> button').nth(1).click();
|
await page
|
||||||
|
.locator('text=Snapshot Save and Finish Editing Save and Continue Editing >> button')
|
||||||
|
.nth(1)
|
||||||
|
.click();
|
||||||
|
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
page.locator('text=Save and Finish Editing').click(),
|
page.locator('text=Save and Finish Editing').click(),
|
||||||
|
|||||||
@@ -27,14 +27,18 @@ Tests to verify log plot functionality when objects are missing
|
|||||||
const { test, expect } = require('../../../../pluginFixtures');
|
const { test, expect } = require('../../../../pluginFixtures');
|
||||||
|
|
||||||
test.describe('Handle missing object for plots', () => {
|
test.describe('Handle missing object for plots', () => {
|
||||||
test('Displays empty div for missing stacked plot item @unstable', async ({ page, browserName, openmctConfig }) => {
|
test('Displays empty div for missing stacked plot item @unstable', async ({
|
||||||
|
page,
|
||||||
|
browserName,
|
||||||
|
openmctConfig
|
||||||
|
}) => {
|
||||||
// eslint-disable-next-line playwright/no-skipped-test
|
// eslint-disable-next-line playwright/no-skipped-test
|
||||||
test.skip(browserName === 'firefox', 'Firefox failing due to console events being missed');
|
test.skip(browserName === 'firefox', 'Firefox failing due to console events being missed');
|
||||||
|
|
||||||
const { myItemsFolderName } = openmctConfig;
|
const { myItemsFolderName } = openmctConfig;
|
||||||
const errorLogs = [];
|
const errorLogs = [];
|
||||||
|
|
||||||
page.on("console", (message) => {
|
page.on('console', (message) => {
|
||||||
if (message.type() === 'warning' && message.text().includes('Missing domain object')) {
|
if (message.type() === 'warning' && message.text().includes('Missing domain object')) {
|
||||||
errorLogs.push(message.text());
|
errorLogs.push(message.text());
|
||||||
}
|
}
|
||||||
@@ -52,18 +56,15 @@ test.describe('Handle missing object for plots', () => {
|
|||||||
delete parsedData[lastKey];
|
delete parsedData[lastKey];
|
||||||
|
|
||||||
//Sets local storage with missing object
|
//Sets local storage with missing object
|
||||||
await page.evaluate(
|
await page.evaluate(`window.localStorage.setItem('mct', '${JSON.stringify(parsedData)}')`);
|
||||||
`window.localStorage.setItem('mct', '${JSON.stringify(parsedData)}')`
|
|
||||||
);
|
|
||||||
|
|
||||||
//Reloads page and clicks on stacked plot
|
//Reloads page and clicks on stacked plot
|
||||||
await Promise.all([
|
await Promise.all([page.reload(), page.waitForLoadState('networkidle')]);
|
||||||
page.reload(),
|
|
||||||
page.waitForLoadState('networkidle')
|
|
||||||
]);
|
|
||||||
|
|
||||||
//Verify Main section is there on load
|
//Verify Main section is there on load
|
||||||
await expect.soft(page.locator('.l-browse-bar__object-name')).toContainText('Unnamed Stacked Plot');
|
await expect
|
||||||
|
.soft(page.locator('.l-browse-bar__object-name'))
|
||||||
|
.toContainText('Unnamed Stacked Plot');
|
||||||
|
|
||||||
await page.locator(`text=Open MCT ${myItemsFolderName} >> span`).nth(3).click();
|
await page.locator(`text=Open MCT ${myItemsFolderName} >> span`).nth(3).click();
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
@@ -72,7 +73,7 @@ test.describe('Handle missing object for plots', () => {
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
//Check that there is only one stacked item plot with a plot, the missing one will be empty
|
//Check that there is only one stacked item plot with a plot, the missing one will be empty
|
||||||
await expect(page.locator(".c-plot--stacked-container:has(.gl-plot)")).toHaveCount(1);
|
await expect(page.locator('.c-plot--stacked-container:has(.gl-plot)')).toHaveCount(1);
|
||||||
//Verify that console.warn is thrown
|
//Verify that console.warn is thrown
|
||||||
expect(errorLogs).toHaveLength(1);
|
expect(errorLogs).toHaveLength(1);
|
||||||
});
|
});
|
||||||
@@ -84,7 +85,7 @@ test.describe('Handle missing object for plots', () => {
|
|||||||
*/
|
*/
|
||||||
async function makeStackedPlot(page, myItemsFolderName) {
|
async function makeStackedPlot(page, myItemsFolderName) {
|
||||||
// fresh page with time range from 2022-03-29 22:00:00.000Z to 2022-03-29 22:00:30.000Z
|
// 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: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
// create stacked plot
|
// create stacked plot
|
||||||
await page.locator('button.c-create-button').click();
|
await page.locator('button.c-create-button').click();
|
||||||
@@ -127,7 +128,10 @@ async function makeStackedPlot(page, myItemsFolderName) {
|
|||||||
*/
|
*/
|
||||||
async function saveStackedPlot(page) {
|
async function saveStackedPlot(page) {
|
||||||
// save stacked plot
|
// save stacked plot
|
||||||
await page.locator('text=Snapshot Save and Finish Editing Save and Continue Editing >> button').nth(1).click();
|
await page
|
||||||
|
.locator('text=Snapshot Save and Finish Editing Save and Continue Editing >> button')
|
||||||
|
.nth(1)
|
||||||
|
.click();
|
||||||
|
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
page.locator('text=Save and Finish Editing').click(),
|
page.locator('text=Save and Finish Editing').click(),
|
||||||
|
|||||||
@@ -26,20 +26,25 @@ necessarily be used for reference when writing new tests in this area.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const { test, expect } = require('../../../../pluginFixtures');
|
const { test, expect } = require('../../../../pluginFixtures');
|
||||||
const { createDomainObjectWithDefaults, selectInspectorTab } = require('../../../../appActions');
|
const {
|
||||||
|
createDomainObjectWithDefaults,
|
||||||
|
getCanvasPixels,
|
||||||
|
selectInspectorTab,
|
||||||
|
waitForPlotsToRender
|
||||||
|
} = require('../../../../appActions');
|
||||||
|
|
||||||
test.describe('Overlay Plot', () => {
|
test.describe('Overlay Plot', () => {
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Plot legend color is in sync with plot series color', async ({ page }) => {
|
test('Plot legend color is in sync with plot series color', async ({ page }) => {
|
||||||
const overlayPlot = await createDomainObjectWithDefaults(page, {
|
const overlayPlot = await createDomainObjectWithDefaults(page, {
|
||||||
type: "Overlay Plot"
|
type: 'Overlay Plot'
|
||||||
});
|
});
|
||||||
|
|
||||||
await createDomainObjectWithDefaults(page, {
|
await createDomainObjectWithDefaults(page, {
|
||||||
type: "Sine Wave Generator",
|
type: 'Sine Wave Generator',
|
||||||
parent: overlayPlot.uuid
|
parent: overlayPlot.uuid
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -52,28 +57,27 @@ test.describe('Overlay Plot', () => {
|
|||||||
await page.locator('li.c-tree__item.menus-to-left .c-disclosure-triangle').click();
|
await page.locator('li.c-tree__item.menus-to-left .c-disclosure-triangle').click();
|
||||||
await page.locator('.c-click-swatch--menu').click();
|
await page.locator('.c-click-swatch--menu').click();
|
||||||
await page.locator('.c-palette__item[style="background: rgb(255, 166, 61);"]').click();
|
await page.locator('.c-palette__item[style="background: rgb(255, 166, 61);"]').click();
|
||||||
|
|
||||||
// gets color for swatch located in legend
|
// gets color for swatch located in legend
|
||||||
const element = await page.waitForSelector('.plot-series-color-swatch');
|
const seriesColorSwatch = page.locator(
|
||||||
const color = await element.evaluate((el) => {
|
'.gl-plot-y-label-swatch-container > .plot-series-color-swatch'
|
||||||
return window.getComputedStyle(el).getPropertyValue('background-color');
|
);
|
||||||
|
await expect(seriesColorSwatch).toHaveCSS('background-color', 'rgb(255, 166, 61)');
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(color).toBe('rgb(255, 166, 61)');
|
test('Limit lines persist when series is moved to another Y Axis and on refresh', async ({
|
||||||
});
|
page
|
||||||
|
}) => {
|
||||||
test('Limit lines persist when series is moved to another Y Axis and on refresh', async ({ page }) => {
|
|
||||||
test.info().annotations.push({
|
test.info().annotations.push({
|
||||||
type: 'issue',
|
type: 'issue',
|
||||||
description: 'https://github.com/nasa/openmct/issues/6338'
|
description: 'https://github.com/nasa/openmct/issues/6338'
|
||||||
});
|
});
|
||||||
// Create an Overlay Plot with a default SWG
|
// Create an Overlay Plot with a default SWG
|
||||||
const overlayPlot = await createDomainObjectWithDefaults(page, {
|
const overlayPlot = await createDomainObjectWithDefaults(page, {
|
||||||
type: "Overlay Plot"
|
type: 'Overlay Plot'
|
||||||
});
|
});
|
||||||
|
|
||||||
const swgA = await createDomainObjectWithDefaults(page, {
|
const swgA = await createDomainObjectWithDefaults(page, {
|
||||||
type: "Sine Wave Generator",
|
type: 'Sine Wave Generator',
|
||||||
parent: overlayPlot.uuid
|
parent: overlayPlot.uuid
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -88,8 +92,15 @@ test.describe('Overlay Plot', () => {
|
|||||||
|
|
||||||
// Expand the "Sine Wave Generator" plot series options and enable limit lines
|
// Expand the "Sine Wave Generator" plot series options and enable limit lines
|
||||||
await selectInspectorTab(page, 'Config');
|
await selectInspectorTab(page, 'Config');
|
||||||
await page.getByRole('list', { name: 'Plot Series Properties' }).locator('span').first().click();
|
await page
|
||||||
await page.getByRole('list', { name: 'Plot Series Properties' }).locator('[title="Display limit lines"]~div input').check();
|
.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 assertLimitLinesExistAndAreVisible(page);
|
await assertLimitLinesExistAndAreVisible(page);
|
||||||
|
|
||||||
@@ -109,7 +120,9 @@ test.describe('Overlay Plot', () => {
|
|||||||
await selectInspectorTab(page, 'Elements');
|
await selectInspectorTab(page, 'Elements');
|
||||||
|
|
||||||
// Drag Sine Wave Generator series from Y Axis 1 into Y Axis 2
|
// Drag Sine Wave Generator series from Y Axis 1 into Y Axis 2
|
||||||
await page.locator(`#inspector-elements-tree >> text=${swgA.name}`).dragTo(page.locator('[aria-label="Element Item Group Y Axis 2"]'));
|
await page
|
||||||
|
.locator(`#inspector-elements-tree >> text=${swgA.name}`)
|
||||||
|
.dragTo(page.locator('[aria-label="Element Item Group Y Axis 2"]'));
|
||||||
|
|
||||||
await assertLimitLinesExistAndAreVisible(page);
|
await assertLimitLinesExistAndAreVisible(page);
|
||||||
|
|
||||||
@@ -122,32 +135,33 @@ test.describe('Overlay Plot', () => {
|
|||||||
await page.reload();
|
await page.reload();
|
||||||
|
|
||||||
await assertLimitLinesExistAndAreVisible(page);
|
await assertLimitLinesExistAndAreVisible(page);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test('The elements pool supports dragging series into multiple y-axis buckets', async ({ page }) => {
|
test('The elements pool supports dragging series into multiple y-axis buckets', async ({
|
||||||
|
page
|
||||||
|
}) => {
|
||||||
const overlayPlot = await createDomainObjectWithDefaults(page, {
|
const overlayPlot = await createDomainObjectWithDefaults(page, {
|
||||||
type: "Overlay Plot"
|
type: 'Overlay Plot'
|
||||||
});
|
});
|
||||||
|
|
||||||
const swgA = await createDomainObjectWithDefaults(page, {
|
const swgA = await createDomainObjectWithDefaults(page, {
|
||||||
type: "Sine Wave Generator",
|
type: 'Sine Wave Generator',
|
||||||
parent: overlayPlot.uuid
|
parent: overlayPlot.uuid
|
||||||
});
|
});
|
||||||
const swgB = await createDomainObjectWithDefaults(page, {
|
const swgB = await createDomainObjectWithDefaults(page, {
|
||||||
type: "Sine Wave Generator",
|
type: 'Sine Wave Generator',
|
||||||
parent: overlayPlot.uuid
|
parent: overlayPlot.uuid
|
||||||
});
|
});
|
||||||
const swgC = await createDomainObjectWithDefaults(page, {
|
const swgC = await createDomainObjectWithDefaults(page, {
|
||||||
type: "Sine Wave Generator",
|
type: 'Sine Wave Generator',
|
||||||
parent: overlayPlot.uuid
|
parent: overlayPlot.uuid
|
||||||
});
|
});
|
||||||
const swgD = await createDomainObjectWithDefaults(page, {
|
const swgD = await createDomainObjectWithDefaults(page, {
|
||||||
type: "Sine Wave Generator",
|
type: 'Sine Wave Generator',
|
||||||
parent: overlayPlot.uuid
|
parent: overlayPlot.uuid
|
||||||
});
|
});
|
||||||
const swgE = await createDomainObjectWithDefaults(page, {
|
const swgE = await createDomainObjectWithDefaults(page, {
|
||||||
type: "Sine Wave Generator",
|
type: 'Sine Wave Generator',
|
||||||
parent: overlayPlot.uuid
|
parent: overlayPlot.uuid
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -157,9 +171,15 @@ test.describe('Overlay Plot', () => {
|
|||||||
await selectInspectorTab(page, 'Elements');
|
await selectInspectorTab(page, 'Elements');
|
||||||
|
|
||||||
// Drag swg a, c, e into Y Axis 2
|
// Drag swg a, c, e into Y Axis 2
|
||||||
await page.locator(`#inspector-elements-tree >> text=${swgA.name}`).dragTo(page.locator('[aria-label="Element Item Group Y Axis 2"]'));
|
await page
|
||||||
await page.locator(`#inspector-elements-tree >> text=${swgC.name}`).dragTo(page.locator('[aria-label="Element Item Group Y Axis 2"]'));
|
.locator(`#inspector-elements-tree >> text=${swgA.name}`)
|
||||||
await page.locator(`#inspector-elements-tree >> text=${swgE.name}`).dragTo(page.locator('[aria-label="Element Item Group Y Axis 2"]'));
|
.dragTo(page.locator('[aria-label="Element Item Group Y Axis 2"]'));
|
||||||
|
await page
|
||||||
|
.locator(`#inspector-elements-tree >> text=${swgC.name}`)
|
||||||
|
.dragTo(page.locator('[aria-label="Element Item Group Y Axis 2"]'));
|
||||||
|
await page
|
||||||
|
.locator(`#inspector-elements-tree >> text=${swgE.name}`)
|
||||||
|
.dragTo(page.locator('[aria-label="Element Item Group Y Axis 2"]'));
|
||||||
|
|
||||||
// Assert that Y Axis 1 and Y Axis 2 property groups are visible only
|
// Assert that Y Axis 1 and Y Axis 2 property groups are visible only
|
||||||
await selectInspectorTab(page, 'Config');
|
await selectInspectorTab(page, 'Config');
|
||||||
@@ -172,14 +192,16 @@ test.describe('Overlay Plot', () => {
|
|||||||
await expect(yAxis2PropertyGroup).toBeVisible();
|
await expect(yAxis2PropertyGroup).toBeVisible();
|
||||||
await expect(yAxis3PropertyGroup).toBeHidden();
|
await expect(yAxis3PropertyGroup).toBeHidden();
|
||||||
|
|
||||||
const yAxis1Group = page.getByLabel("Y Axis 1");
|
const yAxis1Group = page.getByLabel('Y Axis 1');
|
||||||
const yAxis2Group = page.getByLabel("Y Axis 2");
|
const yAxis2Group = page.getByLabel('Y Axis 2');
|
||||||
const yAxis3Group = page.getByLabel("Y Axis 3");
|
const yAxis3Group = page.getByLabel('Y Axis 3');
|
||||||
|
|
||||||
await selectInspectorTab(page, 'Elements');
|
await selectInspectorTab(page, 'Elements');
|
||||||
|
|
||||||
// Drag swg b into Y Axis 3
|
// Drag swg b into Y Axis 3
|
||||||
await page.locator(`#inspector-elements-tree >> text=${swgB.name}`).dragTo(page.locator('[aria-label="Element Item Group Y Axis 3"]'));
|
await page
|
||||||
|
.locator(`#inspector-elements-tree >> text=${swgB.name}`)
|
||||||
|
.dragTo(page.locator('[aria-label="Element Item Group Y Axis 3"]'));
|
||||||
|
|
||||||
// Assert that all Y Axis property groups are visible
|
// Assert that all Y Axis property groups are visible
|
||||||
await selectInspectorTab(page, 'Config');
|
await selectInspectorTab(page, 'Config');
|
||||||
@@ -203,73 +225,40 @@ test.describe('Overlay Plot', () => {
|
|||||||
expect(yAxis3Group.getByRole('listitem').nth(0).getByText(swgB.name)).toBeTruthy();
|
expect(yAxis3Group.getByRole('listitem').nth(0).getByText(swgB.name)).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Clicking on an item in the elements pool brings up the plot preview with data points', async ({ page }) => {
|
test('Clicking on an item in the elements pool brings up the plot preview with data points', async ({
|
||||||
|
page
|
||||||
|
}) => {
|
||||||
const overlayPlot = await createDomainObjectWithDefaults(page, {
|
const overlayPlot = await createDomainObjectWithDefaults(page, {
|
||||||
type: "Overlay Plot"
|
type: 'Overlay Plot'
|
||||||
});
|
});
|
||||||
|
|
||||||
const swgA = await createDomainObjectWithDefaults(page, {
|
const swgA = await createDomainObjectWithDefaults(page, {
|
||||||
type: "Sine Wave Generator",
|
type: 'Sine Wave Generator',
|
||||||
parent: overlayPlot.uuid
|
parent: overlayPlot.uuid
|
||||||
});
|
});
|
||||||
|
|
||||||
await page.goto(overlayPlot.url);
|
await page.goto(overlayPlot.url);
|
||||||
|
// Wait for plot series data to load and be drawn
|
||||||
|
await waitForPlotsToRender(page);
|
||||||
await page.click('button[title="Edit"]');
|
await page.click('button[title="Edit"]');
|
||||||
|
|
||||||
await selectInspectorTab(page, 'Elements');
|
await selectInspectorTab(page, 'Elements');
|
||||||
|
|
||||||
await page.locator(`#inspector-elements-tree >> text=${swgA.name}`).click();
|
await page.locator(`#inspector-elements-tree >> text=${swgA.name}`).click();
|
||||||
|
|
||||||
const plotPixelSize = await getCanvasPixelsWithData(page);
|
const plotPixels = await getCanvasPixels(page, '.js-overlay canvas');
|
||||||
|
const plotPixelSize = plotPixels.length;
|
||||||
expect(plotPixelSize).toBeGreaterThan(0);
|
expect(plotPixelSize).toBeGreaterThan(0);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {import('@playwright/test').Page} page
|
* Asserts that limit lines exist and are visible
|
||||||
*/
|
|
||||||
async function getCanvasPixelsWithData(page) {
|
|
||||||
const getTelemValuePromise = new Promise(resolve => page.exposeFunction('getCanvasValue', resolve));
|
|
||||||
|
|
||||||
await page.evaluate(() => {
|
|
||||||
// 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)
|
|
||||||
let data;
|
|
||||||
let canvas;
|
|
||||||
let ctx;
|
|
||||||
canvas = document.querySelector('.js-overlay canvas');
|
|
||||||
ctx = canvas.getContext('2d');
|
|
||||||
data = ctx.getImageData(0, 0, canvas.width, canvas.height).data;
|
|
||||||
const imageDataValues = Object.values(data);
|
|
||||||
let plotPixels = [];
|
|
||||||
// Each pixel consists of four values within the ImageData.data array. The for loop iterates by multiples of four.
|
|
||||||
// The values associated with each pixel are R (red), G (green), B (blue), and A (alpha), in that order.
|
|
||||||
for (let i = 0; i < imageDataValues.length;) {
|
|
||||||
if (imageDataValues[i] > 0) {
|
|
||||||
plotPixels.push({
|
|
||||||
startIndex: i,
|
|
||||||
endIndex: i + 3,
|
|
||||||
value: `rgb(${imageDataValues[i]}, ${imageDataValues[i + 1]}, ${imageDataValues[i + 2]}, ${imageDataValues[i + 3]})`
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
i = i + 4;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
window.getCanvasValue(plotPixels.length);
|
|
||||||
});
|
|
||||||
|
|
||||||
return getTelemValuePromise;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {import('@playwright/test').Page} page
|
* @param {import('@playwright/test').Page} page
|
||||||
*/
|
*/
|
||||||
async function assertLimitLinesExistAndAreVisible(page) {
|
async function assertLimitLinesExistAndAreVisible(page) {
|
||||||
// Wait for plot series data to load
|
// Wait for plot series data to load
|
||||||
await expect(page.locator('.js-series-data-loaded')).toBeVisible();
|
await waitForPlotsToRender(page);
|
||||||
// Wait for limit lines to be created
|
// Wait for limit lines to be created
|
||||||
await page.waitForSelector('.js-limit-area', { state: 'attached' });
|
await page.waitForSelector('.js-limit-area', { state: 'attached' });
|
||||||
const limitLineCount = await page.locator('.c-plot-limit-line').count();
|
const limitLineCount = await page.locator('.c-plot-limit-line').count();
|
||||||
|
|||||||
@@ -1,113 +0,0 @@
|
|||||||
/*****************************************************************************
|
|
||||||
* 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.
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
/*
|
|
||||||
Tests to verify log plot functionality. Note this test suite if very much under active development and should not
|
|
||||||
necessarily be used for reference when writing new tests in this area.
|
|
||||||
*/
|
|
||||||
|
|
||||||
const { selectInspectorTab } = require('../../../../appActions');
|
|
||||||
const { test, expect } = require('../../../../pluginFixtures');
|
|
||||||
|
|
||||||
test.describe('Legend color in sync with plot color', () => {
|
|
||||||
test('Testing', async ({ page }) => {
|
|
||||||
await makeOverlayPlot(page);
|
|
||||||
|
|
||||||
// navigate to plot series color palette
|
|
||||||
await page.click('.l-browse-bar__actions__edit');
|
|
||||||
await selectInspectorTab(page, 'Config');
|
|
||||||
|
|
||||||
await page.locator('li.c-tree__item.menus-to-left .c-disclosure-triangle').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
|
|
||||||
const element = await page.waitForSelector('.plot-series-color-swatch');
|
|
||||||
const color = await element.evaluate((el) => {
|
|
||||||
return window.getComputedStyle(el).getPropertyValue('background-color');
|
|
||||||
});
|
|
||||||
|
|
||||||
expect(color).toBe('rgb(255, 166, 61)');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
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.locator('text=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' });
|
|
||||||
}
|
|
||||||
|
|
||||||
async function makeOverlayPlot(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: 'networkidle' });
|
|
||||||
|
|
||||||
// create overlay plot
|
|
||||||
|
|
||||||
await page.locator('button.c-create-button').click();
|
|
||||||
await page.locator('li[role="menuitem"]:has-text("Overlay Plot")').click();
|
|
||||||
await Promise.all([
|
|
||||||
page.waitForNavigation({ waitUntil: 'networkidle'}),
|
|
||||||
page.locator('button:has-text("OK")').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'});
|
|
||||||
|
|
||||||
// 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();
|
|
||||||
|
|
||||||
// Click OK to make generator
|
|
||||||
|
|
||||||
await Promise.all([
|
|
||||||
page.waitForNavigation({ waitUntil: 'networkidle'}),
|
|
||||||
page.locator('button:has-text("OK")').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'});
|
|
||||||
|
|
||||||
// click on overlay plot
|
|
||||||
|
|
||||||
await page.locator('text=Open MCT My Items >> span').nth(3).click();
|
|
||||||
await Promise.all([
|
|
||||||
page.waitForNavigation(),
|
|
||||||
page.locator('text=Unnamed Overlay Plot').first().click()
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
@@ -26,15 +26,17 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const { test, expect } = require('../../../../pluginFixtures');
|
const { test, expect } = require('../../../../pluginFixtures');
|
||||||
const { createDomainObjectWithDefaults} = require('../../../../appActions');
|
const { createDomainObjectWithDefaults, getCanvasPixels } = require('../../../../appActions');
|
||||||
|
|
||||||
test.describe('Plot Integrity Testing @unstable', () => {
|
test.describe('Plot Rendering', () => {
|
||||||
let sineWaveGeneratorObject;
|
let sineWaveGeneratorObject;
|
||||||
|
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
// Open a browser, navigate to the main page, and wait until all networkevents to resolve
|
// Open a browser, navigate to the main page, and wait until all networkevents to resolve
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
sineWaveGeneratorObject = await createDomainObjectWithDefaults(page, { type: 'Sine Wave Generator' });
|
sineWaveGeneratorObject = await createDomainObjectWithDefaults(page, {
|
||||||
|
type: 'Sine Wave Generator'
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Plots do not re-request data when a plot is clicked', async ({ page }) => {
|
test('Plots do not re-request data when a plot is clicked', async ({ page }) => {
|
||||||
@@ -44,8 +46,7 @@ test.describe('Plot Integrity Testing @unstable', () => {
|
|||||||
await page.locator('canvas').nth(1).click();
|
await page.locator('canvas').nth(1).click();
|
||||||
// No request was made to get historical data
|
// No request was made to get historical data
|
||||||
const createMineFolderRequests = [];
|
const createMineFolderRequests = [];
|
||||||
page.on('request', req => {
|
page.on('request', (req) => {
|
||||||
// eslint-disable-next-line playwright/no-conditional-in-test
|
|
||||||
createMineFolderRequests.push(req);
|
createMineFolderRequests.push(req);
|
||||||
});
|
});
|
||||||
expect(createMineFolderRequests.length).toEqual(0);
|
expect(createMineFolderRequests.length).toEqual(0);
|
||||||
@@ -56,7 +57,8 @@ test.describe('Plot Integrity Testing @unstable', () => {
|
|||||||
await editSineWaveToUseInfinityOption(page, sineWaveGeneratorObject);
|
await editSineWaveToUseInfinityOption(page, sineWaveGeneratorObject);
|
||||||
|
|
||||||
//Get pixel data from Canvas
|
//Get pixel data from Canvas
|
||||||
const plotPixelSize = await getCanvasPixelsWithData(page);
|
const plotPixels = await getCanvasPixels(page, 'canvas');
|
||||||
|
const plotPixelSize = plotPixels.length;
|
||||||
expect(plotPixelSize).toBeGreaterThan(0);
|
expect(plotPixelSize).toBeGreaterThan(0);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -70,70 +72,23 @@ test.describe('Plot Integrity Testing @unstable', () => {
|
|||||||
*/
|
*/
|
||||||
async function editSineWaveToUseInfinityOption(page, sineWaveGeneratorObject) {
|
async function editSineWaveToUseInfinityOption(page, sineWaveGeneratorObject) {
|
||||||
await page.goto(sineWaveGeneratorObject.url);
|
await page.goto(sineWaveGeneratorObject.url);
|
||||||
// Edit LAD table
|
// Edit SWG properties to include infinity values
|
||||||
await page.locator('[title="More options"]').click();
|
await page.locator('[title="More options"]').click();
|
||||||
await page.locator('[title="Edit properties of this object."]').click();
|
await page.locator('[title="Edit properties of this object."]').click();
|
||||||
// Modify the infinity option to true
|
await page
|
||||||
const infinityInput = page.locator('[aria-label="Include Infinity Values"]');
|
.getByRole('switch', {
|
||||||
await infinityInput.click();
|
name: 'Include Infinity Values'
|
||||||
|
})
|
||||||
|
.check();
|
||||||
|
|
||||||
// Click OK button and wait for Navigate event
|
await page
|
||||||
await Promise.all([
|
.getByRole('button', {
|
||||||
page.waitForLoadState(),
|
name: 'Save'
|
||||||
page.click('[aria-label="Save"]'),
|
})
|
||||||
// Wait for Save Banner to appear
|
.click();
|
||||||
page.waitForSelector('.c-message-banner__message')
|
|
||||||
]);
|
|
||||||
|
|
||||||
// FIXME: Changes to SWG properties should be reflected on save, but they're not?
|
// FIXME: Changes to SWG properties should be reflected on save, but they're not?
|
||||||
// Thus, navigate away and back to the object.
|
// Thus, navigate away and back to the object.
|
||||||
await page.goto('./#/browse/mine');
|
await page.goto('./#/browse/mine');
|
||||||
await page.goto(sineWaveGeneratorObject.url);
|
await page.goto(sineWaveGeneratorObject.url);
|
||||||
|
|
||||||
await page.locator('c-progress-bar c-telemetry-table__progress-bar').waitFor({
|
|
||||||
state: 'hidden'
|
|
||||||
});
|
|
||||||
|
|
||||||
// FIXME: The progress bar disappears on series data load, not on plot render,
|
|
||||||
// so wait for a half a second before evaluating the canvas.
|
|
||||||
// eslint-disable-next-line playwright/no-wait-for-timeout
|
|
||||||
await page.waitForTimeout(500);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {import('@playwright/test').Page} page
|
|
||||||
*/
|
|
||||||
async function getCanvasPixelsWithData(page) {
|
|
||||||
const getTelemValuePromise = new Promise(resolve => page.exposeFunction('getCanvasValue', resolve));
|
|
||||||
|
|
||||||
await page.evaluate(() => {
|
|
||||||
// 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)
|
|
||||||
let data;
|
|
||||||
let canvas;
|
|
||||||
let ctx;
|
|
||||||
canvas = document.querySelector('canvas');
|
|
||||||
ctx = canvas.getContext('2d');
|
|
||||||
data = ctx.getImageData(0, 0, canvas.width, canvas.height).data;
|
|
||||||
const imageDataValues = Object.values(data);
|
|
||||||
let plotPixels = [];
|
|
||||||
// Each pixel consists of four values within the ImageData.data array. The for loop iterates by multiples of four.
|
|
||||||
// The values associated with each pixel are R (red), G (green), B (blue), and A (alpha), in that order.
|
|
||||||
for (let i = 0; i < imageDataValues.length;) {
|
|
||||||
if (imageDataValues[i] > 0) {
|
|
||||||
plotPixels.push({
|
|
||||||
startIndex: i,
|
|
||||||
endIndex: i + 3,
|
|
||||||
value: `rgb(${imageDataValues[i]}, ${imageDataValues[i + 1]}, ${imageDataValues[i + 2]}, ${imageDataValues[i + 3]})`
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
i = i + 4;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
window.getCanvasValue(plotPixels.length);
|
|
||||||
});
|
|
||||||
|
|
||||||
return getTelemValuePromise;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ test.describe('Scatter Plot', () => {
|
|||||||
|
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
// Open a browser, navigate to the main page, and wait until all networkevents to resolve
|
// Open a browser, navigate to the main page, and wait until all networkevents to resolve
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
// Create the Scatter Plot
|
// Create the Scatter Plot
|
||||||
scatterPlot = await createDomainObjectWithDefaults(page, { type: 'Scatter Plot' });
|
scatterPlot = await createDomainObjectWithDefaults(page, { type: 'Scatter Plot' });
|
||||||
@@ -67,7 +67,13 @@ test.describe('Scatter Plot', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Verify that the 'Replace telemetry source' modal appears and accept it
|
// 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?')).toBeVisible();
|
await expect
|
||||||
|
.soft(
|
||||||
|
page.locator(
|
||||||
|
'text=This action will replace the current telemetry source. Do you want to continue?'
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.toBeVisible();
|
||||||
await page.click('text=Ok');
|
await page.click('text=Ok');
|
||||||
|
|
||||||
// Navigate to the scatter plot and verify that the new SWG
|
// Navigate to the scatter plot and verify that the new SWG
|
||||||
@@ -88,7 +94,13 @@ test.describe('Scatter Plot', () => {
|
|||||||
await page.locator('li[title="Remove this object from its containing object."]').click();
|
await page.locator('li[title="Remove this object from its containing object."]').click();
|
||||||
|
|
||||||
// Verify that the 'Remove object' confirmation modal appears and accept it
|
// 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?')).toBeVisible();
|
await expect
|
||||||
|
.soft(
|
||||||
|
page.locator(
|
||||||
|
'text=Warning! This action will remove this object. Are you sure you want to continue?'
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.toBeVisible();
|
||||||
await page.click('text=Ok');
|
await page.click('text=Ok');
|
||||||
|
|
||||||
// Verify that the elements pool shows no elements
|
// Verify that the elements pool shows no elements
|
||||||
|
|||||||
@@ -26,7 +26,11 @@ necessarily be used for reference when writing new tests in this area.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const { test, expect } = require('../../../../pluginFixtures');
|
const { test, expect } = require('../../../../pluginFixtures');
|
||||||
const { createDomainObjectWithDefaults, selectInspectorTab } = require('../../../../appActions');
|
const {
|
||||||
|
createDomainObjectWithDefaults,
|
||||||
|
selectInspectorTab,
|
||||||
|
waitForPlotsToRender
|
||||||
|
} = require('../../../../appActions');
|
||||||
|
|
||||||
test.describe('Stacked Plot', () => {
|
test.describe('Stacked Plot', () => {
|
||||||
let stackedPlot;
|
let stackedPlot;
|
||||||
@@ -36,30 +40,36 @@ test.describe('Stacked Plot', () => {
|
|||||||
|
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
// Open a browser, navigate to the main page, and wait until all networkevents to resolve
|
// Open a browser, navigate to the main page, and wait until all networkevents to resolve
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
stackedPlot = await createDomainObjectWithDefaults(page, {
|
stackedPlot = await createDomainObjectWithDefaults(page, {
|
||||||
type: "Stacked Plot"
|
type: 'Stacked Plot'
|
||||||
});
|
});
|
||||||
|
|
||||||
swgA = await createDomainObjectWithDefaults(page, {
|
swgA = await createDomainObjectWithDefaults(page, {
|
||||||
type: "Sine Wave Generator",
|
type: 'Sine Wave Generator',
|
||||||
parent: stackedPlot.uuid
|
parent: stackedPlot.uuid
|
||||||
});
|
});
|
||||||
swgB = await createDomainObjectWithDefaults(page, {
|
swgB = await createDomainObjectWithDefaults(page, {
|
||||||
type: "Sine Wave Generator",
|
type: 'Sine Wave Generator',
|
||||||
parent: stackedPlot.uuid
|
parent: stackedPlot.uuid
|
||||||
});
|
});
|
||||||
swgC = await createDomainObjectWithDefaults(page, {
|
swgC = await createDomainObjectWithDefaults(page, {
|
||||||
type: "Sine Wave Generator",
|
type: 'Sine Wave Generator',
|
||||||
parent: stackedPlot.uuid
|
parent: stackedPlot.uuid
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Using the remove action removes the correct plot', async ({ page }) => {
|
test('Using the remove action removes the correct plot', async ({ page }) => {
|
||||||
const swgAElementsPoolItem = page.locator('#inspector-elements-tree').locator('.c-object-label', { hasText: swgA.name });
|
const swgAElementsPoolItem = page
|
||||||
const swgBElementsPoolItem = page.locator('#inspector-elements-tree').locator('.c-object-label', { hasText: swgB.name });
|
.locator('#inspector-elements-tree')
|
||||||
const swgCElementsPoolItem = page.locator('#inspector-elements-tree').locator('.c-object-label', { hasText: swgC.name });
|
.locator('.c-object-label', { hasText: swgA.name });
|
||||||
|
const swgBElementsPoolItem = page
|
||||||
|
.locator('#inspector-elements-tree')
|
||||||
|
.locator('.c-object-label', { hasText: swgB.name });
|
||||||
|
const swgCElementsPoolItem = page
|
||||||
|
.locator('#inspector-elements-tree')
|
||||||
|
.locator('.c-object-label', { hasText: swgC.name });
|
||||||
|
|
||||||
await page.goto(stackedPlot.url);
|
await page.goto(stackedPlot.url);
|
||||||
|
|
||||||
@@ -68,8 +78,11 @@ test.describe('Stacked Plot', () => {
|
|||||||
await selectInspectorTab(page, 'Elements');
|
await selectInspectorTab(page, 'Elements');
|
||||||
|
|
||||||
await swgBElementsPoolItem.click({ button: 'right' });
|
await swgBElementsPoolItem.click({ button: 'right' });
|
||||||
await page.getByRole('menuitem').filter({ hasText: /Remove/ }).click();
|
await page
|
||||||
await page.getByRole('button').filter({ hasText: "OK" }).click();
|
.getByRole('menuitem')
|
||||||
|
.filter({ hasText: /Remove/ })
|
||||||
|
.click();
|
||||||
|
await page.getByRole('button').filter({ hasText: 'OK' }).click();
|
||||||
|
|
||||||
await expect(page.locator('#inspector-elements-tree .js-elements-pool__item')).toHaveCount(2);
|
await expect(page.locator('#inspector-elements-tree .js-elements-pool__item')).toHaveCount(2);
|
||||||
|
|
||||||
@@ -80,9 +93,15 @@ test.describe('Stacked Plot', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('Can reorder Stacked Plot items', async ({ page }) => {
|
test('Can reorder Stacked Plot items', async ({ page }) => {
|
||||||
const swgAElementsPoolItem = page.locator('#inspector-elements-tree').locator('.c-object-label', { hasText: swgA.name });
|
const swgAElementsPoolItem = page
|
||||||
const swgBElementsPoolItem = page.locator('#inspector-elements-tree').locator('.c-object-label', { hasText: swgB.name });
|
.locator('#inspector-elements-tree')
|
||||||
const swgCElementsPoolItem = page.locator('#inspector-elements-tree').locator('.c-object-label', { hasText: swgC.name });
|
.locator('.c-object-label', { hasText: swgA.name });
|
||||||
|
const swgBElementsPoolItem = page
|
||||||
|
.locator('#inspector-elements-tree')
|
||||||
|
.locator('.c-object-label', { hasText: swgB.name });
|
||||||
|
const swgCElementsPoolItem = page
|
||||||
|
.locator('#inspector-elements-tree')
|
||||||
|
.locator('.c-object-label', { hasText: swgC.name });
|
||||||
|
|
||||||
await page.goto(stackedPlot.url);
|
await page.goto(stackedPlot.url);
|
||||||
|
|
||||||
@@ -128,7 +147,9 @@ test.describe('Stacked Plot', () => {
|
|||||||
await expect(stackedPlotItem3).toHaveAttribute('aria-label', `Stacked Plot Item ${swgA.name}`);
|
await expect(stackedPlotItem3).toHaveAttribute('aria-label', `Stacked Plot Item ${swgA.name}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Selecting a child plot while in browse and edit modes shows its properties in the inspector', async ({ page }) => {
|
test('Selecting a child plot while in browse and edit modes shows its properties in the inspector', async ({
|
||||||
|
page
|
||||||
|
}) => {
|
||||||
await page.goto(stackedPlot.url);
|
await page.goto(stackedPlot.url);
|
||||||
|
|
||||||
await selectInspectorTab(page, 'Config');
|
await selectInspectorTab(page, 'Config');
|
||||||
@@ -137,25 +158,37 @@ test.describe('Stacked Plot', () => {
|
|||||||
await page.locator(`[aria-label="Stacked Plot Item ${swgA.name}"] canvas`).nth(1).click();
|
await page.locator(`[aria-label="Stacked Plot Item ${swgA.name}"] canvas`).nth(1).click();
|
||||||
|
|
||||||
// Assert that the inspector shows the Y Axis properties for swgA
|
// 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.locator('[aria-label="Plot Series Properties"] >> h2')).toContainText(
|
||||||
await expect(page.getByRole('list', { name: "Y Axis Properties" }).locator("h2")).toContainText("Y Axis");
|
'Plot Series'
|
||||||
await expect(page.locator('[aria-label="Plot Series Properties"] .c-object-label')).toContainText(swgA.name);
|
);
|
||||||
|
await expect(page.getByRole('heading', { name: 'Y Axis' })).toBeVisible();
|
||||||
|
await expect(
|
||||||
|
page.locator('[aria-label="Plot Series Properties"] .c-object-label')
|
||||||
|
).toContainText(swgA.name);
|
||||||
|
|
||||||
// Click on the 2nd plot
|
// Click on the 2nd plot
|
||||||
await page.locator(`[aria-label="Stacked Plot Item ${swgB.name}"] canvas`).nth(1).click();
|
await page.locator(`[aria-label="Stacked Plot Item ${swgB.name}"] canvas`).nth(1).click();
|
||||||
|
|
||||||
// Assert that the inspector shows the Y Axis properties for swgB
|
// 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.locator('[aria-label="Plot Series Properties"] >> h2')).toContainText(
|
||||||
await expect(page.getByRole('list', { name: "Y Axis Properties" }).locator("h2")).toContainText("Y Axis");
|
'Plot Series'
|
||||||
await expect(page.locator('[aria-label="Plot Series Properties"] .c-object-label')).toContainText(swgB.name);
|
);
|
||||||
|
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 the 3rd plot
|
// Click on the 3rd plot
|
||||||
await page.locator(`[aria-label="Stacked Plot Item ${swgC.name}"] canvas`).nth(1).click();
|
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
|
// 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.locator('[aria-label="Plot Series Properties"] >> h2')).toContainText(
|
||||||
await expect(page.getByRole('list', { name: "Y Axis Properties" }).locator("h2")).toContainText("Y Axis");
|
'Plot Series'
|
||||||
await expect(page.locator('[aria-label="Plot Series Properties"] .c-object-label')).toContainText(swgC.name);
|
);
|
||||||
|
await expect(page.getByRole('heading', { name: 'Y Axis' })).toBeVisible();
|
||||||
|
await expect(
|
||||||
|
page.locator('[aria-label="Plot Series Properties"] .c-object-label')
|
||||||
|
).toContainText(swgC.name);
|
||||||
|
|
||||||
// Go into edit mode
|
// Go into edit mode
|
||||||
await page.click('button[title="Edit"]');
|
await page.click('button[title="Edit"]');
|
||||||
@@ -166,24 +199,77 @@ test.describe('Stacked Plot', () => {
|
|||||||
await page.locator(`[aria-label="Stacked Plot Item ${swgA.name}"]`).click();
|
await page.locator(`[aria-label="Stacked Plot Item ${swgA.name}"]`).click();
|
||||||
|
|
||||||
// Assert that the inspector shows the Y Axis properties for swgA
|
// 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.locator('[aria-label="Plot Series Properties"] >> h2')).toContainText(
|
||||||
await expect(page.getByRole('list', { name: "Y Axis Properties" }).locator("h2")).toContainText("Y Axis");
|
'Plot Series'
|
||||||
await expect(page.locator('[aria-label="Plot Series Properties"] .c-object-label')).toContainText(swgA.name);
|
);
|
||||||
|
await expect(page.getByRole('heading', { name: 'Y Axis' })).toBeVisible();
|
||||||
|
await expect(
|
||||||
|
page.locator('[aria-label="Plot Series Properties"] .c-object-label')
|
||||||
|
).toContainText(swgA.name);
|
||||||
|
|
||||||
//Click on canvas for the 2nd plot
|
//Click on canvas for the 2nd plot
|
||||||
await page.locator(`[aria-label="Stacked Plot Item ${swgB.name}"]`).click();
|
await page.locator(`[aria-label="Stacked Plot Item ${swgB.name}"]`).click();
|
||||||
|
|
||||||
// Assert that the inspector shows the Y Axis properties for swgB
|
// 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.locator('[aria-label="Plot Series Properties"] >> h2')).toContainText(
|
||||||
await expect(page.getByRole('list', { name: "Y Axis Properties" }).locator("h2")).toContainText("Y Axis");
|
'Plot Series'
|
||||||
await expect(page.locator('[aria-label="Plot Series Properties"] .c-object-label')).toContainText(swgB.name);
|
);
|
||||||
|
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
|
//Click on canvas for the 3rd plot
|
||||||
await page.locator(`[aria-label="Stacked Plot Item ${swgC.name}"]`).click();
|
await page.locator(`[aria-label="Stacked Plot Item ${swgC.name}"]`).click();
|
||||||
|
|
||||||
// Assert that the inspector shows the Y Axis properties for swgC
|
// 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.locator('[aria-label="Plot Series Properties"] >> h2')).toContainText(
|
||||||
await expect(page.getByRole('list', { name: "Y Axis Properties" }).locator("h2")).toContainText("Y Axis");
|
'Plot Series'
|
||||||
await expect(page.locator('[aria-label="Plot Series Properties"] .c-object-label')).toContainText(swgC.name);
|
);
|
||||||
|
await expect(page.getByRole('heading', { name: 'Y Axis' })).toBeVisible();
|
||||||
|
await expect(
|
||||||
|
page.locator('[aria-label="Plot Series Properties"] .c-object-label')
|
||||||
|
).toContainText(swgC.name);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('the legend toggles between aggregate and per child', async ({ page }) => {
|
||||||
|
await page.goto(stackedPlot.url);
|
||||||
|
|
||||||
|
// Go into edit mode
|
||||||
|
await page.click('button[title="Edit"]');
|
||||||
|
|
||||||
|
await selectInspectorTab(page, 'Config');
|
||||||
|
|
||||||
|
let legendProperties = await page.locator('[aria-label="Legend Properties"]');
|
||||||
|
await legendProperties.locator('[title="Display legends per sub plot."]~div input').uncheck();
|
||||||
|
|
||||||
|
await assertAggregateLegendIsVisible(page);
|
||||||
|
|
||||||
|
// Save (exit edit mode)
|
||||||
|
await page.locator('button[title="Save"]').click();
|
||||||
|
await page.locator('li[title="Save and Finish Editing"]').click();
|
||||||
|
|
||||||
|
await assertAggregateLegendIsVisible(page);
|
||||||
|
|
||||||
|
await page.reload();
|
||||||
|
|
||||||
|
await assertAggregateLegendIsVisible(page);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Asserts that aggregate stacked plot legend is visible
|
||||||
|
* @param {import('@playwright/test').Page} page
|
||||||
|
*/
|
||||||
|
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' });
|
||||||
|
// 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);
|
||||||
|
}
|
||||||
|
|||||||
@@ -25,7 +25,13 @@ Tests to verify plot tagging functionality.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const { test, expect } = require('../../../../pluginFixtures');
|
const { test, expect } = require('../../../../pluginFixtures');
|
||||||
const { createDomainObjectWithDefaults, setRealTimeMode, setFixedTimeMode } = require('../../../../appActions');
|
const {
|
||||||
|
createDomainObjectWithDefaults,
|
||||||
|
setRealTimeMode,
|
||||||
|
setFixedTimeMode,
|
||||||
|
waitForPlotsToRender,
|
||||||
|
selectInspectorTab
|
||||||
|
} = require('../../../../appActions');
|
||||||
|
|
||||||
test.describe('Plot Tagging', () => {
|
test.describe('Plot Tagging', () => {
|
||||||
/**
|
/**
|
||||||
@@ -36,7 +42,7 @@ test.describe('Plot Tagging', () => {
|
|||||||
* @param {Number} yEnd a telemetry item with a plot
|
* @param {Number} yEnd a telemetry item with a plot
|
||||||
* @returns {Promise}
|
* @returns {Promise}
|
||||||
*/
|
*/
|
||||||
async function createTags({page, canvas, xEnd, yEnd}) {
|
async function createTags({ page, canvas, xEnd = 700, yEnd = 480 }) {
|
||||||
await canvas.hover({ trial: true });
|
await canvas.hover({ trial: true });
|
||||||
|
|
||||||
//Alt+Shift Drag Start to select some points to tag
|
//Alt+Shift Drag Start to select some points to tag
|
||||||
@@ -58,7 +64,7 @@ test.describe('Plot Tagging', () => {
|
|||||||
await page.keyboard.up('Alt');
|
await page.keyboard.up('Alt');
|
||||||
await page.keyboard.up('Shift');
|
await page.keyboard.up('Shift');
|
||||||
|
|
||||||
//Wait for canvas to stablize.
|
//Wait for canvas to stabilize.
|
||||||
await canvas.hover({ trial: true });
|
await canvas.hover({ trial: true });
|
||||||
|
|
||||||
// add some tags
|
// add some tags
|
||||||
@@ -85,15 +91,17 @@ test.describe('Plot Tagging', () => {
|
|||||||
await expect(page.getByText('No tags to display for this item')).toBeVisible();
|
await expect(page.getByText('No tags to display for this item')).toBeVisible();
|
||||||
|
|
||||||
const canvas = page.locator('canvas').nth(1);
|
const canvas = page.locator('canvas').nth(1);
|
||||||
|
//Wait for canvas to stabilize.
|
||||||
|
await waitForPlotsToRender(page);
|
||||||
|
|
||||||
//Wait for canvas to stablize.
|
await expect(canvas).toBeInViewport();
|
||||||
await canvas.hover({ trial: true });
|
await canvas.hover({ trial: true });
|
||||||
|
|
||||||
// click on the tagged plot point
|
// click on the tagged plot point
|
||||||
await canvas.click({
|
await canvas.click({
|
||||||
position: {
|
position: {
|
||||||
x: 325,
|
x: 100,
|
||||||
y: 377
|
y: 100
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -115,7 +123,11 @@ test.describe('Plot Tagging', () => {
|
|||||||
|
|
||||||
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').fill('driv');
|
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').fill('driv');
|
||||||
// click on the search result
|
// click on the search result
|
||||||
await page.getByRole('searchbox', { name: 'OpenMCT Search' }).getByText(/Sine Wave/).first().click();
|
await page
|
||||||
|
.getByRole('searchbox', { name: 'OpenMCT Search' })
|
||||||
|
.getByText(/Sine Wave/)
|
||||||
|
.first()
|
||||||
|
.click();
|
||||||
|
|
||||||
// Delete Driving
|
// Delete Driving
|
||||||
await page.hover('[aria-label="Tag"]:has-text("Driving")');
|
await page.hover('[aria-label="Tag"]:has-text("Driving")');
|
||||||
@@ -124,8 +136,8 @@ test.describe('Plot Tagging', () => {
|
|||||||
// Search for Science
|
// Search for Science
|
||||||
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').click();
|
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').click();
|
||||||
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').fill('sc');
|
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').fill('sc');
|
||||||
await expect(page.locator('[aria-label="Search Result"]').nth(0)).toContainText("Science");
|
await expect(page.locator('[aria-label="Search Result"]').nth(0)).toContainText('Science');
|
||||||
await expect(page.locator('[aria-label="Search Result"]').nth(0)).not.toContainText("Drilling");
|
await expect(page.locator('[aria-label="Search Result"]').nth(0)).not.toContainText('Drilling');
|
||||||
|
|
||||||
// Search for Driving
|
// Search for Driving
|
||||||
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').click();
|
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').click();
|
||||||
@@ -133,14 +145,14 @@ test.describe('Plot Tagging', () => {
|
|||||||
await expect(page.getByText('No results found')).toBeVisible();
|
await expect(page.getByText('No results found')).toBeVisible();
|
||||||
|
|
||||||
//Reload Page
|
//Reload Page
|
||||||
await Promise.all([
|
await page.reload({ waitUntil: 'domcontentloaded' });
|
||||||
page.reload(),
|
|
||||||
page.waitForLoadState('networkidle')
|
|
||||||
]);
|
|
||||||
// wait for plots to load
|
// wait for plots to load
|
||||||
await expect(page.locator('.js-series-data-loaded')).toBeVisible();
|
await waitForPlotsToRender(page);
|
||||||
|
|
||||||
|
await expect(page.getByRole('tab', { name: 'Annotations' })).not.toHaveClass(/is-current/);
|
||||||
|
await selectInspectorTab(page, 'Annotations');
|
||||||
|
await expect(page.getByRole('tab', { name: 'Annotations' })).toHaveClass(/is-current/);
|
||||||
|
|
||||||
await page.getByText('Annotations').click();
|
|
||||||
await expect(page.getByText('No tags to display for this item')).toBeVisible();
|
await expect(page.getByText('No tags to display for this item')).toBeVisible();
|
||||||
|
|
||||||
const canvas = page.locator('canvas').nth(1);
|
const canvas = page.locator('canvas').nth(1);
|
||||||
@@ -157,27 +169,36 @@ test.describe('Plot Tagging', () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Tags work with Overlay Plots', async ({ page }) => {
|
test('Tags work with Overlay Plots', async ({ page }) => {
|
||||||
//Test.slow decorator is currently broken. Needs to be fixed in https://github.com/nasa/openmct/issues/5374
|
|
||||||
test.slow();
|
test.slow();
|
||||||
|
test.info().annotations.push({
|
||||||
|
type: 'issue',
|
||||||
|
description: 'https://github.com/nasa/openmct/issues/6822'
|
||||||
|
});
|
||||||
|
|
||||||
const overlayPlot = await createDomainObjectWithDefaults(page, {
|
const overlayPlot = await createDomainObjectWithDefaults(page, {
|
||||||
type: "Overlay Plot"
|
type: 'Overlay Plot'
|
||||||
});
|
});
|
||||||
|
|
||||||
const alphaSineWave = await createDomainObjectWithDefaults(page, {
|
const alphaSineWave = await createDomainObjectWithDefaults(page, {
|
||||||
type: "Sine Wave Generator",
|
type: 'Sine Wave Generator',
|
||||||
name: "Alpha Sine Wave",
|
name: 'Alpha Sine Wave',
|
||||||
parent: overlayPlot.uuid
|
parent: overlayPlot.uuid,
|
||||||
|
customParameters: {
|
||||||
|
'[aria-label="Data Rate (hz)"]': '0.01'
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
await createDomainObjectWithDefaults(page, {
|
await createDomainObjectWithDefaults(page, {
|
||||||
type: "Sine Wave Generator",
|
type: 'Sine Wave Generator',
|
||||||
name: "Beta Sine Wave",
|
name: 'Beta Sine Wave',
|
||||||
parent: overlayPlot.uuid
|
parent: overlayPlot.uuid,
|
||||||
|
customParameters: {
|
||||||
|
'[aria-label="Data Rate (hz)"]': '0.02'
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
await page.goto(overlayPlot.url);
|
await page.goto(overlayPlot.url);
|
||||||
@@ -190,16 +211,11 @@ test.describe('Plot Tagging', () => {
|
|||||||
|
|
||||||
await createTags({
|
await createTags({
|
||||||
page,
|
page,
|
||||||
canvas,
|
canvas
|
||||||
xEnd: 700,
|
|
||||||
yEnd: 480
|
|
||||||
});
|
});
|
||||||
|
|
||||||
await setFixedTimeMode(page);
|
await setFixedTimeMode(page);
|
||||||
|
|
||||||
// changing to fixed time mode rebuilds canvas?
|
|
||||||
canvas = page.locator('canvas').nth(1);
|
|
||||||
|
|
||||||
await basicTagsTests(page);
|
await basicTagsTests(page);
|
||||||
await testTelemetryItem(page, alphaSineWave);
|
await testTelemetryItem(page, alphaSineWave);
|
||||||
|
|
||||||
@@ -210,7 +226,11 @@ test.describe('Plot Tagging', () => {
|
|||||||
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').click();
|
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').click();
|
||||||
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').fill('sc');
|
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').fill('sc');
|
||||||
// click on the search result
|
// click on the search result
|
||||||
await page.getByRole('searchbox', { name: 'OpenMCT Search' }).getByText('Alpha Sine Wave').first().click();
|
await page
|
||||||
|
.getByRole('searchbox', { name: 'OpenMCT Search' })
|
||||||
|
.getByText('Alpha Sine Wave')
|
||||||
|
.first()
|
||||||
|
.click();
|
||||||
// wait for plots to load
|
// wait for plots to load
|
||||||
await expect(page.locator('.js-series-data-loaded')).toBeVisible();
|
await expect(page.locator('.js-series-data-loaded')).toBeVisible();
|
||||||
// expect plot to be paused
|
// expect plot to be paused
|
||||||
@@ -221,34 +241,40 @@ test.describe('Plot Tagging', () => {
|
|||||||
|
|
||||||
test('Tags work with Plot View of telemetry items', async ({ page }) => {
|
test('Tags work with Plot View of telemetry items', async ({ page }) => {
|
||||||
await createDomainObjectWithDefaults(page, {
|
await createDomainObjectWithDefaults(page, {
|
||||||
type: "Sine Wave Generator"
|
type: 'Sine Wave Generator',
|
||||||
|
customParameters: {
|
||||||
|
'[aria-label="Data Rate (hz)"]': '0.01'
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const canvas = page.locator('canvas').nth(1);
|
const canvas = page.locator('canvas').nth(1);
|
||||||
await createTags({
|
await createTags({
|
||||||
page,
|
page,
|
||||||
canvas,
|
canvas
|
||||||
xEnd: 700,
|
|
||||||
yEnd: 480
|
|
||||||
});
|
});
|
||||||
await basicTagsTests(page);
|
await basicTagsTests(page);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Tags work with Stacked Plots', async ({ page }) => {
|
test('Tags work with Stacked Plots', async ({ page }) => {
|
||||||
const stackedPlot = await createDomainObjectWithDefaults(page, {
|
const stackedPlot = await createDomainObjectWithDefaults(page, {
|
||||||
type: "Stacked Plot"
|
type: 'Stacked Plot'
|
||||||
});
|
});
|
||||||
|
|
||||||
const alphaSineWave = await createDomainObjectWithDefaults(page, {
|
const alphaSineWave = await createDomainObjectWithDefaults(page, {
|
||||||
type: "Sine Wave Generator",
|
type: 'Sine Wave Generator',
|
||||||
name: "Alpha Sine Wave",
|
name: 'Alpha Sine Wave',
|
||||||
parent: stackedPlot.uuid
|
parent: stackedPlot.uuid,
|
||||||
|
customParameters: {
|
||||||
|
'[aria-label="Data Rate (hz)"]': '0.01'
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
await createDomainObjectWithDefaults(page, {
|
await createDomainObjectWithDefaults(page, {
|
||||||
type: "Sine Wave Generator",
|
type: 'Sine Wave Generator',
|
||||||
name: "Beta Sine Wave",
|
name: 'Beta Sine Wave',
|
||||||
parent: stackedPlot.uuid
|
parent: stackedPlot.uuid,
|
||||||
|
customParameters: {
|
||||||
|
'[aria-label="Data Rate (hz)"]': '0.02'
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
await page.goto(stackedPlot.url);
|
await page.goto(stackedPlot.url);
|
||||||
|
|||||||
@@ -20,17 +20,22 @@
|
|||||||
* at runtime from the About dialog for additional information.
|
* at runtime from the About dialog for additional information.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
const { createDomainObjectWithDefaults } = require('../../../../appActions');
|
const {
|
||||||
|
createDomainObjectWithDefaults,
|
||||||
|
setTimeConductorBounds
|
||||||
|
} = require('../../../../appActions');
|
||||||
const { test, expect } = require('../../../../pluginFixtures');
|
const { test, expect } = require('../../../../pluginFixtures');
|
||||||
|
|
||||||
test.describe('Telemetry Table', () => {
|
test.describe('Telemetry Table', () => {
|
||||||
test('unpauses and filters data when paused by button and user changes bounds', async ({ page }) => {
|
test('unpauses and filters data when paused by button and user changes bounds', async ({
|
||||||
|
page
|
||||||
|
}) => {
|
||||||
test.info().annotations.push({
|
test.info().annotations.push({
|
||||||
type: 'issue',
|
type: 'issue',
|
||||||
description: 'https://github.com/nasa/openmct/issues/5113'
|
description: 'https://github.com/nasa/openmct/issues/5113'
|
||||||
});
|
});
|
||||||
|
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
const table = await createDomainObjectWithDefaults(page, { type: 'Telemetry Table' });
|
const table = await createDomainObjectWithDefaults(page, { type: 'Telemetry Table' });
|
||||||
await createDomainObjectWithDefaults(page, {
|
await createDomainObjectWithDefaults(page, {
|
||||||
@@ -49,23 +54,24 @@ test.describe('Telemetry Table', () => {
|
|||||||
await expect(tableWrapper).toHaveClass(/is-paused/);
|
await expect(tableWrapper).toHaveClass(/is-paused/);
|
||||||
|
|
||||||
// Subtract 5 minutes from the current end bound datetime and set it
|
// Subtract 5 minutes from the current end bound datetime and set it
|
||||||
const endTimeInput = page.locator('input[type="text"].c-input--datetime').nth(1);
|
// Bring up the time conductor popup
|
||||||
await endTimeInput.click();
|
let endDate = await page.locator('[aria-label="End bounds"]').textContent();
|
||||||
|
|
||||||
let endDate = await endTimeInput.inputValue();
|
|
||||||
endDate = new Date(endDate);
|
endDate = new Date(endDate);
|
||||||
|
|
||||||
endDate.setUTCMinutes(endDate.getUTCMinutes() - 5);
|
endDate.setUTCMinutes(endDate.getUTCMinutes() - 5);
|
||||||
endDate = endDate.toISOString().replace(/T/, ' ');
|
endDate = endDate.toISOString().replace(/T/, ' ');
|
||||||
|
|
||||||
await endTimeInput.fill('');
|
await setTimeConductorBounds(page, undefined, endDate);
|
||||||
await endTimeInput.fill(endDate);
|
|
||||||
await page.keyboard.press('Enter');
|
|
||||||
|
|
||||||
await expect(tableWrapper).not.toHaveClass(/is-paused/);
|
await expect(tableWrapper).not.toHaveClass(/is-paused/);
|
||||||
|
|
||||||
// Get the most recent telemetry date
|
// Get the most recent telemetry date
|
||||||
const latestTelemetryDate = await page.locator('table.c-telemetry-table__body > tbody > tr').last().locator('td').nth(1).getAttribute('title');
|
const latestTelemetryDate = await page
|
||||||
|
.locator('table.c-telemetry-table__body > tbody > tr')
|
||||||
|
.last()
|
||||||
|
.locator('td')
|
||||||
|
.nth(1)
|
||||||
|
.getAttribute('title');
|
||||||
|
|
||||||
// Verify that it is <= our new end bound
|
// Verify that it is <= our new end bound
|
||||||
const latestMilliseconds = Date.parse(latestTelemetryDate);
|
const latestMilliseconds = Date.parse(latestTelemetryDate);
|
||||||
|
|||||||
@@ -21,12 +21,18 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
const { test, expect } = require('../../../../pluginFixtures');
|
const { test, expect } = require('../../../../pluginFixtures');
|
||||||
const { setFixedTimeMode, setRealTimeMode, setStartOffset, setEndOffset } = require('../../../../appActions');
|
const {
|
||||||
|
setFixedTimeMode,
|
||||||
|
setRealTimeMode,
|
||||||
|
setStartOffset,
|
||||||
|
setEndOffset,
|
||||||
|
setTimeConductorBounds
|
||||||
|
} = require('../../../../appActions');
|
||||||
|
|
||||||
test.describe('Time conductor operations', () => {
|
test.describe('Time conductor operations', () => {
|
||||||
test('validate start time does not exceeds end time', async ({ page }) => {
|
test('validate start time does not exceeds end time', async ({ page }) => {
|
||||||
// Go to baseURL
|
// Go to baseURL
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
const year = new Date().getFullYear();
|
const year = new Date().getFullYear();
|
||||||
|
|
||||||
let startDate = 'xxxx-01-01 01:00:00.000Z';
|
let startDate = 'xxxx-01-01 01:00:00.000Z';
|
||||||
@@ -35,36 +41,38 @@ test.describe('Time conductor operations', () => {
|
|||||||
let endDate = 'xxxx-01-01 02:00:00.000Z';
|
let endDate = 'xxxx-01-01 02:00:00.000Z';
|
||||||
endDate = year + endDate.substring(4);
|
endDate = year + endDate.substring(4);
|
||||||
|
|
||||||
const startTimeLocator = page.locator('input[type="text"]').first();
|
await setTimeConductorBounds(page, startDate, endDate);
|
||||||
const endTimeLocator = page.locator('input[type="text"]').nth(1);
|
|
||||||
|
|
||||||
// Click start time
|
|
||||||
await startTimeLocator.click();
|
|
||||||
|
|
||||||
// Click end time
|
|
||||||
await endTimeLocator.click();
|
|
||||||
|
|
||||||
await endTimeLocator.fill(endDate.toString());
|
|
||||||
await startTimeLocator.fill(startDate.toString());
|
|
||||||
|
|
||||||
// invalid start date
|
// invalid start date
|
||||||
startDate = (year + 1) + startDate.substring(4);
|
startDate = year + 1 + startDate.substring(4);
|
||||||
await startTimeLocator.fill(startDate.toString());
|
await setTimeConductorBounds(page, startDate);
|
||||||
await endTimeLocator.click();
|
|
||||||
|
|
||||||
const startDateValidityStatus = await startTimeLocator.evaluate((element) => element.checkValidity());
|
// Bring up the time conductor popup
|
||||||
|
const timeConductorMode = await 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);
|
||||||
|
|
||||||
|
await endDateLocator.click();
|
||||||
|
|
||||||
|
const startDateValidityStatus = await startDateLocator.evaluate((element) =>
|
||||||
|
element.checkValidity()
|
||||||
|
);
|
||||||
expect(startDateValidityStatus).not.toBeTruthy();
|
expect(startDateValidityStatus).not.toBeTruthy();
|
||||||
|
|
||||||
// fix to valid start date
|
// fix to valid start date
|
||||||
startDate = (year - 1) + startDate.substring(4);
|
startDate = year - 1 + startDate.substring(4);
|
||||||
await startTimeLocator.fill(startDate.toString());
|
await setTimeConductorBounds(page, startDate);
|
||||||
|
|
||||||
// invalid end date
|
// invalid end date
|
||||||
endDate = (year - 2) + endDate.substring(4);
|
endDate = year - 2 + endDate.substring(4);
|
||||||
await endTimeLocator.fill(endDate.toString());
|
await setTimeConductorBounds(page, undefined, endDate);
|
||||||
await startTimeLocator.click();
|
|
||||||
|
|
||||||
const endDateValidityStatus = await endTimeLocator.evaluate((element) => element.checkValidity());
|
await startDateLocator.click();
|
||||||
|
|
||||||
|
const endDateValidityStatus = await endDateLocator.evaluate((element) =>
|
||||||
|
element.checkValidity()
|
||||||
|
);
|
||||||
expect(endDateValidityStatus).not.toBeTruthy();
|
expect(endDateValidityStatus).not.toBeTruthy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -74,15 +82,15 @@ test.describe('Time conductor operations', () => {
|
|||||||
test.describe('Time conductor input fields real-time mode', () => {
|
test.describe('Time conductor input fields real-time mode', () => {
|
||||||
test('validate input fields in real-time mode', async ({ page }) => {
|
test('validate input fields in real-time mode', async ({ page }) => {
|
||||||
const startOffset = {
|
const startOffset = {
|
||||||
secs: '23'
|
startSecs: '23'
|
||||||
};
|
};
|
||||||
|
|
||||||
const endOffset = {
|
const endOffset = {
|
||||||
secs: '31'
|
endSecs: '31'
|
||||||
};
|
};
|
||||||
|
|
||||||
// Go to baseURL
|
// Go to baseURL
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
// Switch to real-time mode
|
// Switch to real-time mode
|
||||||
await setRealTimeMode(page);
|
await setRealTimeMode(page);
|
||||||
@@ -91,35 +99,37 @@ test.describe('Time conductor input fields real-time mode', () => {
|
|||||||
await setStartOffset(page, startOffset);
|
await setStartOffset(page, startOffset);
|
||||||
|
|
||||||
// Verify time was updated on time offset button
|
// Verify time was updated on time offset button
|
||||||
await expect(page.locator('data-testid=conductor-start-offset-button')).toContainText('00:30:23');
|
await expect(page.locator('.c-compact-tc__setting-value.icon-minus')).toContainText('00:30:23');
|
||||||
|
|
||||||
// Set end time offset
|
// Set end time offset
|
||||||
await setEndOffset(page, endOffset);
|
await setEndOffset(page, endOffset);
|
||||||
|
|
||||||
// Verify time was updated on preceding time offset button
|
// Verify time was updated on preceding time offset button
|
||||||
await expect(page.locator('data-testid=conductor-end-offset-button')).toContainText('00:00:31');
|
await expect(page.locator('.c-compact-tc__setting-value.icon-plus')).toContainText('00:00:31');
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Verify that offsets and url params are preserved when switching
|
* Verify that offsets and url params are preserved when switching
|
||||||
* between fixed timespan and real-time mode.
|
* between fixed timespan and real-time mode.
|
||||||
*/
|
*/
|
||||||
test('preserve offsets and url params when switching between fixed and real-time mode', async ({ page }) => {
|
test('preserve offsets and url params when switching between fixed and real-time mode', async ({
|
||||||
|
page
|
||||||
|
}) => {
|
||||||
const startOffset = {
|
const startOffset = {
|
||||||
mins: '30',
|
startMins: '30',
|
||||||
secs: '23'
|
startSecs: '23'
|
||||||
};
|
};
|
||||||
|
|
||||||
const endOffset = {
|
const endOffset = {
|
||||||
secs: '01'
|
endSecs: '01'
|
||||||
};
|
};
|
||||||
|
|
||||||
// Convert offsets to milliseconds
|
// Convert offsets to milliseconds
|
||||||
const startDelta = (30 * 60 * 1000) + (23 * 1000);
|
const startDelta = 30 * 60 * 1000 + 23 * 1000;
|
||||||
const endDelta = (1 * 1000);
|
const endDelta = 1 * 1000;
|
||||||
|
|
||||||
// Go to baseURL
|
// Go to baseURL
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
// Switch to real-time mode
|
// Switch to real-time mode
|
||||||
await setRealTimeMode(page);
|
await setRealTimeMode(page);
|
||||||
@@ -137,10 +147,10 @@ test.describe('Time conductor input fields real-time mode', () => {
|
|||||||
await setRealTimeMode(page);
|
await setRealTimeMode(page);
|
||||||
|
|
||||||
// Verify updated start time offset persists after mode switch
|
// Verify updated start time offset persists after mode switch
|
||||||
await expect(page.locator('data-testid=conductor-start-offset-button')).toContainText('00:30:23');
|
await expect(page.locator('.c-compact-tc__setting-value.icon-minus')).toContainText('00:30:23');
|
||||||
|
|
||||||
// Verify updated end time offset persists after mode switch
|
// Verify updated end time offset persists after mode switch
|
||||||
await expect(page.locator('data-testid=conductor-end-offset-button')).toContainText('00:00:01');
|
await expect(page.locator('.c-compact-tc__setting-value.icon-plus')).toContainText('00:00:01');
|
||||||
|
|
||||||
// Verify url parameters persist after mode switch
|
// Verify url parameters persist after mode switch
|
||||||
await page.waitForNavigation({ waitUntil: 'networkidle' });
|
await page.waitForNavigation({ waitUntil: 'networkidle' });
|
||||||
@@ -148,20 +158,29 @@ test.describe('Time conductor input fields real-time mode', () => {
|
|||||||
expect(page.url()).toContain(`endDelta=${endDelta}`);
|
expect(page.url()).toContain(`endDelta=${endDelta}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.fixme('time conductor history in fixed time mode will track changing start and end times', async ({ page }) => {
|
test.fixme(
|
||||||
|
'time conductor history in fixed time mode will track changing start and end times',
|
||||||
|
async ({ page }) => {
|
||||||
// change start time, verify it's tracked in history
|
// change start time, verify it's tracked in history
|
||||||
// change end time, verify it's tracked in history
|
// change end time, verify it's tracked in history
|
||||||
});
|
}
|
||||||
|
);
|
||||||
|
|
||||||
test.fixme('time conductor history in realtime mode will track changing start and end times', async ({ page }) => {
|
test.fixme(
|
||||||
|
'time conductor history in realtime mode will track changing start and end times',
|
||||||
|
async ({ page }) => {
|
||||||
// change start offset, verify it's tracked in history
|
// change start offset, verify it's tracked in history
|
||||||
// change end offset, verify it's tracked in history
|
// change end offset, verify it's tracked in history
|
||||||
});
|
}
|
||||||
|
);
|
||||||
|
|
||||||
test.fixme('time conductor history allows you to set a historical timeframe', async ({ page }) => {
|
test.fixme(
|
||||||
|
'time conductor history allows you to set a historical timeframe',
|
||||||
|
async ({ page }) => {
|
||||||
// make sure there are historical history options
|
// make sure there are historical history options
|
||||||
// select an option and make sure the time conductor start and end bounds are updated correctly
|
// select an option and make sure the time conductor start and end bounds are updated correctly
|
||||||
});
|
}
|
||||||
|
);
|
||||||
|
|
||||||
test.fixme('time conductor history allows you to set a realtime offsets', async ({ page }) => {
|
test.fixme('time conductor history allows you to set a realtime offsets', async ({ page }) => {
|
||||||
// make sure there are realtime history options
|
// make sure there are realtime history options
|
||||||
@@ -170,7 +189,7 @@ test.describe('Time conductor input fields real-time mode', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test.describe('Time Conductor History', () => {
|
test.describe('Time Conductor History', () => {
|
||||||
test("shows milliseconds on hover @unstable", async ({ page }) => {
|
test('shows milliseconds on hover @unstable', async ({ page }) => {
|
||||||
test.info().annotations.push({
|
test.info().annotations.push({
|
||||||
type: 'issue',
|
type: 'issue',
|
||||||
description: 'https://github.com/nasa/openmct/issues/4386'
|
description: 'https://github.com/nasa/openmct/issues/4386'
|
||||||
@@ -178,13 +197,19 @@ test.describe('Time Conductor History', () => {
|
|||||||
// Navigate to Open MCT in Fixed Time Mode, UTC Time System
|
// Navigate to Open MCT in Fixed Time Mode, UTC Time System
|
||||||
// with startBound at 2022-01-01 00:00:00.000Z
|
// with startBound at 2022-01-01 00:00:00.000Z
|
||||||
// and endBound at 2022-01-01 00:00:00.200Z
|
// 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', { waitUntil: 'networkidle' });
|
await page.goto(
|
||||||
await page.locator("[aria-label='Time Conductor History']").hover({ trial: true});
|
'./#/browse/mine?view=grid&tc.mode=fixed&tc.startBound=1640995200000&tc.endBound=1640995200200&tc.timeSystem=utc&hideInspector=true'
|
||||||
await page.locator("[aria-label='Time Conductor History']").click();
|
);
|
||||||
|
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
|
// Validate history item format
|
||||||
const historyItem = page.locator('text="2022-01-01 00:00:00 + 200ms"');
|
const historyItem = page.locator('text="2022-01-01 00:00:00 + 200ms"');
|
||||||
await expect(historyItem).toBeEnabled();
|
await expect(historyItem).toBeEnabled();
|
||||||
await expect(historyItem).toHaveAttribute('title', '2022-01-01 00:00:00.000 - 2022-01-01 00:00:00.200');
|
await expect(historyItem).toHaveAttribute(
|
||||||
|
'title',
|
||||||
|
'2022-01-01 00:00:00.000 - 2022-01-01 00:00:00.200'
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -21,12 +21,15 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
const { test, expect } = require('../../../../pluginFixtures');
|
const { test, expect } = require('../../../../pluginFixtures');
|
||||||
const { openObjectTreeContextMenu, createDomainObjectWithDefaults } = require('../../../../appActions');
|
const {
|
||||||
|
openObjectTreeContextMenu,
|
||||||
|
createDomainObjectWithDefaults
|
||||||
|
} = require('../../../../appActions');
|
||||||
|
|
||||||
test.describe('Timer', () => {
|
test.describe('Timer', () => {
|
||||||
let timer;
|
let timer;
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
timer = await createDomainObjectWithDefaults(page, { type: 'timer' });
|
timer = await createDomainObjectWithDefaults(page, { type: 'timer' });
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -38,21 +41,21 @@ test.describe('Timer', () => {
|
|||||||
|
|
||||||
const timerUrl = timer.url;
|
const timerUrl = timer.url;
|
||||||
|
|
||||||
await test.step("From the tree context menu", async () => {
|
await test.step('From the tree context menu', async () => {
|
||||||
await triggerTimerContextMenuAction(page, timerUrl, 'Start');
|
await triggerTimerContextMenuAction(page, timerUrl, 'Start');
|
||||||
await triggerTimerContextMenuAction(page, timerUrl, 'Pause');
|
await triggerTimerContextMenuAction(page, timerUrl, 'Pause');
|
||||||
await triggerTimerContextMenuAction(page, timerUrl, 'Restart at 0');
|
await triggerTimerContextMenuAction(page, timerUrl, 'Restart at 0');
|
||||||
await triggerTimerContextMenuAction(page, timerUrl, 'Stop');
|
await triggerTimerContextMenuAction(page, timerUrl, 'Stop');
|
||||||
});
|
});
|
||||||
|
|
||||||
await test.step("From the 3dot menu", async () => {
|
await test.step('From the 3dot menu', async () => {
|
||||||
await triggerTimer3dotMenuAction(page, 'Start');
|
await triggerTimer3dotMenuAction(page, 'Start');
|
||||||
await triggerTimer3dotMenuAction(page, 'Pause');
|
await triggerTimer3dotMenuAction(page, 'Pause');
|
||||||
await triggerTimer3dotMenuAction(page, 'Restart at 0');
|
await triggerTimer3dotMenuAction(page, 'Restart at 0');
|
||||||
await triggerTimer3dotMenuAction(page, 'Stop');
|
await triggerTimer3dotMenuAction(page, 'Stop');
|
||||||
});
|
});
|
||||||
|
|
||||||
await test.step("From the object view", async () => {
|
await test.step('From the object view', async () => {
|
||||||
await triggerTimerViewAction(page, 'Start');
|
await triggerTimerViewAction(page, 'Start');
|
||||||
await triggerTimerViewAction(page, 'Pause');
|
await triggerTimerViewAction(page, 'Pause');
|
||||||
await triggerTimerViewAction(page, 'Restart at 0');
|
await triggerTimerViewAction(page, 'Restart at 0');
|
||||||
@@ -142,7 +145,7 @@ async function assertTimerStateAfterAction(page, action) {
|
|||||||
switch (action) {
|
switch (action) {
|
||||||
case 'Start':
|
case 'Start':
|
||||||
case 'Restart at 0':
|
case 'Restart at 0':
|
||||||
timerStateClass = "is-started";
|
timerStateClass = 'is-started';
|
||||||
break;
|
break;
|
||||||
case 'Stop':
|
case 'Stop':
|
||||||
timerStateClass = 'is-stopped';
|
timerStateClass = 'is-stopped';
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ test.describe('Recent Objects', () => {
|
|||||||
/** @type {import('@playwright/test').Locator} */
|
/** @type {import('@playwright/test').Locator} */
|
||||||
let folderA;
|
let folderA;
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
await page.goto('./', { waitUntil: 'networkidle' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
// Set Recent Objects List locator for subsequent tests
|
// Set Recent Objects List locator for subsequent tests
|
||||||
recentObjectsList = page.getByRole('list', {
|
recentObjectsList = page.getByRole('list', {
|
||||||
@@ -49,16 +49,26 @@ test.describe('Recent Objects', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Drag the Recent Objects panel up a bit
|
// Drag the Recent Objects panel up a bit
|
||||||
await page.locator('.l-pane.l-pane--vertical-handle-before', {
|
await page
|
||||||
|
.locator('.l-pane.l-pane--vertical-handle-before', {
|
||||||
hasText: 'Recently Viewed'
|
hasText: 'Recently Viewed'
|
||||||
}).locator('.l-pane__handle').hover();
|
})
|
||||||
|
.locator('.l-pane__handle')
|
||||||
|
.hover();
|
||||||
await page.mouse.down();
|
await page.mouse.down();
|
||||||
await page.mouse.move(0, 100);
|
await page.mouse.move(0, 100);
|
||||||
await page.mouse.up();
|
await page.mouse.up();
|
||||||
});
|
});
|
||||||
test('Navigated objects show up in recents, object renames and deletions are reflected', async ({ page }) => {
|
test('Navigated objects show up in recents, object renames and deletions are reflected', async ({
|
||||||
|
page
|
||||||
|
}) => {
|
||||||
|
test.info().annotations.push({
|
||||||
|
type: 'issue',
|
||||||
|
description: 'https://github.com/nasa/openmct/issues/6818'
|
||||||
|
});
|
||||||
|
|
||||||
// Verify that both created objects appear in the list and are in the correct order
|
// Verify that both created objects appear in the list and are in the correct order
|
||||||
assertInitialRecentObjectsListState();
|
await assertInitialRecentObjectsListState();
|
||||||
|
|
||||||
// Navigate to the folder by clicking on the main object name in the recent objects list item
|
// Navigate to the folder by clicking on the main object name in the recent objects list item
|
||||||
await page.getByRole('listitem', { name: folderA.name }).getByText(folderA.name).click();
|
await page.getByRole('listitem', { name: folderA.name }).getByText(folderA.name).click();
|
||||||
@@ -67,22 +77,30 @@ test.describe('Recent Objects', () => {
|
|||||||
|
|
||||||
// Rename
|
// Rename
|
||||||
folderA.name = `${folderA.name}-NEW!`;
|
folderA.name = `${folderA.name}-NEW!`;
|
||||||
await page.locator('.l-browse-bar__object-name').fill("");
|
await page.locator('.l-browse-bar__object-name').fill('');
|
||||||
await page.locator('.l-browse-bar__object-name').fill(folderA.name);
|
await page.locator('.l-browse-bar__object-name').fill(folderA.name);
|
||||||
await page.keyboard.press('Enter');
|
await page.keyboard.press('Enter');
|
||||||
|
|
||||||
// Verify rename has been applied in recent objects list item and objects paths
|
// Verify rename has been applied in recent objects list item and objects paths
|
||||||
expect(await page.getByRole('navigation', {
|
expect(
|
||||||
|
await page
|
||||||
|
.getByRole('navigation', {
|
||||||
name: clock.name
|
name: clock.name
|
||||||
}).locator('a').filter({
|
})
|
||||||
|
.locator('a')
|
||||||
|
.filter({
|
||||||
hasText: folderA.name
|
hasText: folderA.name
|
||||||
}).count()).toBeGreaterThan(0);
|
})
|
||||||
|
.count()
|
||||||
|
).toBeGreaterThan(0);
|
||||||
expect(recentObjectsList.getByRole('listitem', { name: folderA.name })).toBeTruthy();
|
expect(recentObjectsList.getByRole('listitem', { name: folderA.name })).toBeTruthy();
|
||||||
|
|
||||||
// Delete
|
|
||||||
await page.click('button[title="Show selected item in tree"]');
|
await page.click('button[title="Show selected item in tree"]');
|
||||||
// Delete the folder via the left tree pane treeitem context menu
|
// Delete the folder via the left tree pane treeitem context menu
|
||||||
await page.getByRole('treeitem', { name: new RegExp(folderA.name) }).locator('a').click({
|
await page
|
||||||
|
.getByRole('treeitem', { name: new RegExp(folderA.name) })
|
||||||
|
.locator('a')
|
||||||
|
.click({
|
||||||
button: 'right'
|
button: 'right'
|
||||||
});
|
});
|
||||||
await page.getByRole('menuitem', { name: /Remove/ }).click();
|
await page.getByRole('menuitem', { name: /Remove/ }).click();
|
||||||
@@ -92,7 +110,11 @@ test.describe('Recent Objects', () => {
|
|||||||
await expect(recentObjectsList.getByRole('listitem', { name: folderA.name })).toBeHidden();
|
await expect(recentObjectsList.getByRole('listitem', { name: folderA.name })).toBeHidden();
|
||||||
await expect(recentObjectsList.getByRole('listitem', { name: clock.name })).toBeHidden();
|
await expect(recentObjectsList.getByRole('listitem', { name: clock.name })).toBeHidden();
|
||||||
});
|
});
|
||||||
test("Clicking on an object in the path of a recent object navigates to the object", async ({ page, openmctConfig }) => {
|
|
||||||
|
test('Clicking on an object in the path of a recent object navigates to the object', async ({
|
||||||
|
page,
|
||||||
|
openmctConfig
|
||||||
|
}) => {
|
||||||
const { myItemsFolderName } = openmctConfig;
|
const { myItemsFolderName } = openmctConfig;
|
||||||
test.info().annotations.push({
|
test.info().annotations.push({
|
||||||
type: 'issue',
|
type: 'issue',
|
||||||
@@ -102,11 +124,15 @@ test.describe('Recent Objects', () => {
|
|||||||
|
|
||||||
// Navigate to the folder by clicking on its entry in the Clock's breadcrumb
|
// Navigate to the folder by clicking on its entry in the Clock's breadcrumb
|
||||||
const waitForFolderNavigation = page.waitForURL(`**/${folderA.uuid}?*`);
|
const waitForFolderNavigation = page.waitForURL(`**/${folderA.uuid}?*`);
|
||||||
await page.getByRole('navigation', {
|
await page
|
||||||
|
.getByRole('navigation', {
|
||||||
name: clock.name
|
name: clock.name
|
||||||
}).locator('a').filter({
|
})
|
||||||
|
.locator('a')
|
||||||
|
.filter({
|
||||||
hasText: folderA.name
|
hasText: folderA.name
|
||||||
}).click();
|
})
|
||||||
|
.click();
|
||||||
|
|
||||||
// Verify that the hash URL updates correctly
|
// Verify that the hash URL updates correctly
|
||||||
await waitForFolderNavigation;
|
await waitForFolderNavigation;
|
||||||
@@ -114,20 +140,27 @@ test.describe('Recent Objects', () => {
|
|||||||
|
|
||||||
// Navigate to My Items by clicking on its entry in the Clock's breadcrumb
|
// Navigate to My Items by clicking on its entry in the Clock's breadcrumb
|
||||||
const waitForMyItemsNavigation = page.waitForURL(`**/mine?*`);
|
const waitForMyItemsNavigation = page.waitForURL(`**/mine?*`);
|
||||||
await page.getByRole('navigation', {
|
await page
|
||||||
|
.getByRole('navigation', {
|
||||||
name: clock.name
|
name: clock.name
|
||||||
}).locator('a').filter({
|
})
|
||||||
|
.locator('a')
|
||||||
|
.filter({
|
||||||
hasText: myItemsFolderName
|
hasText: myItemsFolderName
|
||||||
}).click();
|
})
|
||||||
|
.click();
|
||||||
|
|
||||||
// Verify that the hash URL updates correctly
|
// Verify that the hash URL updates correctly
|
||||||
await waitForMyItemsNavigation;
|
await waitForMyItemsNavigation;
|
||||||
expect(page.url()).toMatch(new RegExp(`.*mine?.*`));
|
expect(page.url()).toMatch(new RegExp(`.*mine?.*`));
|
||||||
});
|
});
|
||||||
test("Clicking on the 'target button' scrolls the object into view in the tree and highlights it", async ({ page }) => {
|
test("Clicking on the 'target button' scrolls the object into view in the tree and highlights it", async ({
|
||||||
const clockTreeItem = page.getByRole('tree', { name: 'Main Tree'}).getByRole('treeitem', { name: clock.name });
|
page
|
||||||
const folderTreeItem = page.getByRole('tree', { name: 'Main Tree'})
|
}) => {
|
||||||
.getByRole('treeitem', {
|
const clockTreeItem = page
|
||||||
|
.getByRole('tree', { name: 'Main Tree' })
|
||||||
|
.getByRole('treeitem', { name: clock.name });
|
||||||
|
const folderTreeItem = page.getByRole('tree', { name: 'Main Tree' }).getByRole('treeitem', {
|
||||||
name: folderA.name,
|
name: folderA.name,
|
||||||
expanded: true
|
expanded: true
|
||||||
});
|
});
|
||||||
@@ -148,12 +181,12 @@ test.describe('Recent Objects', () => {
|
|||||||
// Assert that the Clock treeitem is no longer highlighted
|
// Assert that the Clock treeitem is no longer highlighted
|
||||||
await expect(clockTreeItem.locator('.c-tree__item')).not.toHaveClass(/is-targeted-item/);
|
await expect(clockTreeItem.locator('.c-tree__item')).not.toHaveClass(/is-targeted-item/);
|
||||||
});
|
});
|
||||||
test("Persists on refresh", async ({ page }) => {
|
test('Persists on refresh', async ({ page }) => {
|
||||||
assertInitialRecentObjectsListState();
|
await assertInitialRecentObjectsListState();
|
||||||
await page.reload();
|
await page.reload();
|
||||||
assertInitialRecentObjectsListState();
|
await assertInitialRecentObjectsListState();
|
||||||
});
|
});
|
||||||
test("Displays objects and aliases uniquely", async ({ page }) => {
|
test('Displays objects and aliases uniquely', async ({ page }) => {
|
||||||
const mainTree = page.getByRole('tree', { name: 'Main Tree' });
|
const mainTree = page.getByRole('tree', { name: 'Main Tree' });
|
||||||
|
|
||||||
// Navigate to the clock and reveal it in the tree
|
// Navigate to the clock and reveal it in the tree
|
||||||
@@ -161,37 +194,52 @@ test.describe('Recent Objects', () => {
|
|||||||
await page.getByTitle('Show selected item in tree').click();
|
await page.getByTitle('Show selected item in tree').click();
|
||||||
|
|
||||||
// Right click the clock and create an alias using the "link" context menu action
|
// Right click the clock and create an alias using the "link" context menu action
|
||||||
const clockTreeItem = page.getByRole('tree', {
|
const clockTreeItem = page
|
||||||
|
.getByRole('tree', {
|
||||||
name: 'Main Tree'
|
name: 'Main Tree'
|
||||||
}).getByRole('treeitem', {
|
})
|
||||||
|
.getByRole('treeitem', {
|
||||||
name: clock.name
|
name: clock.name
|
||||||
});
|
});
|
||||||
await clockTreeItem.click({
|
await clockTreeItem.click({
|
||||||
button: 'right'
|
button: 'right'
|
||||||
});
|
});
|
||||||
await page.getByRole('menuitem', {
|
await page
|
||||||
|
.getByRole('menuitem', {
|
||||||
name: /Create Link/
|
name: /Create Link/
|
||||||
}).click();
|
})
|
||||||
await page.getByRole('tree', { name: 'Create Modal Tree'}).getByRole('treeitem').first().click();
|
.click();
|
||||||
|
await page
|
||||||
|
.getByRole('tree', { name: 'Create Modal Tree' })
|
||||||
|
.getByRole('treeitem')
|
||||||
|
.first()
|
||||||
|
.click();
|
||||||
await page.getByRole('button', { name: 'Save' }).click();
|
await page.getByRole('button', { name: 'Save' }).click();
|
||||||
|
|
||||||
// Click the newly created object alias in the tree
|
// Click the newly created object alias in the tree
|
||||||
await mainTree.getByRole('treeitem', {
|
await mainTree
|
||||||
|
.getByRole('treeitem', {
|
||||||
name: new RegExp(clock.name)
|
name: new RegExp(clock.name)
|
||||||
}).filter({
|
})
|
||||||
|
.filter({
|
||||||
has: page.locator('.is-alias')
|
has: page.locator('.is-alias')
|
||||||
}).click();
|
})
|
||||||
|
.click();
|
||||||
|
|
||||||
// Assert that two recent objects are displayed and one of them is an alias
|
// 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.getByRole('listitem', { name: clock.name }).count()).toBe(2);
|
||||||
expect(await recentObjectsList.locator('.is-alias').count()).toBe(1);
|
expect(await recentObjectsList.locator('.is-alias').count()).toBe(1);
|
||||||
|
|
||||||
// Assert that the alias and the original's breadcrumbs are different
|
// Assert that the alias and the original's breadcrumbs are different
|
||||||
const clockBreadcrumbs = recentObjectsList.getByRole('listitem', {name: clock.name}).getByRole('navigation');
|
const clockBreadcrumbs = recentObjectsList
|
||||||
|
.getByRole('listitem', { name: clock.name })
|
||||||
|
.getByRole('navigation');
|
||||||
expect(await clockBreadcrumbs.count()).toBe(2);
|
expect(await clockBreadcrumbs.count()).toBe(2);
|
||||||
expect(await clockBreadcrumbs.nth(0).innerText()).not.toEqual(await clockBreadcrumbs.nth(1).innerText());
|
expect(await clockBreadcrumbs.nth(0).innerText()).not.toEqual(
|
||||||
|
await clockBreadcrumbs.nth(1).innerText()
|
||||||
|
);
|
||||||
});
|
});
|
||||||
test("Enforces a limit of 20 recent objects and clears the recent objects", async ({ page }) => {
|
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
|
// Creating 21 objects takes a while, so increase the timeout
|
||||||
test.slow();
|
test.slow();
|
||||||
|
|
||||||
@@ -203,11 +251,11 @@ test.describe('Recent Objects', () => {
|
|||||||
// Create 19 more objects (3 in beforeEach() + 18 new = 21 total)
|
// Create 19 more objects (3 in beforeEach() + 18 new = 21 total)
|
||||||
for (let i = 0; i < 9; i++) {
|
for (let i = 0; i < 9; i++) {
|
||||||
lastFolder = await createDomainObjectWithDefaults(page, {
|
lastFolder = await createDomainObjectWithDefaults(page, {
|
||||||
type: "Folder",
|
type: 'Folder',
|
||||||
parent: lastFolder?.uuid
|
parent: lastFolder?.uuid
|
||||||
});
|
});
|
||||||
lastClock = await createDomainObjectWithDefaults(page, {
|
lastClock = await createDomainObjectWithDefaults(page, {
|
||||||
type: "Clock",
|
type: 'Clock',
|
||||||
parent: lastFolder?.uuid
|
parent: lastFolder?.uuid
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -216,14 +264,12 @@ test.describe('Recent Objects', () => {
|
|||||||
expect(await recentObjectsList.locator('.c-recentobjects-listitem').count()).toBe(20);
|
expect(await recentObjectsList.locator('.c-recentobjects-listitem').count()).toBe(20);
|
||||||
|
|
||||||
// Collapse the tree
|
// Collapse the tree
|
||||||
await page.getByTitle("Collapse all tree items").click();
|
await page.getByTitle('Collapse all tree items').click();
|
||||||
const lastFolderTreeItem = page.getByRole('tree', { name: 'Main Tree'})
|
const lastFolderTreeItem = page.getByRole('tree', { name: 'Main Tree' }).getByRole('treeitem', {
|
||||||
.getByRole('treeitem', {
|
|
||||||
name: lastFolder.name,
|
name: lastFolder.name,
|
||||||
expanded: true
|
expanded: true
|
||||||
});
|
});
|
||||||
const lastClockTreeItem = page.getByRole('tree', { name: 'Main Tree'})
|
const lastClockTreeItem = page.getByRole('tree', { name: 'Main Tree' }).getByRole('treeitem', {
|
||||||
.getByRole('treeitem', {
|
|
||||||
name: lastClock.name
|
name: lastClock.name
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -252,13 +298,59 @@ test.describe('Recent Objects', () => {
|
|||||||
// Assert that the list is empty
|
// Assert that the list is empty
|
||||||
expect(await recentObjectsList.locator('.c-recentobjects-listitem').count()).toBe(0);
|
expect(await recentObjectsList.locator('.c-recentobjects-listitem').count()).toBe(0);
|
||||||
});
|
});
|
||||||
|
test('Ensure clear recent objects button is active or inactive', async ({ page }) => {
|
||||||
|
// Assert that the list initially contains 3 objects (clock, folder, my items)
|
||||||
|
expect(await recentObjectsList.locator('.c-recentobjects-listitem').count()).toBe(3);
|
||||||
|
|
||||||
|
// Assert that the button is enabled
|
||||||
|
expect(await page.getByRole('button', { name: 'Clear Recently Viewed' }).isEnabled()).toBe(
|
||||||
|
true
|
||||||
|
);
|
||||||
|
|
||||||
|
// 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' }).click();
|
||||||
|
|
||||||
|
// Assert that the list is empty
|
||||||
|
expect(await recentObjectsList.locator('.c-recentobjects-listitem').count()).toBe(0);
|
||||||
|
|
||||||
|
// Assert that the button is disabled
|
||||||
|
expect(await page.getByRole('button', { name: 'Clear Recently Viewed' }).isEnabled()).toBe(
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
|
// 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);
|
||||||
|
|
||||||
|
// Assert that the button is enabled
|
||||||
|
expect(await page.getByRole('button', { name: 'Clear Recently Viewed' }).isEnabled()).toBe(
|
||||||
|
true
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
function assertInitialRecentObjectsListState() {
|
function assertInitialRecentObjectsListState() {
|
||||||
expect(recentObjectsList.getByRole('listitem', { name: clock.name })).toBeTruthy();
|
return Promise.all([
|
||||||
expect(recentObjectsList.getByRole('listitem', { name: folderA.name })).toBeTruthy();
|
expect(recentObjectsList.getByRole('listitem', { name: clock.name })).toBeVisible(),
|
||||||
expect(recentObjectsList.getByRole('listitem', { name: clock.name }).locator('a').getByText(folderA.name)).toBeTruthy();
|
expect(recentObjectsList.getByRole('listitem', { name: folderA.name })).toBeVisible(),
|
||||||
expect(recentObjectsList.getByRole('listitem').nth(0).getByText(clock.name)).toBeTruthy();
|
expect(
|
||||||
expect(recentObjectsList.getByRole('listitem', { name: clock.name }).locator('a').getByText(folderA.name)).toBeTruthy();
|
recentObjectsList
|
||||||
expect(recentObjectsList.getByRole('listitem').nth(1).getByText(folderA.name)).toBeTruthy();
|
.getByRole('listitem', { name: clock.name })
|
||||||
|
.locator('a')
|
||||||
|
.getByText(folderA.name)
|
||||||
|
).toBeVisible(),
|
||||||
|
expect(recentObjectsList.getByRole('listitem').nth(0).getByText(clock.name)).toBeVisible(),
|
||||||
|
expect(
|
||||||
|
recentObjectsList
|
||||||
|
.getByRole('listitem', { name: clock.name })
|
||||||
|
.locator('a')
|
||||||
|
.getByText(folderA.name)
|
||||||
|
).toBeVisible(),
|
||||||
|
expect(recentObjectsList.getByRole('listitem').nth(3).getByText(folderA.name)).toBeVisible()
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||