Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Commit 3626c97

Browse files
authored
Merge pull request #687 from andrewnicols/mouseUp
Fix mouseUp W3C Action
2 parents e8561c2 + 9d5623f commit 3626c97

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

lib/Remote/RemoteMouse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
],

tests/functional/WebDriverActionsTest.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff 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
*/

0 commit comments

Comments
 (0)