Skip to content

Commit

Permalink
add step structure and helper
Browse files Browse the repository at this point in the history
  • Loading branch information
RODO94 committed Nov 5, 2024
1 parent c44a90e commit 51573c1
Show file tree
Hide file tree
Showing 6 changed files with 137 additions and 364 deletions.
74 changes: 42 additions & 32 deletions e2e/tests/api-driven/src/demo-workspace/demoUser.feature
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
Feature: Demo user access
Feature: Demo user access

Background:
Given I am a user with a demoUser role
And I have the following flows in the database:
| id | creator_id | name | team_id |
| 1 | 1 | Test Flow 1 | 32 |
| 2 | 1 | Test Flow 2 | 32 |
| 3 | 2 | Other Flow | 45 |
And I have two users in the database:
| id | first_name | last_name | email |
| 1 | Demo | User | demo.user@email.com |
| 2 | Nota | Demo | nota.demo@email.com |

And I have the following teams in the database:
| id | name | slug |
Expand All @@ -15,20 +14,23 @@ Feature: Demo user access
| 30 | Open Digital Planning | open-digital-planning |
| 32 | Demo | demo |
| 45 | Other Team | other-team |
And I have two users in the database:
| id | first_name | last_name | email |
| 1 | Demo | User | demo.user@email.com |
| 2 | Nota | Demo | nota.demo@email.com |

@demo-user-permissions
Scenario Outline: I can only view my own flows
When I am on the Demo team
Then I only see my own flows
And I have the following flows in the database:
| id | creator_id | name | team_id |
| 1 | 1 | Test Flow 1 | 32 |
| 2 | 1 | Test Flow 2 | 32 |
| 3 | 2 | Other Flow | 45 |

@demo-user-permissions
Scenario: I can only view my own flows
When I am in the Demo team
Then I should only see flows with ids "1, 2"
And I should not see flow with id "3"

@demo-user-permissions
Scenario Outline: I can only view 4 teams
Scenario Outline: I can only view specific teams
When I am on the Teams page
Then I can only see teams with these "<ID>"
Then I can only see team with id: "<ID>"

Examples:
| ID |
Expand All @@ -38,13 +40,13 @@ Feature: Demo user access
| 32 |

@demo-user-permissions
Scenario Outline: Creating a new flow in the Demo team
When I am in the "Demo" team
Scenario: Creating a new flow in the Demo team
When I am in the Demo team
Then I should be able to create a flow

@demo-user-permissions
@demo-user-permissions
Scenario Outline: Creating a new flow in other teams
When I am in the team "<TEAM>"
When I am in the "<TEAM>" team
Then I should not be able to create a flow

Examples:
Expand All @@ -53,33 +55,41 @@ Feature: Demo user access
| open-systems-lab |
| open-digital-planning |

@demo-user-permissions
@demo-user-permissions
Scenario Outline: Actioning my own flows
When I am in the "Demo" team
And I am on a flow I have created
When I am in the Demo team
And I am on my own flow
Then I should be able to "<ACTION>" the flow

Examples:
| ACTION |
| update |
| delete |

@demo-user-permissions
Scenario Outline: Actioning flows in other teams
When I am in the "<TEAM>" team
And I want to edit a flow that I did not create
Then I should not have access to modify the flow

Examples:
| TEAM |
| templates |
| open-systems-lab |
| open-digital-planning |

@demo-user-permissions
Scenario Outline: Accessing flow settings
When I am on my own flows
Then I should have access
Scenario: Accessing flow settings
When I am on my own flow
Then I should have access to flow settings

@demo-user-permissions
Scenario Outline: Editing team settings

When I am in the team <"TEAM">
Then I should not have access
When I am in the "<TEAM>" team
Then I should not have access to team settings

Examples:
| TEAM |
| templates |
| open-systems-lab |
| open-digital-planning |


| open-digital-planning |
Empty file.
Loading

0 comments on commit 51573c1

Please sign in to comment.