Skip to content

Fix #2 #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion globals.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export default {
waitForConditionTimeout: 10000
waitForConditionTimeout: 100000
};
57 changes: 50 additions & 7 deletions nightwatch.conf.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,52 @@
require('babel-core/register');
const fs = require("fs");
require("babel-core/register")

module.exports = ((settings) => {
const seleniumFileName =
fs.readdirSync("node_modules/selenium-standalone/.selenium/selenium-server/");
settings.selenium.server_path += seleniumFileName;
return settings;
})(require("./nightwatch.json"));
settings.test_settings = {
default: {
launch_url: "https://nightwatchjs.org",
},

selenium: {
// Selenium Server is running locally and is managed by Nightwatch
selenium: {
start_process: true,
port: 4444,
server_path: require("selenium-server").path,
cli_args: {
"webdriver.gecko.driver": require("geckodriver").path,
"webdriver.chrome.driver": require("chromedriver").path,
"webdriver.ie.driver":
process.platform === "win32" ? require("iedriver").path : "",
},
},
webdriver: {
start_process: false,
},
},

"selenium.chrome": {
extends: "selenium",
desiredCapabilities: {
browserName: "chrome",
chromeOptions: {
w3c: false,
},
},
},

"selenium.firefox": {
extends: "selenium",
desiredCapabilities: {
browserName: "firefox",
},
},

"selenium.ie": {
extends: "selenium",
desiredCapabilities: {
browserName: "internet explorer",
},
},
}
return settings
})(require("./nightwatch.json"))
35 changes: 1 addition & 34 deletions nightwatch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,5 @@
"custom_commands_path": "",
"custom_assertions_path": "",
"page_objects_path": "pages",
"globals_path": "globals",

"selenium": {
"start_process": true,
"server_path": "node_modules/selenium-standalone/.selenium/selenium-server/",
"log_path": "./reports",
"host": "127.0.0.1",
"port": 4444,
"cli_args": {
"webdriver.chrome.driver": ""
}
},
"test_settings": {
"default": {
"launch_url": "https://localhost",
"selenium_port": 80,
"selenium_host": "ondemand.saucelabs.com",
"silent": true,
"globals": {
"waitForConditionTimeout": 5000
},
"username" : "${SAUCE_USERNAME}",
"access_key" : "${SAUCE_ACCESS_KEY}"
},
"local": {
"selenium_port": 4444,
"selenium_host": "localhost",
"desiredCapabilities": {
"browserName": "chrome",
"javascriptEnabled": true,
"acceptSslCerts": true
}
}
}
"globals_path": "globals"
}
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
"main": "index.js",
"scripts": {
"e2e-setup": "selenium-standalone install",
"sauce": "nightwatch",
"test": "nightwatch --env local"
"firefox": "nightwatch --env firefox",
"sauce": "nightwatch --env saucelabs",
"test": "nightwatch"
},
"keywords": [],
"author": "John Kennedy - @codejockie",
Expand All @@ -15,6 +16,10 @@
"babel-cli": "^6.26.0",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-preset-es2015": "^6.24.1",
"chromedriver": "^81.0.0",
"geckodriver": "^1.19.1",
"nightwatch": "^1.3.5",
"selenium-server": "^3.141.59",
"selenium-standalone": "^6.7.0"
}
}
2 changes: 1 addition & 1 deletion pages/signinPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const signinCommands = {
};

export default {
url: 'https://cjdocs.herokuapp.com/auth/signin',
url: 'https://cjdocs.herokuapp.com/signin',
commands: [signinCommands],
elements: {
emailInput: {
Expand Down
2 changes: 1 addition & 1 deletion tests/signin.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
.navigate()
.signin(process.env.EMAIL, process.env.PASSWORD);

instancesPage.expect.element('@homepageWelcomeTitle').text.to.contain('Welcome to the CJDocs Home!');
instancesPage.expect.element('@homepageWelcomeTitle').text.to.contain('Welcome to the Docs Home!');

client.end();
}
Expand Down
Loading