I need create e2e test for the my angular 5 application. We're using cucumber and protractor.
I have concrete list steps which i should do at the beginning some scenarios.
This is an example:
Scenario: I need do process below before some scenarious
Given I load a html page
When I filling the form
| name | testname|
| gender | male|
| date | 08/18 |
| surmane | TestSurname |
And I click the checkbox
And I click the "SAVE AND CONTINUE" button
And I submit the details
Then I should be redirected to the second page
Then at the beginning other scenarios i need done the same steps from 1-st scenario.
Scenario: Scenario 2 - i need the same from scenario 1
Given All steps from scenario 1 done and i redirected to the second page
...
Scenario: Scenario 3 - i need the same from scenario 1
Given All steps from scenario 1 done and i redirected to the second page
...
Is there solution to put all steps into one scenario and use it?
How to create a "Before" hook for this? e.g.
Before('@copyScenario', () => {
//.......list of steps
});
I do not want copy/paste it...any ideas?