File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed
Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -241,7 +241,7 @@ public function mouseUp(WebDriverCoordinates $where = null)
241241 'parameters ' => ['pointerType ' => 'mouse ' ],
242242 'actions ' => array_merge ($ moveAction , [
243243 [
244- 'type ' => 'pointerDown ' ,
244+ 'type ' => 'pointerUp ' ,
245245 'duration ' => 0 ,
246246 'button ' => 0 ,
247247 ],
Original file line number Diff line number Diff line change @@ -136,6 +136,30 @@ public function testShouldDoubleClickOnElement()
136136 $ this ->assertContains ('dblclick item-3 ' , $ this ->retrieveLoggedEvents ());
137137 }
138138
139+ /**
140+ * @covers ::__construct
141+ * @covers ::dragAndDrop
142+ * @covers ::perform
143+ */
144+ public function testShouldDragAndDrop ()
145+ {
146+ if ($ this ->desiredCapabilities ->getBrowserName () === WebDriverBrowserType::HTMLUNIT ) {
147+ $ this ->markTestSkipped ('Not supported by HtmlUnit browser ' );
148+ }
149+
150+ $ element = $ this ->driver ->findElement (WebDriverBy::id ('item-3 ' ));
151+ $ target = $ this ->driver ->findElement (WebDriverBy::id ('item-1 ' ));
152+
153+ $ this ->driver ->action ()
154+ ->dragAndDrop ($ element , $ target )
155+ ->perform ();
156+
157+ $ this ->assertContains ('mouseover item-3 ' , $ this ->retrieveLoggedEvents ());
158+ $ this ->assertContains ('mousedown item-3 ' , $ this ->retrieveLoggedEvents ());
159+ $ this ->assertContains ('mouseover item-1 ' , $ this ->retrieveLoggedEvents ());
160+ $ this ->assertContains ('mouseup item-1 ' , $ this ->retrieveLoggedEvents ());
161+ }
162+
139163 /**
140164 * @return array
141165 */
You can’t perform that action at this time.
0 commit comments