File tree Expand file tree Collapse file tree
src/test/java/io/github/mfaisalkhatri/tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ public class MouseHoverTest {
1313 private Playwright playwright ;
1414 private Page page ;
1515
16-
1716 @ BeforeClass
1817 public void setup () {
1918 this .playwright = Playwright .create ();
@@ -30,6 +29,17 @@ public void testMouseHover() {
3029 assertThat (userNameText ).hasText ("name: user1" );
3130 }
3231
32+ @ Test
33+ public void testMouseHoverOnMyAccountLink () {
34+ page .navigate ("https://ecommerce-playground.lambdatest.io/" );
35+ Locator myAccountLink = page .locator ("#widget-navbar-217834 > ul > li:nth-child(6) > a" );
36+ myAccountLink .hover ();
37+ Locator loginLink = page .locator ("#widget-navbar-217834 > ul > li:nth-child(6) > ul > li:nth-child(1) > a" );
38+ loginLink .click ();
39+ Locator pageHeader = page .getByRole (AriaRole .HEADING , new Page .GetByRoleOptions ().setName ("Returning Customer" ));
40+ assertThat (pageHeader ).hasText ("Returning Customer" );
41+ }
42+
3343 @ AfterClass
3444 public void tearDown () {
3545 this .page .close ();
Original file line number Diff line number Diff line change 66 <class name =" io.github.mfaisalkhatri.tests.MouseHoverTest" >
77 <methods >
88 <include name =" testMouseHover" />
9+ <include name =" testMouseHoverOnMyAccountLink" />
910 </methods >
1011 </class >
1112 </classes >
Original file line number Diff line number Diff line change 1212 <suite-file path =" testng-textfielddemo.xml" />
1313 <suite-file path =" testng-mousehovertest.xml" />
1414 <suite-file path =" testng-playwrightdemotests.xml" />
15+ <suite-file path =" testng-radiobuttons.xml" />
1516 </suite-files >
1617</suite >
You can’t perform that action at this time.
0 commit comments