public function ConditionalFieldCheckboxTest::testInvisibleChecked in Conditional Fields 4.x
Same name and namespace in other branches
- 8 tests/src/FunctionalJavascript/ConditionalFieldCheckboxTest.php \Drupal\Tests\conditional_fields\FunctionalJavascript\ConditionalFieldCheckboxTest::testInvisibleChecked()
File
- tests/
src/ FunctionalJavascript/ ConditionalFieldCheckboxTest.php, line 64
Class
- ConditionalFieldCheckboxTest
- Test Conditional Fields Checkbox state.
Namespace
Drupal\Tests\conditional_fields\FunctionalJavascriptCode
public function testInvisibleChecked() {
$this
->baseTestSteps();
// Visit a ConditionalFields configuration page for `Article` Content type.
$this
->createCondition('body', 'promote', '!visible', 'checked');
// Check that configuration is saved.
$this
->drupalGet('admin/structure/conditional_fields/node/article');
$this
->assertSession()
->pageTextContains('body promote !visible checked');
// Visit Article Add form to check that conditions are applied.
$this
->drupalGet('node/add/article');
$this
->waitUntilHidden('.field--name-body', 10, '01. Article Body field is visible');
$this
->changeSelect('#edit-promote-value', FALSE);
$this
->waitUntilVisible('.field--name-body', 0, '02. Article Body field is not visible');
}