@checksum-ai/runtime 1.1.26 → 1.1.27
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 +79 -1
- package/checksumlib.js +2059 -1925
- package/cli.js +66 -76
- package/index.d.ts +32 -25
- package/index.js +78 -80
- package/package.json +1 -1
- package/test-run-monitor.js +5 -5
- package/vtg-build/asset-manifest.json +6 -6
- package/vtg-build/index.html +1 -1
- package/vtg-build/static/css/main.feaf2948.css +2 -0
- package/vtg-build/static/css/main.feaf2948.css.map +1 -0
- package/vtg-build/static/js/main.0a42875a.js +103 -0
- package/vtg-build/static/js/main.0a42875a.js.LICENSE.txt +118 -0
- package/vtg-build/static/js/main.0a42875a.js.map +1 -0
- package/vtg-build/static/js/main.877be2ba.js +103 -0
- package/vtg-build/static/js/main.877be2ba.js.LICENSE.txt +118 -0
- package/vtg-build/static/js/main.877be2ba.js.map +1 -0
- package/vtg-build/static/js/main.969d7da0.js +103 -0
- package/vtg-build/static/js/main.969d7da0.js.LICENSE.txt +128 -0
- package/vtg-build/static/js/main.969d7da0.js.map +1 -0
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
### Quick Start
|
|
4
4
|
|
|
5
|
-
1. Install the package using `npm install -D
|
|
5
|
+
1. Install the package using `npm install -D checksumai` or `yarn add checksumai -D`.
|
|
6
6
|
2. Navigate to the directory where you want to initialize the Checksum tests folder and run `npx checksumai init`.
|
|
7
7
|
3. In the newly created "checksum" folder
|
|
8
8
|
1. Edit `checksum.config.ts` and add the necessary configurations, including your apiKey, application baseURL, environment info, etc.
|
|
@@ -222,6 +222,20 @@ interface ChecksumPage extends Page {
|
|
|
222
222
|
* When required to login mid-test, use reauthenticate with the user's role. Note: It is not possible to change environments during a single test run.
|
|
223
223
|
*/
|
|
224
224
|
reauthenticate: (role: string) => Promise<void>;
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* When required to handle actions that involve browser Native Dialogs that are part of the WebAPI,
|
|
228
|
+
* use waitForDialog to listen for any dialog events, and handle them accordingly inside the handler.
|
|
229
|
+
* Note: waitForDialog can only work within a checksumAI.withDialog call which initiates the dialog listener.
|
|
230
|
+
*
|
|
231
|
+
* await checksumAI.withDialog("delete item and confirm", () => {
|
|
232
|
+
* await page.locator('.delete').click();
|
|
233
|
+
* await page.waitForDialog().then((confirm) => {
|
|
234
|
+
* confirm.accept();
|
|
235
|
+
* });
|
|
236
|
+
* });
|
|
237
|
+
*/
|
|
238
|
+
waitForDialog: (timeout?: number) => Promise<Dialog>;
|
|
225
239
|
}
|
|
226
240
|
|
|
227
241
|
```
|
|
@@ -229,6 +243,8 @@ interface ChecksumPage extends Page {
|
|
|
229
243
|
## ChecksumLocator API
|
|
230
244
|
|
|
231
245
|
ChecksumLocator extends the existing Playwright Locator, adding the following functionality:
|
|
246
|
+
* canvasClick
|
|
247
|
+
* compoundSelection
|
|
232
248
|
|
|
233
249
|
```js
|
|
234
250
|
interface ChecksumLocator extends Locator {
|
|
@@ -240,6 +256,68 @@ interface ChecksumLocator extends Locator {
|
|
|
240
256
|
* await page.locator('canvas').canvasClick('graph-point-1', 1); // clicking on the 2nd largest
|
|
241
257
|
*/
|
|
242
258
|
canvasClick: (canvasText: string, rectSizeIndex?: number) => Promise<void>;
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* Will create a compound selection that selects elements by grouping multiple locators as anchors
|
|
262
|
+
* and finding the target elements, if specified, from their common root parent.
|
|
263
|
+
* If no target is provided, the compound selection will return a locator to the common parents that were calculated from the anchors.
|
|
264
|
+
*
|
|
265
|
+
* **Usage example**
|
|
266
|
+
*
|
|
267
|
+
* ```js
|
|
268
|
+
* await page.compoundSelection(
|
|
269
|
+
* (base) => [base.getByText("<selector to first anchor>""), page.locator("selector to second anchor"), "<text content of third anchor>"],
|
|
270
|
+
* (base) => base.locator("<relative selector to target element>")
|
|
271
|
+
* ]).first().click();
|
|
272
|
+
* ```
|
|
273
|
+
*
|
|
274
|
+
* @param anchors Method that returns array of locators and/or text context, to group and calculate the common parent from.
|
|
275
|
+
* The method receives the base locator as an argument, which is the relative locator or page that the compound selection is called on.
|
|
276
|
+
* The method should return an array of locators or strings that point at the anchor elements.
|
|
277
|
+
* @param target [optional] Method that returns the relative locator or string content that will point at the target element from the common parent
|
|
278
|
+
* that was calculated from the anchors.
|
|
279
|
+
* If no target is provided, the compound selection will return a locator pointing at the common parents.
|
|
280
|
+
* @returns Locator to the common parent(s) or the target element(s) if specified.
|
|
281
|
+
*/
|
|
282
|
+
compoundSelection(
|
|
283
|
+
anchors: (base: Locator) => Array<Locator | string>,
|
|
284
|
+
target?: (base: Locator) => Locator | string
|
|
285
|
+
): ChecksumLocator;
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Will create a compound selection that selects elements by grouping multiple locators as anchors
|
|
289
|
+
* and finding the target elements, if specified, from their common root parent.
|
|
290
|
+
* If no target is provided, the compound selection will return a locator to the common parents that were calculated from the anchors.
|
|
291
|
+
*
|
|
292
|
+
* **Usage example**
|
|
293
|
+
*
|
|
294
|
+
* ```js
|
|
295
|
+
* await page.compoundSelection({
|
|
296
|
+
* anchors: (base) => [base.getByText("<selector to first anchor>""), page.locator("selector to second anchor"), "<text content of third anchor>"],
|
|
297
|
+
* target?: (base) => base.locator("<relative selector to target element>")
|
|
298
|
+
* }).first().click();
|
|
299
|
+
* ```
|
|
300
|
+
* @param selection
|
|
301
|
+
* @returns Locator to the common parent(s) or the target element(s) if specified.
|
|
302
|
+
*/
|
|
303
|
+
compoundSelection(selection: {
|
|
304
|
+
/**
|
|
305
|
+
* Method that returns array of locators and/or text context, to group and calculate the common parent from.
|
|
306
|
+
* The method receives the base locator as an argument, which is the relative locator or page that the compound selection is called on.
|
|
307
|
+
* The method should return an array of locators or strings that point at the anchor elements.
|
|
308
|
+
*
|
|
309
|
+
* @param base Base locator that the compound selection is called on.
|
|
310
|
+
*/
|
|
311
|
+
anchors: (base: Locator) => Array<Locator | string>;
|
|
312
|
+
/**
|
|
313
|
+
* Method that returns the relative locator or string content that will point at the target element from the common parent
|
|
314
|
+
* that was calculated from the anchors.
|
|
315
|
+
* If the target is null, the compound selection will return a locator pointing at the common parents.
|
|
316
|
+
*
|
|
317
|
+
* @param base Base locator that the compound selection is called on.
|
|
318
|
+
*/
|
|
319
|
+
target?: (base: Locator) => Locator | string;
|
|
320
|
+
}): ChecksumLocator;
|
|
243
321
|
}
|
|
244
322
|
```
|
|
245
323
|
|