Zfilipin has uploaded a new change for review. https://gerrit.wikimedia.org/r/268412
Change subject: WIP Nightwatch.js ...................................................................... WIP Nightwatch.js Bug: T108874 Change-Id: Id6bc52b4ef7f7ed7dda9d32cbe9b7feb36bde556 --- A nightwatch A nightwatch.json M package.json A tests/google.js 4 files changed, 64 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/12/268412/1 diff --git a/nightwatch b/nightwatch new file mode 100755 index 0000000..42c1d96 --- /dev/null +++ b/nightwatch @@ -0,0 +1,2 @@ +#!/usr/bin/env node +require('nightwatch/bin/runner.js'); diff --git a/nightwatch.json b/nightwatch.json new file mode 100644 index 0000000..e6f6031 --- /dev/null +++ b/nightwatch.json @@ -0,0 +1,46 @@ +{ + "src_folders" : ["tests"], + "output_folder" : "reports", + "custom_commands_path" : "", + "custom_assertions_path" : "", + "page_objects_path" : "", + "globals_path" : "", + + "selenium" : { + "start_process" : false, + "server_path" : "", + "log_path" : "", + "host" : "127.0.0.1", + "port" : 4444, + "cli_args" : { + "webdriver.chrome.driver" : "", + "webdriver.ie.driver" : "" + } + }, + + "test_settings" : { + "default" : { + "launch_url" : "http://localhost", + "selenium_port" : 4444, + "selenium_host" : "localhost", + "silent": true, + "screenshots" : { + "enabled" : false, + "path" : "" + }, + "desiredCapabilities": { + "browserName": "firefox", + "javascriptEnabled": true, + "acceptSslCerts": true + } + }, + + "chrome" : { + "desiredCapabilities": { + "browserName": "chrome", + "javascriptEnabled": true, + "acceptSslCerts": true + } + } + } +} diff --git a/package.json b/package.json index 5a8257c..044d617 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,8 @@ }, "devDependencies": { "grunt": "0.4.5", - "grunt-cli": "0.1.13", "grunt-banana-checker": "0.4.0", + "grunt-cli": "0.1.13", "grunt-contrib-copy": "0.8.1", "grunt-contrib-jshint": "0.11.3", "grunt-contrib-watch": "0.6.1", @@ -19,6 +19,7 @@ "karma-chrome-launcher": "0.2.2", "karma-firefox-launcher": "0.1.7", "karma-qunit": "0.1.5", + "nightwatch": "^0.8.15", "qunitjs": "1.18.0" } } diff --git a/tests/google.js b/tests/google.js new file mode 100644 index 0000000..ffb8eea --- /dev/null +++ b/tests/google.js @@ -0,0 +1,14 @@ +module.exports = { + 'Demo test Google' : function (browser) { + browser + .url('http://www.google.com') + .waitForElementVisible('body', 1000) + .setValue('input[type=text]', 'nightwatch') + .waitForElementVisible('button[name=btnG]', 1000) + .click('button[name=btnG]') + .pause(1000) + .assert.containsText('#main', 'Night Watch') + .end(); + } +}; + -- To view, visit https://gerrit.wikimedia.org/r/268412 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id6bc52b4ef7f7ed7dda9d32cbe9b7feb36bde556 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Zfilipin <zfili...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits