WebformUiElementJavaScriptTest.php in Webform 8.5        
                          
                  
                        
  
  
  
  
File
  modules/webform_ui/tests/src/FunctionalJavascript/WebformUiElementJavaScriptTest.php
  
    View source  
  <?php
namespace Drupal\Tests\webform_ui\FunctionalJavascript;
use Drupal\Tests\webform\FunctionalJavascript\WebformWebDriverTestBase;
class WebformUiElementJavaScriptTest extends WebformWebDriverTestBase {
  
  public static $modules = [
    'webform',
    'webform_ui',
  ];
  
  protected static $testWebforms = [];
  
  public function testElement() {
    $page = $this
      ->getSession()
      ->getPage();
    $assert_session = $this
      ->assertSession();
    
    $this
      ->drupalLogin($this->rootUser);
    $this
      ->drupalGet('/admin/structure/webform/manage/contact/element/add/textfield');
    
    $title = $page
      ->findField('properties[title]');
    $title
      ->setValue('destination');
    $assert_session
      ->waitForText("Please avoid using the reserved word 'destination' as the element's key.");
    
    $title = $page
      ->findField('properties[title]');
    $title
      ->setValue('destination');
    $assert_session
      ->waitForText("Please avoid using the reserved word 'destination' as the element's key.");
  }
}