Skip to content

Commit

Permalink
Merge pull request #241 from creative-commoners/pulls/1/review-behat-…
Browse files Browse the repository at this point in the history
…tests

ENH Replace ADMIN permissions with less permissions in Behat test
  • Loading branch information
GuySartorelli authored Sep 12, 2022
2 parents 5bed885 + 4d0f492 commit 045bcc3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
11 changes: 9 additions & 2 deletions tests/behat/features/manage-campaigns.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ Feature: Manage campaigns

Background:
Given a "campaign" "Test Campaign" with "Description"="this is a test"
And I am logged in with "ADMIN" permissions
And I go to "/admin/campaigns"
And the "group" "EDITOR" has permissions "Access to 'Pages' section" and "Access to 'Campaigns' section" and "Access to 'Files' section" and "FILE_EDIT_ALL"
And the "group" "CAMPAIGNS_EDITOR" has permissions "Access to 'Campaigns' section"

Scenario: I can create a campaign
Given I am logged in as a member of "CAMPAIGNS_EDITOR" group
And I go to "/admin/campaigns"
When I press the "Add campaign" button
Then I should see the "Form_campaignCreateForm" form
When I fill in "Name" with "newcampaign"
Expand All @@ -19,6 +21,8 @@ Feature: Manage campaigns
And the "Publish campaign" button should be disabled

Scenario: I can edit campaign
Given I am logged in as a member of "CAMPAIGNS_EDITOR" group
And I go to "/admin/campaigns"
When I wait until I see the ".grid-field__table" element
And I edit the campaign "Test Campaign"
Then the "Name" field should contain "Test Campaign"
Expand All @@ -35,6 +39,8 @@ Feature: Manage campaigns
Then I should see the campaign "Test campaign changed"

Scenario: I can delete a campaign
Given I am logged in as a member of "CAMPAIGNS_EDITOR" group
And I go to "/admin/campaigns"
When I wait until I see the ".grid-field__table" element
And I delete the campaign "Test Campaign"
Then I should not see the campaign "Test Campaign"
Expand All @@ -44,6 +50,7 @@ Feature: Manage campaigns

Given a "page" "My page"
And a "image" "assets/file2.jpg"
And I am logged in as a member of "EDITOR" group

# Page is draft
When I go to "/admin/pages"
Expand Down
3 changes: 2 additions & 1 deletion tests/behat/features/populate-campaigns.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ Feature: Populate campaigns
And a "image" "assets/folder1/file2.jpg"
And a "Campaign" "Empty Campaign"
And a campaign "Full Campaign" with changes "image"="assets/folder1/file2.jpg" and "page"="About Us"
And I am logged in with "ADMIN" permissions
And the "group" "EDITOR" has permissions "Access to 'Pages' section" and "Access to 'Campaigns' section" and "Access to 'Files' section" and "FILE_EDIT_ALL"
And I am logged in as a member of "EDITOR" group
And I go to "/admin/campaigns"

Scenario: I can build a campaign from pages and files
Expand Down

0 comments on commit 045bcc3

Please sign in to comment.