Removing test output

This commit is contained in:
Belen Curcio
2017-10-18 08:51:38 -03:00
parent 2c757e9d57
commit 14a8fcd475
4 changed files with 171 additions and 4 deletions
+8
View File
@@ -19,6 +19,14 @@ module.exports = {
username: 'admin',
password: 'testtest',
},
user: {
email: 'user@test.com',
username: 'user',
password: 'testtest',
},
comment: {
body: 'This is a test comment'
},
organizationName: 'Coral',
}
};
+20
View File
@@ -27,18 +27,38 @@ module.exports = {
this.expect.section('@profile').to.be.present;
return this.section.profile;
},
getCommentsSection: function() {
this.click('@commentsTabButton');
this.expect.section('@comments').to.be.present;
return this.section.comments;
},
}],
selector: '#talk-embed-stream-container',
elements: {
logoutButton: '.talk-stream-userbox-logout',
commentsTabButton: '.talk-embed-stream-comments-tab > button',
profileTabButton: '.talk-embed-stream-profile-tab > button',
signInButton: '#coralSignInButton',
commentBoxTextarea: '#commentText',
commentBoxPostButton: '.talk-plugin-commentbox-button',
firstCommentContent: '.talk-stream-comment.talk-stream-comment-level-0 .talk-stream-comment-content',
likeButton: '.talk-stream-comment.talk-stream-comment-level-0 .talk-stream-comment-footer .talk-plugin-like-button'
},
sections: {
profile: {
selector: '.talk-embed-stream-profile-tab-pane',
elements: {
notLoggedIn: '.talk-embed-stream-not-logged-in',
myCommentHistory: '.talk-my-profile-comment-history',
myCommentHistoryReactions: '.talk-my-profile-comment-history .comment-summary .comment-summary-reactions',
myCommentHistoryReactionCount: '.talk-my-profile-comment-history .comment-summary .comment-summary-reactions .comment-summary-reaction-count',
myCommentHistoryComment: '.talk-my-profile-comment-history .my-comment-body'
},
},
comments: {
selector: '.talk-embed-stream-comments-tab-pane',
elements: {},
},
},
},
},
+13
View File
@@ -0,0 +1,13 @@
module.exports = {
elements: {
registerButton: '#coralRegister',
signInButton: '#coralSignInButton',
emailInput: '#email',
usernameInput: '#username',
passwordInput: '#password',
confirmPasswordInput: '#confirmPassword',
signUpButton: '#coralSignUpButton',
signIn: '.coral-sign-in',
loginButton: '#coralLogInButton'
},
};
+130 -4
View File
@@ -1,7 +1,6 @@
module.exports = {
'@tags': ['embedStream'],
'Creates a new asset': (client) => {
'@tags': ['embedStream', 'login'],
'creates a new asset': (client) => {
const asset = 'newAssetTest';
const embedStream = client.page.embedStream();
@@ -11,6 +10,134 @@ module.exports = {
.getEmbedSection();
},
'creates an user and user logs in': (client) => {
const {testData: {user}} = client.globals;
const embedStream = client.page.embedStream();
const embed = embedStream
.navigate()
.getEmbedSection();
embed
.waitForElementVisible('@signInButton')
.click('@signInButton');
// Focusing on the Login PopUp
client.window_handles((result) => {
const handle = result.value[1];
client.switchWindow(handle);
});
const login = client.page.login();
login
.waitForElementVisible('@registerButton')
.click('@registerButton')
.setValue('@emailInput', user.email)
.setValue('@usernameInput', user.username)
.setValue('@passwordInput', user.password)
.setValue('@confirmPasswordInput', user.password)
.waitForElementVisible('@signUpButton')
.click('@signUpButton')
.waitForElementVisible('@signIn')
.waitForElementVisible('@loginButton')
.click('@loginButton');
// Focusing on the Embed Window
client.window_handles((result) => {
const handle = result.value[0];
client.switchWindow(handle);
});
},
'user posts a comment': (client) => {
const embedStream = client.page.embedStream();
const {testData: {comment}} = client.globals;
const embed = embedStream
.navigate()
.getEmbedSection();
embed
.waitForElementVisible('@commentBoxTextarea')
.setValue('@commentBoxTextarea', comment.body)
.waitForElementVisible('@commentBoxPostButton')
.click('@commentBoxPostButton')
.waitForElementVisible('@firstCommentContent')
.getText('@firstCommentContent', (result) => {
embed.assert.equal(result.value, comment.body);
});
},
'signed in user sees comment history': (client) => {
const embedStream = client.page.embedStream();
const {testData: {comment}} = client.globals;
const embed = embedStream
.navigate()
.getEmbedSection();
const profile = embed
.getProfileSection();
profile
.waitForElementVisible('@myCommentHistory')
.waitForElementVisible('@myCommentHistoryComment')
.getText('@myCommentHistoryComment', (result) => {
profile.assert.equal(result.value, comment.body);
});
},
'user sees replies and reactions to comments': (client) => {
const embedStream = client.page.embedStream();
const embed = embedStream
.navigate()
.getEmbedSection();
const profile = embed
.getProfileSection();
profile
.waitForElementVisible('@myCommentHistory')
.waitForElementVisible('@myCommentHistoryReactions')
.waitForElementVisible('@myCommentHistoryReactionCount')
.getText('@myCommentHistoryReactionCount', (result) => {
profile.assert.equal(result.value, '0');
});
},
'user goes to the stream and replies and reacts to comment': (client) => {
const embedStream = client.page.embedStream();
const embed = embedStream
.navigate()
.getEmbedSection();
embed
.waitForElementVisible('@likeButton')
.click('@likeButton');
const profile = embed
.getProfileSection();
profile
.waitForElementVisible('@myCommentHistory')
.waitForElementVisible('@myCommentHistoryReactions')
.waitForElementVisible('@myCommentHistoryReactionCount')
.getText('@myCommentHistoryReactionCount', (result) => {
profile.assert.equal(result.value, '1');
});
},
'user logs out': (client) => {
const embedStream = client.page.embedStream();
const embed = embedStream
.navigate()
.getEmbedSection();
embed
.click('@commentsTabButton')
.waitForElementVisible('@logoutButton')
.click('@logoutButton');
},
'not logged in user clicks my profile tab': (client) => {
const embedStream = client.page.embedStream();
@@ -24,7 +151,6 @@ module.exports = {
profile
.assert.visible('@notLoggedIn');
},
after: (client) => {
client.end();
}