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
v5 - changelog, upgrade instructions, ready for tickets? #2943
Comments
Yes, with #2862 I am creating a script that should auto generate these type definitions. I am not an typescript expert so I will definitely need some help validating the result. You can also pick this task up, just let me know in the PR.
True. I haven't actually thought about this. I guess it is impossible anyway to migrate and run v4 and v5 tests in the same repo anyway. What would you suggest. I definitely want to get rid of the configuration option.
Yeah, know issue. I deprecated rc1 of webdriver and released the actual version with @next tag. No idea why NPM is still preferring to install the deprecated version.
We got rid of support for promise chaining. It made the whole monad construct to complex to work with and it felt sometimes like pure magic. The issue with reference becomes stale doesn't really relate to this. It doesn't matter if you do: await $("#elem").click()
# or
const elem = await $("#elem")
await elem.click() It's the same thing. The first is not supported anymore.
Yes, the new API can be discovered here: http://beta.webdriver.io/docs/api.html. We also haven't ported all commands but we will as we move forward with the project.
Nope. As mentioned above to access the element scope you need to actually fetch an element. No command that interacts with an element can be called from the browser object. This is also why we separated commands between
The
Not sure if I understand this one. Thanks for trying out v5. Looking forward to more feedback! |
Thanks @christian-bromann!
Amazing! I'm new to Typescript as well, I'm using it to learn new libraries faster and write code with fewer bugs. It's been great, except supporting both
I agree controlling something so pivotal to the entire system feels strange to be a simple boolean. What about publishing
I'm really happy about this change. The API had too many ways it could be used in v4 and I wasn't sure what the right approach was.
This stack tells me about webdriverio's code, not my code.
This seems fine, but over time the code evolves to something like this:
or do we need to do something like this to avoid stale references:
|
I don't think this is a good idea. In general I would like to advocate that it is always better to use sync because it is (especially now with v5) literally just removing the await in front of the command which makes the code so much easier to read.
That would be indeed an issue. I guess we can tweak the stack trace that it reports correctly.
For this we actually implemented a retry mechanism. So if a stale element errors occurs it refetches the selector and updates the element automatically. I think someone started the work on that, I can't find the issue though. |
Interesting. I thought fibers were a hack in node. I agree it's easier to read. I think the v4 remote api was async-only. A team here using Cucumber required us to only use async so we can share our page objects. What about
Nice! Would that include retrying parent selectors? Example: const parent = await $('parent');
const child = await parent.$(child);
.... // React re-renders parent and child
await child.click(); // would need to retry parent to find child. |
Yes. @dylang anything else to answer? Happy to do this also on the Gitter support channel. |
If someone has questions to the new v5 version feel free to join the dev channel . Thanks for reaching out @dylang |
The problem
Hi! I'm new to webdriverio, and since I kept running in to issues that tickets said would be fixed in
v5
, I decided to give thebeta
a try. Exciting, I love the monorepo, the code seems a lot cleaner and easier to follow, and much more modern.I'm not sure if you are ready for bugs, PR's, feature requests, etc for v5.
To close this ticket we just need some guidance with how you would like us involved in the beta testing of v5.
Environment
v5
latest 10
homemade jest test environment
async
not yet
Details
Since it took me a few hours to transition my code to
5.0.0-beta.1
, I documented some of the changes I ran into so others could have a quicker upgrade.Note to readers: I've only spent a couple days with
v4
and a couple hours withv5
so these items might be incorrect, out-of-date, or subject to change.@types
that target v4 are not compatible.sync: false
config is ignored. Instead, yournode_modules
directory cannot havewdio-sync
installed to enableasync
. This might be hard or impossible if you are using a monorepo and/or in the process of migrating. I usedyarn why wdio-sync
to find modules that were installing it and removed them.RC1
ofwebdriver 5
, which has a different API. Adding this to ourpackage.json
helped it install the right version.browser.element
orbrowser.elements
, justbrowser.$
/browser.$$
.browser.end
. Usebrowser.deleteSession
.browser
, such asbrowser.click(selector)
. (Cleaner/smaller API footprint, yay!)waitForVisible
changed towaitForDisplayed
. Other element function names may have changed too.v4
async mode, if you resolved a$(selector)
promise, it would break chaining and access to element methods. Inv5
async mode,$(selector)
must be resolved to access element methods likeclick()
. Chaining async is not supported. This, of course, could lead to references becoming stale, so I'm guessing it will be fixed to support chaining.await browser.element(selector).click()
becomesawait (await browser.$(selector)).click()
.beta.1
, element timeouts exception stack is still not including the context, such as where in the test the timeout occurred. (This was one of the reasons I upgraded to v5.)^ stack does not include where in the test file the request for the element occurred. This makes it more difficult to trace how far the test got when it failed.
Code To Reproduce Issue [ Good To Have ]
n/a
The text was updated successfully, but these errors were encountered: