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 11package io .github .mfaisalkhatri .tests ;
22
3+ import static com .microsoft .playwright .assertions .PlaywrightAssertions .assertThat ;
4+
35import com .microsoft .playwright .Browser ;
46import com .microsoft .playwright .BrowserType ;
7+ import com .microsoft .playwright .Locator ;
58import com .microsoft .playwright .Page ;
69import com .microsoft .playwright .Playwright ;
10+ import com .microsoft .playwright .options .AriaRole ;
711import org .testng .annotations .AfterClass ;
812import org .testng .annotations .BeforeClass ;
13+ import org .testng .annotations .Test ;
914
1015public class ClickOperationTests {
1116
@@ -20,7 +25,18 @@ public void setup() {
2025 this .page = browser .newPage ();
2126 }
2227
23-
28+ @ Test
29+ public void testLeftClick () {
30+ page .navigate ("https://the-internet.herokuapp.com/" );
31+ Locator challenginDomLink = page .getByRole (AriaRole .LINK ,
32+ new Page .GetByRoleOptions ().setName ("Challenging DOM" ));
33+ challenginDomLink .click ();
34+
35+ assertThat (
36+ page .getByRole (AriaRole .HEADING , new Page .GetByRoleOptions ().setName ("Challenging DOM" ))).isVisible ();
37+ }
38+
39+
2440
2541
2642 @ AfterClass
You can’t perform that action at this time.
0 commit comments