@cloudscape-design/browser-test-tools 3.0.83 → 3.0.85

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.
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "8e6c290a1772af4bde980d09ce0f0ea1b70698cd"
2
+ "commit": "d90048583013bdf89dfcd8fbd53381332263c29f"
3
3
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudscape-design/browser-test-tools",
3
- "version": "3.0.83",
3
+ "version": "3.0.85",
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.6",
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.6"
53
+ "vitest": "^3.0.7"
54
54
  },
55
55
  "exports": {
56
56
  "./chrome-launcher": "./chrome-launcher.js",
@@ -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>;
@@ -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);