You are here

protected function AutosaveFormTestBase::reloadPageAndRestore in Autosave Form 8

Loads the page and submits the autosave restore.

Parameters

string|\Drupal\Core\Url $path: Drupal path or URL to load into Mink controlled browser.

$last_autosave_timestamp: The last autosave timestamp for the provided path to check that the correct restore message is shown to the user.

2 calls to AutosaveFormTestBase::reloadPageAndRestore()
ContentEntityAutosaveFormTestBase::doTestAutosaveFormExistingEntity in tests/src/FunctionalJavascript/ContentEntity/ContentEntityAutosaveFormTestBase.php
Tests the autosave support on entity forms.
ContentEntityAutosaveFormTestBase::doTestSavingRestoredEntityForm in tests/src/FunctionalJavascript/ContentEntity/ContentEntityAutosaveFormTestBase.php
Tests saving an entity form restored from an autosaved state.

File

tests/src/FunctionalJavascript/AutosaveFormTestBase.php, line 81

Class

AutosaveFormTestBase
Basic functionality for autosave form tests.

Namespace

Drupal\Tests\autosave_form\FunctionalJavascript

Code

protected function reloadPageAndRestore($path, $last_autosave_timestamp) {
  $this
    ->logHtmlOutput(__FUNCTION__ . ' before reload');
  $this
    ->drupalGet($path);
  $this
    ->logHtmlOutput(__FUNCTION__ . ' after reload');
  $this
    ->assertAutosaveResumeDiscardMessageIsShown(TRUE, $last_autosave_timestamp);
  $this
    ->pressAutosaveRestoreButton();
  $this
    ->waitForAutosaveResumeButtonToDisappear();
}