mirror of
https://github.com/wassname/talk.git
synced 2026-09-12 13:01:11 +08:00
Tests
This commit is contained in:
@@ -59,6 +59,14 @@ module.exports = {
|
||||
popUpText: '.talk-plugin-flags-popup-text',
|
||||
}
|
||||
},
|
||||
mod: {
|
||||
selector: '.talk-plugin-moderation-actions',
|
||||
elements: {
|
||||
arrow: '.talk-plugin-moderation-actions-arrow',
|
||||
menu: '.talk-plugin-modetarion-actions-menu',
|
||||
banButton: 'talk-plugin-moderation-actions-ban',
|
||||
},
|
||||
},
|
||||
profile: {
|
||||
selector: '.talk-embed-stream-profile-tab-pane',
|
||||
elements: {
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
module.exports = {
|
||||
'admin logs in': (client) => {
|
||||
const adminPage = client.page.admin();
|
||||
const {testData: {admin}} = client.globals;
|
||||
|
||||
adminPage
|
||||
.navigate()
|
||||
.waitForElementVisible('@loginLayout')
|
||||
.waitForElementVisible('@signInForm')
|
||||
.setValue('@emailInput', admin.email)
|
||||
.setValue('@passwordInput', admin.password)
|
||||
.waitForElementVisible('@signInButton')
|
||||
.click('@signInButton');
|
||||
|
||||
client.pause(3000);
|
||||
|
||||
adminPage
|
||||
.waitForElementVisible('@moderationContainer');
|
||||
},
|
||||
'navigate to the embed stream': (client) => {
|
||||
const embedStream = client.page.embedStream();
|
||||
|
||||
embedStream
|
||||
.navigate()
|
||||
.getEmbedSection();
|
||||
},
|
||||
'ban': (client) => {
|
||||
const modSection = client.page.embedStream().section.embed.section.mod;
|
||||
|
||||
modSection
|
||||
.waitForElementVisible('@arrow')
|
||||
.click('@arrow')
|
||||
.waitForElementVisible('@menu')
|
||||
.waitForElementVisible('@banButton')
|
||||
.click('@banButton');
|
||||
}
|
||||
};
|
||||
@@ -125,7 +125,6 @@ module.exports = {
|
||||
embed
|
||||
.waitForElementVisible('@restrictedMessageBox');
|
||||
},
|
||||
|
||||
'user picks another username': (client) => {
|
||||
const {testData: {user}} = client.globals;
|
||||
const embedStream = client.page.embedStream();
|
||||
Reference in New Issue
Block a user