Fix syntax in intern tests

!A || B logic changed to A && B into functional tests.

Partial-Bug: #1626059

Change-Id: I31cfd2145c4fc3f5cf85c51340bee5f734ba0dab
This commit is contained in:
Julia Aranovich 2016-09-22 12:45:18 +03:00
parent dc54e2ec96
commit 468dcd1dc4
4 changed files with 6 additions and 6 deletions

View File

@ -48,7 +48,7 @@ class ClusterPage {
.then(() => this.modal.waitToOpen())
.then(() => this.modal.clickFooterButton('Delete'))
.findAllByCssSelector('.confirmation-form input[type=text]')
.then((confirmInputs) => !confirmInputs.length ||
.then((confirmInputs) => !!confirmInputs.length &&
confirmInputs[0]
.type(clusterName)
.then(() => this.modal.clickFooterButton('Delete'))
@ -108,7 +108,7 @@ class ClusterPage {
.then(() => this.modal.checkTitle('Reset Environment'))
.then(() => this.modal.clickFooterButton('Reset'))
.findAllByCssSelector('.confirmation-form input[type=text]')
.then((confirmationInputs) => !confirmationInputs.length ||
.then((confirmationInputs) => !!confirmationInputs.length &&
confirmationInputs[0]
.type(clusterName)
.then(() => this.modal.clickFooterButton('Reset'))

View File

@ -92,7 +92,7 @@ class CommonMethods {
.clickByCssSelector('.btn-add-nodes')
.waitForElementDeletion('.btn-add-nodes', 3000)
.waitForCssSelector('.node', 3000)
.then(() => !nodeNameFilter || this.clusterPage.searchForNode(nodeNameFilter))
.then(() => !!nodeNameFilter && this.clusterPage.searchForNode(nodeNameFilter))
.then(() => this.clusterPage.checkNodeRoles(nodesRoles))
.then(() => this.clusterPage.checkNodes(nodesAmount, nodeStatus))
.clickByCssSelector('.btn-apply')

View File

@ -29,7 +29,7 @@ class LoginPage {
.setFindTimeout(500)
.setWindowSize(1280, 1024)
.getCurrentUrl()
.then((url) => url === Helpers.serverUrl + '/#login' || this.logout())
.then((url) => url !== Helpers.serverUrl + '/#login' && this.logout())
.setInputValue('[name=username]', username)
.setInputValue('[name=password]', password)
.clickByCssSelector('.login-btn');
@ -38,7 +38,7 @@ class LoginPage {
logout() {
return this.remote
.getCurrentUrl()
.then((url) => url.indexOf(Helpers.serverUrl) === 0 ||
.then((url) => url.indexOf(Helpers.serverUrl) !== 0 &&
this.remote
.get(Helpers.serverUrl + '/#logout')
.findByClassName('login-btn')

View File

@ -55,7 +55,7 @@ registerSuite(() => {
.findByCssSelector('.btn-revert-changes')
.then(
(element) => element.isEnabled()
.then((isEnabled) => !isEnabled || element.click())
.then((isEnabled) => isEnabled && element.click())
)
.end();
},