Upgrading to WebDriverIO 6
In March I went through the process of upgrading to WebDriver v5. Last month I took the next step by upgrading our deployment to version 6 so we’d be current. I learned quite a bit from that first upgrade which made this upgrade a whole lot easier.
Here’s what I did to upgrade to WebDriverIO 6:
- Checked the Docs. I scanned through the change log sections on breaking changes. Maybe I’m boring but nothing in the docs breaking changes notes looked to impact our setup! 👏
npm oudated
. This is one of my favorite (and mostly unused) npm commands. It told me specifically what packages I had that were outdated. Hint: it was all of them. 🤯- Upgrade the easy stuff.
- Based on what npm returned, I began by updating my package.json file for 3rd party libraries. Libraries such as prettier, chromedriver, moment, etc. that all played a part in my solution but didn’t deal directly with my tests. Then I
npm install
the latest changes.
- Based on what npm returned, I began by updating my package.json file for 3rd party libraries. Libraries such as prettier, chromedriver, moment, etc. that all played a part in my solution but didn’t deal directly with my tests. Then I
- Run the whole test suite looking for failures.
- Upgrade the harder stuff.
- Same thing as step 3, updated the package.json versions to be the “latest” and then
npm install
. - Another way to do this is to remove the node_modules folder and re-install each package based on the install instructions.
- Same thing as step 3, updated the package.json versions to be the “latest” and then
- Run the whole test suite… until nothing is broken!
More reasonable!
This upgrade wasn’t as daunting as I initially feared. With upgrades there’s always some level of concern you are going to “ruin a good thing”. Once I moved past that concern, there wasn’t much effort involved in getting things to work. Lots of credit goes to the WebDriverIO team for making the process more reasonable and straightforward, which of course they stated in their announcement:
This major update is much more reasonable and contains subtle changes that will help the project further grow while remaining performant at the same time.
I’ve been pretty happy thus far using WebDriverIO and I’m excited to see where things go!