You are here

private function MediaBrowserContext::uploadNoJs in Lightning Media 8.3

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

Uploads a file in the media browser without using JavaScript.

Parameters

string $file: The absolute path to the file.

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

File

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

Class

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

Namespace

Acquia\LightningExtension\Context

Code

private function uploadNoJs($file) {
  $page = $this
    ->getSession()
    ->getPage();
  $assert = $this
    ->assertSession();

  // Switch to the "Upload" tab of the media browser, which should be the
  // first button named "Upload" on the page.
  $page
    ->pressButton('Upload');
  $page
    ->attachFileToField('File', $file);
  $assert
    ->elementExists('css', '.js-form-managed-file')
    ->pressButton('Upload');
}