Skip to content

Commit

Permalink
Standardize whitespace for Behat feature tests
Browse files Browse the repository at this point in the history
  • Loading branch information
allejo committed Aug 26, 2017
1 parent 6154ed2 commit eee661e
Show file tree
Hide file tree
Showing 7 changed files with 302 additions and 302 deletions.
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ trim_trailing_whitespace = true
indent_style = space
indent_size = 4

[*.md,*.markdown]
[*.{md,markdown}]
trim_trailing_whitespace = false

[*.json]
[*.feature]
indent_size = 2
34 changes: 17 additions & 17 deletions tests/features/auth.feature
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
Feature: Authentication
In order to be identifiable
As a guest
I need to be able to log in and out
In order to be identifiable
As a guest
I need to be able to log in and out

Scenario: Bad Login
Given I am logged out
When I go to "/login"
Then I should see "Bad Request"
When I log in
And I go to "/login?token=sample&username=samothy"
Then I should see "You are already logged in"
Scenario: Bad Login
Given I am logged out
When I go to "/login"
Then I should see "Bad Request"
When I log in
And I go to "/login?token=sample&username=samothy"
Then I should see "You are already logged in"

Scenario: Logging out
Given I am logged in
When I go to "/logout"
Then I should be on the homepage
Then I should see "You logged out successfully"
When I go to "/profile"
Then I should see "You need to be signed in"
Scenario: Logging out
Given I am logged in
When I go to "/logout"
Then I should be on the homepage
Then I should see "You logged out successfully"
When I go to "/profile"
Then I should see "You need to be signed in"
42 changes: 21 additions & 21 deletions tests/features/errors.feature
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
Feature: Error messages
As a user who performed an erroneous request
I need to see a description of the error
In order to readjust my request
As a user who performed an erroneous request
I need to see a description of the error
In order to readjust my request

Scenario: 404 error page
When I go to "sampel/errorrrrr/pgae/apre/parege/refresh/page"
Then the response status code should be 404
And I should see "Sorry, the page you are looking for could not be found."
And I should see "Error" in the title
Scenario: 404 error page
When I go to "sampel/errorrrrr/pgae/apre/parege/refresh/page"
Then the response status code should be 404
And I should see "Sorry, the page you are looking for could not be found."
And I should see "Error" in the title

Scenario: 404 model not found
Given there is a player called "illusory"
Given there is no player called "illusory"
When I go to "players/illusory"
Then the response status code should be 404
And I should see "The specified player could not be found"
And I should see "Players" in the title
Scenario: 404 model not found
Given there is a player called "illusory"
Given there is no player called "illusory"
When I go to "players/illusory"
Then the response status code should be 404
And I should see "The specified player could not be found"
And I should see "Players" in the title

Scenario: Access forbidden
Given I am logged out
When I go to "bans/new"
Then I should see "You are not allowed to create a new ban"
And I should see "Error" in the title
But the response status code should be 200
Scenario: Access forbidden
Given I am logged out
When I go to "bans/new"
Then I should see "You are not allowed to create a new ban"
And I should see "Error" in the title
But the response status code should be 200
28 changes: 14 additions & 14 deletions tests/features/home.feature
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
Feature: Home Page

Scenario: Visit home page
Given I have entered a news article named "Significant News"
And I have a custom page named "FAQ"
When I go to the homepage
Then I should see "Welcome"
And I should see "Significant News"
And I should see "FAQ"
Scenario: Visit home page
Given I have entered a news article named "Significant News"
And I have a custom page named "FAQ"
When I go to the homepage
Then I should see "Welcome"
And I should see "Significant News"
And I should see "FAQ"

Scenario: Hide registration button
Given I have a user
When I go to the homepage
Then I should see "Register"
When I log in
And I go to the homepage
Then I should not see "Register"
Scenario: Hide registration button
Given I have a user
When I go to the homepage
Then I should see "Register"
When I log in
And I go to the homepage
Then I should not see "Register"
186 changes: 93 additions & 93 deletions tests/features/match.feature
Original file line number Diff line number Diff line change
@@ -1,101 +1,101 @@
Feature: Matches
In order to promote competition
As a league team
we need to be able to record matches against other teams
In order to promote competition
As a league team
we need to be able to record matches against other teams

Scenario: Enter match - Denial of Access
Given I am logged out
When I go to "/matches/enter"
Then I should see "You are not allowed to create a new match"
Scenario: Enter match - Denial of Access
Given I am logged out
When I go to "/matches/enter"
Then I should see "You are not allowed to create a new match"

Scenario: Enter match - Invalid data
Given I am an admin
And there is a team called "Inimitable habitués"
And there is a player called "uncherished"
And a new user called "Wildcat" joins "Inimitable habitués"
And a new user called "unmercifuL" joins "Inimitable habitués"
When I go to "/matches/enter"
And I select "Inimitable habitués" from "form_first_team_team"
And I select "Inimitable habitués" from "form_second_team_team"
And I fill in "form_first_team_participants_player" with "uncherished, ..., , ,,, ,,,, Wildcat, uNmErCIFUl"
And I press "Enter"
Then I should see "You can't report a match where a team played against itself!"
And I should see "This value should not be blank."
And I should see "uncherished is not a member of Inimitable habitués"
And I should see "There is no player called \"...\""
And the "form_first_team_participants_player" field should contain "uncherished, ..., Wildcat, unmercifuL"
But I should not see "The match was created successfully"
Scenario: Enter match - Invalid data
Given I am an admin
And there is a team called "Inimitable habitués"
And there is a player called "uncherished"
And a new user called "Wildcat" joins "Inimitable habitués"
And a new user called "unmercifuL" joins "Inimitable habitués"
When I go to "/matches/enter"
And I select "Inimitable habitués" from "form_first_team_team"
And I select "Inimitable habitués" from "form_second_team_team"
And I fill in "form_first_team_participants_player" with "uncherished, ..., , ,,, ,,,, Wildcat, uNmErCIFUl"
And I press "Enter"
Then I should see "You can't report a match where a team played against itself!"
And I should see "This value should not be blank."
And I should see "uncherished is not a member of Inimitable habitués"
And I should see "There is no player called \"...\""
And the "form_first_team_participants_player" field should contain "uncherished, ..., Wildcat, unmercifuL"
But I should not see "The match was created successfully"

Scenario: Enter Team vs Team match
Given I am an admin
And there is a team called "Preeminent Cannoneers"
And there is a team called "Subpar Fusillade"
When I go to "/matches/enter"
And I select "Preeminent Cannoneers" from "form_first_team_team"
And I fill in "16" for "form_first_team_score"
And I select "Subpar Fusillade" from "form_second_team_team"
And I fill in "2" for "form_second_team_score"
And I select "30" from "form_duration_0"
And I press "Enter"
Then I should be on "/matches/1"
And I should see "The match was created successfully"
And I should see "Preeminent Cannoneers 1200 → 1225 16"
And I should see "Subpar Fusillade 1200 → 1175 2"
Scenario: Enter Team vs Team match
Given I am an admin
And there is a team called "Preeminent Cannoneers"
And there is a team called "Subpar Fusillade"
When I go to "/matches/enter"
And I select "Preeminent Cannoneers" from "form_first_team_team"
And I fill in "16" for "form_first_team_score"
And I select "Subpar Fusillade" from "form_second_team_team"
And I fill in "2" for "form_second_team_score"
And I select "30" from "form_duration_0"
And I press "Enter"
Then I should be on "/matches/1"
And I should see "The match was created successfully"
And I should see "Preeminent Cannoneers 1200 → 1225 16"
And I should see "Subpar Fusillade 1200 → 1175 2"

Scenario: Enter fun match
Given I am an admin
And there is a player called "convivial"
And there is a player called "mirthful"
And there is a player called "jocund"
And there is a player called "sprightly"
When I go to "/matches/enter"
And I select "Red Team" from "form_first_team_team"
And I fill in "5" for "form_first_team_score"
And I select "Green Team" from "form_second_team_team"
And I fill in "1" for "form_second_team_score"
And I select "20" from "form_duration_0"
And I fill in "form_first_team_participants_player" with "convivial,mirthful"
And I fill in "form_second_team_participants_player" with "convivial,mirthful"
And I select "Fun match" from "form_type"
And I press "Enter"
Then I should be on "/matches/2"
And I should see "The match was created successfully"
And I should see "Red Team 5"
And I should see "Green Team 1"
And I should see "20 minutes"
And I should see "Fun Match"
But I should not see "ELO Difference"
Given I am an admin
And there is a player called "convivial"
And there is a player called "mirthful"
And there is a player called "jocund"
And there is a player called "sprightly"
When I go to "/matches/enter"
And I select "Red Team" from "form_first_team_team"
And I fill in "5" for "form_first_team_score"
And I select "Green Team" from "form_second_team_team"
And I fill in "1" for "form_second_team_score"
And I select "20" from "form_duration_0"
And I fill in "form_first_team_participants_player" with "convivial,mirthful"
And I fill in "form_second_team_participants_player" with "convivial,mirthful"
And I select "Fun match" from "form_type"
And I press "Enter"
Then I should be on "/matches/2"
And I should see "The match was created successfully"
And I should see "Red Team 5"
And I should see "Green Team 1"
And I should see "20 minutes"
And I should see "Fun Match"
But I should not see "ELO Difference"

Scenario: Enter Team vs Mixed match with the team winning
Given I am an admin
And there is a team called "Polymorphic wombats"
And there is a player called "joyful bread"
And there is a player called "angry hippos"
And a new user called "gabaliumes" joins "Polymorphic wombats"
And a new user called "tabloid" joins "Polymorphic wombats"
When I go to "/matches/enter"
And I select "Polymorphic wombats" from "form_first_team_team"
And I fill in "4" for "form_first_team_score"
And I select "Green Team" from "form_second_team_team"
And I fill in "2" for "form_second_team_score"
And I select "30" from "form_duration_0"
And I fill in "form_first_team_participants_player" with "gabaliumes,tabloid"
And I fill in "form_second_team_participants_player" with "joyful bread,angry hippos"
And I press "Enter"
Then I should be on "/matches/3"
And I should see "The match was created successfully"
And I should see "Polymorphic wombats 1200 → 1225 4"
And I should see "Green Team 2"
Scenario: Enter Team vs Mixed match with the team winning
Given I am an admin
And there is a team called "Polymorphic wombats"
And there is a player called "joyful bread"
And there is a player called "angry hippos"
And a new user called "gabaliumes" joins "Polymorphic wombats"
And a new user called "tabloid" joins "Polymorphic wombats"
When I go to "/matches/enter"
And I select "Polymorphic wombats" from "form_first_team_team"
And I fill in "4" for "form_first_team_score"
And I select "Green Team" from "form_second_team_team"
And I fill in "2" for "form_second_team_score"
And I select "30" from "form_duration_0"
And I fill in "form_first_team_participants_player" with "gabaliumes,tabloid"
And I fill in "form_second_team_participants_player" with "joyful bread,angry hippos"
And I press "Enter"
Then I should be on "/matches/3"
And I should see "The match was created successfully"
And I should see "Polymorphic wombats 1200 → 1225 4"
And I should see "Green Team 2"

Scenario: Enter Team vs Mixed match without player roster for color team
Given I am an admin
And there is a team called "Numb3rs"
When I go to "/matches/enter"
And I select "Numb3rs" from "form_first_team_team"
And I fill in "3" for "form_first_team_score"
And I select "Green Team" from "form_second_team_team"
And I fill in "0" for "form_second_team_score"
And I select "30" from "form_duration_0"
And I press "Enter"
Then I should be on "/matches/enter"
And I should see "A player roster is necessary for a color team for a mixed official match"
Scenario: Enter Team vs Mixed match without player roster for color team
Given I am an admin
And there is a team called "Numb3rs"
When I go to "/matches/enter"
And I select "Numb3rs" from "form_first_team_team"
And I fill in "3" for "form_first_team_score"
And I select "Green Team" from "form_second_team_team"
And I fill in "0" for "form_second_team_score"
And I select "30" from "form_duration_0"
And I press "Enter"
Then I should be on "/matches/enter"
And I should see "A player roster is necessary for a color team for a mixed official match"
Loading

0 comments on commit eee661e

Please sign in to comment.