mirror of
https://github.com/wassname/talk.git
synced 2026-07-29 11:28:24 +08:00
Permalink tests
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user