Skip to content

Commit

Permalink
Remove weird, superfluous type hedging on IonicComponent selector
Browse files Browse the repository at this point in the history
  • Loading branch information
NoelLH committed Aug 25, 2024
1 parent b1f0457 commit 39bd20f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
10 changes: 3 additions & 7 deletions e2e/src/helpers/ionic-component.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
export class IonicComponent {
constructor(public selector: string | WebdriverIO.Element) {
constructor(public selector: string) {
}

get $() {
return async ({ IonicPage }) => {
if (typeof this.selector === 'string') {
const activePage = await IonicPage.active();
return activePage.$(this.selector);
}

return this.selector;
const activePage = await IonicPage.active();
return activePage.$(this.selector);
};
}
}
4 changes: 2 additions & 2 deletions e2e/src/helpers/ionic-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class IonicInput extends IonicComponent {
value: string,
{ visibilityTimeout = 5000 }: ElementActionOptions = {}
) {
const el = await Ionic$.$(this.selector as string);
const el = await Ionic$.$(this.selector);
await el.waitForDisplayed({ timeout: visibilityTimeout });

const ionTags = ['ion-input', 'ion-textarea'];
Expand All @@ -24,7 +24,7 @@ export class IonicInput extends IonicComponent {
}

async getValue({ visibilityTimeout = 5000 }: ElementActionOptions = {}) {
const el = await Ionic$.$(this.selector as string);
const el = await Ionic$.$(this.selector);
await el.waitForDisplayed({ timeout: visibilityTimeout });

const ionTags = ['ion-input', 'ion-textarea'];
Expand Down

0 comments on commit 39bd20f

Please sign in to comment.