You are here

protected function ResponsivePreview::selectDevice in Thunder 8.3

Same name and namespace in other branches
  1. 8.5 tests/src/FunctionalJavascript/Integration/ResponsivePreview.php \Drupal\Tests\thunder\FunctionalJavascript\Integration\ResponsivePreview::selectDevice()
  2. 8.2 tests/src/FunctionalJavascript/Integration/ResponsivePreview.php \Drupal\Tests\thunder\FunctionalJavascript\Integration\ResponsivePreview::selectDevice()
  3. 8.4 tests/src/FunctionalJavascript/Integration/ResponsivePreview.php \Drupal\Tests\thunder\FunctionalJavascript\Integration\ResponsivePreview::selectDevice()
  4. 6.2.x tests/src/FunctionalJavascript/Integration/ResponsivePreview.php \Drupal\Tests\thunder\FunctionalJavascript\Integration\ResponsivePreview::selectDevice()
  5. 6.0.x tests/src/FunctionalJavascript/Integration/ResponsivePreview.php \Drupal\Tests\thunder\FunctionalJavascript\Integration\ResponsivePreview::selectDevice()
  6. 6.1.x tests/src/FunctionalJavascript/Integration/ResponsivePreview.php \Drupal\Tests\thunder\FunctionalJavascript\Integration\ResponsivePreview::selectDevice()

Select device for device preview.

NOTE: Index starts from 1.

Parameters

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

1 call to ResponsivePreview::selectDevice()
ResponsivePreview::testDevicePreview in tests/src/FunctionalJavascript/Integration/ResponsivePreview.php
Testing integration of "responsive_preview" module.

File

tests/src/FunctionalJavascript/Integration/ResponsivePreview.php, line 88

Class

ResponsivePreview
Tests the device preview functionality integration.

Namespace

Drupal\Tests\thunder\FunctionalJavascript\Integration

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();
}