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

Selenium upgrade #59

Merged
merged 3 commits into from
Mar 23, 2023
Merged

Selenium upgrade #59

merged 3 commits into from
Mar 23, 2023

Conversation

mnocon
Copy link
Contributor

@mnocon mnocon commented Mar 6, 2023

JIRA: https://issues.ibexa.co/browse/IBX-4460

All PRs:
ibexa/recipes-dev#60
ibexa/docker#11
https://github.com/ibexa/version-comparison/pull/52
ibexa/admin-ui#726
#59

Tested in ibexa/commerce#227

Background

Selenium has stopped publishing new images for the Selenum 3 version:
https://hub.docker.com/r/selenium/standalone-chrome-debug/tags

The latest release is from 2021-09-21, meaning we are using a browser that is slowly becoming outdated - and because new Selenium 3 Docker images are no longer published we need to move away from Selenium 3 and upgrade.

Solutions considered:

  1. Chrome driver for Mink

Repository: https://gitlab.com/behat-chrome/chrome-mink-driver

It promises great results:

It communicates directly with Google Chrome over HTTP and WebSockets, which allows it to work at least twice as fast as Chrome with Selenium. For Chrome 59+ it supports headless mode, eliminating the need to install a display server, and the overhead that comes with it. This driver is tested and benchmarked against a behat suite of 1800 scenarios and 19000 steps. It can successfully run it in less than 18 minutes with Chrome 60 headless. The same suite running against Chrome 58 with xvfb and Selenium takes ~60 minutes.

but I was not able to get file uploads to work with this driver - after a file was uploaded the next tests would start failing.

  1. Symfony Panther, together with a Mink extension for it
    https://github.com/robertfausk/behat-panther-extension
    https://github.com/symfony/panther/

It would be great to use it, because it's closely tied to the Symfony ecosystem - but sadly it cannot be used with remote Selenium out of the box:
symfony/panther#590

Right now the idea is that the driver is installed in the project directory, which doesn't work for us.

  1. Selenium2Driver & instaclick/php-webdriver

This is the driver we've used so far, but it's not compatible with Selenium 4.8.0:
instaclick/php-webdriver#122

and when upgrading it would be best to upgrade to the latest version already.
The fact that the issue is one month old already is not a good indicator for the future

  1. oleg-andreyev/MinkPhpWebDriver & php-webdriver/php-webdriver

This is the solution that I've chosen

Repositories:
https://github.com/oleg-andreyev/MinkPhpWebDriver
https://github.com/oleg-andreyev/MinkPhpWebdriverExtension

which uses https://github.com/php-webdriver/php-webdriver under the hood

I'm happy that we can switch from https://github.com/instaclick/php-webdriver/ to https://github.com/php-webdriver/php-webdriver, the latter seems more popular which should make the maintenence of test dependencies easier in the future. And it supports Selenium 4.8.0 already 🤩

Other changes

  1. File uploads don't have to be zip anymore (also done in Selenium 4 upgrade admin-ui#726), changed FileUploadHelper to reflect that for the new driver
  2. I had a lot of issues when running our tests in parallel - they would randomly fail on CSS transitions.

I was able to find this post:

which mentions how to disable background throttling - and with these settings the parallelism issues are gone.

@sonarcloud
Copy link

sonarcloud bot commented Mar 22, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@micszo micszo merged commit 9e4207b into main Mar 23, 2023
@micszo micszo deleted the selenium-upgrade branch March 23, 2023 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants