You are here

public function ConditionalFieldTextfieldTest::testInvisibleFilled in Conditional Fields 8

Same name and namespace in other branches
  1. 4.x tests/src/FunctionalJavascript/ConditionalFieldTextfieldTest.php \Drupal\Tests\conditional_fields\FunctionalJavascript\ConditionalFieldTextfieldTest::testInvisibleFilled()

The target field is Invisible when the control field is Filled.

Overrides ConditionalFieldFilledEmptyInterface::testInvisibleFilled

File

tests/src/FunctionalJavascript/ConditionalFieldTextfieldTest.php, line 406

Class

ConditionalFieldTextfieldTest
Test Conditional Fields Text Handler.

Namespace

Drupal\Tests\conditional_fields\FunctionalJavascript

Code

public function testInvisibleFilled() {
  $this
    ->baseTestSteps();
  $this
    ->createCondition($this->targetFieldName, 'field_' . $this->fieldName, '!visible', '!empty');

  // Check that configuration is saved.
  $this
    ->drupalGet('admin/structure/conditional_fields/node/article');
  $this
    ->assertSession()
    ->pageTextContains($this->targetFieldName . ' ' . 'field_' . $this->fieldName . ' !visible !empty');
  $this
    ->drupalGet('node/add/article');
  $this
    ->waitUntilVisible($this->targetFieldWrapp, 0, '01. Article Body field is not visible');
  $this
    ->changeField($this->fieldSelector, 'This field is not empty.');
  $this
    ->waitUntilHidden($this->targetFieldWrapp, 10, '02. Article Body field is visible');
  $this
    ->changeField($this->fieldSelector, '');
  $this
    ->waitUntilVisible($this->targetFieldWrapp, 10, '03. Article Body field is  notvisible');
}