I'm stuck at a bit of a quandary trying to figure out the best way of structuring my CRUD tests. Within my application users have the ability to create several types of 'tasks'. My currently implementation looks something like the following:
Scenario: Create Task-Type A
Given I am on a user's profile page
And Have access to create tasks
When I create a new task with a unique title and description
Then The confirmation prompt should display
Scenario: Read the Task-Type A
Given A new task was created
When I search the text on the page for the unique title
Then I should find the task
And All the details of the task should match what was created
Scenario: Update the Task-Type A
Given A task exists
And I have opened the edit dialog
When I make the following changes:
| title | description | date | save |
| "" | "" | "" | yes |
Then all the saved changes should match the task details
Scenario: Delete the Take-Type A
Given A task exist
When I select the option to delete
And I confirm deletion process
Then The Task should no longer exist in the list
The reason I'm looking for help here is because I'm having trouble controlling execution order of the CRUD steps. I'm using Specflow and NUnit which executes the scenarios in alphabetical order rather than the order they appear in the feature file. Which results in this order C > D > R > U, which of course crashes and burns when run.
I tried adding characters to the beginning of the scenario name, resulting in something like this "Scenario: Phase 1 Create...", "Scenario: Phase 2 Read...", and so on. But as I was making this change I could not help but thinking how 'hack-ish' it felt. I've done some research but have for the most part come up empty on a better way to control the execution order.
I do have multiple of these CRUD tests to write; one for each type of 'task' and I'm wondering would it be better to try and condense the entire CRUD stack into a single scenario so I don't have to worry about execution order or is there a better way to control the execution?