I have a website that opens a dialog where you can add rows of information like a spreadsheet. There is a total amount that shows in the window that adds up a column of items in the table (before the user clicks save). When the user is done editing the information, they click save, which closes the window and sends off the information to a server, which processes the data and updates the front end with more calculated values based on the data entered.
Using Gherkin, Cucumber, and nightwatch.js, I need to test the total display in the window before the user clicks save, but I also need to test the values outside of the window after the user clicks save. But from what I understand of Gherkin, having two when statements is bad practice. But if i split it up into two Scenarios, they would rely on each other.
What I have now:
Scenario: Modify data in the data window
Given the window is open
When I modify the data inside the window
Then the total amount should reflect that change
When I click save
Then the data should save
And the processed data should reflect my changes