Unverified Commit 8aef9a84 authored by alexpott's avatar alexpott

Issue #2976593 by drpal, justafish, dawehner: Prefix Nightwatch commands with a "drupal" namespace

parent 8f6fcbdd
...@@ -14,7 +14,7 @@ import { commandAsWebserver } from '../globals'; ...@@ -14,7 +14,7 @@ import { commandAsWebserver } from '../globals';
* @return {object} * @return {object}
* The 'browser' object. * The 'browser' object.
*/ */
exports.command = function installDrupal({ setupFile = '' }, callback) { exports.command = function drupalInstall({ setupFile = '' }, callback) {
const self = this; const self = this;
try { try {
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
* @return {object} * @return {object}
* The 'browser' object. * The 'browser' object.
*/ */
exports.command = function logAndEnd({ onlyOnError = true }, callback) { exports.command = function drupalLogAndEnd({ onlyOnError = true }, callback) {
const self = this; const self = this;
this.drupalLogConsole = true; this.drupalLogConsole = true;
this.drupalLogConsoleOnlyOnError = onlyOnError; this.drupalLogConsoleOnlyOnError = onlyOnError;
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* @return {object} * @return {object}
* The 'browser' object. * The 'browser' object.
*/ */
exports.command = function relativeURL(pathname, callback) { exports.command = function drupalRelativeURL(pathname, callback) {
const self = this; const self = this;
this.url(`${process.env.DRUPAL_TEST_BASE_URL}${pathname}`); this.url(`${process.env.DRUPAL_TEST_BASE_URL}${pathname}`);
......
...@@ -9,7 +9,7 @@ import { commandAsWebserver } from '../globals'; ...@@ -9,7 +9,7 @@ import { commandAsWebserver } from '../globals';
* @return {object} * @return {object}
* The 'browser' object. * The 'browser' object.
*/ */
exports.command = function uninstallDrupal(callback) { exports.command = function drupalUninstal(callback) {
const self = this; const self = this;
const prefix = self.drupalDbPrefix; const prefix = self.drupalDbPrefix;
......
...@@ -2,18 +2,18 @@ module.exports = { ...@@ -2,18 +2,18 @@ module.exports = {
'@tags': ['core'], '@tags': ['core'],
before(browser) { before(browser) {
browser browser
.installDrupal({ setupFile: 'core/tests/Drupal/TestSite/TestSiteInstallTestScript.php' }); .drupalInstall({ setupFile: 'core/tests/Drupal/TestSite/TestSiteInstallTestScript.php' });
}, },
after(browser) { after(browser) {
browser browser
.uninstallDrupal(); .drupalUninstall();
}, },
'Test page': (browser) => { 'Test page': (browser) => {
browser browser
.relativeURL('/test-page') .drupalRelativeURL('/test-page')
.waitForElementVisible('body', 1000) .waitForElementVisible('body', 1000)
.assert.containsText('body', 'Test page text') .assert.containsText('body', 'Test page text')
.logAndEnd({ onlyOnError: false }); .drupalLogAndEnd({ onlyOnError: false });
}, },
/** /**
'Example failing test': (browser) => { 'Example failing test': (browser) => {
...@@ -25,7 +25,7 @@ module.exports = { ...@@ -25,7 +25,7 @@ module.exports = {
// Wait for some errors to build up. // Wait for some errors to build up.
.pause(5000) .pause(5000)
.assert.containsText('h1', 'I\'m the operator with my pocket calculator') .assert.containsText('h1', 'I\'m the operator with my pocket calculator')
.logAndEnd(); .drupalLogAndEnd();
}, },
**/ **/
}; };
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment