Login Page
Login page functions are only implemented for standard Pega UI login form. In case of SSO or other types of access custom solution is required.
Visit Page
First of all, it is required to go to a Pega application url. Visit
method is very simple:
await pega.visit(`pega url`);
There is another one optional parameter in the visit
method, a runInfo
. RunInfo is a Test Maker feature that returns current configuration state. In case of visit
, runInfo as a parameter provides info about actual Selector and Assertion timeouts. If runInfo is not specified, default values will be used (15000 ms for a Selector and 17000 ms for an Assertion).
Don't forget to get runInfo from the corresponding Gherkin step or hook:
.Given("The user is logged in", async (I, runInfo) => {
await pega.visit(`pega url`, runInfo);
})
Login, Password and Submit Button
For Pega OOTB login form, methods are quite standard. It is possible to combine all the steps in 1 method (login
) or to use them one by one (setLogin
, setPassword
then submit
):
Name | Parameter(s) | Type | Description |
---|---|---|---|
setLogin | username | string | Sets a given string into Login field |
options? | { timeout?: number; interval?: number; retries?: number } | ||
setPassword | password | string | Sets a given string into Password field |
options? | { timeout?: number; interval?: number; retries?: number } | ||
submit | options? | { timeout?: number; interval?: number; retries?: number } | Clicks Submit button |
login | username | string | Sets login and password then clicks Submit button |
password | string | ||
options? | { timeout?: number; interval?: number; retries?: number } | ||
assertLogInButtonIsVisible | options? | { timeout?: number; interval?: number; retries?: number, soft?: boolean } | Checks if an OOTB Login form Submit button is visible |
await pega.loginForm.login(`username`, `password`);
For a custom login form implementation, it is recommended to use specific methods that don't include hardcoded selectors:
Name | Parameter(s) | Type | Description |
---|---|---|---|
setCustomLogin | username | string | Sets a given string into Login field |
selector | string | ||
options? | { timeout?: number; interval?: number; retries?: number } | ||
setCustomPassword | password | string | Sets a given string into Password field |
selector | string | ||
options? | { timeout?: number; interval?: number; retries?: number } | ||
customSubmit | selector | string | Clicks Submit button |
options? | { timeout?: number; interval?: number; retries?: number } | ||
assertCustomSubmitButtonIsVisible | selector | string | Checks if Submit button is visible |
options? | { timeout?: number; interval?: number; retries?: number, soft?: boolean } |
For custom login for methods, it is required to use full selectors (for instance, if a field or button has it's data-test-id, you need to pass it as [data-test-id="56789876574834574839"]
or //*[@data-test-id="56789876574834574839"]
but NOT 56789876574834574839
only)
It is possible to combine methods for OOTB or custom implementation in any order. e.g.:
await pega.loginForm.setLogin(`Username`);
await pega.loginForm.setPassword(`Password`);
await pega.loginForm.customSubmit(`Selector`);