Logoff
Logoff functionality is often required when users should be changed one by one according to the scenario. It is also recommended to perform logoff step after each scenario to make tests more stable and to avoid operator conflicts in Pega. To make sure logoff
is executed every time (even if test case fails) you can put this action into any of appropriate hooks (global, feature or scenario hooks).
By default, logoff
function clicks an operator icon (with the selector [data-test-id="px-opr-image-ctrl"]
), expects to find a menu item with text Log off
and clicks this menu item.
It is possible to replace default values by any other value (for example, if an application uses a different language).
await pega.logoff(); //default implementation
or
await pega.logoff(`Déconnecter`, `[data-test-id="fr-px-opr-image-ctrl"]`); //custom implementation