Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ehasa-frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
WIMMA Lab 2019
Overflow
ehasa-frontend
Commits
1f48cdf8
Commit
1f48cdf8
authored
5 years ago
by
M3079
Browse files
Options
Downloads
Patches
Plain Diff
Added new robot test
parent
d71bbdfd
No related branches found
No related tags found
No related merge requests found
Pipeline
#64178
failed
5 years ago
Stage: purge
Stage: build
Stage: rf-test
Stage: push-results
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tests/02_invalid_registration.robot
+30
-6
30 additions, 6 deletions
tests/02_invalid_registration.robot
tests/03_invalid_login.robot
+29
-0
29 additions, 0 deletions
tests/03_invalid_login.robot
tests/resource.robot
+115
-73
115 additions, 73 deletions
tests/resource.robot
with
174 additions
and
79 deletions
tests/02_invalid_registration.robot
+
30
−
6
View file @
1f48cdf8
...
...
@@ -8,7 +8,6 @@ Test Template Registration With Invalid Options Should Fail
*** Variables ***
${ge_u}
=
Generate Username
${ge_p}
=
Generate Password
${ge_vp}
=
Generate Differing Password
*** Test Cases ***
Short Username
${ge_u}
2
${ge_p}
32
${SHORT_U}
...
...
@@ -19,11 +18,17 @@ Short Username/Password ${ge_u} 2 ${ge_p}
Long Username/Password
${ge_u}
32
${ge_p}
256
${LONG_UP}
Short Username And Long Password
${ge_u}
2
${ge_p}
256
${SU_LP}
Long Username And Short Password
${ge_u}
32
${ge_p}
2
${LU_SP}
#Differing Password
#Existing Account Correct Password
#Existing Account New Password
Empty Username And Password
${ge_u}
0
${ge_p}
0
${SHORT_UP}
Differing Password
[
Template
]
NONE
Differing Password
Existing Account Correct Password
[
Template
]
NONE
Existing Account Correct Password
Existing Account New Password
[
Template
]
NONE
Existing Account New Password
*** Keywords ***
Registration With Invalid Options Should Fail
...
...
@@ -45,5 +50,24 @@ Differing Password
Generate Username
31
Generate Differing Password
8
Submit Credentials Registration
#Registration Should Have Failed
Close Registration Screen
\ No newline at end of file
Element Text Should Be
css=h2
${P_NOMATCH}
Close Registration Screen
Existing Account Correct Password
Open Registration
Input Valid Username
Input Valid Password
Submit Credentials Registration
Element Text Should Be
css=h2
${ACC_EXISTS}
Close Registration Screen
Existing Account New Password
Open Registration
Input Valid Username
Generate Password
4
Submit Credentials Registration
Element Text Should Be
css=h2
${ACC_EXISTS}
Close Registration Screen
This diff is collapsed.
Click to expand it.
tests/03_invalid_login.robot
0 → 100644
+
29
−
0
View file @
1f48cdf8
*** Settings ***
Documentation
A test suite for invalid login.
Resource
resource.robot
Suite Setup
Open Browser To Login Page
Suite Teardown
Close Browser
Test Template
Login With Invalid Credentials Should Fail
*** Test Cases ***
Invalid Username
invalid
${VALID PASSWORD}
${INVALID_U}
Invalid Password
${VALID USER}
invalid
${INVALID_P}
Invalid Username And Password
invalid
whatever
${INVALID_U}
Empty Username
${EMPTY}
${VALID PASSWORD}
${SHORT_U}
Empty Password
${VALID USER}
${EMPTY}
${SHORT_P}
Empty Username And Password
${EMPTY}
${EMPTY}
${SHORT_UP}
*** Keywords ***
Login With Invalid Credentials Should Fail
[
Arguments
]
${username}
${password}
${error_text}
Open Login
Input Username
${username}
Input Password
${password}
Submit Credentials Login
Login Should Have Failed
${error_text}
Close Login Screen
Login Should Have Failed
#Checks the error message.
[
Arguments
]
${error_text}
Element Text Should Be
css=h2
${error_text}
#Title Should Be Error Page #If there's going to be an error page.
This diff is collapsed.
Click to expand it.
tests/resource.robot
+
115
−
73
View file @
1f48cdf8
*** Settings ***
Documentation
A resource file with reusable keywords and variables.
Library
SeleniumLibrary
run_on_failure=nothing
Library
String
Documentation
A resource file with reusable keywords and variables.
Library
SeleniumLibrary
run_on_failure=nothing
Library
String
*** Variables ***
${SERVER}
%{SITE_URL}
${BROWSER}
ff
${DELAY}
0.5
${VALID PASSWORD}
=
koira
${LOGIN URL}
https://
${SERVER}
/
${WELCOME URL}
#You can use this if there's a different page after login page.
${LOC_USER}
id=registerUsernameInput
#Generated username.
${LOC_PASSWORD}
id=registerPasswordInput
#Generated password first time.
${LOC_PASSWORD2}
id=registerPasswordVerifyInput
#Generated password verify.
${ZOOMIN}
//*[@id="root"]/div/div[1]/div[2]/div[2]/div[1]/a[1]
#Zoom in button location
${ZOOMOUT}
//*[@id="root"]/div/div[1]/div[2]/div[2]/div[1]/a[2]
#Zoom out button location
${INVALID_U}
User does not exist
${INVALID_P}
Invalid password
${SHORT_P}
Validation failed: password must be longer than or equal to 3 characters
${SHORT_U}
Validation failed: name must be longer than or equal to 3 characters
${SHORT_UP}
Validation failed: name must be longer than or equal to 3 characters, password must be longer than or equal to 3 characters
${LONG_U}
Validation failed: name must be shorter than or equal to 31 characters
${LONG_P}
Validation failed: password must be shorter than or equal to 255 characters
${LONG_UP}
Validation failed: name must be shorter than or equal to 31 characters, password must be shorter than or equal to 255 characters
${SU_LP}
Validation failed: name must be longer than or equal to 3 characters, password must be shorter than or equal to 255 characters
${LU_SP}
Validation failed: name must be shorter than or equal to 31 characters, password must be longer than or equal to 3 characters
${SERVER}
%{SITE_URL}
${BROWSER}
ff
${DELAY}
0.5
#${VALID USER} = ville
${VALID PASSWORD}
=
koira
${LOGIN URL}
http://
${SERVER}
/
${WELCOME URL}
#You can use this if there's a different page after login page.
${LOC_USER}
id=registerUsernameInput
#Generated username.
${LOC_PASSWORD}
id=registerPasswordInput
#Generated password first time.
${LOC_PASSWORD2}
id=registerPasswordVerifyInput
#Generated password verify.
${ZOOMIN}
//*[@id="root"]/div/div[1]/div[2]/div[2]/div[1]/a[1]
#Zoom in button location
${ZOOMOUT}
//*[@id="root"]/div/div[1]/div[2]/div[2]/div[1]/a[2]
#Zoom out button location
${INVALID_U}
User does not exist
${INVALID_P}
Invalid password
${SHORT_P}
Validation failed: password must be longer than or equal to 3 characters
${SHORT_U}
Validation failed: name must be longer than or equal to 3 characters
${SHORT_UP}
Validation failed: name must be longer than or equal to 3 characters, password must be longer than or equal to 3 characters
${LONG_U}
Validation failed: name must be shorter than or equal to 31 characters
${LONG_P}
Validation failed: password must be shorter than or equal to 255 characters
${LONG_UP}
Validation failed: name must be shorter than or equal to 31 characters, password must be shorter than or equal to 255 characters
${SU_LP}
Validation failed: name must be longer than or equal to 3 characters, password must be shorter than or equal to 255 characters
${LU_SP}
Validation failed: name must be shorter than or equal to 31 characters, password must be longer than or equal to 3 characters
${ACC_EXISTS}
User already exists
${P_NOMATCH}
Passwords do not match
*** Keywords ***
#Valid Login
Open Browser To Login Page
Open Browser
${LOGIN URL}
${BROWSER}
Maximize Browser Window
Set Selenium Speed
${DELAY}
Login Page Should be Open
Open Browser
${LOGIN URL}
${BROWSER}
Maximize Browser Window
Set Selenium Speed
${DELAY}
Login Page Should be Open
Login Page Should be Open
Title Should Be
React App
Title Should Be
React App
Go To Login Page
Go To
${LOGIN URL}
Login Page Should be Open
Go To
${LOGIN URL}
Login Page Should be Open
Open Login
Click Button
id=loginButton
Click Button
id=loginButton
Input Username
[
Arguments
]
${username}
Input Text
id=loginUsernameInput
${username}
[
Arguments
]
${username}
Input Text
id=loginUsernameInput
${username}
Input Password
[
Arguments
]
${password}
Input Text
id=loginPasswordInput
${password}
[
Arguments
]
${password}
Input Text
id=loginPasswordInput
${password}
Submit Credentials Login
Click Button
id=submitLoginButton
Welcome Page Should Be Open
#You can use this if there's a different page after login page.
Location Should Be
${WELCOME URL}
Click Button
id=submitLoginButton
Welcome Page Should Be Open
#You can use this if there's a different page after login page.
Location Should Be
${WELCOME URL}
Log Out
Click Button
id=logoutButton
Click Button
id=logoutButton
Close Login Screen
Click Element
id=closeLoginFormX
Click Element
id=closeLoginFormX
Wait For Log Out Button To Appear
Wait Until Page Contains Element
id=logoutButton
1
Wait Until Page Contains Element
id=logoutButton
1
#Registration
Open Registration
Click Button
id=registerButton
Generate Valid Username
${GENE_username}
=
Generate Random String
12
[LETTERS][NUMBERS]
Set Global Variable
${VALID USER}
${GENE_username}
Input Valid Username
Input Text
${LOC_USER}
${VALID USER}
Input Valid Password
Input Text
${LOC_PASSWORD}
${VALID PASSWORD}
Input Text
${LOC_PASSWORD2}
${VALID PASSWORD}
Generate Username
#Generates a random username lenght=8 chars=[LETTERS][NUMBERS]
[
Arguments
]
${GNUM_U}
${GENE_username}
=
Generate Random String
${GNUM_U}
[LETTERS][NUMBERS]
Input Text
${LOC_USER}
${GENE_username}
Generate Password
#Generates a random password lenght=8 chars=[LETTERS][NUMBERS]
[
Arguments
]
${GNUM_P}
${GENE_password}
=
Generate Random String
${GNUM_P}
[LETTERS][NUMBERS]
Input Text
${LOC_PASSWORD}
${GENE_password}
Input Text
${LOC_PASSWORD2}
${GENE_password}
Click Button
id=registerButton
Generate Valid Username
#Generates new username for every test rotation in gitlab. Used in test suite 00.
${GENE_username}
=
Generate Random String
12
[LETTERS][NUMBERS]
Set Global Variable
${VALID USER}
${GENE_username}
Input Valid Username
#Inputs the generated valid username for login. (Test suite 00)
Input Text
${LOC_USER}
${VALID USER}
Input Valid Password
#Inputs the valid password: ville. (Test suite 00 and 01)
Input Text
${LOC_PASSWORD}
${VALID PASSWORD}
Input Text
${LOC_PASSWORD2}
${VALID PASSWORD}
Generate Username
#Generates a random username lenght=8 chars=[LETTERS][NUMBERS]
[
Arguments
]
${GNUM_U}
${GENE_username}
=
Generate Random String
${GNUM_U}
[LETTERS][NUMBERS]
Input Text
${LOC_USER}
${GENE_username}
Generate Password
#Generates a random password lenght=8 chars=[LETTERS][NUMBERS]
[
Arguments
]
${GNUM_P}
${GENE_password}
=
Generate Random String
${GNUM_P}
[LETTERS][NUMBERS]
Input Text
${LOC_PASSWORD}
${GENE_password}
Input Text
${LOC_PASSWORD2}
${GENE_password}
Generate Differing Password
[
Arguments
]
${GNUM_VP}
${GENE_dpassword}
=
Generate Random String
${GNUM_VP}
[LETTERS][NUMBERS]
${GENE_dpassword2}
=
Generate Random String
${GNUM_VP}
[LETTERS][NUMBERS]
Input Text
${LOC_PASSWORD}
${GENE_dpassword}
Input Text
${LOC_PASSWORD2}
${GENE_dpassword2}
[
Arguments
]
${GNUM_VP}
${GENE_dpassword}
=
Generate Random String
${GNUM_VP}
[LETTERS][NUMBERS]
${GENE_dpassword2}
=
Generate Random String
${GNUM_VP}
[LETTERS][NUMBERS]
Input Text
${LOC_PASSWORD}
${GENE_dpassword}
Input Text
${LOC_PASSWORD2}
${GENE_dpassword2}
Submit Credentials Registration
Click Button
id=submitRegisterButton
Click Button
id=submitRegisterButton
Close Registration Screen
Click Element
id=closeRegisterFormX
Click Element
id=closeRegisterFormX
#Zoom frontpage
Wait For Zoom Button To Appear
Wait Until Page Contains Element
//*[@id="root"]/div/div[1]/div[2]/div[2]/div[1]/a[1]
1
Wait Until Page Contains Element
//*[@id="root"]/div/div[1]/div[2]/div[2]/div[1]/a[1]
1
Zoom In On Frontpage
Repeat Keyword
3 times
Click Element
${ZOOMIN}
Repeat Keyword
3 times
Click Element
${ZOOMIN}
Zoom Out On Frontpage
Repeat Keyword
3 times
Click Element
${ZOOMOUT}
Move Around On The Map Frontpage
#en saanut toimimaan
#Press Key //*[@id="root"]/div/div[1]/div[1] ARROW_LEFT
Press Combination
Key.
\ No newline at end of file
Repeat Keyword
3 times
Click Element
${ZOOMOUT}
#TEST IDEAS
Move Around On The Map Frontpage
#en saanut toimimaan
#Press Key //*[@id="root"]/div/div[1]/div[1] ARROW_LEFT
Press Combination
Key.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment