class DropzoneContext in Lightning Media 8
Same name and namespace in other branches
- 8.2 tests/contexts/DropzoneContext.behat.inc \Acquia\LightningExtension\Context\DropzoneContext
- 8.3 tests/contexts/DropzoneContext.behat.inc \Acquia\LightningExtension\Context\DropzoneContext
Contains step definitions for interacting with DropzoneJS widgets.
Hierarchy
- class \Acquia\LightningExtension\Context\DropzoneContext extends \Drupal\DrupalExtension\Context\DrupalSubContextBase
Expanded class hierarchy of DropzoneContext
File
- tests/
contexts/ DropzoneContext.behat.inc, line 11
Namespace
Acquia\LightningExtension\ContextView source
class DropzoneContext extends DrupalSubContextBase {
/**
* Attaches a file to a dropzone.
*
* @param string $file
* The file to attach, relative to the file directory configured for Mink.
*
* @When I attach the file :file to the dropzone
*/
public function attachFileToDropzone($file) {
$this
->getSession()
->executeScript('Dropzone.instances[0].hiddenFileInput.name = "file"');
$this
->getContext(MinkContext::class)
->attachFileToField('file', $file);
// @todo: React when the upload actually completes.
sleep(3);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DropzoneContext:: |
public | function | Attaches a file to a dropzone. |