public function SocialMinkContext::attachFileToHiddenField in Open Social 10.1.x
Same name and namespace in other branches
- 8.9 tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::attachFileToHiddenField()
- 8.3 tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::attachFileToHiddenField()
- 8.4 tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::attachFileToHiddenField()
- 8.5 tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::attachFileToHiddenField()
- 8.6 tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::attachFileToHiddenField()
- 8.7 tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::attachFileToHiddenField()
- 8.8 tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::attachFileToHiddenField()
- 10.3.x tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::attachFileToHiddenField()
- 10.0.x tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::attachFileToHiddenField()
- 10.2.x tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::attachFileToHiddenField()
Attaches file to field with specified name.
@When /^(?:|I )attach the file "(?P<path>[^"]*)" to hidden field "(?P<field>(?:[^"]|\\")*)"$/
File
- tests/
behat/ features/ bootstrap/ SocialMinkContext.php, line 150
Class
- SocialMinkContext
- Defines application features from the specific context.
Namespace
Drupal\social\BehatCode
public function attachFileToHiddenField($field, $path) {
$field = $this
->fixStepArgument($field);
$id = $this
->getSession()
->getPage()
->findField($field)
->getAttribute('id');
$javascript = "jQuery('#{$id}').parent().removeClass('hidden')";
$this
->getSession()
->executeScript($javascript);
$this
->attachFileToField($field, $path);
}