This commit is contained in:
Belen Curcio
2017-11-07 16:43:58 -03:00
parent 9b98e3cac9
commit a2470fa01b
5 changed files with 112 additions and 38 deletions
+41 -5
View File
@@ -2,16 +2,50 @@ const iframeId = 'coralStreamEmbed_iframe';
module.exports = {
commands: [{
navigateToAsset: function(asset) {
navigateToAsset(asset) {
this.api.url(`${this.api.launchUrl}/assets/title/${asset}`);
return this;
},
getEmbedSection: function() {
getEmbedSection() {
this.waitForElementVisible('@iframe');
this.api.frame(iframeId);
this.expect.section('@embed').to.be.present;
return this.section.embed;
},
login(user = {}) {
const embedStream = this.page.embedStream();
const embed = embedStream
.navigate()
.getEmbedSection();
embed
.waitForElementVisible('@signInButton')
.click('@signInButton');
this.pause(3000);
// Focusing on the Login PopUp
this.windowHandles((result) => {
const handle = result.value[1];
this.switchWindow(handle);
});
const login = this.page.login();
login
.setValue('@emailInput', user.email)
.setValue('@passwordInput', user.password)
.waitForElementVisible('@signIn')
.waitForElementVisible('@loginButton')
.click('@loginButton');
// Focusing on the Embed Window
this.windowHandles((result) => {
const handle = result.value[0];
this.switchWindow(handle);
});
},
}],
url: function() {
return this.api.launchUrl;
@@ -22,12 +56,12 @@ module.exports = {
sections: {
embed: {
commands: [{
getProfileSection: function() {
getProfileSection() {
this.click('@profileTabButton');
this.expect.section('@profile').to.be.present;
return this.section.profile;
},
getCommentsSection: function() {
getCommentsSection() {
this.click('@commentsTabButton');
this.expect.section('@comments').to.be.present;
return this.section.comments;
@@ -64,7 +98,9 @@ module.exports = {
elements: {
arrow: '.talk-plugin-moderation-actions-arrow',
menu: '.talk-plugin-modetarion-actions-menu',
banButton: 'talk-plugin-moderation-actions-ban',
banButton: '.talk-plugin-moderation-actions-ban',
banDialog: '.talk-ban-user-dialog',
banDialogbanButton: '.talk-ban-user-dialog-button-ban',
},
},
profile: {