-
Notifications
You must be signed in to change notification settings - Fork 282
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
Make usable as a library #12
Comments
@geekdenz thanks for putting your efforts to contribute this library |
@geekdenz can you provide examples/tests using selenium-cucumber-java as a library? |
I will create a sample project soon. |
Here you go: https://github.com/geekdenz/selenium-cucumber-java-examples Hope it works for you. It seems to work fine on Linux. For Windows and MacOS you may need to download the OS's web drivers for Firefox etc. |
@geekdenz I ran the example, its not picking up pre-defined steps from library as it showing steps not implemented errors. |
@sameer49 This is bizarre since it works perfectly for me. Are you using ./gradlew on Linux? |
No I am using on Windows
And with maven as well same issue
…On Sep 8, 2017 11:45 AM, "Tim-Hinnerk Heuer" ***@***.***> wrote:
@sameer49 <https://github.com/sameer49> This is bizarre since it works
perfectly for me. Are you using ./gradlew on Linux?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#12 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHSlNJxXxUcab5-X44bBcqzgOpiZr9Gdks5sgNtkgaJpZM4PMQPm>
.
|
Can you please try with gradlew? It works even when you don't have it installed and gradle is more powerful than maven. Android uses it as its default build system and it has a Turing complete scripting language in the bills tool. You will need the driver in the same directory on windows. I can look into making it work with Maven later maybe, although I don't know why you would use maven over gradle tbh. |
If you really want to use Maven, you need to look at the test task in the build.gradle file for its parameters to make it work and possibly write a maven plugin if it doesn't support the same options with xml or an existing plugin. |
I tried with gradle as well
Actually its not build issue its not able to link pre defined step
definitions from library.
…On Sep 8, 2017 6:48 PM, "Tim-Hinnerk Heuer" ***@***.***> wrote:
Can you please try with gradlew? It works even when you don't have it
installed and gradle is more powerful than maven. Android uses it as its
default build system and it has a Turing complete scripting language in the
bills tool. You will need the driver in the same directory on windows. I
can look into making it work with Maven later maybe, although I don't know
why you would use maven over gradle tbh.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#12 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHSlNPzx-i34xJ7wAynRgWS3phJmP0WAks5sgT6lgaJpZM4PMQPm>
.
|
Hi @sameer49 Yeah, sorry but I assumed it would work on Windows as well, which it doesn't. It does work on Linux though, which is weird since it is Java and supposedly cross-platform. I'm looking into what might be the problem but I am getting an exception when I try to run the tests on Windows. How did you manage to get it to a state where the tests were suggested? I don't even get that far on Windows. It fails when it tries to connect to the browser driver, although I have it in the folder. Could you post in more detail the errors you are getting, please? |
Hi @sameer49 I think it should work now also on Windows. Did some cleanup of how the DriverUtil is used to ensure there is only one instance used. Can you please try again on Windows with Gradle? |
okay |
following error I got when try to run with gradle. tk.landcare.sampletests.TestRunner STANDARD_OUT
tk.landcare.sampletests.TestRunner > Scenario: I am learning selenium-cucumber.classMethod STARTED tk.landcare.sampletests.TestRunner > Scenario: I am learning selenium-cucumber.classMethod STANDARD_OUT When I run using maven it opens multiple instance of browser and at end it shows all test steps as pass but scenario fail. Failed scenarios: 1 Scenarios (1 failed) java.lang.NoSuchMethodError: env.DriverUtil.closeDriver()V |
@geekdenz it working now, in my project few files ware outdated |
Soon after I published this to a Maven repository, I noticed, that one cannot use this as a library. I've changed my own fork a lot and after a lot of googling and browsing through the Cucumber Java source code found that it is indeed possible to use the step definitions from this library:
https://github.com/geekdenz/selenium-cucumber-java/blob/fb23d90fee928718458370d4f9922bf46c937b20/src/test/java/stepDefintions/RunCukeTest.java#L13
Also see the README:
https://github.com/geekdenz/selenium-cucumber-java/blob/master/README.md#using-canned-tests-in-your-project
You are more than welcome to merge these changes in. I also made it so that if a test fails, it makes a screenshot and puts it into the directory with the scenario ID.
Also, I made the headless Firefox the default driver, so this can be used on a build server. For this some libraries may need to be installed:
The text was updated successfully, but these errors were encountered: