Permalink tests

This commit is contained in:
Belen Curcio
2016-12-19 11:23:49 -03:00
parent 89709a80c1
commit 6d473f780a
3 changed files with 45 additions and 5 deletions
+17 -1
View File
@@ -69,6 +69,13 @@ const embedStreamCommands = {
.waitForElementVisible('@flagDoneButton')
.click('@flagDoneButton')
.click('@flagDoneButton');
},
getPermalink(fn) {
return this
.waitForElementVisible('@permalinkButton')
.click('@permalinkButton')
.waitForElementVisible('@permalinkPopUp')
.getValue('@permalinkInput', result => fn(result.value));
}
};
@@ -131,6 +138,15 @@ export default {
},
flagDoneButton: {
selector: '.comment .coral-plugin-flags-popup .coral-plugin-flags-popup-button'
}
},
permalinkButton: {
selector: '.comment .coral-plugin-permalinks-button'
},
permalinkPopUp: {
selector: '.comment .coral-plugin-permalinks-popover.active'
},
permalinkInput: {
selector: '.comment .coral-plugin-permalinks-popover.active input'
},
}
};
@@ -1,5 +1,5 @@
export default {
tags: 'flag',
'@tags': ['flag', 'commenter'],
before: client => {
const embedStreamPage = client.page.embedStreamPage();
const {users} = client.globals;
@@ -11,11 +11,11 @@ export default {
embedStreamPage
.login(users.commenter);
},
'Commenter flags a comment': client => {
'Commenter flags a username': client => {
const embedStreamPage = client.page.embedStreamPage();
embedStreamPage
.flagComment();
.flagUsername();
},
after: client => {
client.end();
+25 -1
View File
@@ -1,8 +1,32 @@
let permalink = '';
export default {
'@tags': ['permalink', 'commenter'],
'Permalink': () => {
before: client => {
const embedStreamPage = client.page.embedStreamPage();
const {users} = client.globals;
embedStreamPage
.navigate()
.ready();
embedStreamPage
.login(users.commenter);
},
'Commenter gets the permalink of a comment': client => {
const embedStreamPage = client.page.embedStreamPage();
embedStreamPage
.getPermalink(value => {
permalink = value;
});
},
'Commenter navigates to the permalink': client => {
const embedStreamPage = client.page.embedStreamPage();
embedStreamPage
.navigate(permalink);
},
after: client => {
client.end();
}
};