Web-Tester Login API to streamline authentication of a user
The @IvyProcessTest
and the @IvyTest
provided since day one a AppFixture utility, to quickly change the user or some config etc.
And since day one the IvyWebTest
didn't help you with such use-cases 😥
But this is no longer the case! With Ivy 10.0.14 and 11.2.0 the web-tester gives you a new utility class WebAppFixture, which provides API to quickly login to another user or change a variable or another app config 😍
However, as the web integration tests work a little bit differently, the new WebAppFixture
behaves a little bit differently too in comparison to the AppFixture
. E.g. the values are not automatically reset to the default value after a test or test class run.
Audience
- Process Developers
- Process Testers
Value
- WebAppFixture utility class with the API's:
- login, logout
- set / reset variable
- set / reset app config
- 11.2.0: Rest endpoints on the system security context for change variables and app configs
Version
Next steps
Screenshots / Code
@IvyWebTest
public class WebTestOrderFormFixtureIT {
@Test
void user(WebAppFixture fixture) {
fixture.login("test", "test");
open(EngineUrl.createProcessUrl("a-process-url/start.ivp"));
fixture.logout();
open(EngineUrl.createProcessUrl("a-process-url/start.ivp"));
}
@Test
void variable(WebAppFixture fixture) {
fixture.var("myVar", "hello");
open(EngineUrl.createProcessUrl("a-process-url/start.ivp"));
$(By.id("form:variable")).shouldBe(exactText("hello"));
fixture.resetVar("myVar");
Selenide.refresh();
$(By.id("form:variable")).shouldBe(exactText("init"));
}
}