Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Close #69.

  • Loading branch information...
commit 02da9332c8066e93660027da348bc8af50ea701e 1 parent cb5bdb4
Sebastian Bergmann authored
Showing with 108 additions and 19 deletions.
  1. +108 −19 PHPUnit/Extensions/SeleniumTestCase.php
127 PHPUnit/Extensions/SeleniumTestCase.php
View
@@ -224,7 +224,10 @@ public function setTimeout($timeout)
*/
public function assertAlertPresent()
{
- $this->assertTrue($this->isAlertPresent());
+ $this->assertTrue(
+ $this->isAlertPresent(),
+ 'No alert present.'
+ );
}
/**
@@ -234,7 +237,10 @@ public function assertAlertPresent()
*/
public function assertNoAlertPresent()
{
- $this->assertFalse($this->isAlertPresent());
+ $this->assertFalse(
+ $this->isAlertPresent(),
+ 'Alert present.'
+ );
}
/**
@@ -245,7 +251,13 @@ public function assertNoAlertPresent()
*/
public function assertChecked($locator)
{
- $this->assertTrue($this->isChecked($locator));
+ $this->assertTrue(
+ $this->isChecked($locator),
+ sprintf(
+ '"%s" not checked.',
+ $locator
+ )
+ );
}
/**
@@ -256,7 +268,13 @@ public function assertChecked($locator)
*/
public function assertNotChecked($locator)
{
- $this->assertFalse($this->isChecked($locator));
+ $this->assertFalse(
+ $this->isChecked($locator),
+ sprintf(
+ '"%s" checked.',
+ $locator
+ )
+ );
}
/**
@@ -266,7 +284,10 @@ public function assertNotChecked($locator)
*/
public function assertConfirmationPresent()
{
- $this->assertTrue($this->isConfirmationPresent());
+ $this->assertTrue(
+ $this->isConfirmationPresent(),
+ 'No confirmation present.'
+ );
}
/**
@@ -276,7 +297,10 @@ public function assertConfirmationPresent()
*/
public function assertNoConfirmationPresent()
{
- $this->assertFalse($this->isConfirmationPresent());
+ $this->assertFalse(
+ $this->isConfirmationPresent(),
+ 'Confirmation present.'
+ );
}
/**
@@ -287,7 +311,13 @@ public function assertNoConfirmationPresent()
*/
public function assertEditable($locator)
{
- $this->assertTrue($this->isEditable($locator));
+ $this->assertTrue(
+ $this->isEditable($locator),
+ sprintf(
+ '"%s" not editable.',
+ $locator
+ )
+ );
}
/**
@@ -298,7 +328,13 @@ public function assertEditable($locator)
*/
public function assertNotEditable($locator)
{
- $this->assertFalse($this->isEditable($locator));
+ $this->assertFalse(
+ $this->isEditable($locator),
+ sprintf(
+ '"%s" editable.',
+ $locator
+ )
+ );
}
/**
@@ -357,7 +393,13 @@ public function assertElementNotContainsText($locator, $text)
*/
public function assertElementPresent($locator)
{
- $this->assertTrue($this->isElementPresent($locator));
+ $this->assertTrue(
+ $this->isElementPresent($locator),
+ sprintf(
+ 'Element "%s" not present.',
+ $locator
+ )
+ );
}
/**
@@ -368,7 +410,13 @@ public function assertElementPresent($locator)
*/
public function assertElementNotPresent($locator)
{
- $this->assertFalse($this->isElementPresent($locator));
+ $this->assertFalse(
+ $this->isElementPresent($locator),
+ sprintf(
+ 'Element "%s" present.',
+ $locator
+ )
+ );
}
/**
@@ -400,7 +448,10 @@ public function assertLocationNotEquals($location)
*/
public function assertPromptPresent()
{
- $this->assertTrue($this->isPromptPresent());
+ $this->assertTrue(
+ $this->isPromptPresent(),
+ 'No prompt present.'
+ );
}
/**
@@ -410,7 +461,10 @@ public function assertPromptPresent()
*/
public function assertNoPromptPresent()
{
- $this->assertFalse($this->isPromptPresent());
+ $this->assertFalse(
+ $this->isPromptPresent(),
+ 'Prompt present.'
+ );
}
/**
@@ -421,7 +475,13 @@ public function assertNoPromptPresent()
*/
public function assertSomethingSelected($selectLocator)
{
- $this->assertTrue($this->isSomethingSelected($selectLocator));
+ $this->assertTrue(
+ $this->isSomethingSelected($selectLocator),
+ sprintf(
+ 'Nothing selected from "%s".',
+ $selectLocator
+ )
+ );
}
/**
@@ -432,7 +492,13 @@ public function assertSomethingSelected($selectLocator)
*/
public function assertNothingSelected($selectLocator)
{
- $this->assertFalse($this->isSomethingSelected($selectLocator));
+ $this->assertFalse(
+ $this->isSomethingSelected($selectLocator),
+ sprintf(
+ 'Something selected from "%s".',
+ $selectLocator
+ )
+ );
}
/**
@@ -443,7 +509,13 @@ public function assertNothingSelected($selectLocator)
*/
public function assertTextPresent($pattern)
{
- $this->assertTrue($this->isTextPresent($pattern));
+ $this->assertTrue(
+ $this->isTextPresent($pattern),
+ sprintf(
+ '"%s" not present.',
+ $pattern
+ )
+ );
}
/**
@@ -454,7 +526,13 @@ public function assertTextPresent($pattern)
*/
public function assertTextNotPresent($pattern)
{
- $this->assertFalse($this->isTextPresent($pattern));
+ $this->assertFalse(
+ $this->isTextPresent($pattern),
+ sprintf(
+ '"%s" present.',
+ $pattern
+ )
+ );
}
/**
@@ -487,10 +565,15 @@ public function assertTitleNotEquals($title)
*/
public function assertVisible($locator)
{
- $this->assertTrue($this->isVisible($locator));
+ $this->assertTrue(
+ $this->isVisible($locator),
+ sprintf(
+ '"%s" not visible.',
+ $locator
+ )
+ );
}
-
/**
* Asserts that something is not visible.
*
@@ -499,7 +582,13 @@ public function assertVisible($locator)
*/
public function assertNotVisible($locator)
{
- $this->assertFalse($this->isVisible($locator));
+ $this->assertFalse(
+ $this->isVisible($locator),
+ sprintf(
+ '"%s" visible.',
+ $locator
+ )
+ );
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.