Test Case
|
Action
|
Argument
|
Argument
|
User can create an account and log in
|
Create Valid User
|
fred
|
P4ssw0rd
|
Attempt to Login with Credentials
|
fred
|
P4ssw0rd
|
|
Status Should Be
|
Logged In
|
||
User cannot log in with bad password
|
Create Valid User
|
betty
|
P4ssw0rd
|
Attempt to Login with Credentials
|
betty
|
wrong
|
|
Status Should Be
|
Access Denied
|
Test Case
|
Steps
|
User can change password
|
Given a user has a valid account
|
when she changes her password
|
|
then she can log in with the new password
|
|
and she cannot use the old password anymore
|
Test Case
|
Action
|
Password
|
Expected error message
|
Too short password
|
Creating user with invalid password should fail
|
abCD5
|
${PWD INVALID LENGTH}
|
Too long password
|
Creating user with invalid password should fail
|
abCD567890123
|
${PWD INVALID LENGTH}
|
Password without lowercase letters
|
Creating user with invalid password should fail
|
123DEFG
|
${PWD INVALID CONTENT}
|
Password without capital letters
|
Creating user with invalid password should fail
|
abcd56789
|
${PWD INVALID CONTENT}
|
Password without numbers
|
Creating user with invalid password should fail
|
AbCdEfGh
|
${PWD INVALID CONTENT}
|
Password with special characters
|
Creating user with invalid password should fail
|
abCD56+
|
${PWD INVALID CONTENT}
|
Setting
|
Value
|
Library
|
OperatingSystem
|
Library
|
testlibs/LoginLibrary.py
|
Meta: Version
|
1.
0
|
Keyword
|
Action
|
Argument
|
Argument
|
Clear login database
|
Remove file
|
${DATABASE FILE}
|
|
Create valid user
|
[Arguments]
|
${username}
|
${password}
|
Create user
|
${username}
|
${password}
|
|
Status should be
|
SUCCESS
|
||
Creating user with invalid password should fail
|
[Arguments]
|
${password}
|
${error}
|
Create user
|
example
|
${password}
|
|
Status should be
|
Creating user failed: ${error}
|
||
Login
|
[Arguments]
|
${username}
|
${password}
|
Attempt to login with credentials
|
${username}
|
${password}
|
|
Status should be
|
Logged In
|
||
# Used by BDD test cases (this is a comment)
|
|||
Given a user has a valid account
|
Create valid user
|
${USERNAME}
|
${PASSWORD}
|
When she changes her password
|
Change password
|
${USERNAME}
|
${PASSWORD}
|
...
|
${NEW PASSWORD}
|
||
Status should be
|
SUCCESS
|
||
Then she can log in with the new password
|
Login
|
${USERNAME}
|
${NEW PASSWORD}
|
And she cannot use the old password anymore
|
Attempt to login with credentials
|
${USERNAME}
|
${PASSWORD}
|
Status should be
|
Access Denied
|
Variable
|
Value
|
${USERNAME}
|
janedoe
|
${PASSWORD}
|
J4n3D0e
|
${NEW PASSWORD}
|
e0D3n4J
|
${DATABASE FILE}
|
${TEMPDIR}${/}robotframework-quickstart-db.txt
|
${PWD INVALID LENGTH}
|
Password must be 7-12 characters long
|
${PWD INVALID CONTENT}
|
Password must be a combination of lowercase and uppercase letters and numbers
|
Test Case
|
Action
|
Argument
|
Argument
|
Argument
|
User status is stored in database
|
[Tags]
|
variables
|
database
|
|
Create Valid User
|
${USERNAME}
|
${PASSWORD}
|
||
Database Should Contain
|
${USERNAME}
|
${PASSWORD}
|
Inactive
|
|
Login
|
${USERNAME}
|
${PASSWORD}
|
||
Database Should Contain
|
${USERNAME}
|
${PASSWORD}
|
Active
|
Keyword
|
Action
|
Argument
|
Argument
|
Argument
|
Database Should Contain
|
[Arguments]
|
${username}
|
${password}
|
${status}
|
${database} =
|
Get File
|
${DATABASE FILE}
|
||
Should Contain
|
${database}
|
${username}/t${password}/t${status}
|
Setting
|
Value
|
Test Setup
|
Clear Login Database
|
Test Teardown
|
Setting
|
Value
|
Value
|
Force Tags
|
quickstart
|
|
Default Tags
|
example
|
smoke
|