You are here

private function MediaBrowserContext::uploadJs in Lightning Media 8.3

Same name and namespace in other branches
  1. 8.2 tests/contexts/MediaBrowserContext.behat.inc \Acquia\LightningExtension\Context\MediaBrowserContext::uploadJS()

Uploads a file in the media browser using JavaScript.

Parameters

string $file: The absolute path to the file.

1 call to MediaBrowserContext::uploadJs()
MediaBrowserContext::upload in tests/contexts/MediaBrowserContext.behat.inc
Uploads a file in the media browser.

File

tests/contexts/MediaBrowserContext.behat.inc, line 188

Class

MediaBrowserContext
Contains step definitions for interacting with Lightning's media browser.

Namespace

Acquia\LightningExtension\Context

Code

private function uploadJs($file) {
  $page = $this
    ->getSession()
    ->getPage();
  $page
    ->clickLink('Upload');
  $page
    ->attachFileToField('File', $file);
  $this
    ->awaitExpression('jQuery("#entity").children().length');
}