php - Behat run again a scenario programmatically -
itemprop = "text">
After a question on staxahovarflow Ian, there was a solution nearby to deal with the parameter.
This is fine for the environment, but for the country's parameters I'm a little confused I have such a specialty:
Scenario outline: If the first link Checks if I'm on the website & lt; Country & gt; "Then I click on the first link by going to the URL" my-url ": Example: | Country | | United States | IT | I have it, and now I do something like that I want to:
env = "stg" country = "US, IT" php53 bin / Behat --suite = mySuite but a scenario outline Together, the entire scenario is run for each country. I want to do the same thing, but with a list of criteria in the country.
It may be that after the hook, Can I again run my whole scenario with a different configuration?
Thanks!
This is unfortunately not possible with standard equipment, without at least one headache and rewinding the wheel, though an interesting question!
You can change your behat.yml You can do this by configuring suites in . You have a basic suite with basic configuration and a Suits should be: default: Extension: Biht \ Mink extension suites: default: Path: [â ??] Re: [A ?? |] America: Path: [A ?? |] Reference: [A | | |] IT: Path: [One | |] Reference: [â ?? |] and use a @beforeSuite hook: / ** * @beforeSuite * * @Param FirstSiteScope $ scope * / Public static function set upsite (BeforeSuiteScope $ scope) {$ SuiteName = $ scope-> GetSpecificationIterator () - & gt; GetSuite () - & gt; GetName (); // If the suit shows one of the languages, set it as the main language} There are some consents in this solution:
- You can not use the suite for anything other than languages.
- Too many configurations duplicated.
- Setting language from hook will be a pain. You probably will need to store it as a static asset and before it is sent every mining request will have to pass it in the header, so that your server knows which language to use. Anyway, you should have another hook for that hook, this is another story of pain.
Another solution that comes to mind, is to use only another PHP / Bash script which will run the beat with the country ultimately. There is also some dispute in this:
- If you use different extremists every time, then you probably have to add logic to them to be lost.
-
-
- You still need to pass that app to your app in some way, but should work on the above suggestions.
As you see, this is not a trivial thing. Personally, I have a good faith in the second solution, although it can be over time, it also gives space for many adaptations. On another hand, unless you have completely different content / logic for each country, you may not need to go into such extremities. By doing some targeted testing that the language can be changed and the change in the expected form should be sufficient. Once again, tests for 40 countries will take some time and no significant value will be added.
Comments
Post a Comment