Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chalasr/de05cf6ffb2e93de515b01132fcd00cb to your computer and use it in GitHub Desktop.
Save chalasr/de05cf6ffb2e93de515b01132fcd00cb to your computer and use it in GitHub Desktop.
Behat context feature: Element with id :id should have attribute :attribute containing :expectedValue
<?php
/**
* @Then element with id :id should have attribute :attribute containing :expectedValue
*/
public function elementWithIdShouldHaveAttributeContaining($id, $attribute, $expectedValue)
{
$this->assertSession()->elementAttributeContains('css', '#'.$id, $attribute , $expectedValue);
}
@chalasr
Copy link
Author

chalasr commented Jul 7, 2016

Usage = Then element with id "pages_2-collapse" should have attribute "aria-expanded" containing "true"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment