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 33import com .microsoft .playwright .*;
44import com .microsoft .playwright .options .AriaRole ;
55import com .microsoft .playwright .options .BoundingBox ;
6+ import com .microsoft .playwright .options .KeyboardModifier ;
67import com .microsoft .playwright .options .MouseButton ;
78import org .testng .annotations .AfterMethod ;
89import org .testng .annotations .BeforeMethod ;
910import org .testng .annotations .Test ;
1011
12+ import java .util .List ;
13+
1114import static com .microsoft .playwright .assertions .PlaywrightAssertions .assertThat ;
1215import static org .testng .Assert .assertEquals ;
1316
@@ -98,6 +101,23 @@ public void testPositionBasedClick() {
98101
99102 }
100103
104+ @ Test
105+ public void testClickWithModifiers () {
106+ page .navigate ("https://jqueryui.com/selectable/" );
107+ FrameLocator frame = page .frameLocator (".demo-frame" );
108+
109+ Locator items = frame .locator ("#selectable li" );
110+
111+ items .nth (0 ).click (new Locator .ClickOptions ()
112+ .setModifiers (List .of (KeyboardModifier .CONTROL )));
113+
114+ items .nth (3 ).click (new Locator .ClickOptions ()
115+ .setModifiers (List .of (KeyboardModifier .CONTROL )));
116+
117+ page .waitForTimeout (4000 );
118+
119+ }
120+
101121 @ AfterMethod
102122 public void tearDown () {
103123 this .page .close ();
You can’t perform that action at this time.
0 commit comments