You are here

protected function ResponsivePreviewTest::selectDevice in Responsive Theme Preview 8

Select device for device preview.

NOTE: Index starts from 1.

Parameters

int $xpath_device_button: The index number of device in drop-down list.

2 calls to ResponsivePreviewTest::selectDevice()
ResponsivePreviewTest::testContentEdit in tests/src/FunctionalJavascript/ResponsivePreviewTest.php
Tests that preview works on node edit.
ResponsivePreviewTest::testToolbarIntegration in tests/src/FunctionalJavascript/ResponsivePreviewTest.php
Tests that the toolbar integration works properly.

File

tests/src/FunctionalJavascript/ResponsivePreviewTest.php, line 107

Class

ResponsivePreviewTest
Tests the toolbar integration.

Namespace

Drupal\Tests\responsive_preview\FunctionalJavascript

Code

protected function selectDevice($xpath_device_button) {
  $page = $this
    ->getSession()
    ->getPage();
  $page
    ->find('xpath', '//*[@id="responsive-preview-toolbar-tab"]/button')
    ->click();
  $this
    ->assertSession()
    ->assertWaitOnAjaxRequest();
  $page
    ->find('xpath', $xpath_device_button)
    ->click();
  $this
    ->assertSession()
    ->assertWaitOnAjaxRequest();
}