minkphp / MinkSelenium2Driver

Selenium2 (webdriver) driver for Mink framework
MIT License
507 stars 163 forks source link

Use chrome on Travis rather than Firefox for most jobs #300

Closed stof closed 3 years ago

stof commented 6 years ago

On Trusty, the preinstalled Firefox version is newer than the latest version supported by the FirefoxDriver of Selenium 2, and requires using the W3C protocol. But we don't support this protocol yet.

Replaces #290

stof commented 6 years ago

This also uses Selenium 3 rather than Selenium 2 for most jobs, as Selenium 2 is not maintained anymore.

aik099 commented 6 years ago

OK.

stof commented 6 years ago

OK, chrome is crashing, but I have an idea why.

aik099 commented 6 years ago

Try using that scenario (that selenium verison, that chrome version) locally. Maybe you'll see what's actually happening, e.g. Chrome window opens and then closes after a specific test. Maybe we're attempting to connect before Chrome was able to start.

stof commented 6 years ago

@aik099 I know what happens. Chrome's sandbox is enabled by default, but it is not compatible with Travis's container setup (containers are not priviledged enough to enable the sandboxing). And currently, Selenium2Driver does not auto-detect Travis to disable the chrome sandbox. It requires users to manually specify it.

We have 2 choices:

what do you prefer ?

stof commented 6 years ago

I will need to debug the build, as it fails many things and takes a very long time

aik099 commented 6 years ago

According to https://stackoverflow.com/questions/33013378/how-can-we-disable-web-security-of-chrome-browser-using-selenium-testng disabling sandboxing is done via capabilities during driver creation. If that is so, then we can:

  1. create an option in phpunit.xml.dist for chrome sandboxing (not set by default = use whatever happens currently)
  2. when creating a driver we pick that option and set correct capabilities
  3. in the travis.yml we always disable sandboxing by packing phpunit.xml.dist file
stof commented 6 years ago

Well, for now, I made a solution only for our own testsuite (so no impact on our users yet, which would be discussed separately once our CI works again), detecting Travis.

mvorisek commented 3 years ago

This is 2 years old, I belive it can be closed now.

oleg-andreyev commented 3 years ago

@mvorisek maybe it worth a look at https://github.com/oleg-andreyev/MinkPhpWebDriver