You are here

public function UiPageTest::testDeleteExpressionInRule in Rules 8.3

Tests that deleting an expression from a rule works.

File

tests/src/Functional/UiPageTest.php, line 128

Class

UiPageTest
Tests that the Rules UI pages are reachable.

Namespace

Drupal\Tests\rules\Functional

Code

public function testDeleteExpressionInRule() {

  // Setup a rule with one condition.
  $this
    ->testCreateReactionRule();

  /** @var \Drupal\Tests\WebAssert $assert */
  $assert = $this
    ->assertSession();
  $this
    ->clickLink('Delete');
  $assert
    ->pageTextContains('Are you sure you want to delete Node is promoted from Test rule?');
  $this
    ->pressButton('Delete');
  $assert
    ->pageTextContains('You have unsaved changes.');
  $this
    ->pressButton('Save');
  $assert
    ->pageTextContains('Reaction rule Test rule has been updated. ');
}