Skip to content
This repository has been archived by the owner on Apr 20, 2021. It is now read-only.

Way to easy adjust lots of wait for 'element' #250

Open
Trogie opened this issue May 8, 2018 · 2 comments
Open

Way to easy adjust lots of wait for 'element' #250

Trogie opened this issue May 8, 2018 · 2 comments

Comments

@Trogie
Copy link

Trogie commented May 8, 2018

Hello,

I am using the behatch browser context a lot. Thanks for the great work!

But because I got lots of different production/staging/dev websites with different languages and/or texts for elements.

So when I want to use the same scenarios for different sites it's sometimes pretty hard to maintain.

For example on site A I wait for a "text a", on site B the text is "text b"

I usually have my application contexts in the behat configuration default suites defined. The different sites on profile level in behat.yml

so quick write:
suites: default: projectA: paths: - ... contexts: - behatch:context:browser projectB: ... siteA: base_url: siteA.com ... siteB: base_url: siteB.org
When I start behat I precify the suite and profile to be able to run my scenarios/suites against diffent sites/profiles.

But then I need to find a good way to 'translate' the texts of forexample iWaitUntilISee():
SiteA: Then I wait until I see "text A"
SiteB: Then I wait until I see "text B"

I am not the big OO programmer so If I am wrong correct me please: I thought on extending the browsercontext and overwriting iWaitUntilISee function so it checks for a certain parameter/text value in the profile section, uses that to wait for, or else use it's parent function?
Would that be the right way?

@sanpii
Copy link
Member

sanpii commented May 8, 2018

Hello,

I thought on extending the browsercontext

I don’t see alternative.

and overwriting iWaitUntilISee function

Instead of overwriting iWaitUntilSee you can create a new function likes I wait until I see the site title (who uses iWaitUntilSee internaly) and take from configuration the site title.

@Trogie
Copy link
Author

Trogie commented May 9, 2018

Hmmm, yes I see your point.

The problem is that I already feel I have too much almost the same functions or steps. And for the non-programmer-testers who write gherkin scenarios too sometimes it's getting even more difficult...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants