Mink can now check that an element does not contain the given HTML

This commit is contained in:
Sebastien Armand
2012-10-15 19:54:25 +08:00
parent b191eb1b9f
commit 5041313307
2 changed files with 20 additions and 0 deletions

View File

@@ -317,6 +317,16 @@ class MinkContext extends RawMinkContext implements TranslatedContextInterface
$this->assertSession()->elementContains('css', $element, $this->fixStepArgument($value));
}
/**
* Checks, that element with specified CSS doesn't contain specified HTML.
*
* @Then /^the "(?P<element>[^"]*)" element should not contain "(?P<value>(?:[^"]|\\")*)"$/
*/
public function assertElementNotContains($element, $value)
{
$this->assertSession()->elementNotContains('css', $element, $this->fixStepArgument($value));
}
/**
* Checks, that element with specified CSS exists on page.
*

View File

@@ -383,6 +383,16 @@ trait MinkDictionary
$this->assertSession()->elementContains('css', $element, $this->fixStepArgument($value));
}
/**
* Checks, that element with specified CSS doesn't contain specified HTML.
*
* @Then /^the "(?P<element>[^"]*)" element should not contain "(?P<value>(?:[^"]|\\")*)"$/
*/
public function assertElementNotContains($element, $value)
{
$this->assertSession()->elementNotContains('css', $element, $this->fixStepArgument($value));
}
/**
* Checks, that element with specified CSS exists on page.
*