mantoni / mochify.js

☕️ TDD with Browserify, Mocha, Headless Chrome and WebDriver
MIT License
346 stars 57 forks source link

Mochify does not work on Browserstack with Safari 12 or Firefox 64 #194

Closed jandockx closed 4 years ago

jandockx commented 5 years ago

Mochify does not work on Browserstack, with Safari 12 on Mojave and Firefox 64 on Windows 10, High Sierra nor Mojave.

It did work with Safari 11 and Firefox 63 on High Sierra, and Firefox 63 on WIndows 10.

# Firefox - OS X:
POST /wd/hub/session/fb0858d69e0c47c0c71453957267f2560049b6e8/execute
Unexpected HTTP status: 404 Not Found
server: nginx/1.10.1
date: Fri, 04 Jan 2019 16:15:45 GMT
content-type: application/json;charset=utf-8
content-length: 158
connection: keep-alive
expires: Thu, 01 Jan 1970 00:00:00 GMT
cache-control: no-cache, no-cache
Response Status Code: undefined
Response Message:
    POST /session/fb0858d69e0c47c0c71453957267f2560049b6e8/execute did not match a known command

See

jandockx commented 5 years ago

Tested with 5.8.0, 5.8.1, and 6.0.4

jandockx commented 5 years ago

Correction: it has worked with Firefox 64, but stopped working between 2018-12-22 and 2018-12-29, on both High Sierra and Windows 10. It is strange that the 'same' issue also happens with Safari 12 / Mojave.

mantoni commented 5 years ago

Thank you for reporting. It is strange that it works in some browsers and doesn’t work in others since the client side code shouldn‘t have changed.

You’re running a lot of test cases there. Can I ask you to retry with a single, simple test case? I had issues before that only occurred when a lot of tests were executed or the tests were blocking for a long time.

jandockx commented 5 years ago

Hi @mantoni ! You're quick!

I'm just trying to get a grip on this, so reporting on the fly:

The logs say that both the last working and the first failing run use

So, there was no switch there either.

In the Selenium logs, there is a difference in the first line. The logs for Windows / Firefox 64 of Travis/651 say

INFO [ActiveSessionFactory.apply] - Capabilities are: Capabilities {64bit: true, acceptSslCert: false, acceptSslCerts: false, browser: firefox, browserName: firefox, browser_version: 64.0, browserstack.appiumLogs: false, browserstack.console: ALL, browserstack.debug: false, browserstack.geckodriver: 0.21.0, browserstack.ie.noFlash: false, browserstack.key: <>, browserstack.selenium.jar.version: 3.11.0, browserstack.seleniumLogs: true, browserstack.user: <>, browserstack.video: true, browserstack.video.disableWaterMark: false, firefox_binary: c:\Program Files (x86)\fire..., firefox_profile: UEsDBBQAAAAIADNwWUmK7I+M9AM..., javascriptEnabled: true, moz:firefoxOptions: {args: [-start-debugger-server, 9222], prefs: {devtools.chrome.enabled: true, devtools.debugger.prompt-connection: false, devtools.debugger.remote-enabled: true}}, orig_os: win10, os: Windows, os_version: 10, proxy_type: node, version: 64.0}

Note:

browser: firefox,
browserName: firefox,
browser_version: 64.0,
…
browserstack.console: ALL,
…
browserstack.accessKey: <>,
browserstack.user: <>,
…
os_version: 10

The logs Travis/654 say

INFO [ActiveSessionFactory.apply] - Capabilities are: Capabilities {64bit: true, acceptSslCert: false, acceptSslCerts: false, browser: firefox, browserName: firefox, browser_name: Firefox, browser_version: 64.0, browserstack.accessKey: <>, browserstack.appiumLogs: false, browserstack.console: ALL, browserstack.consoleLogs: verbose, browserstack.debug: false, browserstack.geckodriver: 0.21.0, browserstack.ie.noFlash: false, browserstack.key: <>, browserstack.selenium.jar.version: 3.11.0, browserstack.seleniumLogs: true, browserstack.user: <>, browserstack.userName: <>, browserstack.video: true, browserstack.video.disableWaterMark: false, buildName: travis/00654, firefox_binary: c:\Program Files (x86)\fire..., firefox_profile: UEsDBBQAAAAIADNwWUmK7I+M9AM..., javascriptEnabled: true, moz:firefoxOptions: {args: [-start-debugger-server, 9222], prefs: {devtools.chrome.enabled: true, devtools.debugger.prompt-connection: false, devtools.debugger.remote-enabled: true}}, orig_os: win10, os: Windows, osVersion: 10, os_version: 10, projectName: Toryt contracts, proxy_type: node, version: 64.0}

Note:

browser: firefox,
browserName: firefox,
browser_name: Firefox,
browser_version: 64.0,
…
browserstack.console: ALL,
browserstack.consoleLogs: verbose,
…
browserstack.accessKey: <>,
browserstack.key: <>,
browserstack.user: <>,
browserstack.userName: <>,
…
buildName: travis/00654,
…
osVersion: 10,
os_version: 10,
projectName: Toryt contracts,

browser_name, browserstack.consoleLogs, browserstack.key, browserstack.userName, buildName, osVersion and projectName are added, although neither mochify (with a package-lock, nor selenium, nor the web-driver nor the Firefox version, nor the OS, changed.

Just observing.

jandockx commented 5 years ago

@mantoni : I'll see what I can do.

jandockx commented 5 years ago

@mantoni Ok, removed all tests except 1. Still the same problem.

Safari 12 on Mojave fails, Safari 11 on High Sierra works. Firefox 64 on Mojave and Windows 10 fails.

See build Travis/00666 (mmh, what a coincidence ;-) )

The more I look into this, the more I get the impression that this must be a Browserstack issue. Some update they did between 2018-12-22 and 2018-12-29. I am sorry I inconvenienced you.

mantoni commented 5 years ago

No worries. The issue on the Mochify side is clearly the error reporting. It is kind of difficult to extract meaningful information via WebDriver.

mantoni commented 5 years ago

Ok, I found some time to investigate the issue and I believe that tge cause is a transition to Selenium 3. I guess that for some browsers the default Selenium version has changed to a newer protocol. I'm personally using SauceLabs and ran some tests there.

What I did in node_modules/min-wd/lib/driver.js:

On SauceLabs this still works with all browsers I'm testing, except for Safari which only likes the old endpoints. If you have the possibility to run BrowserStack tests from your local machine, I'd appreciate if you could try applying these changes to see if they improve things for you. Thanks.

jandockx commented 5 years ago

@mantoni

As requested:

jandockx commented 4 years ago

This seems to no longer be an issue.