OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/features/session/user_session.feature

102 lines
3.9 KiB

#-- copyright
# OpenProject is a project management system.
# Copyright (C) 2012-2014 the OpenProject Foundation (OPF)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
# Copyright (C) 2006-2013 Jean-Philippe Lang
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# See doc/COPYRIGHT.rdoc for more details.
#++
Feature: User session
Background:
Given there is 1 user with the following:
| login | bob |
Scenario: A user will be forwarded to the login page from the my page
When I go to the My page
Then I should be on the login page
When I fill in "bob" for "username" within "#login-form"
And I fill in "adminADMIN!" for "password" within "#login-form"
And I click on "Login" within "#login-form"
And I go to the my account page
Then I should be on the my account page
Scenario: A user logging in will be forwarded to the original page
When I go to the my account page
Then I should be on the login page
When I fill in "bob" for "username" within "#login-form"
And I fill in "adminADMIN!" for "password" within "#login-form"
And I click on "Login" within "#login-form"
Then I should be on the my account page
Scenario: Autologin works if enabled
Given the "autologin" setting is set to 1
Given the "session_ttl_enabled" setting is set to true
And the "session_ttl" setting is set to 5
When I login with autologin enabled as "bob"
And I wait for "10" minutes
And I go to the home page
Then I should be logged in as "bob"
Scenario: Autologin does not work if disabled
Given the "autologin" setting is set to 0
Given the "session_ttl_enabled" setting is set to true
And the "session_ttl" setting is set to 5
When I login with autologin enabled as "bob"
And I wait for "10" minutes
And I go to the home page
Then I should be logged out
Scenario: A user can log in
When I login as "bob"
Then I should be logged in as "bob"
Scenario: A user can log out
Given I am logged in as "bob"
When I logout
Then I should be logged out
Scenario: A user is logged out when their session is expired
Given the "session_ttl_enabled" setting is set to true
And the "session_ttl" setting is set to 5
When I login as "bob"
And I wait for "10" minutes
And I go to the home page
Then I should be logged out
Scenario: A user is logged in as long as their session is valid
Given the "session_ttl_enabled" setting is set to true
And the "session_ttl" setting is set to 5
When I login as "bob"
And I wait for "4" minutes
And I go to the home page
Then I should be logged in as "bob"
Scenario: A blocked user cannot log in
Given there is 1 user with the following:
| login | blocked_user |
| password | iamblocked |
| password_confirmation | iamblocked |
And the user "blocked_user" is locked
When I login as blocked_user with password iamblocked
Then there should be a flash error message
And the flash message should contain "Invalid user or password"