-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2125368
commit 74e1c72
Showing
7 changed files
with
85 additions
and
11 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
tmail_selenium/src/main/java/com/tmail/robots/BasicAuthLoginRobot.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.tmail.robots; | ||
|
||
import com.microsoft.playwright.Page; | ||
import com.tmail.base.CoreRobot; | ||
|
||
public class BasicAuthLoginRobot extends CoreRobot { | ||
|
||
public BasicAuthLoginRobot(Page page) { | ||
super(page); | ||
} | ||
|
||
public void enterUsername(String username) { | ||
page.locator("#email").fill(username); | ||
} | ||
|
||
public void enterPassword(String password) { | ||
page.locator("input[aria-label='password']").click(); | ||
page.waitForTimeout(1000); | ||
page.locator("input[aria-label='password']").fill(password); | ||
} | ||
|
||
public void clickLogin() { | ||
page.getByText("Sign in").last().click(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
tmail_selenium/src/main/java/com/tmail/scenarios/BasicAuthLoginScenario.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.tmail.scenarios; | ||
|
||
import com.microsoft.playwright.Page; | ||
import com.tmail.base.BaseScenario; | ||
import com.tmail.robots.BasicAuthLoginRobot; | ||
import com.tmail.robots.HomeRobot; | ||
import com.tmail.robots.MailboxDashboardRobot; | ||
|
||
public class BasicAuthLoginScenario extends BaseScenario { | ||
String testUrl; | ||
String username; | ||
String password; | ||
|
||
public BasicAuthLoginScenario(String testUrl, String username, String password) { | ||
this.testUrl = testUrl; | ||
this.username = username; | ||
this.password = password; | ||
} | ||
|
||
@Override | ||
public void execute(Page page) { | ||
HomeRobot homeRobot = new HomeRobot(page); | ||
BasicAuthLoginRobot loginRobot = new BasicAuthLoginRobot(page); | ||
MailboxDashboardRobot mailboxDashboardRobot = new MailboxDashboardRobot(page); | ||
|
||
homeRobot.navigateToTestSite(testUrl); | ||
|
||
loginRobot.enterUsername(username); | ||
loginRobot.enterPassword(password); | ||
loginRobot.clickLogin(); | ||
|
||
mailboxDashboardRobot.waitUntilExactLabelIsVisible("Compose"); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
tmail_selenium/src/test/java/com/tmail/preprod/basic_auth/login/BasicAuthLoginTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.tmail.preprod.basic_auth.login; | ||
|
||
import com.tmail.base.TestBase; | ||
import com.tmail.scenarios.BasicAuthLoginScenario; | ||
|
||
public class BasicAuthLoginTest extends TestBase { | ||
BasicAuthLoginTest() { | ||
scenario = new BasicAuthLoginScenario( | ||
properties.getProperty("app.basicAuthUrl"), | ||
properties.getProperty("user.name"), | ||
properties.getProperty("user.password")); | ||
} | ||
} |
8 changes: 4 additions & 4 deletions
8
...m/tmail/preprod/oidc/login/LoginTest.java → ...ail/preprod/oidc/login/OidcLoginTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters