You are here

protected function MediaImageModifyTest::clickSave in Thunder 8.2

Click article save option based on index of action.

1 - Save as unpublished (default). 2 - Save and publish.

Media entity still using the old collased "Save and publish" button.

@TODO: Remove this when switching to core media.

Parameters

int $actionIndex: Index for option that should be clicked. (by default 1)

Overrides ThunderJavascriptTestBase::clickSave

2 calls to MediaImageModifyTest::clickSave()
MediaImageModifyTest::testFocalPointChange in tests/src/FunctionalJavascript/MediaImageModifyTest.php
Test Focal Point change.
MediaImageModifyTest::testImageEdit in tests/src/FunctionalJavascript/MediaImageModifyTest.php
Test Image modifications (edit fields).

File

tests/src/FunctionalJavascript/MediaImageModifyTest.php, line 121

Class

MediaImageModifyTest
Tests the Image media modification.

Namespace

Drupal\Tests\thunder\FunctionalJavascript

Code

protected function clickSave($actionIndex = 1) {
  $page = $this
    ->getSession()
    ->getPage();
  if ($actionIndex !== 1) {
    $page
      ->find('xpath', '//ul[@data-drupal-selector="edit-save"]/li[2]/button')
      ->click();
  }
  $page
    ->find('xpath', '(//ul[@data-drupal-selector="edit-save"]/li/input)[' . $actionIndex . ']')
    ->click();
}