-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from creative-commoners/pulls/2.3/behat
MNT Add behat tests
- Loading branch information
Showing
14 changed files
with
92 additions
and
3 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
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,29 @@ | ||
default: | ||
suites: | ||
securityreport: | ||
paths: | ||
- "%paths.modules.securityreport%/tests/behat/features" | ||
contexts: | ||
- SilverStripe\Admin\Tests\Behat\Context\AdminContext | ||
- SilverStripe\BehatExtension\Context\BasicContext | ||
- SilverStripe\BehatExtension\Context\EmailContext | ||
- SilverStripe\BehatExtension\Context\LoginContext | ||
- SilverStripe\Framework\Tests\Behaviour\CmsFormsContext | ||
- SilverStripe\Framework\Tests\Behaviour\CmsUiContext | ||
- SilverStripe\SecurityReport\Tests\Behat\Context\FeatureContext | ||
- SilverStripe\SecurityReport\Tests\Behat\Context\FixtureContext | ||
- | ||
SilverStripe\SecurityReport\Tests\Behat\Context\FixtureContext: | ||
- "%paths.modules.securityreport%/tests/behat/files/" | ||
|
||
extensions: | ||
SilverStripe\BehatExtension\MinkExtension: | ||
default_session: facebook_web_driver | ||
javascript_session: facebook_web_driver | ||
facebook_web_driver: | ||
browser: chrome | ||
wd_host: "http://127.0.0.1:9515" | ||
|
||
SilverStripe\BehatExtension\Extension: | ||
screenshot_path: "%paths.base%/artifacts/screenshots" | ||
bootstrap_file: vendor/silverstripe/framework/tests/behat/serve-bootstrap.php |
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
Empty file.
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,41 @@ | ||
Feature: Security report | ||
As a website user | ||
I want to use the security report | ||
|
||
Background: | ||
Given the "group" "EDITOR group" has permissions "CMS_ACCESS_LeftAndMain" and "FILE_EDIT_ALL" | ||
|
||
# Login as EDITOR to create member | ||
And I am logged in with "EDITOR" permissions | ||
|
||
# Logout and login again as ADMIN | ||
And I go to "/Security/login" | ||
And I press the "Log in as someone else" button | ||
And I am logged in with "ADMIN" permissions | ||
|
||
# Create a subsite | ||
And I go to "/admin/subsites" | ||
And I press the "Add Subsite" button | ||
And I fill in "Subsite Name" with "My subsite" | ||
And I press the "Create" button | ||
|
||
Scenario: Operate the security report | ||
|
||
# Show members | ||
When I go to "/admin/reports" | ||
And I follow "Users, Groups and Permissions" | ||
|
||
# Assert firstname, surname and email | ||
Then I should see "EDITOR" | ||
And I should see "User" | ||
And I should see "[email protected]" | ||
|
||
# Groups column | ||
And I should see "EDITOR group (global group)" | ||
|
||
# Permissions column | ||
Then I should see "Edit any file" | ||
And I should see "Full administrative rights" | ||
|
||
# Subsites column | ||
And I should see "Main site, My subsite" |
Empty file.
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,9 @@ | ||
<?php | ||
|
||
namespace SilverStripe\SecurityReport\Tests\Behat\Context; | ||
|
||
use SilverStripe\BehatExtension\Context\SilverStripeContext; | ||
|
||
class FeatureContext extends SilverStripeContext | ||
{ | ||
} |
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,9 @@ | ||
<?php | ||
|
||
namespace SilverStripe\SecurityReport\Tests\Behat\Context; | ||
|
||
use SilverStripe\BehatExtension\Context\FixtureContext as BaseFixtureContext; | ||
|
||
class FixtureContext extends BaseFixtureContext | ||
{ | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.