Use visible were suitable and wait for drawer to dissappear

This commit is contained in:
Chi Vinh Le
2017-11-09 23:32:03 +01:00
parent 0b18bb06e7
commit 31ee8139b6
6 changed files with 23 additions and 22 deletions
+9 -8
View File
@@ -11,19 +11,19 @@ module.exports = {
this
.waitForElementVisible('@drawerButton')
.click('@drawerButton');
this.expect.section('@drawer').to.be.present;
this.expect.section('@drawer').to.be.visible;
return this.section.drawer;
},
goToStories() {
this
.click('@storiesNav')
.expect.section('@stories').to.be.present;
.expect.section('@stories').to.be.visible;
return this.section.stories;
},
goToCommunity() {
this
.click('@communityNav')
.expect.section('@community').to.be.present;
.expect.section('@community').to.be.visible;
return this.section.community;
},
logout() {
@@ -62,7 +62,7 @@ module.exports = {
goToPeople() {
this
.click('@peopleNav')
.expect.section('@people').to.be.present;
.expect.section('@people').to.be.visible;
return this.section.people;
},
}],
@@ -98,20 +98,21 @@ module.exports = {
goToStories() {
this
.click('@storiesButton');
this.parent.expect.section('@stories').to.be.present;
this.parent.expect.section('@stories').to.be.visible;
this.close();
return this.parent.section.stories;
},
goToCommunity() {
this
.click('@communityButton');
this.parent.expect.section('@community').to.be.present;
this.parent.expect.section('@community').to.be.visible;
this.close();
return this.parent.section.stories;
},
close() {
this.parent
.click('@drawerOverlay');
.click('@drawerOverlay')
.waitForElementNotPresent('@drawerOverlay');
},
}],
elements: {
@@ -129,7 +130,7 @@ module.exports = {
.waitForElementVisible('@signInButton')
.click('@signInButton');
const adminPage = this.api.page.admin();
adminPage.expect.section('@moderate').to.be.present;
adminPage.expect.section('@moderate').to.be.visible;
return adminPage.section.moderate;
},
}],
+3 -3
View File
@@ -5,19 +5,19 @@ module.exports = {
commands: [{
ready: function() {
this.switchToIframe();
this.expect.section('@comments').to.be.present;
this.expect.section('@comments').to.be.visible;
return this.section.comments;
},
goToProfileSection: function() {
this.waitForElementVisible('@profileTabButton');
this.click('@profileTabButton');
this.expect.section('@profile').to.be.present;
this.expect.section('@profile').to.be.visible;
return this.section.profile;
},
goToCommentsSection: function() {
this.waitForElementVisible('@commentsTabButton');
this.click('@commentsTabButton');
this.expect.section('@comments').to.be.present;
this.expect.section('@comments').to.be.visible;
return this.section.comments;
},
navigateToAsset: function(asset) {
+5 -5
View File
@@ -21,7 +21,7 @@ module.exports = {
install
.navigate()
.expect.section('@step1').to.be.present;
.expect.section('@step1').to.be.visible;
},
'User clicks get started button': (client) => {
@@ -35,7 +35,7 @@ module.exports = {
const install = client.page.install();
install
.expect.section('@step2').to.be.present;
.expect.section('@step2').to.be.visible;
},
'User fills step 2': (client) => {
const step2 = client.page.install().section.step2;
@@ -51,7 +51,7 @@ module.exports = {
const install = client.page.install();
install
.expect.section('@step3').to.be.present;
.expect.section('@step3').to.be.visible;
},
'User fills step 3': (client) => {
const step3 = client.page.install().section.step3;
@@ -69,7 +69,7 @@ module.exports = {
const install = client.page.install();
install
.expect.section('@step4').to.be.present;
.expect.section('@step4').to.be.visible;
},
'User fills step 4': (client) => {
const step4 = client.page.install().section.step4;
@@ -88,6 +88,6 @@ module.exports = {
const install = client.page.install();
install
.expect.section('@step5').to.be.present;
.expect.section('@step5').to.be.visible;
},
};
+1 -1
View File
@@ -21,7 +21,7 @@ module.exports = {
const {testData: {admin}} = client.globals;
adminPage.navigate();
adminPage.expect.section('@login').to.be.present;
adminPage.expect.section('@login').to.be.visible;
adminPage.section.login.login(admin);
},
+1 -1
View File
@@ -21,7 +21,7 @@ module.exports = {
adminPage
.navigate()
.expect.section('@login').to.be.present;
.expect.section('@login').to.be.visible;
adminPage.section.login
.login(admin);
+4 -4
View File
@@ -21,7 +21,7 @@ module.exports = {
adminPage
.navigate()
.expect.section('@login').to.be.present;
.expect.section('@login').to.be.visible;
adminPage.section.login
.login(admin);
@@ -83,7 +83,7 @@ module.exports = {
adminPage
.navigate()
.expect.section('@login').to.be.present;
.expect.section('@login').to.be.visible;
adminPage.section.login
.login(admin);
@@ -129,7 +129,7 @@ module.exports = {
const comments = embedStream.section.comments;
comments
.waitForElementPresent('@commentBoxTextarea')
.waitForElementPresent('@commentBoxPostButton');
.waitForElementVisible('@commentBoxTextarea')
.waitForElementVisible('@commentBoxPostButton');
},
};