diff --git a/e2e/tests/api-driven/src/demo-workspace/demoUser.feature b/e2e/tests/api-driven/src/demo-workspace/demoUser.feature index a01ad8a463..679fd1a845 100644 --- a/e2e/tests/api-driven/src/demo-workspace/demoUser.feature +++ b/e2e/tests/api-driven/src/demo-workspace/demoUser.feature @@ -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 | @@ -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 "" + Then I can only see team with id: "" Examples: | ID | @@ -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 "" + When I am in the "" team Then I should not be able to create a flow Examples: @@ -53,10 +55,10 @@ 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 "" the flow Examples: @@ -64,22 +66,30 @@ Feature: Demo user access | update | | delete | + @demo-user-permissions + Scenario Outline: Actioning flows in other teams + When I am in the "" 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 + Then I should not have access to team settings Examples: | TEAM | | templates | | open-systems-lab | - | open-digital-planning | - - + | open-digital-planning | \ No newline at end of file diff --git a/e2e/tests/api-driven/src/demo-workspace/helper.ts b/e2e/tests/api-driven/src/demo-workspace/helper.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/e2e/tests/api-driven/src/demo-workspace/steps.ts b/e2e/tests/api-driven/src/demo-workspace/steps.ts deleted file mode 100644 index df70a8af6d..0000000000 --- a/e2e/tests/api-driven/src/demo-workspace/steps.ts +++ /dev/null @@ -1,332 +0,0 @@ - - Given('I am a user with a demoUser role', async function () { - // Write code here that turns the phrase above into concrete actions - return 'pending'; - }); - - - When('I am on the Demo team', async function () { - // Write code here that turns the phrase above into concrete actions - return 'pending'; - }); - - - Then('I only see my own flows', async function () { - // Write code here that turns the phrase above into concrete actions - return 'pending'; - }); - - - - Given('I am a user with a demoUser role', async function () { - // Write code here that turns the phrase above into concrete actions - return 'pending'; - }); - - - - When('I am on the Teams page', async function () { - // Write code here that turns the phrase above into concrete actions - return 'pending'; - }); - - - Then('I can only see teams with these {string}', async function (string) { - // Write code here that turns the phrase above into concrete actions - return 'pending'; - }); - - Given('I am a user with a demoUser role', async function () { - // Write code here that turns the phrase above into concrete actions - return 'pending'; - }); - - When('I am on the Teams page', async function () { - // Write code here that turns the phrase above into concrete actions - return 'pending'; - }); - - - Then('I can only see teams with these {string}', async function (string) { - // Write code here that turns the phrase above into concrete actions - return 'pending'; - }); - - - Given('I am a user with a demoUser role', async function () { - // Write code here that turns the phrase above into concrete actions - return 'pending'; - }); - - - When('I am on the Teams page', async function () { - // Write code here that turns the phrase above into concrete actions - return 'pending'; - }); - - Then('I can only see teams with these {string}', async function (string) { - // Write code here that turns the phrase above into concrete actions - return 'pending'; - }); - - Given('I am a user with a demoUser role', async function () { - // Write code here that turns the phrase above into concrete actions - return 'pending'; - }); - - When('I am on the Teams page', async function () { - // Write code here that turns the phrase above into concrete actions - return 'pending'; - }); - - - Then('I can only see teams with these {string}', async function (string) { - // Write code here that turns the phrase above into concrete actions - return 'pending'; - }); - - Given('I am a user with a demoUser role', 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'; - }); - - Then('I should be able to create a flow', async function () { - // Write code here that turns the phrase above into concrete actions - return 'pending'; - }); - - Given('I am a user with a demoUser role', async function () { - // Write code here that turns the phrase above into concrete actions - return 'pending'; - }); - - When('I am in the team {string}', async function (string) { - // 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'; - }); - - Given('I am a user with a demoUser role', async function () { - // Write code here that turns the phrase above into concrete actions - return 'pending'; - }); - - When('I am in the team {string}', async function (string) { - // Write code here that turns the phrase above into concrete actions - return 'pending'; - }); - - ? Then I should not be able to create a flow - Undefined. Implement with the following snippet: - - 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'; - }); - - -9) Scenario: Creating a new flow in other teams # src/demo-workspace/demoUser.feature:37 - ? Given I am a user with a demoUser role - Undefined. Implement with the following snippet: - - Given('I am a user with a demoUser role', async function () { - // Write code here that turns the phrase above into concrete actions - return 'pending'; - }); - - ? When I am in the team "open-digital-planning" - Undefined. Implement with the following snippet: - - When('I am in the team {string}', async function (string) { - // Write code here that turns the phrase above into concrete actions - return 'pending'; - }); - - ? Then I should not be able to create a flow - Undefined. Implement with the following snippet: - - 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'; - }); - - -10) Scenario: Actioning my own flows # src/demo-workspace/demoUser.feature:47 - ? Given I am a user with a demoUser role - Undefined. Implement with the following snippet: - - Given('I am a user with a demoUser role', async function () { - // Write code here that turns the phrase above into concrete actions - return 'pending'; - }); - - ? When I am in the "Demo" team - Undefined. Implement with the following snippet: - - When('I am in the {string} team', async function (string) { - // Write code here that turns the phrase above into concrete actions - return 'pending'; - }); - - ? And I am on a flow I have created - Undefined. Implement with the following snippet: - - When('I am on a flow I have created', async function () { - // Write code here that turns the phrase above into concrete actions - return 'pending'; - }); - - ? Then I should be able to "update" the flow - Undefined. Implement with the following snippet: - - 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'; - }); - - -11) Scenario: Actioning my own flows # src/demo-workspace/demoUser.feature:48 - ? Given I am a user with a demoUser role - Undefined. Implement with the following snippet: - - Given('I am a user with a demoUser role', async function () { - // Write code here that turns the phrase above into concrete actions - return 'pending'; - }); - - ? When I am in the "Demo" team - Undefined. Implement with the following snippet: - - When('I am in the {string} team', async function (string) { - // Write code here that turns the phrase above into concrete actions - return 'pending'; - }); - - ? And I am on a flow I have created - Undefined. Implement with the following snippet: - - When('I am on a flow I have created', async function () { - // Write code here that turns the phrase above into concrete actions - return 'pending'; - }); - - ? Then I should be able to "delete" the flow - Undefined. Implement with the following snippet: - - 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'; - }); - - -12) Scenario: Accessing flow settings # src/demo-workspace/demoUser.feature:52 - ? Given I am a user with a demoUser role - Undefined. Implement with the following snippet: - - Given('I am a user with a demoUser role', async function () { - // Write code here that turns the phrase above into concrete actions - return 'pending'; - }); - - ? When I am on my own flows - Undefined. Implement with the following snippet: - - When('I am on my own flows', async function () { - // Write code here that turns the phrase above into concrete actions - return 'pending'; - }); - - ? Then I should have access - Undefined. Implement with the following snippet: - - Then('I should have access', async function () { - // Write code here that turns the phrase above into concrete actions - return 'pending'; - }); - - -13) Scenario: Editing team settings # src/demo-workspace/demoUser.feature:63 - ? Given I am a user with a demoUser role - Undefined. Implement with the following snippet: - - Given('I am a user with a demoUser role', async function () { - // Write code here that turns the phrase above into concrete actions - return 'pending'; - }); - - ? When I am in the team <"TEAM"> - Undefined. Implement with the following snippet: - - When('I am in the team <{string}>', async function (string) { - // Write code here that turns the phrase above into concrete actions - return 'pending'; - }); - - ? Then I should not have access - Undefined. Implement with the following snippet: - - Then('I should not have access', async function () { - // Write code here that turns the phrase above into concrete actions - return 'pending'; - }); - - -14) Scenario: Editing team settings # src/demo-workspace/demoUser.feature:64 - ? Given I am a user with a demoUser role - Undefined. Implement with the following snippet: - - Given('I am a user with a demoUser role', async function () { - // Write code here that turns the phrase above into concrete actions - return 'pending'; - }); - - ? When I am in the team <"TEAM"> - Undefined. Implement with the following snippet: - - When('I am in the team <{string}>', async function (string) { - // Write code here that turns the phrase above into concrete actions - return 'pending'; - }); - - ? Then I should not have access - Undefined. Implement with the following snippet: - - Then('I should not have access', async function () { - // Write code here that turns the phrase above into concrete actions - return 'pending'; - }); - - -15) Scenario: Editing team settings # src/demo-workspace/demoUser.feature:65 - ? Given I am a user with a demoUser role - Undefined. Implement with the following snippet: - - Given('I am a user with a demoUser role', async function () { - // Write code here that turns the phrase above into concrete actions - return 'pending'; - }); - - ? When I am in the team <"TEAM"> - Undefined. Implement with the following snippet: - - When('I am in the team <{string}>', async function (string) { - // Write code here that turns the phrase above into concrete actions - return 'pending'; - }); - - ? Then I should not have access - Undefined. Implement with the following snippet: - - Then('I should not have access', async function () { - // Write code here that turns the phrase above into concrete actions - return 'pending'; - }); \ No newline at end of file diff --git a/e2e/tests/api-driven/src/demo-workspace/steps/background_steps.ts b/e2e/tests/api-driven/src/demo-workspace/steps/background_steps.ts new file mode 100644 index 0000000000..c199e8eb2a --- /dev/null +++ b/e2e/tests/api-driven/src/demo-workspace/steps/background_steps.ts @@ -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'; + }); diff --git a/e2e/tests/api-driven/src/demo-workspace/steps/navigation_steps.ts b/e2e/tests/api-driven/src/demo-workspace/steps/navigation_steps.ts new file mode 100644 index 0000000000..6c967d933e --- /dev/null +++ b/e2e/tests/api-driven/src/demo-workspace/steps/navigation_steps.ts @@ -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'; + }); diff --git a/e2e/tests/api-driven/src/demo-workspace/steps/verification_steps.ts b/e2e/tests/api-driven/src/demo-workspace/steps/verification_steps.ts new file mode 100644 index 0000000000..0e9134c203 --- /dev/null +++ b/e2e/tests/api-driven/src/demo-workspace/steps/verification_steps.ts @@ -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'; + }); \ No newline at end of file