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

window._webdriver_manualPoll is not a function on BrowserStack since 8.0.0 #238

Open
jandockx opened this issue Jul 19, 2021 · 1 comment

Comments

@jandockx
Copy link

I've been running BrowserStack tests with mochify for years in the F/OSS project Toryt Contracts. I just tried to upgrade dependencies, and found that, with my existing definitions in any case, this still works with version 7.1.1, but fails for all browsers starting from version 8.0.0.

contracts>npm install mochify@8.1.0

> puppeteer@10.1.0 install /Users/…/toryt/contracts/node_modules/puppeteer
> node install.js

Downloading Chromium r884014 - 113.6 Mb [====================] 99% 0.0s 
npm WARN eslint-config-standard@16.0.2 requires a peer of eslint@^7.12.1 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-standard-jsx@10.0.0 requires a peer of eslint@^7.12.1 but none is installed. You must install peer dependencies yourself.
npm WARN tsutils@3.21.0 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.

+ mochify@8.1.0
added 2 packages from 1 contributor, removed 130 packages, updated 7 packages and audited 1215 packages in 11.943s

117 packages are looking for funding
  run `npm fund` for details

found 3 high severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details
contracts>npm run wd:osx-chrome

> @toryt/contracts-v@5.0.0 wd:osx-chrome /Users/…/toryt/contracts
> mochify --wd --wd-file .min-wd-osx-chrome.js --async-polling false --reporter dot 'test/**/*Test.js'

build: manual 2021-07-19T09:25:13.577Z
# Chrome - OS X Catalina:
POST /wd/hub/session/ce9637880fbd173f8bcb5d95a7db91d5b6840c41/execute

Unexpected HTTP status: 500 Internal Server Error

server: nginx
date: Mon, 19 Jul 2021 09:25:19 GMT
content-type: application/json; charset=utf-8
content-length: 9479
connection: keep-alive
source-from: 02
expires: Thu, 01 Jan 1970 00:00:00 GMT
cache-control: no-cache, no-cache

Response Status Code: 13
Response Message:
    javascript error: window._webdriver_manualPoll is not a function
      (Session info: chrome=91.0.4472.106)
      (Driver info: chromedriver=91.0.4472.101 (af52a90bf87030dd1523486a1cd3ae25c5d76c9b-refs/branch-heads/4472@{#1462}),platform=Mac OS X 10.15.6 x86_64) (WARNING: The server did not provide any stacktrace information)
    Command duration or timeout: 11 milliseconds
    Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 17:00:58'
    System info: host: 'mac-10-144-144-71.browserstack.com', ip: '10.144.144.71', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.15.6', java.version: '1.8.0_51'
    Driver info: org.openqa.selenium.chrome.ChromeDriver
    Capabilities [{mobileEmulationEnabled=false, timeouts={implicit=0, pageLoad=300000, script=30000}, hasTouchScreen=false, platform=MAC, acceptSslCerts=false, goog:chromeOptions={debuggerAddress=localhost:56431}, acceptInsecureCerts=false, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, setWindowRect=true, webauthn:extension:largeBlob=true, unexpectedAlertBehaviour=ignore, applicationCacheEnabled=false, rotatable=false, networkConnectionEnabled=false, chrome={chromedriverVersion=91.0.4472.101 (af52a90bf87030dd1523486a1cd3ae25c5d76c9b-refs/branch-heads/4472@{#1462}), userDataDir=/var/folders/3y/zz_w6_s56sl__vcrf3r5bhzr0000hr/T/.com.google.Chrome.F9A1RA}, takesHeapSnapshot=true, pageLoadStrategy=normal, strictFileInteractability=false, databaseEnabled=false, handlesAlerts=true, version=91.0.4472.106, browserConnectionEnabled=false, proxy={}, nativeEvents=true, locationContextEnabled=true, cssSelectorsEnabled=true, webauthn:virtualAuthenticators=true}]
    Session ID: 58d41e96c6c8901d66da09cd9555cf63


Error: Unexpected HTTP status: 500 Internal Server Error

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @toryt/contracts-v@5.0.0 wd:osx-chrome: `mochify --wd --wd-file .min-wd-osx-chrome.js --async-polling false --reporter dot 'test/**/*Test.js'`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @toryt/contracts-v@5.0.0 wd:osx-chrome script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/…/.npm/_logs/2021-07-19T09_25_20_928Z-debug.log
j

Does anybody have any idea what is wrong?

jandockx added a commit to Toryt/contracts that referenced this issue Jul 19, 2021
@m90
Copy link
Collaborator

m90 commented Jul 23, 2021

More luck with debugging the issue this time: this seems to happen once mocaccino is using the rollupified bundle of Mocha that was introduced in Mocha 8.1.0. When you forcefully downgrade mocaccino to use Mocha 8.0.0 it seems to work as expected, upgrading it back to 8.1.0 breaks it, creating the window._webdriver_manualPoll is not a function error. (at least the bundling mochajs/mocha#4293 is what I would expect to be the culprit as everything else seems to be pretty unsuspicious: https://github.com/mochajs/mocha/releases/tag/v8.1.0)

I still have no idea why this is creating a problem in the WebDriver context though: when bundling the test output of min-wd and loading it up in a real browser, window._webdriver_manualPoll and siblings will be present and callable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants