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

Serenity and Selenide with Cucumber4 #6

Open
SeleniumTestAB opened this issue May 8, 2019 · 5 comments
Open

Serenity and Selenide with Cucumber4 #6

SeleniumTestAB opened this issue May 8, 2019 · 5 comments

Comments

@SeleniumTestAB
Copy link

Hello,

I am trying to add Selenide Webdriver into Serenity Suite with Cucumber4. However, i am experiencing an issue with how Serenity (or maybe Cucumber4) works with browser threads.

Basically Selenide bounds it's driver (or driver we provide) to the thread pool and after calling method to open() browser it does it's workings. But after going trough a feature file the current thread is closed and Selenide with it.

My issues with that is that the application has several areas connected with each other (like big receipt that has several tabs and sections). Making each test for each section to open new browser and getting to that point is not good.

Is there a way to tell Serenity to not close current thread after each feature file? I tried serenity.restart.browser.for.each=NEVER option but it did not work. Also i setup my custom provided with:
webdriver.driver = provided
webdriver.provided.type = mydriver
webdriver.provided.mydriver = //pathToClassWithDriverSourceImplemented
serenity.driver.capabilities = mydriver

but after quick debug i see that contents of that provider are not even touched.

Regards,

@wakaleo
Copy link
Member

wakaleo commented May 8, 2019

I would advise against using a Custom driver if you can. Cucumber makes it hard to know when all the features are finished, so restart.browser.for.each=feature is about the best you can do. Which Selenide features are you after? Serenity also has very similar fluent API methods within Page Objects and action classes, which might be sufficient for your needs.

@SeleniumTestAB
Copy link
Author

My whole project and experience is based on Selenide. So mostly that, and i am sure it will not fail vs angualr applications and such. However i really like the approach of Serenity Living Documentation and i want to merge both of this worlds.

In longer answer:
Selenide and Serenity do share similar approach in writing test steps/definitions (sources) but Selenide in my point of view is more flexible than Serenity in that regard. You do not need to extend a specific class to make use of Selenide driver. You can set that driver in various methods (using their configuration variables, making custom provider or using typical setter in their WebDriverRunner). Also, since i did not use a Serenity waiters, i can only speak from Selenide perspective, their conditional waits are very efficient.

Thats about it in nutshell.

I could only suggest one thing. Making TestNG suite feature available as well in Serenity. Cucumber does support it so why not Serenity? (that is about cucumber not knowing if features did finish).

@wakaleo
Copy link
Member

wakaleo commented May 8, 2019

If you are familiar with TestNG you are most welcome to contribute a driver.

@SeleniumTestAB
Copy link
Author

I only familiar with using it. I am not an expert with its inner workings, sadly. Is there no other way?

@wakaleo
Copy link
Member

wakaleo commented Aug 19, 2019

If this is an important feature for you you can always ask your company to raise a one-offcsupport request or subscribe to a support contract (see https://johnfergusonsmart.com/serenity-bdd-mentoring).

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