mirror of
https://github.com/wassname/talk.git
synced 2026-09-09 11:38:08 +08:00
refactor
This commit is contained in:
@@ -1,22 +1,10 @@
|
||||
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');
|
||||
.login(admin);
|
||||
},
|
||||
'navigate to the embed stream': (client) => {
|
||||
const embedStream = client.page.embedStream();
|
||||
@@ -39,6 +27,12 @@ module.exports = {
|
||||
.click('@banDialogbanButton')
|
||||
.waitForElementNotVisible('@banDialog');
|
||||
},
|
||||
'admin logs out': (client) => {
|
||||
const embedStream = client.page.embedStream();
|
||||
|
||||
embedStream
|
||||
.logout();
|
||||
},
|
||||
'user logs in': (client) => {
|
||||
const {testData: {user}} = client.globals;
|
||||
const embedStream = client.page.embedStream();
|
||||
|
||||
Reference in New Issue
Block a user