@cloudscape-design/browser-test-tools 3.0.68 → 3.0.70

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": "7d95ce8ce11454a31d1f7fd819b2f1f1f93cace2"
2
+ "commit": "60fad4d570846d1d7fd384c266534b86d2d32b7d"
3
3
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudscape-design/browser-test-tools",
3
- "version": "3.0.68",
3
+ "version": "3.0.70",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/cloudscape-design/browser-test-tools.git"
@@ -31,6 +31,7 @@ export default class BasePageObject {
31
31
  isSelected(selector: string): Promise<boolean>;
32
32
  isExisting(selector: string): Promise<boolean>;
33
33
  isDisplayed(selector: string): Promise<boolean>;
34
+ isDisplayedInViewport(selector: string): Promise<boolean>;
34
35
  isClickable(selector: string): Promise<boolean>;
35
36
  getElementAttribute(selector: string, attributeName: string): Promise<string>;
36
37
  getElementProperty(selector: string, propertyName: string): Promise<any>;
@@ -172,12 +172,12 @@ class BasePageObject {
172
172
  return elements.length > 0;
173
173
  }
174
174
  async isDisplayed(selector) {
175
- // browser.$ throws an error if element is not found, so we use this method to avoid try/catch
176
- const elements = await this.browser.$$(selector);
177
- if (elements.length === 0) {
178
- return false;
179
- }
180
- return elements[0].isDisplayed();
175
+ const element = await this.browser.$(selector);
176
+ return element.isDisplayed();
177
+ }
178
+ async isDisplayedInViewport(selector) {
179
+ const element = await this.browser.$(selector);
180
+ return element.isDisplayedInViewport();
181
181
  }
182
182
  async isClickable(selector) {
183
183
  const element = await this.browser.$(selector);