webdriverio / codemod

A codemod to transform Protractor into WebdriverIO tests
MIT License
25 stars 12 forks source link

Missing await keyword #86

Open AlexandreBonneau opened 1 year ago

AlexandreBonneau commented 1 year ago

The async scripts works very well, thank you!

One note though, is that it forgets to add the await keyword on lines like this one: const inputClassic = $(selectors.inputClassic); where it should transform those into: const inputClassic = await $(selectors.inputClassic);.

Do note that it does add the await keyword in lines like that: expect($(selectors.elementP1).getText()).toEqual('2.140%'); (to: expect(await $(selectors.elementP1).getText()).toEqual('2.140%');)

christian-bromann commented 1 year ago

Thanks for reporting, this should indeed be changed, ideally to:

await expect($(selectors.elementP1)).toHaveText('2.140%');