How to fix unordered scenario & steps execution in Nunit 3 logs and make them ordered - bdd

E.g. I have four scenarios in two different features files as below.
Feature 1:
Scenario 1 : Validate title
Given I am logged in application
And I verify the title
Scenario 2: Verify book checkout
Given I am logged in application
And I select 2 books
Feature 2:
Scenario 1: Verify search books
Given I am logged in application
And I search books
When the above scenarios are executed in pipeline using Nunit3-console.exe and parallel execution, all scenarios are started at the same time but execution logs are not ordered. See below.
Scenario 1: Validate title
Given: I am logged in application
Scenario 2: Verify book checkout
Given I am logged in application and so on..
It is clear that Scenario 1 and 2 steps execution logs are not ordered. They are randomly displayed

Related

SpecFlow: To run feature file with multiple scenarios several times with different parameters

I'm wondering why we can run Scenario several times with different parameters but cannot run whole feature file with different parameters.
Our feature files consists of many scenarios and feature file corresponds to Test Case, but when we need to run the same feature file, but with different parameter(s) then whole feature file has to be duplicated... Is there any possibility to parametrize whole feature file?
I don't know whether you are aware of the Scenario Outline.
The Scenario Outline keyword can be used to run the same Scenario
multiple times, with different combinations of values
Copying and pasting scenarios to use different values quickly becomes tedious and repetitive as shown in the below example:
Scenario: Successful Login with Valid Credentials
Given User is at the Home Page
And Navigate to LogIn Page
When User enter "testuser_1" and "Test#123"
And Click on the LogIn button
Then Successful LogIN message should display
Scenario: Successful Login with Valid Credentials
Given User is at the Home Page
And Navigate to LogIn Page
When User enter "testuser_2" and "Test#153"
And Click on the LogIn button
Then Successful LogIN message should display
We can collapse these two similar scenarios into a Scenario Outline.
Scenario outlines allow us to more concisely express these scenarios through the use of a template with < > - delimited parameters:
Scenario Outline: Successful Login with Valid Credentials
Given User is at the Home Page
And Navigate to LogIn Page
When User enter <username> and <password>
And Click on the LogIn button
Then Successful LogIN message should display
Examples:
| username | password |
| testuser_1 | Test#123 |
| testuser_2 | Test#153 |
A Scenario Outline must contain an Examples (or Scenarios) section. Its steps are interpreted as a template which is never directly run. Instead, the Scenario Outline is run once for each row in the Examples section beneath it (not counting the first header row).
The steps can use <> delimited parameters that reference headers in the examples table. Cucumber will replace these parameters with values from the table before it tries to match the step against a step definition.

Cucumber -Run scenario only once

I am looking for a solution for the following scenario.
I am writing the cucumber-capybara tests for the Ruby on Rails application.
I have multiple cucumber feature file with several scenarios (say Scenario B...Z) which are dependent on one particular scenario (say Scenario A). I want to run the scenario only once for all the scenarios which are dependent on it.
So if i run the scenarios (B....Z) I wanted to run the dependent scenario (A) only once. I came across Before hook in cucumber but it will run once for every scenario.
I have one feature file and in that there is one scenario which provisions a server. (Scenario A)
I have multiple other feature files and multiple scenarios (Scenario B..Z) which will run the tests assuming that the server is actually provisioned (Scenario A)
So whenever someone runs the dependent scenarios (Scenario B..Z ), it should check if server is provisioned by some other scenario then it should not try to provision the server. As it will increase the no.of servers.
You could write a feature with scenario A, and then write a Given block which will set the initial expectation for what scenario A is about, Then you can call that before scenario B..Z
So, assuming scenario A is to sign in, then write a single feature for signing in, and then for scenario B to Z, you write a given block that set a user as signed-in, and use that as:
Given user is signed in
...
where Given user is signed in is defined like:
Given /^user is signed in$/ do
# code to sign a user in
end

TFS 2015 test case Web UI does not display data in columns

I have a few users who are not able to see the Details of test cases.
They can see the test plans. The test plan is Active.
They do not have permission to create test cases but they should be able to see them and run them. Some of the test cases in the test plan have a state of Ready. Some have a state of design.
The users have access to see and run tests but their display looks like this:
If they try to run the test case they get the message "You cannot run the selected tests. The test case no longer exists. " which is clearly wrong because I and other users can see the test.
The users in question have visibility to the area and iterations.
I'm stumped and I'm sure it's something simple. Why is all of the column data blank?
This can be an issue with area-path permissions. Even though I see that you have mentioned "The users in question have visibility to the area and iterations", I'd like you to try this simple task:
Ask the user who is not able to see the tests in Test hub to head over to the Work hub and write a simple work item query to see if she can access those test case work items in Work hub. You can find out the test case work item IDs from someone who is able to see the test case work items in this test plan. Or you can write a generic query for all test case work items and see of the test case work items that have gone missing in Test hub are showing up in Work hub.
If you are not able to access the test case work items in Work hub, then its an area path permissions issue. If not, I'll be glad to ask someone on my team to look into this. Please reach out to us at devops_tools#microsoft.com
Thanks,
Manoj
It was indeed a problem with the areas. But not in the project in question.
The test cases in question pulled in from a different project. Everything looked normal if you opened the test case. No errors about invalid area paths. And all the permissions on the project looks ok. The user had all appropriate permissions. If just wasn't until I added up all the pieces I saw the disconnect.,

jira script runner script that counts 2 statuses or fields togheter

i want to count how many issues are in status open, and in verify (our custom flow) per day.
if today 3 issues entered into status open, and 3 entered into status verify i would like to see the result of that field saying 6.
now sure how the script should be done in SCRIPT RUNNER.
thanks guys =)
It would help if you could tell what you want to solve. JIRA allows you to define filters, that will give all the time as result a list of issues found. You can then define / use reports and / or gadgets on dashboards to display the data based on those filters.
So a solution could be:
Define a filter that searches for the issues. Something like project = XYZ AND status in (open, verify).
Save that filter under a name (e.g. "Open and verified").
Use that filter then in a gadget that displays the issues as chart, ...

Cucumber Background and persisting Scenarios (or prerequisites)

I had this problem Cucumber scenarios for extremely long work flow
And now I've been writing isolated scenarios for each of a long series of multi-part form steps. I have a Background section that sets up each Scenario. But now when I run the entire feature, cucumber wants to repeat the Background for each Scenario. I want to test a Scenario that builds off of all the previous ones.
Here is the bare outline of what my feature looks like:
Feature: Submit a manuscript
In order to complete a manuscript submission
As a corresponding author
I want to complete the to-do list
Background:
Given I am logged in as "Steve"
And an article_submission "Testing Web Apps" exists
And "Steve" is a "Corresponding Author" for "Testing Web Apps"
And I am on the manuscript to-do list page for "Testing Web Apps"
Scenario: Steve suggests reviewers for his manuscript
...
Scenario: Steve completes the manuscript fees to-do item
...
Scenario: Steve wants to add Barbara as a co-author
...
Scenario: Steve uploads necessary files
...
Scenario: Steve edits the fees page and general information page
...
Scenario: Steve re-uploads the manuscript file
...
Scenario: Steve completes the Copyright Transfer
...
Scenario: Steve completes Author Responsibilities & Agreement
...
# These scenarios depend on all the previous ones having run
Scenario: Steve Completes submission
...
Scenario: Steve goes back and make changes
...
Scenario: Steve fills out payment page
Is there are way to require previous scenarios to be run? And is there a way of running the Background only once?
I decided to "freeze" the application in the state it was immediately after running the Feature. I did this by adding hooks that dump and load the databse.
In features/support/hooks.rb I have:
After('#complete-submission') do
# Dump the database
exec "mysqldump -u root --password=### onc_test > #{Rails.root}/support/submission.sql"
end
Before('#load-submission') do
# Load the database
exec "mysql -u root --password=### onc_test < #{Rails.root}/support/submission.sql"
end
This is working basically, except the #load-submission fails mysteriously to run the Scenario, but the database is loaded. So I have to run it again without the tag. Maybe someone can help me figure that own out.

Resources