Git Product home page Git Product logo

Comments (11)

chmanie avatar chmanie commented on June 24, 2024 1

Yup, I'll archive it asap.

from wdio-intercept-service.

DPGZl avatar DPGZl commented on June 24, 2024

btw, I didn't call before and beforeTest / beforeScenario functions manually, could you give a suggestion how to call these functions manually?

from wdio-intercept-service.

tehhowch avatar tehhowch commented on June 24, 2024

webdriverajax is an old version of this library, and you should not attempt to use both it and wdio-intercept-service at the same time. You also shouldn't need to invoke before / beforeScenario manually, they should be invoked by the local runner automatically if you have configured the service in wdio.conf.js correctly.

@chmanie can we get webdriverajax archived?

also @DPGZl , what version of WebdriverIO are you using?

from wdio-intercept-service.

DPGZl avatar DPGZl commented on June 24, 2024

Hi @tehhowch, thanks for your response, according to your suggestion I've removed webdriverajax from my project, and I config as services: ['intercept'], but I still run into the same error.

I'm not using webdriverio directly, instead below are the wdio related packages I'm using:

"@wdio/cli": "6.0.16",
"@wdio/junit-reporter": "^6.3.6",
"@wdio/local-runner": "6.0.16",
"@wdio/mocha-framework": "6.0.16",
"@wdio/selenium-standalone-service": "6.0.16",
"@wdio/spec-reporter": "6.0.16",
"wdio-chromedriver-service": "6.0.4",
"wdio-intercept-service": "^4.3.1",

from wdio-intercept-service.

tehhowch avatar tehhowch commented on June 24, 2024

Please upgrade from v6 to v7. The signature of the before hook changed, and the 3rd argument is now the browser object. In v6 and earlier, there is no third argument and thus the browser parameter is undefined, and shadows the global browser. This has been broken since 4cb8d0d, apparently.

If you cannot upgrade to the current LTS or higher, please open a PR to this repo that changes the "before" hook in index.js to use either the provided 3rd argument or the global, depending on the presence of the argument.

e.g.

before() {
  const browser = typeof arguments[2] === 'undefined' ? globalThis.browser : arguments[2];
  //...rest is unmodified

from wdio-intercept-service.

tehhowch avatar tehhowch commented on June 24, 2024

You don't actually have to upgrade to v7, v6.10 will suffice, as that is when the change was made to start providing browser to the before hook: webdriverio/webdriverio@22ee028

from wdio-intercept-service.

DPGZl avatar DPGZl commented on June 24, 2024

@tehhowch , you mean I need to update @wdio/cli to v6.10? (not webdriverio, right? because I'm using @wdio/cli.)

I've tried to update @wdio/cli to v6.10, but the issue still exists.

The issue is resolved when I tried to debug on my local like the example you list above, so I'm wondering if it's ok to open a PR.

from wdio-intercept-service.

tehhowch avatar tehhowch commented on June 24, 2024

@tehhowch , you mean I need to update @wdio/cli to v6.10? (not webdriverio, right? because I'm using @wdio/cli.)

I've tried to update @wdio/cli to v6.10, but the issue still exists.

The issue is resolved when I tried to debug on my local like the example you list above, so I'm wondering if it's ok to open a PR.

To update your WDIO packages, you should modify all @wdio/** entries in your package.json to be ^6.10 and then run npm i or yarn, etc.
@wdio/local-runner will be the most important one as that is the part of the framework that is running the tests and invoking the hooks, which is where the issue is occurring.

And yes, feel free to open a PR (with a test!) that restores support for WDIO 5.x, <6.10.

from wdio-intercept-service.

tehhowch avatar tehhowch commented on June 24, 2024

@DPGZl were you interested in contributing the fix?

from wdio-intercept-service.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.