-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add new scenarios to feature file revert ui-driven test changes update feature with new tests add step structure and helper
- Loading branch information
Showing
8 changed files
with
190 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
Feature: Demo user access | ||
|
||
Background: | ||
Given I am a user with a demoUser role | ||
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 | | ||
| 1 | Open Systems Lab | open-systems-lab | | ||
| 29 | Templates | templates | | ||
| 30 | Open Digital Planning | open-digital-planning | | ||
| 32 | Demo | demo | | ||
| 45 | Other Team | other-team | | ||
|
||
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 specific teams | ||
When I am on the Teams page | ||
Then I can only see team with id: "<ID>" | ||
|
||
Examples: | ||
| ID | | ||
| 1 | | ||
| 29 | | ||
| 30 | | ||
| 32 | | ||
|
||
@demo-user-permissions | ||
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 | ||
Scenario Outline: Creating a new flow in other teams | ||
When I am in the "<TEAM>" team | ||
Then I should not be able to create a flow | ||
|
||
Examples: | ||
| TEAM | | ||
| templates | | ||
| open-systems-lab | | ||
| open-digital-planning | | ||
|
||
@demo-user-permissions | ||
Scenario Outline: Actioning my own flows | ||
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: 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 to team settings | ||
|
||
Examples: | ||
| TEAM | | ||
| templates | | ||
| open-systems-lab | | ||
| open-digital-planning | |
Empty file.
22 changes: 22 additions & 0 deletions
22
e2e/tests/api-driven/src/demo-workspace/steps/background_steps.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Given } from "@cucumber/cucumber"; | ||
|
||
Given('I am a user with a demoUser role', async function () { | ||
// Write code here that turns the phrase above into concrete actions | ||
return 'pending'; | ||
}); | ||
|
||
Given('I have two users in the database:', async function (dataTable) { | ||
// Write code here that turns the phrase above into concrete actions | ||
return 'pending'; | ||
}); | ||
|
||
Given('I have the following teams in the database:', async function (dataTable) { | ||
// Write code here that turns the phrase above into concrete actions | ||
return 'pending'; | ||
}); | ||
|
||
|
||
Given('I have the following flows in the database:', async function (dataTable) { | ||
// Write code here that turns the phrase above into concrete actions | ||
return 'pending'; | ||
}); |
26 changes: 26 additions & 0 deletions
26
e2e/tests/api-driven/src/demo-workspace/steps/navigation_steps.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { When } from "@cucumber/cucumber"; | ||
|
||
When('I am on the Teams page', async function () { | ||
// Write code here that turns the phrase above into concrete actions | ||
return 'pending'; | ||
}); | ||
|
||
When('I am in the Demo team', async function () { | ||
// Write code here that turns the phrase above into concrete actions | ||
return 'pending'; | ||
}); | ||
|
||
When('I am in the {string} team', async function (string) { | ||
// Write code here that turns the phrase above into concrete actions | ||
return 'pending'; | ||
}); | ||
|
||
When('I am on my own flow', async function () { | ||
// Write code here that turns the phrase above into concrete actions | ||
return 'pending'; | ||
}); | ||
|
||
When('I want to edit a flow that I did not create', async function () { | ||
// Write code here that turns the phrase above into concrete actions | ||
return 'pending'; | ||
}); |
47 changes: 47 additions & 0 deletions
47
e2e/tests/api-driven/src/demo-workspace/steps/verification_steps.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { Then } from "@cucumber/cucumber"; | ||
|
||
Then('I should be able to create a flow', async function () { | ||
// Write code here that turns the phrase above into concrete actions | ||
return 'pending'; | ||
}); | ||
|
||
Then('I should not be able to create a flow', async function () { | ||
// Write code here that turns the phrase above into concrete actions | ||
return 'pending'; | ||
}); | ||
|
||
Then('I should have access to flow settings', async function () { | ||
// Write code here that turns the phrase above into concrete actions | ||
return 'pending'; | ||
}); | ||
|
||
|
||
Then('I should not have access to team settings', async function () { | ||
// Write code here that turns the phrase above into concrete actions | ||
return 'pending'; | ||
}); | ||
|
||
Then('I should not have access to modify the flow', async function () { | ||
// Write code here that turns the phrase above into concrete actions | ||
return 'pending'}); | ||
|
||
Then('I should be able to {string} the flow', async function (string) { | ||
// Write code here that turns the phrase above into concrete actions | ||
return 'pending'; | ||
}); | ||
|
||
Then('I can only see team with id: {string}', async function (string) { | ||
// Write code here that turns the phrase above into concrete actions | ||
return 'pending'; | ||
}); | ||
|
||
Then('I should only see flows with ids {string}', async function (string) { | ||
// Write code here that turns the phrase above into concrete actions | ||
return 'pending'; | ||
}); | ||
|
||
|
||
Then('I should not see flow with id {string}', async function (string) { | ||
// Write code here that turns the phrase above into concrete actions | ||
return 'pending'; | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,28 +46,6 @@ export const contextDefaults: Context = { | |
}, | ||
}; | ||
|
||
export const demoContext: Context = { | ||
user: { | ||
firstName: "Demo", | ||
lastName: "demo", | ||
email: "[email protected]", | ||
isPlatformAdmin: false, | ||
}, | ||
team: { | ||
name: "E2E Test Team", | ||
slug: "E2E", | ||
theme: { | ||
logo: "https://raw.githubusercontent.com/theopensystemslab/planx-team-logos/main/planx-testing.svg", | ||
primaryColour: "#444444", | ||
}, | ||
settings: { | ||
homepage: "planx.uk", | ||
submissionEmail: "[email protected]", | ||
}, | ||
}, | ||
}; | ||
|
||
|
||
export async function setUpTestContext( | ||
initialContext: Context, | ||
): Promise<Context> { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters