mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-19 14:13:34 +01:00
[fix:test] Use promise chain instead of chain (is deprecated) (#3419)
Fix warning when running tests: "chain api has been deprecated, use promise chain instead."
This commit is contained in:
parent
ad898b701a
commit
7729e5a1a9
1 changed files with 6 additions and 7 deletions
|
@ -12,14 +12,13 @@ var config = {
|
||||||
var allTestsPassed = true;
|
var allTestsPassed = true;
|
||||||
|
|
||||||
var sauceTestWorker = async.queue(function (testSettings, callback) {
|
var sauceTestWorker = async.queue(function (testSettings, callback) {
|
||||||
var browser = wd.remote(config.host, config.port, config.username, config.accessKey);
|
var browser = wd.promiseChainRemote(config.host, config.port, config.username, config.accessKey);
|
||||||
var browserChain = browser.chain();
|
|
||||||
var name = process.env.GIT_HASH + " - " + testSettings.browserName + " " + testSettings.version + ", " + testSettings.platform;
|
var name = process.env.GIT_HASH + " - " + testSettings.browserName + " " + testSettings.version + ", " + testSettings.platform;
|
||||||
testSettings.name = name;
|
testSettings.name = name;
|
||||||
testSettings["public"] = true;
|
testSettings["public"] = true;
|
||||||
testSettings["build"] = process.env.GIT_HASH;
|
testSettings["build"] = process.env.GIT_HASH;
|
||||||
|
|
||||||
browserChain.init(testSettings).get("http://localhost:9001/tests/frontend/", function(){
|
browser.init(testSettings).get("http://localhost:9001/tests/frontend/", function(){
|
||||||
var url = "https://saucelabs.com/jobs/" + browser.sessionID;
|
var url = "https://saucelabs.com/jobs/" + browser.sessionID;
|
||||||
console.log("Remote sauce test '" + name + "' started! " + url);
|
console.log("Remote sauce test '" + name + "' started! " + url);
|
||||||
|
|
||||||
|
@ -28,7 +27,7 @@ var sauceTestWorker = async.queue(function (testSettings, callback) {
|
||||||
getStatusInterval && clearInterval(getStatusInterval);
|
getStatusInterval && clearInterval(getStatusInterval);
|
||||||
clearTimeout(timeout);
|
clearTimeout(timeout);
|
||||||
|
|
||||||
browserChain.quit();
|
browser.quit();
|
||||||
|
|
||||||
if(!success){
|
if(!success){
|
||||||
allTestsPassed = false;
|
allTestsPassed = false;
|
||||||
|
@ -39,7 +38,7 @@ var sauceTestWorker = async.queue(function (testSettings, callback) {
|
||||||
testResult = testResult.split("\\n").map(function(line){
|
testResult = testResult.split("\\n").map(function(line){
|
||||||
return "[" + testSettings.browserName + (testSettings.version === "" ? '' : (" " + testSettings.version)) + "] " + line;
|
return "[" + testSettings.browserName + (testSettings.version === "" ? '' : (" " + testSettings.version)) + "] " + line;
|
||||||
}).join("\n");
|
}).join("\n");
|
||||||
|
|
||||||
console.log(testResult);
|
console.log(testResult);
|
||||||
console.log("Remote sauce test '" + name + "' finished! " + url);
|
console.log("Remote sauce test '" + name + "' finished! " + url);
|
||||||
|
|
||||||
|
@ -53,7 +52,7 @@ var sauceTestWorker = async.queue(function (testSettings, callback) {
|
||||||
|
|
||||||
var knownConsoleText = "";
|
var knownConsoleText = "";
|
||||||
var getStatusInterval = setInterval(function(){
|
var getStatusInterval = setInterval(function(){
|
||||||
browserChain.eval("$('#console').text()", function(err, consoleText){
|
browser.eval("$('#console').text()", function(err, consoleText){
|
||||||
if(!consoleText || err){
|
if(!consoleText || err){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -68,7 +67,7 @@ var sauceTestWorker = async.queue(function (testSettings, callback) {
|
||||||
});
|
});
|
||||||
}, 5); //run 5 tests in parrallel
|
}, 5); //run 5 tests in parrallel
|
||||||
|
|
||||||
// Firefox
|
// Firefox
|
||||||
sauceTestWorker.push({
|
sauceTestWorker.push({
|
||||||
'platform' : 'Linux'
|
'platform' : 'Linux'
|
||||||
, 'browserName' : 'firefox'
|
, 'browserName' : 'firefox'
|
||||||
|
|
Loading…
Reference in a new issue