Merge "Don't use lodash methods in tests where it's not required"
This commit is contained in:
commit
bc15921ecf
@ -301,7 +301,7 @@ _.defaults(Command.prototype, {
|
|||||||
return new this.constructor(this, function() {
|
return new this.constructor(this, function() {
|
||||||
return this.parent
|
return this.parent
|
||||||
.waitForCssSelector(cssSelector, timeout)
|
.waitForCssSelector(cssSelector, timeout)
|
||||||
.catch(_.constant(true))
|
.catch(() => true)
|
||||||
.assertElementExists(cssSelector, message);
|
.assertElementExists(cssSelector, message);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -309,7 +309,7 @@ _.defaults(Command.prototype, {
|
|||||||
return new this.constructor(this, function() {
|
return new this.constructor(this, function() {
|
||||||
return this.parent
|
return this.parent
|
||||||
.waitForCssSelector(cssSelector, timeout)
|
.waitForCssSelector(cssSelector, timeout)
|
||||||
.catch(_.constant(true))
|
.catch(() => true)
|
||||||
.assertElementsExist(cssSelector, message);
|
.assertElementsExist(cssSelector, message);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -317,7 +317,7 @@ _.defaults(Command.prototype, {
|
|||||||
return new this.constructor(this, function() {
|
return new this.constructor(this, function() {
|
||||||
return this.parent
|
return this.parent
|
||||||
.waitForElementDeletion(cssSelector, timeout)
|
.waitForElementDeletion(cssSelector, timeout)
|
||||||
.catch(_.constant(true))
|
.catch(() => true)
|
||||||
.assertElementNotExists(cssSelector, message);
|
.assertElementNotExists(cssSelector, message);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -120,7 +120,7 @@ ClusterPage.prototype = {
|
|||||||
return this.remote
|
return this.remote
|
||||||
.then(() => this.goToTab(tabName))
|
.then(() => this.goToTab(tabName))
|
||||||
.waitForCssSelector('div.tab-content div.row.changes-locked', 2000)
|
.waitForCssSelector('div.tab-content div.row.changes-locked', 2000)
|
||||||
.then(_.constant(true), _.constant(false));
|
.then(() => true, () => false);
|
||||||
},
|
},
|
||||||
deployEnvironment() {
|
deployEnvironment() {
|
||||||
return this.remote
|
return this.remote
|
||||||
|
@ -26,7 +26,7 @@ function ClustersPage(remote) {
|
|||||||
ClustersPage.prototype = {
|
ClustersPage.prototype = {
|
||||||
constructor: ClustersPage,
|
constructor: ClustersPage,
|
||||||
createCluster(clusterName, stepsMethods) {
|
createCluster(clusterName, stepsMethods) {
|
||||||
var stepMethod = (stepName) => _.bind(_.get(stepsMethods, stepName, _.noop), this);
|
var stepMethod = (stepName) => _.get(stepsMethods, stepName, _.noop).bind(this);
|
||||||
return this.remote
|
return this.remote
|
||||||
.clickByCssSelector('.create-cluster')
|
.clickByCssSelector('.create-cluster')
|
||||||
.then(() => this.modal.waitToOpen())
|
.then(() => this.modal.waitToOpen())
|
||||||
|
@ -34,7 +34,7 @@ InterfacesPage.prototype = {
|
|||||||
(ifcDiv) => ifcDiv
|
(ifcDiv) => ifcDiv
|
||||||
.getVisibleText()
|
.getVisibleText()
|
||||||
.then(
|
.then(
|
||||||
(currentIfcName) => _.trim(currentIfcName) === ifcName ? ifcElement : result
|
(currentIfcName) => currentIfcName.trim() === ifcName ? ifcElement : result
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
null
|
null
|
||||||
@ -116,7 +116,7 @@ InterfacesPage.prototype = {
|
|||||||
(ifcNameElement) => ifcNameElement
|
(ifcNameElement) => ifcNameElement
|
||||||
.getVisibleText()
|
.getVisibleText()
|
||||||
.then((name) => {
|
.then((name) => {
|
||||||
name = _.trim(name);
|
name = name.trim();
|
||||||
if (!_.contains(ifcsNames, name)) {
|
if (!_.contains(ifcsNames, name)) {
|
||||||
throw new Error('Unexpected name in bond: ' + name);
|
throw new Error('Unexpected name in bond: ' + name);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user