make all login tests skip (instead of fail) if there are no social networking credentials included in the repo

This commit is contained in:
Peter Snyder 2017-10-23 01:45:27 -05:00
parent b4f6356ed5
commit 5580148632
2 changed files with 20 additions and 4 deletions

View file

@ -87,7 +87,7 @@ Testing and Development
---
There is a [Mocha](https://mochajs.org/) and [Selenium](http://docs.seleniumhq.org/)
based test suite in place now. To run it you'll need to provide the test suite
with some GitHub and YouTube credentials (to make check for previous regressions
with some social networking credentials (to make check for previous regressions
related to cookies and logging into sites).
To run the tests, give the following a try:

View file

@ -18,6 +18,11 @@ describe("Logging into popular sites", function () {
describe("GitHub", function () {
if (!testParams.github.username) {
console.log(" * No Github account information in test.config.js, skipping these tests.");
return;
}
const formValues = [
["login", testParams.github.username],
["password", testParams.github.password]
@ -93,6 +98,12 @@ describe("Logging into popular sites", function () {
});
describe("Facebook", function () {
if (!testParams.facebook.username) {
console.log(" * No Facebook account information in test.config.js, skipping these tests.");
return;
}
this.timeout = function () {
return 20000;
};
@ -136,8 +147,13 @@ describe("Logging into popular sites", function () {
describe("YouTube", function () {
if (!testParams.google.username) {
console.log(" * No Google/YouTube account information in test.config.js, skipping these tests.");
return;
}
this.timeout = function () {
return 20000;
return 30000;
};
it("Log in", function (done) {
@ -159,7 +175,7 @@ describe("Logging into popular sites", function () {
.then(function () {
return driverReference.wait(until.elementLocated(
by.name("identifier")
), 3000);
), 5000);
})
.then(identifierElm => driverReference.wait(until.elementIsVisible(identifierElm)))
.then(identifierElm => identifierElm.sendKeys(testParams.google.username, keys.ENTER))
@ -167,7 +183,7 @@ describe("Logging into popular sites", function () {
.then(function () {
return driverReference.wait(until.elementLocated(
by.name("password")
), 3000);
), 5000);
})
.then(passwordElm => driverReference.wait(until.elementIsVisible(passwordElm)))
.then(passwordElm => passwordElm.sendKeys(testParams.google.password, keys.ENTER))