You are here

public function AssetInjectorJsTest::testSaveContinue in Asset Injector 8.2

Tests if the save and continue button works accurately.

Throws

\Exception

File

tests/src/Functional/AssetInjectorJsTest.php, line 106

Class

AssetInjectorJsTest
Class AssetInjectorJsTest.

Namespace

Drupal\Tests\asset_injector\Functional

Code

public function testSaveContinue() {
  $page = $this
    ->getSession()
    ->getPage();
  $this
    ->testJsPermissionGranted();
  $this
    ->drupalGet('admin/config/development/asset-injector/js/add');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->assertSession()
    ->pageTextContains($this
    ->t('Code'));
  $page
    ->fillField('Label', 'test save continue');
  $page
    ->fillField('Machine-readable name', 'test_save_continue');
  $page
    ->fillField('Code', 'var a;');
  $page
    ->pressButton('Save and Continue Editing');
  $this
    ->assertSession()
    ->pageTextContains('Created the test save continue Asset Injector');
  $this
    ->assertSession()
    ->addressEquals('admin/config/development/asset-injector/js/test_save_continue');
}