testaro 41.0.2 → 42.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 CHANGED
@@ -143,17 +143,16 @@ Here is an example of a job:
143
143
  timeLimit: 80,
144
144
  creationTimeStamp: '241229T0537',
145
145
  executionTimeStamp: '250110T1200',
146
+ sendReportTo: 'https://abccorp.com/api/report',
147
+ target: {
148
+ what: 'Real Estate Management',
149
+ url: 'https://abccorp.com/mgmt/realproperty.html'
150
+ },
146
151
  sources: {
147
152
  script: 'ts99',
148
153
  batch: 'departments',
149
154
  mergeID: '7f',
150
- sendReportTo: 'https://abccorp.com/api/report',
151
155
  requester: 'malavu@abccorp.com'
152
- target: {
153
- what: 'Real Estate Management',
154
- url: 'https://abccorp.com/mgmt/realproperty.html'
155
- },
156
- lastTarget: false,
157
156
  },
158
157
  acts: [
159
158
  {
@@ -194,7 +193,9 @@ Job properties:
194
193
  - `timeLimit`: the number of seconds allowed for the execution of the job.
195
194
  - `creationTimeStamp`: a string in `yymmddThhMM` format, describing when the job was created.
196
195
  - `executionTimeStamp`: a string in `yymmddThhMM` format, specifying a date and time before which the job is not to be performed.
197
- - `sources`: an object describing the source of the job.
196
+ - `sendReportTo`: the URL to which the job report is to be sent, or `''` if not a `netWatch` job.
197
+ - `target`: data about the target of the job, or `{}` if the job involves multiple targets.
198
+ - `sources`: data optionally inserted into the job by the job creator for use by the job creator.
198
199
  - `acts`: an array of the acts to be performed (documented below).
199
200
 
200
201
  ## Acts
@@ -237,7 +238,7 @@ When the texts of multiple elements of the same type will contain the same `whic
237
238
 
238
239
  #### Navigations
239
240
 
240
- An example of a **navigation** is the act of type `launch` above. The launch configuration is inherited from properties of the job, except that the act may override any of those properties.
241
+ An example of a **navigation** is the act of type `launch` above. The launch configuration is inherited from the `deviceID`, `browserID`, `lowMotion`, and `target` properties of the job, except that the act may override any of those properties.
241
242
 
242
243
  If any act alters the page, you can restore the page to its original state for the next act by inserting a new `launch` act (and, if necessary, additional page-specific acts) between them.
243
244
 
package/call.js CHANGED
@@ -83,7 +83,7 @@ const callRun = async jobIDStart => {
83
83
  // Otherwise, i.e. if the job does not exist.
84
84
  else {
85
85
  // Report the error.
86
- console.log('ERROR: No specified job exists');
86
+ console.log('ERROR: Specified job does not exist');
87
87
  }
88
88
  };
89
89
  // Starts a directory watch, converting the interval argument to a number.
package/netWatch.js CHANGED
@@ -142,8 +142,7 @@ exports.netWatch = async (isForever, intervalInSeconds, isCertTolerant = true) =
142
142
  }
143
143
  // Otherwise, i.e. if there was a job or a message:
144
144
  else {
145
- const {id, message, sources} = contentObj;
146
- const sendReportTo = sources ? sources.sendReportTo : '';
145
+ const {id, message, sendReportTo, sources} = contentObj;
147
146
  // If the server sent a message, not a job:
148
147
  if (message) {
149
148
  // Report it.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testaro",
3
- "version": "41.0.2",
3
+ "version": "42.0.0",
4
4
  "description": "Run 1000 web accessibility tests from 10 tools and get a standardized report",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/procs/job.js CHANGED
@@ -196,6 +196,8 @@ exports.isValidJob = job => {
196
196
  timeLimit,
197
197
  creationTimeStamp,
198
198
  executionTimeStamp,
199
+ sendReportTo,
200
+ target,
199
201
  sources,
200
202
  acts
201
203
  } = job;
@@ -237,12 +239,13 @@ exports.isValidJob = job => {
237
239
  ) {
238
240
  return 'bad job executionTimeStamp';
239
241
  }
240
- if (
241
- ! sources
242
- || typeof sources !== 'object'
243
- || ! ['script', 'batch', 'target'].every(key => sources[key])
244
- || ! ['what', 'url'].every(key => sources.target[key])
245
- ) {
242
+ if (typeof sendReportTo !== 'string' || sendReportTo && ! isURL(sendReportTo)) {
243
+ return 'bad job sendReportTo';
244
+ }
245
+ if (typeof target !== 'object' || target.url && ! isURL(target.url) || target.what === '') {
246
+ return 'bad job target';
247
+ }
248
+ if (sources && typeof sources !== 'object') {
246
249
  return 'Bad job sources';
247
250
  }
248
251
  if (
package/run.js CHANGED
@@ -622,7 +622,7 @@ const doActs = async (report, actIndex, page) => {
622
622
  // Launch the specified browser on the specified device and navigate to the specified URL.
623
623
  const launchResult = await launch(
624
624
  report,
625
- act.url || report.sources.target.url,
625
+ act.url || report.target.url,
626
626
  debug,
627
627
  waits,
628
628
  act.deviceID || report.deviceID,