Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enhanced types #440

Merged
merged 2 commits into from
Mar 15, 2023
Merged

feat: enhanced types #440

merged 2 commits into from
Mar 15, 2023

Conversation

vobu
Copy link

@vobu vobu commented Mar 2, 2023

this change provides a better DevX when wdi5 is used w/ TS.

before:

const multiInput = (await browser.asControl(multiInputSelector)) as unknown as MultiInput

after:

const multiInput = await browser.asControl<MultiInput>(multiInputSelector)

other samples "after":

const allButtons = await browser.allControls<Button>(allButtonsSelector)
const allButtonsOne = await browser.one.allControls<Button>(allButtonsSelector)
const navButton = await browser.asControl<Button>({
      selector: {
          id: "NavFwdButton",
          viewName: "test.Sample.tsapp.view.Main"
      }
  })
await navButton.press()

caveat: this does not apply to the fluent async api!

(kudos to @jkoenig134 for the jumpstart!)

@vobu
Copy link
Author

vobu commented Mar 2, 2023

Hey @aiopa, can you have a look too, please? 😄

Copy link
Collaborator

@ArnaudBuchholz ArnaudBuchholz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting changes

@vobu vobu merged commit 5b0d371 into main Mar 15, 2023
@vobu vobu deleted the feat/enhance-types branch March 15, 2023 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants