Skip to content

Commit

Permalink
Fix/refactor types migrated from DefinitelyTyped (#3744)
Browse files Browse the repository at this point in the history
  • Loading branch information
garg3133 committed May 31, 2023
1 parent 543115b commit 7b9c5bf
Show file tree
Hide file tree
Showing 9 changed files with 276 additions and 110 deletions.
1 change: 1 addition & 0 deletions lib/api/element-commands/getLocationInView.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const BaseElementCommand = require('./_baseElementCommand.js');
* @returns {{x: number, y: number}} The X and Y coordinates for the element on the page.
* @jsonwire
* @api protocol.elementlocation
* @deprecated This is a JSON Wire Protocol command and is no longer supported.
*/
class GetLocationInView extends BaseElementCommand {
get w3c_deprecated() {
Expand Down
3 changes: 2 additions & 1 deletion lib/api/protocol/elementIdLocationInView.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ const ProtocolAction = require('./_base-action.js');
* Determine an element's location on the screen once it has been scrolled into view.
*
* @link
* @param {string} webElementId The [Web Element ID](https://www.w3.org/TR/webdriver1/#dfn-web-elements) of the element to route the command to.
* @param {string} webElementId The [Web Element ID](https://www.w3.org/TR/webdriver1/#dfn-web-elements) of the element to route the command to.
* @param {function} [callback] Optional callback function to be called when the command finishes.
* @api protocol.elementinternal
* @deprecated This is a JSON Wire Protocol command and is no longer supported.
*/
module.exports = class Session extends ProtocolAction {
get w3c_deprecated() {
Expand Down
32 changes: 16 additions & 16 deletions types/assertions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface NightwatchCommonAssertions<ReturnType> {
* Checks if the given attribute of an element contains the expected value.
*
* ```
* this.demoTest = function (client) {
* this.demoTest = function (browser) {
* browser.assert.attributeContains('#someElement', 'href', 'google.com');
* };
* ```
Expand All @@ -30,7 +30,7 @@ export interface NightwatchCommonAssertions<ReturnType> {
* Checks if the given attribute of an element has the expected value.
*
* ```
* this.demoTest = function (client) {
* this.demoTest = function (browser) {
* browser.assert.attributeEquals('body', 'data-attr', 'some value');
* };
* ```
Expand Down Expand Up @@ -65,7 +65,7 @@ export interface NightwatchCommonAssertions<ReturnType> {
* Checks if the specified css property of a given element has the expected value.
*
* ```
* this.demoTest = function (client) {
* this.demoTest = function (browser) {
* browser.assert.cssProperty('#main', 'display', 'block');
* };
* ```
Expand Down Expand Up @@ -138,7 +138,7 @@ export interface NightwatchCommonAssertions<ReturnType> {
* Checks if the given element exists in the DOM.
*
* ```
* this.demoTest = function (client) {
* this.demoTest = function (browser) {
* browser.assert.elementPresent("#main");
* };
* ```
Expand Down Expand Up @@ -192,7 +192,7 @@ export interface NightwatchCommonAssertions<ReturnType> {
* Checks if the given element has the specified CSS class.
*
* ```
* this.demoTest = function (client) {
* this.demoTest = function (browser) {
* browser.assert.cssClassPresent('#main', 'container');
* };
* ```
Expand Down Expand Up @@ -280,7 +280,7 @@ export interface NightwatchCommonAssertions<ReturnType> {
* Checks if the given element contains the specified text.
*
* ```
* this.demoTest = function (client) {
* this.demoTest = function (browser) {
* browser.assert.containsText('#main', 'The Night Watch');
* };
* ```
Expand Down Expand Up @@ -350,7 +350,7 @@ export interface NightwatchCommonAssertions<ReturnType> {
* Checks if the page title equals the given value.
*
* ```
* this.demoTest = function (client) {
* this.demoTest = function (browser) {
* browser.assert.title("Nightwatch.js");
* };
* ```
Expand All @@ -366,7 +366,7 @@ export interface NightwatchCommonAssertions<ReturnType> {
* Checks if the page title equals the given value.
*
* ```
* this.demoTest = function (client) {
* this.demoTest = function (browser) {
* browser.assert.title("Nightwatch.js");
* };
* ```
Expand All @@ -380,7 +380,7 @@ export interface NightwatchCommonAssertions<ReturnType> {
* Checks if the page title equals the given value.
* @since 2.0
* ```
* this.demoTest = function (client) {
* this.demoTest = function (browser) {
* browser.assert.titleEquals("Nightwatch.js");
* };
* ```
Expand All @@ -396,7 +396,7 @@ export interface NightwatchCommonAssertions<ReturnType> {
* @example
*
* ```
* this.demoTest = function (client) {
* this.demoTest = function (browser) {
* browser.assert.titleMatches('^Nightwatch');
* };
* ```
Expand All @@ -411,7 +411,7 @@ export interface NightwatchCommonAssertions<ReturnType> {
* Checks if the current URL contains the given value.
*
* ```
* this.demoTest = function (client) {
* this.demoTest = function (browser) {
* browser.assert.urlContains('google');
* };
* ```
Expand All @@ -425,7 +425,7 @@ export interface NightwatchCommonAssertions<ReturnType> {
* Checks if the current url equals the given value.
*
* ```
* this.demoTest = function (client) {
* this.demoTest = function (browser) {
* browser.assert.urlEquals('https://www.google.com');
* };
* ```
Expand All @@ -440,7 +440,7 @@ export interface NightwatchCommonAssertions<ReturnType> {
*
* @example
* ```
* this.demoTest = function (client) {
* this.demoTest = function (browser) {
* browser.assert.urlMatches('^https');
* };
* ```
Expand All @@ -455,7 +455,7 @@ export interface NightwatchCommonAssertions<ReturnType> {
* Checks if the given form element's value equals the expected value.
*
* ```
* this.demoTest = function (client) {
* this.demoTest = function (browser) {
* browser.assert.value("form.login input[type=text]", "username");
* };
* ```
Expand All @@ -472,7 +472,7 @@ export interface NightwatchCommonAssertions<ReturnType> {
* Checks if the given form element's value contains the expected value.
*
* ```
* this.demoTest = function (client) {
* this.demoTest = function (browser) {
* browser.assert.valueContains("form.login input[type=text]", "username");
* };
* ```
Expand Down Expand Up @@ -523,7 +523,7 @@ export interface NightwatchCommonAssertions<ReturnType> {
* Checks if the given element is visible on the page.
*
* ```
* this.demoTest = function (client) {
* this.demoTest = function (browser) {
* browser.assert.visible(".should_be_visible");
* };
* ```
Expand Down
Loading

0 comments on commit 7b9c5bf

Please sign in to comment.