I have done a lot of R&D on this but I am unable to find a solution.
I need to maintain a login session between different scenarios in a single feature file.
I have made a function I am logged in
and I have written in background. so at the start of every scenario the login happens. but what I want is to maintain a single login session across the scenarios.
Can anyone suggest?
example Code is:
Feature: To test the output
Background:
Given I am logged in
@javascript
Scenario: To test the positive input
When I fill in "test" with "aab"
And I press "add"
Then I should see "welcome"
@javascript
Scenario:To test the negative inputs
When I fill in "test" with "@#$@!!111"
And I press "add"
Then I should see "Sorry,invalid input please try again"
Now if another person reviews my code he would come to know about the positive and negative test cases. but every time the scenarios are reloaded, what if I have 50 scenarios in a feature. for bigger projects. it doesn't look good at every scenario I log in and I waste extra 15 minutes in total. what I want is after every scenario in a single feature file, the test continues with the same login session.