mirror of
https://github.com/wassname/talk.git
synced 2026-08-12 12:30:39 +08:00
tests
This commit is contained in:
@@ -7,6 +7,10 @@ module.exports = {
|
||||
return this
|
||||
.waitForElementVisible('body');
|
||||
},
|
||||
goToPeople() {
|
||||
this
|
||||
.navigate(`${this.url()}/people`);
|
||||
},
|
||||
}],
|
||||
elements: {
|
||||
container: '.talk-admin-community',
|
||||
@@ -18,5 +22,18 @@ module.exports = {
|
||||
usernameDialogButtons: '.talk-reject-username-dialog-buttons',
|
||||
usernameDialogSuspend: '.talk-reject-username-dialog-button-k',
|
||||
usernameDialogSuspensionMessage: '.talk-reject-username-dialog-suspension-message'
|
||||
},
|
||||
sections: {
|
||||
people: {
|
||||
selector: '.talk-admin-community-people-container',
|
||||
elements: {
|
||||
row: '.talk-admin-community-people-row',
|
||||
dropdownStatus: '.talk-admin-community-people-dd-status',
|
||||
dropdownRole: '.talk-admin-community-people-dd-role',
|
||||
dropdownStatusActive: '.talk-admin-community-people-dd-status .dd-list-active',
|
||||
optionActive: '.dd-option#ACTIVE',
|
||||
optionBanned: '.dd-option#BANNED',
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -50,4 +50,33 @@ module.exports = {
|
||||
embed
|
||||
.waitForElementVisible('@restrictedMessageBox');
|
||||
},
|
||||
'user logs out': (client) => {
|
||||
const embedStream = client.page.embedStream();
|
||||
|
||||
embedStream
|
||||
.logout();
|
||||
},
|
||||
'admin logs in (2)': (client) => {
|
||||
const adminPage = client.page.admin();
|
||||
const {testData: {admin}} = client.globals;
|
||||
|
||||
adminPage
|
||||
.login(admin);
|
||||
},
|
||||
'admin goes to community': (client) => {
|
||||
const community = client.page.adminCommunity();
|
||||
|
||||
community
|
||||
.goToPeople();
|
||||
},
|
||||
'admin removes ban from user': (client) => {
|
||||
const modSection = client.page.adminCommunity().section.people;
|
||||
|
||||
modSection
|
||||
.waitForElementVisible('@row')
|
||||
.waitForElementVisible('@dropdownStatus')
|
||||
.click('@dropdownStatus')
|
||||
.waitForElementVisible('@dropdownStatusActive')
|
||||
.click('@optionActive');
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user