In this chapter, particularly the [waitForEnabled](https://webdriver.io/docs/api/element/waitForEnabled/)
and [waitForExist](https://webdriver.io/docs/api/element/waitForExist/)
sections, you may get some failures in your test. In order to avoid those failures, you need to update the way you pass in the parameters into the different functions.
In version 5, you could have just passed in the parameters in the round brackets — “(parameter)”.
With version 7 and above, you now have to pass in those parameters into a curly bracket and you have to state what they are.
timeout
, you need to say: ({ timeout: <the amount of time. })
.reverse
, you need to say: ({ reverse: true })
.With this change, that may cause the waitForExist
and thewaitForEnabled
tests that are further on in this course to fail.
I'm going to show you what the differences are.
I've also updated the code, so if you click the link to go to the code, the correct things should be there.
The correct thing, that will work should be there; but keep in mind that you need to update the code that you're writing.
Here on the left, you're seeing the version 5 code and, on the right, you're seeing the version 7 code.
The explanations are the same, the way the functions work will remain the same.
As I said before, you're just passing in curly brackets and you're having {timeout:}
, {reverse:}
, et cetera.
Same thing for the waitForExist
— on the left, version 5, on the right, version 7.
And you just see that we're just changing how we are passing in the parameters.
So, the way that the parameters are being accepted by a WebdriverIO version 7 has been updated, and so we need to update our code to ensure that it still works as it should.
Quiz
The quiz for this chapter can be found in Chapter 7.6.