Add utility functiion to get an elemet's text content also when running tests in PhantomJS

pull/278/head
Thomas Bruederli 10 years ago
parent 8042e13af6
commit 9311fea09b

@ -32,6 +32,6 @@ class Selenium_Mail_Getunread extends Selenium_Test
$this->assertHasClass('unread', $li);
$badge = $this->byCssSelector('.folderlist li.inbox span.unreadcount');
$this->assertEquals(strval($this->msgcount), $badge->text());
$this->assertEquals(strval($this->msgcount), $this->getText($badge));
}
}

@ -42,7 +42,7 @@ class Selenium_Mail_List extends Selenium_Test
$this->assertHasClass('unread', $row);
$subject = $this->byCssSelector('.messagelist tbody tr:first-child td.subject');
$this->assertEquals('Lines', $subject->text());
$this->assertEquals('Lines', $this->getText($subject));
$icon = $this->byCssSelector('.messagelist tbody tr:first-child td.status span');
$this->assertHasClass('unread', $icon);

@ -337,6 +337,11 @@ class Selenium_Test extends PHPUnit_Extensions_Selenium2TestCase
return $response;
}
protected function getText($element)
{
return $element->text() ?: $element->attribute('textContent');
}
protected function assertHasClass($classname, $element)
{
$this->assertContains($classname, $element->attribute('class'));

Loading…
Cancel
Save