public function WebformCardsUiJavaScriptTest::testUi in Webform 6.x
Same name and namespace in other branches
- 8.5 modules/webform_cards/tests/src/FunctionalJavaScript/WebformCardsUiJavaScriptTest.php \Drupal\Tests\webform_cards\FunctionalJavaScript\WebformCardsUiJavaScriptTest::testUi()
Test webform cards UI.
File
- modules/
webform_cards/ tests/ src/ FunctionalJavaScript/ WebformCardsUiJavaScriptTest.php, line 31
Class
- WebformCardsUiJavaScriptTest
- Tests for webform cards UI.
Namespace
Drupal\Tests\webform_cards\FunctionalJavaScriptCode
public function testUi() {
$this
->placeBlocks();
$this
->drupalLogin($this->rootUser);
/**************************************************************************/
// Check that 'Add page' and 'Add card' actions are visible.
$this
->drupalGet('/admin/structure/webform/manage/contact');
$this
->assertElementVisible('#webform-ui-add-page');
$this
->assertElementVisible('#webform-ui-add-card');
// Check that only 'Add card' action is visible on cards form.
$this
->drupalGet('/admin/structure/webform/manage/test_cards_progress');
$this
->assertElementNotVisible('#webform-ui-add-page');
$this
->assertElementVisible('#webform-ui-add-card');
// Check that only 'Add page' action is visible on wizard form.
$this
->drupalGet('/admin/structure/webform/manage/test_form_wizard_basic');
$this
->assertElementVisible('#webform-ui-add-page');
$this
->assertElementNotVisible('#webform-ui-add-card');
}