function JsWebAssertTestForm::addWaitForElementVisible

Same name and namespace in other branches
  1. 8.9.x core/modules/system/tests/modules/js_webassert_test/src/Form/JsWebAssertTestForm.php \Drupal\js_webassert_test\Form\JsWebAssertTestForm::addWaitForElementVisible()
  2. 10 core/modules/system/tests/modules/js_webassert_test/src/Form/JsWebAssertTestForm.php \Drupal\js_webassert_test\Form\JsWebAssertTestForm::addWaitForElementVisible()
  3. 11.x core/modules/system/tests/modules/js_webassert_test/src/Form/JsWebAssertTestForm.php \Drupal\js_webassert_test\Form\JsWebAssertTestForm::addWaitForElementVisible()
  4. 11.x core/modules/system/tests/modules/jswebassert_test/src/Form/JsWebAssertTestForm.php \Drupal\jswebassert_test\Form\JsWebAssertTestForm::addWaitForElementVisible()

Ajax callback for the "Test waitForElementVisible" button.

File

core/modules/system/tests/modules/js_webassert_test/src/Form/JsWebAssertTestForm.php, line 202

Class

JsWebAssertTestForm
Test form for JSWebAssert WebDriverTestBase.

Namespace

Drupal\js_webassert_test\Form

Code

public static function addWaitForElementVisible(array $form, FormStateInterface $form_state) {
  // Attach the library necessary for this test.
  $form['#attached']['library'][] = 'js_webassert_test/wait_for_element';
  $form['element_invisible'] = [
    '#id' => 'js_webassert_test_element_invisible',
    '#type' => 'submit',
    '#value' => 'Added WaitForElementVisible',
    '#button_type' => 'primary',
    '#attributes' => [
      'style' => [
        'display: none;',
      ],
    ],
  ];
  return $form;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.