MCPcopy Create free account
hub / github.com/TestLeafInc/Simba / LoginPage

Class LoginPage

src/test/java/page/base/LoginPage.java:9–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7import com.microsoft.playwright.BrowserContext;
8
9public class LoginPage extends ProjectHooks{
10
11 public LoginPage typeUserName(String username) {
12 type("#username", username, "Username");
13 return this;
14 }
15
16 public LoginPage typePassword(String password) {
17 type("#password", password, "Password");
18 return this;
19 }
20
21 public LoginPage clickLogin() {
22 click("#Login", "Log In");
23 return this;
24 }
25
26 public LoginPage doLogin() {
27 if(getPage().title().contains("Login")) {
28 typeUserName(ConfigurationManager.configuration().appUserName())
29 .typePassword(ConfigurationManager.configuration().appPassword())
30 .clickLogin();
31
32 getContext().storageState(new BrowserContext.StorageStateOptions().setPath(Paths.get("storage/login.json")));
33 }
34 return this;
35
36 }
37
38}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected