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

PHANTOMJS_RESOURCE hardcoded, 1.9.8 not working #28

Open
FibreFoX opened this issue Oct 23, 2017 · 7 comments
Open

PHANTOMJS_RESOURCE hardcoded, 1.9.8 not working #28

FibreFoX opened this issue Oct 23, 2017 · 7 comments

Comments

@FibreFoX
Copy link

With older 1.9.x versions of PhantomJS, the binary is NOT inside some "BIN"-folder within the JAR-archive.

Stacktrace:

java.io.FileNotFoundException: cannot find file: bin/phantomjs.exe in archive: C:\Users\someuser\.m2\repository\org\jboss\arquillian\extension\arquillian-phantom-binary\1.9.8\arquillian-phantom-binary-1.9.8-windows.jar
	at org.jboss.arquillian.phantom.resolver.FileUtils.extract(FileUtils.java:38)
	at org.jboss.arquillian.phantom.resolver.maven.MavenPhantomJSBinaryResolver.resolveFreshExtracted(MavenPhantomJSBinaryResolver.java:70)
	at org.jboss.arquillian.phantom.resolver.maven.MavenPhantomJSBinaryResolver.resolve(MavenPhantomJSBinaryResolver.java:56)
	at org.jboss.arquillian.phantom.resolver.ResolvingPhantomJSDriverService.resolveBinary(ResolvingPhantomJSDriverService.java:99)
	at org.jboss.arquillian.phantom.resolver.ResolvingPhantomJSDriverService.createDefaultService(ResolvingPhantomJSDriverService.java:52)

How can PHANTOMJS_RESOURCE be overridden/changed? Do I need to use an older version of arquillian-phantom-driver for using older phantomjs-versions?

@FibreFoX FibreFoX changed the title PHANTOMJS_RESOURCE hardcoded, 1.9.7 not working PHANTOMJS_RESOURCE hardcoded, 1.9.8 not working Oct 23, 2017
@MatousJobanek
Copy link
Contributor

Yeah, if you want to use an older version of PhantomJS you need to use the respective version of arquillian-phantom-driver that is compatible with it

@FibreFoX
Copy link
Author

Your readme states this:

// enforce resolver to use given phantomjs version
capabilities.setCapability("phantomjs.binary.version", "2.1.1");

This makes me assume that I can use arquillian-phantom-driver with older versions. By adding some custom-field for users to adjust the location makes it zip-archive-agnostic.

So the solution you are suggesting is to use an older version? Is there a table where I can see which versions is suggested for PhantomJS 1.9.8?

@MatousJobanek
Copy link
Contributor

well, yeah this property specifies which version of PhantomJS binary should be fetched, but the internal logic has been changed to reflect the latest version without taking care of backward compatibility. Looking at the code, the compatible version of arquillian-phantom-driver with your version should be 1.1.4.Final
It shouldn't be so difficult to change the logic to provide the backward compatibility also in the latest version - so you could use the same release for all PhantomJS versions.
If you provide a PR that would help you with using this project in your test suite, then I would merge it and release a new patch version 1.2.1.2

@FibreFoX
Copy link
Author

Seems to be not the only problem, as there is no linux-binary for PhantomJS 2.0.0, so even when having a way to adjust to location inside the ZIP-file, it would fail. Is this a know problem, that there is no linux-binary for 2.0.0?
There is even another "internal logic change", as far as I can see the maven-artifacts for version 1.9.0 do not have compatible classifier.

This makes me thinking about not creating some PR for changing this (or adding some adjustment-feature), but for just adding some note/compatibility-matrix to the README.

How do you think about this @MatousJobanek ?

@MatousJobanek
Copy link
Contributor

As for the PhantomJS 2.0.0 for linux - there hasn't been any binary available ever - ariya/phantomjs#12948 so we didn't try to make the arquillian-phantom-driver to be compatible with this version. In other words, there hasn't been any release of the arquillian-phantom-binary for this version released.
If the problem with the classifiers is only for 1.9.0 then I would just make a note in the README.

May I have a question? Which project/framework do you use for writing the UI tests? This is "only" for getting the binary, so I'm asking what do you use for getting it into the code. Do you use Arquillian Drone with Graphene or something else?

@FibreFoX
Copy link
Author

So this will end up in some "readme-only" pull-request, I can live with that.

Actually we are using this for cucumber-tests to check some internal customer project. Plan was to boot some webdriver-instance (it was phantomjs) and then execute our cucumber-magic, without any other arquilian-magic. (Personally I do like your stuff, using it as often as I can, but this project does not need it, yet).

As working with PhantomJS is a pain to itself (old, lots of bugs, not maintained anymore), I started some (yet unfinished) project, which downloads Chromium and Webdriver: https://github.com/FibreFoX/headless-cr24

@MatousJobanek
Copy link
Contributor

Unfortunately, there is no @ClassRule or @Rule for the Drone functionality. I'd love to have it, but I haven't had time to implement it yet. As for downloading of the webdriver binaries, I have it in Drone implemented. Check this part of the doc for more information how it works, and this package if you want to reuse some code. Here you can see how it is used for Chrome.

The reason why I had asked is that I don't use arquillian-phantom-driver project anymore as I have it implemented directly inside of the Drone

if you send the PR with the change of the README, I'll be happy to merge it to provide more information to any other user

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