PixnBits / karma-selenium-webdriver-launcher

A Karma plugin. Run tests in an instance of a Selenium Webdriver.
MIT License
5 stars 8 forks source link

Selenium 3.X ? #10

Open mmilbrath opened 7 years ago

mmilbrath commented 7 years ago

From initial testing it appears that this module also works with 3.x, any known reason not to update the dependency to also allow 3.X?

package.json ... "selenium-webdriver": "^2.44.0" ...

PixnBits commented 7 years ago

Not by me, but I haven't used this for...oof, years. @dos or @jdmarshall might be better able to comment as IIRC they use this package

jdmarshall commented 7 years ago

I'm just starting to look at this now.

You use such a thin slice of Webdriver, mostly around the builder navigation, that it probably shouldn't care what version is being used. I have some circumstantial evidence that it works fine but I'm building up a case for a PR.

PixnBits commented 7 years ago

Maybe something like "selenium-webdriver": ">=2.44.0" would be better? (Will defer to @jdmarshall's assessment)

jdmarshall commented 7 years ago

My limited assessment is that most of the 3.X changes are around promises (catch, thenCatch) and Conditions (webdriver.until.Condition -> webdriver.Condition), neither of which appear in your code. And firefox needs a supplemental binary which is clearly documented in the SW release notes, [edit] but since we're talking SauceLabs here, that's moot.

Of course, anyone who chooses 3.X may have to modify their getDriver() implementation slightly to deal with errors, but that feels like a reasonable (normal) element of an upgrade process from 2.X to 3.X of a library.

I would be tempted to suggest "selenium-webdriver": ">=2.44.0 < 4" but then this discussion will simply repeat in another six months.

dustysys commented 7 years ago

If you end up bumping the selenium-webdriver version you might need to update/append to the example in the readme. The module worked fine for me with the latest webdriver but I needed to use the Builder method for creating a driver instance(I used chrome if it makes a difference.)

By the way, out of curiosity, what is the intended use case of this package? When I tried getting it working I initially hoped it would somehow expose Selenium's automation methods while maintaining Karma's test structure, but after looking at the issues I realized this wasn't the case.

PixnBits commented 7 years ago

@dustysys My original use case was to test a browser extension, but selenium didn't allow for clicking buttons outside of the webpage (doh) so I haven't use cases to maintain this with. I'm not sure of others' uses and am frankly surprised that this (by far) the most popular npm package I started, ha ha \m/

jdmarshall commented 7 years ago

@dustysys Ah, I'd been using the builder pattern to begin with, so that explains a few things.