class MediaSubContext in Panopoly 7
Hierarchy
- class \MediaSubContext extends \Drupal\DrupalExtension\Context\RawDrupalContext implements \Drupal\DrupalExtension\Context\DrupalSubContextInterface
Expanded class hierarchy of MediaSubContext
File
- modules/
panopoly/ panopoly_test/ behat/ steps/ panopoly_test_media.behat.inc, line 13 - Provide Behat step-definitions for the Media module.
View source
class MediaSubContext extends RawDrupalContext implements DrupalSubContextInterface {
/**
* Contains the DrupalDriverManager.
*
* @var \Drupal\DrupalDriverManager
*/
private $drupal;
/**
* Initializes context.
*/
public function __construct(DrupalDriverManager $drupal) {
$this->drupal = $drupal;
}
/**
* @When I click the fake :text button
*/
public function iClickTheFakeButton($text) {
// Media style selector "buttons" are A tags with no href, so not findable
// by normal steps.
$driver = $this
->getSession()
->getDriver();
$buttons = $driver
->find("//a[text()='{$text}']");
$buttons[0]
->click();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MediaSubContext:: |
private | property | Contains the DrupalDriverManager. | |
MediaSubContext:: |
public | function | @When I click the fake :text button | |
MediaSubContext:: |
public | function | Initializes context. |