class HoverTest in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/behat/mink/driver-testsuite/tests/Css/HoverTest.php \Behat\Mink\Tests\Driver\Css\HoverTest
Hierarchy
Expanded class hierarchy of HoverTest
File
- vendor/
behat/ mink/ driver-testsuite/ tests/ Css/ HoverTest.php, line 7
Namespace
Behat\Mink\Tests\Driver\CssView source
class HoverTest extends TestCase {
/**
* @group mouse-events
*/
public function testMouseOverHover() {
$this
->getSession()
->visit($this
->pathTo('/css_mouse_events.html'));
$this
->findById('reset-square')
->mouseOver();
$this
->assertActionSquareHeight(100);
$this
->findById('action-square')
->mouseOver();
$this
->assertActionSquareHeight(200);
}
/**
* @group mouse-events
* @depends testMouseOverHover
*/
public function testClickHover() {
$this
->getSession()
->visit($this
->pathTo('/css_mouse_events.html'));
$this
->findById('reset-square')
->mouseOver();
$this
->assertActionSquareHeight(100);
$this
->findById('action-square')
->click();
$this
->assertActionSquareHeight(200);
}
/**
* @group mouse-events
* @depends testMouseOverHover
*/
public function testDoubleClickHover() {
$this
->getSession()
->visit($this
->pathTo('/css_mouse_events.html'));
$this
->findById('reset-square')
->mouseOver();
$this
->assertActionSquareHeight(100);
$this
->findById('action-square')
->doubleClick();
$this
->assertActionSquareHeight(200);
}
/**
* @group mouse-events
* @depends testMouseOverHover
*/
public function testRightClickHover() {
$this
->getSession()
->visit($this
->pathTo('/css_mouse_events.html'));
$this
->findById('reset-square')
->mouseOver();
$this
->assertActionSquareHeight(100);
$this
->findById('action-square')
->rightClick();
$this
->assertActionSquareHeight(200);
}
private function assertActionSquareHeight($expected) {
$this
->assertEquals($expected, $this
->getSession()
->evaluateScript("return window.\$('#action-square').height();"), 'Mouse is located over the object when mouse-related action is performed');
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
HoverTest:: |
private | function | ||
HoverTest:: |
public | function | @group mouse-events @depends testMouseOverHover | |
HoverTest:: |
public | function | @group mouse-events @depends testMouseOverHover | |
HoverTest:: |
public | function | @group mouse-events | |
HoverTest:: |
public | function | @group mouse-events @depends testMouseOverHover | |
TestCase:: |
private static | property | ||
TestCase:: |
private static | property | Mink session manager. | |
TestCase:: |
protected | function | ||
TestCase:: |
protected | function | Creates a new driver instance. | |
TestCase:: |
protected | function | ||
TestCase:: |
protected | function | Returns assert session. | |
TestCase:: |
private static | function | ||
TestCase:: |
protected | function | Returns session. | |
TestCase:: |
protected | function | Map remote file path. | |
TestCase:: |
protected | function | ||
TestCase:: |
protected | function | ||
TestCase:: |
protected | function | Waits for a condition to be true, considering than it is successful for drivers not supporting wait(). | |
TestCase:: |
public static | function | Initializes the test case. | |
TestCase:: |
protected | function |