Skip to content

Commit

Permalink
chore: update types for wdio 7.16.x (#11)
Browse files Browse the repository at this point in the history
WDIO make changes in their types.
Now we need to return ChainablePromiseElement<WebdriverIO.Element> for methods which return $('selector');
  • Loading branch information
charlyautomatiza authored Feb 23, 2022
1 parent eb6c383 commit 6895d1a
Show file tree
Hide file tree
Showing 6 changed files with 200 additions and 155 deletions.
2 changes: 1 addition & 1 deletion mobile/features/pageobjects/alert.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class AlertWiew {
/**
* define selectors using getter methods
*/
public get messageAlert() {
public get messageAlert(): ChainablePromiseElement<WebdriverIO.Element> {
return $('//*[@resource-id="android:id/message"]');
}
}
Expand Down
10 changes: 6 additions & 4 deletions mobile/features/pageobjects/login.view.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
import { ChainablePromiseElement } from 'webdriverio';

/**
* sub page containing specific selectors and methods for a specific page
*/
class LoginPage {
/**
* define selectors using getter methods
*/
public get inputUsername() {
public get inputUsername(): ChainablePromiseElement<WebdriverIO.Element> {
return $('//android.widget.EditText[@content-desc="input-email"]');
}

public get inputPassword() {
public get inputPassword(): ChainablePromiseElement<WebdriverIO.Element> {
return $('//android.widget.EditText[@content-desc="input-password"]');
}

public get btnSubmit() {
public get btnSubmit(): ChainablePromiseElement<WebdriverIO.Element> {
return $('//android.view.ViewGroup[@content-desc="button-LOGIN"]/android.view.ViewGroup');
}

public get btnLogin() {
public get btnLogin(): ChainablePromiseElement<WebdriverIO.Element> {
return $('//android.widget.Button[@content-desc="Login"]/android.widget.TextView');
}

Expand Down
Loading

0 comments on commit 6895d1a

Please sign in to comment.