make all login tests skip (instead of fail) if there are no social networking credentials included in the repo
This commit is contained in:
parent
b4f6356ed5
commit
5580148632
2 changed files with 20 additions and 4 deletions
|
@ -87,7 +87,7 @@ Testing and Development
|
||||||
---
|
---
|
||||||
There is a [Mocha](https://mochajs.org/) and [Selenium](http://docs.seleniumhq.org/)
|
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
|
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).
|
related to cookies and logging into sites).
|
||||||
|
|
||||||
To run the tests, give the following a try:
|
To run the tests, give the following a try:
|
||||||
|
|
|
@ -18,6 +18,11 @@ describe("Logging into popular sites", function () {
|
||||||
|
|
||||||
describe("GitHub", function () {
|
describe("GitHub", function () {
|
||||||
|
|
||||||
|
if (!testParams.github.username) {
|
||||||
|
console.log(" * No Github account information in test.config.js, skipping these tests.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const formValues = [
|
const formValues = [
|
||||||
["login", testParams.github.username],
|
["login", testParams.github.username],
|
||||||
["password", testParams.github.password]
|
["password", testParams.github.password]
|
||||||
|
@ -93,6 +98,12 @@ describe("Logging into popular sites", function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("Facebook", 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 () {
|
this.timeout = function () {
|
||||||
return 20000;
|
return 20000;
|
||||||
};
|
};
|
||||||
|
@ -136,8 +147,13 @@ describe("Logging into popular sites", function () {
|
||||||
|
|
||||||
describe("YouTube", 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 () {
|
this.timeout = function () {
|
||||||
return 20000;
|
return 30000;
|
||||||
};
|
};
|
||||||
|
|
||||||
it("Log in", function (done) {
|
it("Log in", function (done) {
|
||||||
|
@ -159,7 +175,7 @@ describe("Logging into popular sites", function () {
|
||||||
.then(function () {
|
.then(function () {
|
||||||
return driverReference.wait(until.elementLocated(
|
return driverReference.wait(until.elementLocated(
|
||||||
by.name("identifier")
|
by.name("identifier")
|
||||||
), 3000);
|
), 5000);
|
||||||
})
|
})
|
||||||
.then(identifierElm => driverReference.wait(until.elementIsVisible(identifierElm)))
|
.then(identifierElm => driverReference.wait(until.elementIsVisible(identifierElm)))
|
||||||
.then(identifierElm => identifierElm.sendKeys(testParams.google.username, keys.ENTER))
|
.then(identifierElm => identifierElm.sendKeys(testParams.google.username, keys.ENTER))
|
||||||
|
@ -167,7 +183,7 @@ describe("Logging into popular sites", function () {
|
||||||
.then(function () {
|
.then(function () {
|
||||||
return driverReference.wait(until.elementLocated(
|
return driverReference.wait(until.elementLocated(
|
||||||
by.name("password")
|
by.name("password")
|
||||||
), 3000);
|
), 5000);
|
||||||
})
|
})
|
||||||
.then(passwordElm => driverReference.wait(until.elementIsVisible(passwordElm)))
|
.then(passwordElm => driverReference.wait(until.elementIsVisible(passwordElm)))
|
||||||
.then(passwordElm => passwordElm.sendKeys(testParams.google.password, keys.ENTER))
|
.then(passwordElm => passwordElm.sendKeys(testParams.google.password, keys.ENTER))
|
||||||
|
|
Loading…
Add table
Reference in a new issue