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 @@ -142,8 +142,35 @@ public void testDragAndDropActions () {
142142 this .page .navigate ("https://the-internet.herokuapp.com/" );
143143 this .page .getByRole (AriaRole .LINK , new Page .GetByRoleOptions ().setName ("Drag and Drop" ))
144144 .click ();
145- this .page .locator ("#column-a" ).dragTo (this .page .locator ("#column-b" ));
146- assertThat (this .page .locator ("#column-a" )).containsText ("B" );
145+ this .page .locator ("#column-a" )
146+ .dragTo (this .page .locator ("#column-b" ));
147+ assertThat (this .page .locator ("#column-a" )).containsText ("B" );
148+
149+ }
150+
151+ @ Test
152+ public void testDragAndDropManually () {
153+ this .page .navigate ("https://the-internet.herokuapp.com/" );
154+ this .page .getByRole (AriaRole .LINK , new Page .GetByRoleOptions ().setName ("Drag and Drop" ))
155+ .click ();
156+ this .page .locator ("#column-a" )
157+ .hover ();
158+ this .page .mouse ()
159+ .down ();
160+ this .page .locator ("#column-b" )
161+ .hover ();
162+ this .page .mouse ()
163+ .up ();
164+ assertThat (this .page .locator ("#column-a" )).containsText ("B" );
165+ }
166+
167+ @ Test
168+ public void testProgrammaticClick () {
169+ this .page .navigate ("https://the-internet.herokuapp.com/" );
170+ this .page .getByRole (AriaRole .LINK , new Page .GetByRoleOptions ().setName ("Checkboxes" ))
171+ .dispatchEvent ("click" );
172+
173+ assertThat (this .page .getByRole (AriaRole .HEADING )).containsText ("Checkboxes" );
147174
148175 }
149176
You can’t perform that action at this time.
0 commit comments