Skip to content

Commit

Permalink
add Behat test
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Feb 25, 2022
1 parent 36ed3f8 commit 5570ebf
Showing 1 changed file with 36 additions and 27 deletions.
63 changes: 36 additions & 27 deletions tests-behat/login.feature
Original file line number Diff line number Diff line change
@@ -1,32 +1,41 @@
Feature: Login basic
In order prevent public accessing admin system
As a system admin
I need to authenticate to access the interface
In order prevent public accessing admin system
As a system admin
I need to authenticate to access the interface

Scenario:
Given I am on "form-login.php"
Then I should see "Sign in"
And I should not see "Currently logged in"
Scenario:
Given I am on "form-login.php"
Then I should see "Sign in"
And I should not see "Currently logged in"

Scenario:
Given I am on "form-login.php"
And I fill in "email" with "admin"
And I fill in "password" with "admin"
And I press button "Sign in"
Then I should see "Currently logged in"
Scenario:
Given I am on "form-login.php"
And I fill in "email" with "admin"
And I fill in "password" with "admin"
And I press button "Sign in"
Then I should see "Currently logged in"

Scenario:
Given I am on "form-login.php"
And I fill in "email" with "admin"
And I fill in "password" with "wrong"
And I press button "Sign in"
Then I should see "incorrect"
And I should not see "Currently logged in"
Scenario:
Given I am on "form-login.php"
And I fill in "email" with "admin"
And I fill in "password" with "wrong"
And I press button "Sign in"
Then I should see "incorrect"
And I should not see "Currently logged in"

Scenario:
Given I am on "form-login.php"
When I fill in "email" with ""
And I fill in "password" with "admin"
And I press button "Sign in"
Then I should see "Must not be empty"
And I should not see "Currently logged in"
Scenario:
Given I am on "form-login.php"
When I fill in "email" with ""
And I fill in "password" with "admin"
And I press button "Sign in"
Then I should see "Must not be empty"
And I should not see "Currently logged in"

Scenario: Return to original URL after successful login
Given I am on "form-login.php"
Given I am on "acl-clients.php?parameter=whatever"
And I fill in "email" with "user"
And I fill in "password" with "user"
And I press button "Sign in"
Then I should be on "acl-clients.php?parameter=whatever"
And I should see "Client list for ACL testing"

0 comments on commit 5570ebf

Please sign in to comment.