Skip to content

Commit 9ab1af4

Browse files
committed
Add functional test for WebDriverBy::className
1 parent 8bde8d5 commit 9ab1af4

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

tests/functional/BaseTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,12 @@ public function testGetById() {
3838
$this->driver->findElement(WebDriverBy::id('id_test'))->getText()
3939
);
4040
}
41+
42+
public function testGetByClassName() {
43+
$this->driver->get($this->getTestPath('index.html'));
44+
self::assertEquals(
45+
'Test by Class',
46+
$this->driver->findElement(WebDriverBy::className('test_class'))->getText()
47+
);
48+
}
4149
}

tests/functional/html/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
<body>
66
<h1 id='welcome'>Welcome to the facebook/php-webdriver testing page.</h1>
77
<p id="id_test">Test by ID</p>
8+
<p class="test_class">Test by Class</p>
89
</body>
910
</html>

0 commit comments

Comments
 (0)