Skip to main content
Version: 8.0.2

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):

NameParameter(s)TypeDescription
setLoginusernamestringSets a given string into Login field
options?{ timeout?: number; interval?: number; retries?: number }
setPasswordpasswordstringSets a given string into Password field
options?{ timeout?: number; interval?: number; retries?: number }
submitoptions?{ timeout?: number; interval?: number; retries?: number }Clicks Submit button
loginusernamestringSets login and password then clicks Submit button
passwordstring
options?{ timeout?: number; interval?: number; retries?: number }
assertLogInButtonIsVisibleoptions?{ timeout?: number; interval?: number; retries?: number }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:

NameParameter(s)TypeDescription
setCustomLoginusernamestringSets a given string into Login field
selectorstring
options?{ timeout?: number; interval?: number; retries?: number }
setCustomPasswordpasswordstringSets a given string into Password field
selectorstring
options?{ timeout?: number; interval?: number; retries?: number }
customSubmitselectorstringClicks Submit button
options?{ timeout?: number; interval?: number; retries?: number }
assertCustomSubmitButtonIsVisibleselectorstringChecks if Submit button is visible
options?{ timeout?: number; interval?: number; retries?: number }
info

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`);