testaro 53.2.0 → 54.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +69 -51
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,11 +18,11 @@ The need for multi-tool integration, and its costs, are discussed in [Accessibil
|
|
|
18
18
|
|
|
19
19
|
Testaro launches and controls web browsers, performing operations, conducting tests, and recording results.
|
|
20
20
|
|
|
21
|
-
Testaro
|
|
21
|
+
Testaro was designed to be a workstation-based agent, because many of the tests performed by Testaro simulate the use of a web browser on a workstation. However, Testaro can be installed under a MacOS, Windows, Debian, or Ubuntu operating system. Results of installing it on servers have not yet been reported.
|
|
22
22
|
|
|
23
23
|
Testaro accepts _jobs_, performs them, and returns _reports_.
|
|
24
24
|
|
|
25
|
-
Other software, located on
|
|
25
|
+
Other software, located on the same or a different host, can make use of Testaro, performing functions such as:
|
|
26
26
|
- Job preparation
|
|
27
27
|
- Converting user specifications into jobs
|
|
28
28
|
- Job scheduling
|
|
@@ -95,13 +95,39 @@ Version 16 or later of [Node.js](https://nodejs.org/en/).
|
|
|
95
95
|
|
|
96
96
|
## Installation
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
### As an application
|
|
99
99
|
|
|
100
|
-
|
|
100
|
+
You can clone the [Testaro repository](https://github.com/cvs-health/testaro) to install Testaro as an application:
|
|
101
101
|
|
|
102
|
-
|
|
102
|
+
```bash
|
|
103
|
+
cd path/to/what/will/be/the/parent/directory/of/testaro
|
|
104
|
+
git clone https://github.com/cvs-health/testaro.git
|
|
105
|
+
cd testaro
|
|
106
|
+
npm install
|
|
107
|
+
npx playwright install
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
After that, you can update Testaro after any version change:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
cd testaro
|
|
114
|
+
git checkout package-lock.json
|
|
115
|
+
git pull
|
|
116
|
+
npm update
|
|
117
|
+
npx playwright install
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Once it is installed as an application, you can use its features with a terminal interface by executing the “By a user” statements below.
|
|
121
|
+
|
|
122
|
+
### As a dependency
|
|
123
|
+
|
|
124
|
+
You can make Testaro a dependency of another application by installing it as you would install any `npm` package, such as by executing `npm install-save testaro` or including `testaro` among the dependencies in a `package.json` file.
|
|
103
125
|
|
|
104
|
-
|
|
126
|
+
Once it is installed as a dependency, your application can use Testaro features by executing the “By a module” statements below.
|
|
127
|
+
|
|
128
|
+
### Prerequisites
|
|
129
|
+
|
|
130
|
+
To make the Testaro features work, you will also need to provide the environment variables described below under “Environment variables”.
|
|
105
131
|
|
|
106
132
|
All of the tests that Testaro can perform are free of cost, except those performed by the WallyAX and WAVE tools. The owners of those tools issue API keys. A free initial allowance of usage may be granted to you with a new API key. Before using Testaro to perform their tests, get your API keys for [WallyAX](mailto:technology@wallyax.com) and [WAVE](https://wave.webaim.org/api/). Then use those API keys to define environment variables, as described below under “Environment variables”.
|
|
107
133
|
|
|
@@ -683,93 +709,85 @@ You are not dependent on the judgments incorporated into the standard format, be
|
|
|
683
709
|
|
|
684
710
|
The standard format does not express opinions on issue classification. A rule ID identifies something deemed to be an issue by a tool. Useful reporting from multi-tool testing still requires the classification of tool **rules** into **issues**. If tool `A` has `alt-incomplete` as a rule ID and tool `B` has `image_alt_stub` as a rule ID, Testaro does not decide whether those are really the same issue or different issues. That decision belongs to you. The standardization of tool reports by Testaro eliminates some of the drudgery in issue classification, but not any of the judgment required for issue classification.
|
|
685
711
|
|
|
686
|
-
##
|
|
687
|
-
|
|
688
|
-
### Introduction
|
|
689
|
-
|
|
690
|
-
Testaro can be called by modules and by users.
|
|
712
|
+
## Invocation
|
|
691
713
|
|
|
692
|
-
|
|
714
|
+
Testaro features can be invoked by modules of your application when Testaro is a dependency, or directly by users who have installed Testaro as an application.
|
|
693
715
|
|
|
694
|
-
Before a module can execute a Testaro function, it must import that function from the module that exports it. A
|
|
716
|
+
Before a module can execute a Testaro function, it must import that function from the Testaro module that exports it. A module can import function `f` from module `m` with the statement
|
|
695
717
|
|
|
696
718
|
```javascript
|
|
697
|
-
const {f} = require('
|
|
719
|
+
const {f} = require('testaro/m');`
|
|
698
720
|
```
|
|
699
721
|
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
A module in another Node.js package that has Testaro as a dependency can execute the same statements, except changing `'./m'` to `'testaro/m'`.
|
|
703
|
-
|
|
704
|
-
#### Immediate
|
|
722
|
+
## Immediate job execution
|
|
705
723
|
|
|
706
724
|
A job can be immediately executed as follows:
|
|
707
725
|
|
|
708
|
-
|
|
726
|
+
### By a module
|
|
709
727
|
|
|
710
728
|
```javascript
|
|
711
|
-
const {doJob} = require('
|
|
729
|
+
const {doJob} = require('testaro/run');
|
|
712
730
|
doJob(job)
|
|
713
731
|
.then(report => …);
|
|
714
732
|
```
|
|
715
733
|
|
|
716
734
|
Testaro will run the job and return a `report` object, a copy of the job with the `acts` and `jobData` properties containing the results. The final statement can further process the `report` object as desired in the `then` callback.
|
|
717
735
|
|
|
718
|
-
The Testilo package contains functions that can create jobs from scripts
|
|
736
|
+
The Testilo package contains functions that can create jobs from scripts, add scores and explanations to reports, and create HTML documents summarizing reports.
|
|
719
737
|
|
|
720
|
-
|
|
738
|
+
### By a user
|
|
721
739
|
|
|
722
740
|
```bash
|
|
723
741
|
node call run
|
|
724
|
-
node call run
|
|
742
|
+
node call run 250525T
|
|
725
743
|
```
|
|
726
744
|
|
|
727
|
-
In the second example, `
|
|
745
|
+
In the second example, `250525T` is the initial characters of the ID of a job saved as a JSON file in the `todo` subdirectory of the `JOBDIR` directory (`JOBDIR` refers to the value of the environment variable `JOBDIR`, obtained via `process.env.JOBDIR`).
|
|
728
746
|
|
|
729
|
-
The `call` module will find the first job file with a matching name if an argument is given, or the first job file if not. Then the module will execute the `doJob` function of the `run` module on the job, save the report in the `raw` subdirectory of the `REPORTDIR` directory, and archive the job file in the `done` subdirectory of the `JOBDIR` directory.
|
|
747
|
+
The `call` module will find the first job file with a matching name if an argument is given, or the first job file if not. Then the module will execute the `doJob` function of the `run` module on the job, save the report in the `raw` subdirectory of the `REPORTDIR` directory, and archive the job file in the `done` subdirectory of the `JOBDIR` directory. (The report destination is named `raw` because the report has not yet been further processed by your application, perhaps using Testilo, to convert the report data into user-friendly reports.)
|
|
730
748
|
|
|
731
|
-
|
|
749
|
+
## Job watching
|
|
732
750
|
|
|
733
751
|
In watch mode, Testaro periodically checks for a job to run and, when a job is obtained, performs it.
|
|
734
752
|
|
|
735
|
-
|
|
753
|
+
### Directory watching
|
|
736
754
|
|
|
737
|
-
Testaro can watch for a job in a directory
|
|
755
|
+
Testaro can watch for a job in a directory of the filesystem where Testaro or your application is located, with the `dirWatch` function.
|
|
738
756
|
|
|
739
|
-
|
|
757
|
+
#### By a module
|
|
740
758
|
|
|
741
759
|
```javaScript
|
|
742
|
-
const {dirWatch} = require('
|
|
760
|
+
const {dirWatch} = require('testaro/dirWatch');
|
|
743
761
|
dirWatch(true, 300);
|
|
744
762
|
```
|
|
745
763
|
|
|
746
|
-
In this example, a
|
|
764
|
+
In this example, a moduleof your application asks Testaro to check a directory for a job every 300 seconds, to perform the jobs in the directory if any are found, and then to continue checking. If the first argument is `false`, Testaro will stop checking after performing 1 job. If it is `true`, Testaro continues checking until the `dirWatch` process is stopped.
|
|
747
765
|
|
|
748
|
-
|
|
766
|
+
Testaro checks for jobs in the `todo` subdirectory of `JOBDIR`. When it has performed a job, Testaro moves it into the `done` subdirectory.
|
|
749
767
|
|
|
750
|
-
Testaro creates a report for each job and saves the report in the
|
|
768
|
+
Testaro creates a report for each job and saves the report in the `raw` subdirectory of `REPORTDIR`.
|
|
751
769
|
|
|
752
|
-
|
|
770
|
+
#### By a user
|
|
753
771
|
|
|
754
772
|
```javaScript
|
|
755
773
|
node call dirWatch true 300
|
|
756
774
|
```
|
|
757
775
|
|
|
758
|
-
The arguments and behaviors described above for execution by a module apply here, too.
|
|
776
|
+
The arguments and behaviors described above for execution by a module apply here, too. If the first argument is `true`, you can terminate the process by entering `CTRL-c`.
|
|
759
777
|
|
|
760
|
-
|
|
778
|
+
### Network watching
|
|
761
779
|
|
|
762
|
-
|
|
780
|
+
Testaro can poll servers for jobs to be performed.
|
|
763
781
|
|
|
764
782
|
Network watching is governed by environment variables of the form `NETWATCH_URL_0_JOB`, `NETWATCH_URL_0_OBSERVE`, `NETWATCH_URL_0_REPORT`, and `NETWATCH_URL_0_AUTH`, and by an environment variable `NETWATCH_URLS`.
|
|
765
783
|
|
|
766
|
-
You can create as many quadruples of `…JOB`, `OBSERVE`, `…REPORT`, and `AUTH` variables as you want, one quadruple for each server that the agent may get jobs from. Each quadruple has a different number inside the variable name. The `…JOB` variable is the URL that the agent needs to send a job request to. The `…OBSERVE` variable is the URL that the agent needs to send granular job progress messages to. The `…REPORT` variable is the URL that the agent needs to send a completed report to. The `…AUTH` variable is the password of the agent that will be recognized by the server. Each URL can contain segments and/or query parameters that identify the purpose of the request, the identity and authorization of the agent, etc.
|
|
784
|
+
You can create as many quadruples of `…JOB`, `OBSERVE`, `…REPORT`, and `AUTH` variables as you want, one quadruple for each server that the agent may get jobs from. Each quadruple has a different number inside the variable name. The `…JOB` variable is the URL that the agent needs to send a job request to. The `…OBSERVE` variable is the URL that the agent needs to send granular job progress messages to if the job requests that. The `…REPORT` variable is the URL that the agent needs to send a completed report to. The `…AUTH` variable is the password of the agent that will be recognized by the server. Each URL can contain segments and/or query parameters that identify the purpose of the request, the identity and authorization of the agent, etc.
|
|
767
785
|
|
|
768
|
-
In each quadruple, the `…AUTH` variable is optional. If it is truthy (i.e. it exists and has a non-empty value), then the job request sent to the server will be a `POST` request and the payload will be
|
|
786
|
+
In each quadruple, the `…AUTH` variable is optional. If it is truthy (i.e. it exists and has a non-empty value), then the job request sent to the server will be a `POST` request and the payload will be an object with an `agentPW` property, whose value is the password. Otherwise, i.e. if the variable has an empty string as its value or does not exist, the request will be a `GET` request, and an agent password, if required by the server, will need to be provided in the URL.
|
|
769
787
|
|
|
770
788
|
The `NETWATCH_URLS` variable has a value of the form `0,3,4`. This is a comma-delimited list of the numbers of the servers to be polled.
|
|
771
789
|
|
|
772
|
-
Once
|
|
790
|
+
Once Testaro obtains a network job from one of the servers, Testaro performs it and adds the result data to the job, which then becomes a report. Testaro also makes its `AGENT` value the value of the `sources.agent` property of the report. Testaro then sends the report in a `POST` request to the `…REPORT` URL with the same server number. If there is a truthy `…AUTH` variable for the server, the request payload has this format:
|
|
773
791
|
|
|
774
792
|
```json
|
|
775
793
|
{
|
|
@@ -788,20 +806,20 @@ If granular reporting is desired, Testaro sends progress messages to the observa
|
|
|
788
806
|
|
|
789
807
|
Network watching can be repeated or 1-job. 1-job watching stops after 1 job has been performed.
|
|
790
808
|
|
|
791
|
-
After checking all the URLs in succession without getting a job from any of them, Testaro waits for
|
|
809
|
+
After checking all the URLs in succession without getting a job from any of them, Testaro waits for the prescribed time before continuing to check.
|
|
792
810
|
|
|
793
|
-
|
|
811
|
+
#### By a module
|
|
794
812
|
|
|
795
813
|
```javaScript
|
|
796
|
-
const {netWatch} = require('
|
|
814
|
+
const {netWatch} = require('testaro/netWatch');
|
|
797
815
|
netWatch(true, 300, true);
|
|
798
816
|
```
|
|
799
817
|
|
|
800
|
-
In this example, a module asks Testaro to check the servers for a job every 300 seconds, to perform any jobs obtained from the servers, and then to continue checking until the process is stopped. If the first argument is `false`, Testaro will stop checking after performing 1 job.
|
|
818
|
+
In this example, a module of your application asks Testaro to check the servers for a job every 300 seconds, to perform any jobs obtained from the servers, and then to continue checking until the process is stopped. If the first argument is `false`, Testaro will stop checking after performing 1 job.
|
|
801
819
|
|
|
802
820
|
The third argument specifies whether Testaro should be certificate-tolerant. A `true` value makes Testaro accept SSL certificates that fail verification against a list of certificate authorities. This allows testing of `https` targets that, for example, use self-signed certificates. If the third argument is omitted, the default for that argument is implemented. The default is `true`.
|
|
803
821
|
|
|
804
|
-
|
|
822
|
+
#### By a user
|
|
805
823
|
|
|
806
824
|
```javaScript
|
|
807
825
|
node call netWatch true 300 true
|
|
@@ -809,7 +827,7 @@ node call netWatch true 300 true
|
|
|
809
827
|
|
|
810
828
|
The arguments and behaviors described above for execution by a module apply here, too. If the first argument is `true`, you can terminate the process by entering `CTRL-c`.
|
|
811
829
|
|
|
812
|
-
|
|
830
|
+
## Environment variables
|
|
813
831
|
|
|
814
832
|
In addition to their uses described above, environment variables can be used by acts of type `test`, as documented in the `actSpecs.js` file.
|
|
815
833
|
|
|
@@ -878,13 +896,13 @@ The Playwright “Receives Events” actionability check does **not** check whet
|
|
|
878
896
|
|
|
879
897
|
### Test prevention
|
|
880
898
|
|
|
881
|
-
Test targets employ mechanisms to prevent scraping, automated form submission, and other automated actions. These mechanisms may interfere with testing. When a test act is prevented by a target, Testaro reports this prevention.
|
|
899
|
+
Test targets employ mechanisms to prevent scraping, multiple requests within a short time, automated form submission, and other automated actions. These mechanisms may interfere with testing. When a test act is prevented by a target, Testaro reports this prevention.
|
|
882
900
|
|
|
883
901
|
Some targets prohibit the execution of alien scripts unless the client can demonstrate that it is the requester of the page. Failure to provide that evidence results in the script being blocked and an error message being logged, saying “Refused to execute a script because its hash, its nonce, or unsafe-inline does not appear in the script-src directive of the Content Security Policy”. This mechanism affects tools that insert scripts into a target in order to test it. Those tools include `axe`, `aslint`, `ed11y`, and `htmlcs`. To comply with this requirement, Testaro obtains a _nonce_ from the response that serves the target. Then the file that runs the tool adds that nonce to the script as the value of a `nonce` attribute when it inserts its script into the target.
|
|
884
902
|
|
|
885
903
|
### Tool duplicativity
|
|
886
904
|
|
|
887
|
-
Tools sometimes do redundant testing, in that two or more tools test for the same defects, although such duplications are not necessarily perfect. This fact creates
|
|
905
|
+
Tools sometimes do redundant testing, in that two or more tools test for the same defects, although such duplications are not necessarily perfect. This fact creates problems:
|
|
888
906
|
- One cannot be confident in excluding some tests of some tools on the assumption that they perfectly duplicate tests of other tools.
|
|
889
907
|
- The Testaro report from a job documents each tool’s results separately, so a single defect may be documented in multiple locations within the report, making the direct consumption of the report inefficient.
|
|
890
908
|
- An effort to aggregate the results into a single score may distort the scores by inflating the weights of defects that happen to be discovered by multiple tools.
|
|
@@ -917,7 +935,7 @@ The files in the `temp` directory are presumed ephemeral and are not tracked by
|
|
|
917
935
|
|
|
918
936
|
Testilo contains procedures that reorganize report data by issue and by element, rather than tool, and that compensate for duplicative tests when computing scores.
|
|
919
937
|
|
|
920
|
-
Report standardization could be performed
|
|
938
|
+
Report standardization could be performed by other software rather than by Testaro. That would require sending the original reports to the server. They are typically larger than standardized reports. Whenever users want only standardized reports, the fact that Testaro standardizes them eliminates the need to send the original reports anywhere.
|
|
921
939
|
|
|
922
940
|
## Code style
|
|
923
941
|
|
|
@@ -938,7 +956,7 @@ As of 12 February 2024, upon the transfer of the repository ownership to CVS Hea
|
|
|
938
956
|
“Testaro” means “collection of tests” in Esperanto.
|
|
939
957
|
|
|
940
958
|
/*
|
|
941
|
-
© 2021–
|
|
959
|
+
© 2021–2025 CVS Health and/or one of its affiliates. All rights reserved.
|
|
942
960
|
|
|
943
961
|
MIT License
|
|
944
962
|
|