Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / tests / Drupal / Nightwatch / Tests / statesTest.js
diff --git a/web/core/tests/Drupal/Nightwatch/Tests/statesTest.js b/web/core/tests/Drupal/Nightwatch/Tests/statesTest.js
new file mode 100644 (file)
index 0000000..f7ee1ba
--- /dev/null
@@ -0,0 +1,23 @@
+module.exports = {
+  '@tags': ['core'],
+  before(browser) {
+    browser.drupalInstall().drupalLoginAsAdmin(() => {
+      browser
+        .drupalRelativeURL('/admin/modules')
+        .setValue('input[type="search"]', 'FormAPI')
+        .waitForElementVisible('input[name="modules[form_test][enable]"]', 1000)
+        .click('input[name="modules[form_test][enable]"]')
+        .click('input[type="submit"]') // Submit module form.
+        .click('input[type="submit"]'); // Confirm installation of dependencies.
+    });
+  },
+  after(browser) {
+    browser.drupalUninstall();
+  },
+  'Test form with state API': browser => {
+    browser
+      .drupalRelativeURL('/form-test/javascript-states-form')
+      .waitForElementVisible('body', 1000)
+      .waitForElementNotVisible('input[name="textfield"]', 1000);
+  },
+};