Comments (4)
Hi,
I will try to answer.
- Accessing tags.
You cannot access tags of the scenario from the step method. But maybe you can set the browser windowsize some other way? e.g. make it part of the scenario. Otherwise if you remove the tag, the scenario will fail. That actually tells me that maybe it's part of the scenario? What do you say? - Determining pass/failure result.
You cannot do that. Xunit does not have such thing as test context because they believe it's bad to share any information between various test executions. I could theoretically expose it but I hesitate to do so yet, again because I don't want to go against Xunit design guidelines. I'm curious though - why do you want to shut down the browser when the test fails? What's wrong with going to the home page regardless of failure or success?
from xunit.gherkin.quick.
Thanks for the quick reply.
-
I agree this is part of the scenario. In the past we had been using the tags as parameters to pass into a scenario. I have added another step to a step base class.
-
Determining the result of the test, I probably didn't go into enough detail. I restarted the browser on failed tests as there might be a popup in the UI or brower is mobile view and it was easier to start again with new browser instance. This does defy Xunit design guidelines to re-use the current browser over different tests but it cut's in half the execution time. The other option I have is not to dispose the browser in the steps file but at the end of the test run. Unfortunately I don't know in code when all of the tests are complete to shut the browser down. Is this possible? I have a kill any left over tasks/browsers in job outside of the test run.
In summary, we can use it as is by starting a new browser then shutting it down at the end of scenario. This is cleaner, especially when different browser sizes for different scenarios. It will just take longer but we are hoping to parallel run these in containers.
from xunit.gherkin.quick.
Okay, thanks for understanding why I follow the Xunit guidelines.
You asked how to determine that all the tests ran. You can do that using Xunit collection fixtures. Simply attach the same fixture to all feature classes. You can see an example of this here: https://github.com/xunit/samples.xunit/blob/master/CollectionFixtureExample/InsertTests.cs
Point is that the fixture gets disposed when all the corresponding tests have ran already.
I would also suggest to find a way and go to home page before every test. If there is a popup, or if it's a mobile view, then you should ensure to close the popup and reset to the default non-mobile view. Whatever it takes to reset the state, you should be doing that at the beginning of every unit test. That's how I would recommend.
I hope this helps.
from xunit.gherkin.quick.
Thanks, this has been very useful.
from xunit.gherkin.quick.
Related Issues (20)
- Fail to discover feature file if tab character is in between "And" keyword and step definition HOT 1
- Has anyone got it work in a Unity3d project? - HelpWanted HOT 14
- Pass string as list HOT 3
- Enable cucumber expressions HOT 14
- Code generator to convert Gherkin file into C# test code?
- Cannot install Xunit.Gherkin.Quick due to circular reference HOT 1
- Double are converted to integers HOT 4
- Running Feature files without compilation HOT 4
- Feature discoverable by pattern parent folder issue HOT 15
- Scenario name in spec constructor HOT 2
- Can we have an @retry attribute? HOT 8
- Exception during discovery
- Feature files not discovered by test explorer in Visual Studio v. 17.6.2 HOT 3
- Visual Studio Test Explorer unable to discover Cucumber tests. HOT 1
- 'And' step keyword add to more constraint HOT 4
- Scenario outlines don't push values into DocString objects HOT 7
- DataTable and DocString in Scenario Outline - don't inject examples by default
- Scenario Outlines parser consider less operator ("<") as a starting char of an Example and searches for a wrong instance in the table. HOT 12
- Let ignoring scenarios using multiple @ignore tags. HOT 5
- Tests aren't visible in test explorer in visual studio code HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xunit.gherkin.quick.