@cloudscape-design/browser-test-tools 3.0.83 → 3.0.84
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/internal/manifest.json +1 -1
- package/package.json +3 -3
- package/page-objects/base.d.ts +1 -0
- package/page-objects/base.js +9 -0
package/internal/manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudscape-design/browser-test-tools",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.84",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/cloudscape-design/browser-test-tools.git"
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@types/wait-on": "^5.3.4",
|
|
39
39
|
"@typescript-eslint/eslint-plugin": "^5.41.0",
|
|
40
40
|
"@typescript-eslint/parser": "^5.41.0",
|
|
41
|
-
"@vitest/coverage-istanbul": "^3.0.
|
|
41
|
+
"@vitest/coverage-istanbul": "^3.0.7",
|
|
42
42
|
"eslint": "^8.26.0",
|
|
43
43
|
"eslint-config-prettier": "^8.5.0",
|
|
44
44
|
"eslint-plugin-header": "^3.1.1",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"npm-run-all": "^4.1.5",
|
|
51
51
|
"prettier": "^2.7.1",
|
|
52
52
|
"typescript": "^5.7.3",
|
|
53
|
-
"vitest": "^3.0.
|
|
53
|
+
"vitest": "^3.0.7"
|
|
54
54
|
},
|
|
55
55
|
"exports": {
|
|
56
56
|
"./chrome-launcher": "./chrome-launcher.js",
|
package/page-objects/base.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ export default class BasePageObject {
|
|
|
25
25
|
getElementScroll(selector: string): Promise<ScrollPosition>;
|
|
26
26
|
elementScrollTo(selector: string, { top, left }: Partial<ScrollPosition>): Promise<void>;
|
|
27
27
|
waitForVisible(selector: string, shouldDisplay?: boolean, timeout?: number): Promise<void>;
|
|
28
|
+
waitForExist(selector: string, shouldExist?: boolean, timeout?: number): Promise<true>;
|
|
28
29
|
waitForAssertion(expression: () => Promise<void>): Promise<void>;
|
|
29
30
|
waitForJsTimers(timeout?: number): Promise<void>;
|
|
30
31
|
isFocused(selector: string): Promise<boolean>;
|
package/page-objects/base.js
CHANGED
|
@@ -148,6 +148,15 @@ class BasePageObject {
|
|
|
148
148
|
: `Element "${selector}" is still visible after waiting`,
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
|
+
waitForExist(selector, shouldExist = true, timeout) {
|
|
152
|
+
return this.browser.$(selector).waitForExist({
|
|
153
|
+
reverse: !shouldExist,
|
|
154
|
+
timeout,
|
|
155
|
+
timeoutMsg: shouldExist
|
|
156
|
+
? `Element "${selector}" is not existing upon waiting`
|
|
157
|
+
: `Element "${selector}" is still existing after waiting`,
|
|
158
|
+
});
|
|
159
|
+
}
|
|
151
160
|
async waitForAssertion(expression) {
|
|
152
161
|
const retryOptions = { minTimeout: 100, retries: 5 };
|
|
153
162
|
await (0, p_retry_1.default)(expression, retryOptions);
|