A standardized library for the logging in and logging out of applications.
Required Global Variables: * wait - map variable with the keys: vs, s, m, l and vl ```groovy Map<String, Int> wait = [ vs:1, s:5, m:15, l:30, vl:60 ]
```
* env - string variable with one of the following values: dev, stg or prd
Cookie
Description
Tries to login using cookies stored on \\qatest\qatest
.
You may override behavior by supplying your own instance of the Login class, telling the test case to open a new browser window, or supplying a different test object to determine if the login succeeded.
Variables
Name | Type | Default Value | Description |
---|---|---|---|
newWindow | Boolean | true | Whether or not to open a new browser window at the start. |
login | Null | null | Override the Login class with your own. Must adhere to the same contract. |
toLoggedIn | TestObject | findTestObject('Login/Page_Login Already Logged In/h1_You are already logged in') | Test Object to assert exists after login. |
Password
Description
Tries to login using username and password stored in the Login class. You may override behavior by supplying your own instance of the Login class, telling the test case to open a new browser window, or supplying a different test objects (to determine if the login succeeded, etc).
After successfully logging in, this test case will attempt to scrape the RLILogin cookies and save them to environment-specific XLSX files on \\qatest\qatest
.
Variables
Name | Type | Default Value | Description |
---|---|---|---|
newWindow | Boolean | true | Whether or not to open a new browser window at the start. |
login | Null | null | Override the Login class with your own. Must adhere to the same contract. |
toLoggedIn | TestObject | findTestObject('Login/Page_Login Already Logged In/h1_You are already logged in') | Test Object to assert exists after login. |
toUsername | TestObject | findTestObject('Login/Page_Login Already Logged In/input_Username_UserName') | Username input Test Object. |
toPassword | TestObject | findTestObject('Login/Page_Login Already Logged In/input_Password_Password') | Password input Test Object. |
toBtnLogin | TestObject | findTestObject('Login/Page_Login Already Logged In/input_Password_LoginButton') | Login button Test Object (clickable). |
Login to URI
Description Try to login via cookie (optional), then navigate to uri variable. If the security header test object is not found, then try to login via password. Finally, assert the security header test object exists.
Login via password will refresh the cookies for the next attempt.
Variables
Name | Type | Default Value | Description |
---|---|---|---|
newWindow | Boolean | true | Whether or not to open a new browser window at the start. |
uri | GlobalVariable | GlobalVariable.loginUri | The URL behind the RLI login which requires authentication. |
toNavBar | TestObject | findTestObject('Login/Page_Home Page - Linehaul/a_Toggle navigation_navbar-brand rl-eh-navbar-brand') | Test Object to assert exists after login. |
Logout (jQuery)
Description
Uses jQuery issue a click to the navbar logout button. Asserts the Login page title. Optionally closes the browser.
Variables
Name | Type | Default Value | Description |
---|---|---|---|
toLogout | Boolean | findTestObject('Object Repository/Login/Page_Home Page - Linehaul/a_Logout') | Test Object with a class attribute of an element that can be clicked in order to logout. |
toNavbar | TestObject | findTestObject('Login/Page_Home Page - Linehaul/a_Toggle navigation_navbar-brand rl-eh-navbar-brand') | Test Object which, when visible, denotes that the logout button should also be available. |
close | TestObject | true | Whether or not to close the browser after this test case asserts. |
title | TestObject | Login | Expected title of page after logout for assertion. |