mirror of
https://github.com/wassname/talk.git
synced 2026-07-02 08:30:46 +08:00
Add navigateAndLogin
This commit is contained in:
@@ -33,6 +33,12 @@ module.exports = {
|
||||
.waitForElementVisible('@signOutButton')
|
||||
.click('@signOutButton');
|
||||
},
|
||||
navigateAndLogin(user) {
|
||||
this
|
||||
.navigate()
|
||||
.expect.section('@login').to.be.visible;
|
||||
return this.section.login.login(user);
|
||||
},
|
||||
}],
|
||||
elements: {
|
||||
'drawerButton': '.mdl-layout__drawer-button',
|
||||
@@ -113,6 +119,7 @@ module.exports = {
|
||||
this.parent
|
||||
.click('@drawerOverlay')
|
||||
.waitForElementNotPresent('@drawerOverlay');
|
||||
return this.parent;
|
||||
},
|
||||
}],
|
||||
elements: {
|
||||
|
||||
@@ -20,9 +20,7 @@ module.exports = {
|
||||
const adminPage = client.page.admin();
|
||||
const {testData: {admin}} = client.globals;
|
||||
|
||||
adminPage.navigate();
|
||||
adminPage.expect.section('@login').to.be.visible;
|
||||
adminPage.section.login.login(admin);
|
||||
adminPage.navigateAndLogin(admin);
|
||||
},
|
||||
|
||||
'Admin goes to Stories': (client) => {
|
||||
|
||||
@@ -19,12 +19,7 @@ module.exports = {
|
||||
const adminPage = client.page.admin();
|
||||
const {testData: {admin}} = client.globals;
|
||||
|
||||
adminPage
|
||||
.navigate()
|
||||
.expect.section('@login').to.be.visible;
|
||||
|
||||
adminPage.section.login
|
||||
.login(admin);
|
||||
adminPage.navigateAndLogin(admin);
|
||||
},
|
||||
'admin flags user\'s username as offensive': (client) => {
|
||||
const embedStream = client.page.embedStream();
|
||||
|
||||
@@ -19,12 +19,7 @@ module.exports = {
|
||||
const adminPage = client.page.admin();
|
||||
const {testData: {admin}} = client.globals;
|
||||
|
||||
adminPage
|
||||
.navigate()
|
||||
.expect.section('@login').to.be.visible;
|
||||
|
||||
adminPage.section.login
|
||||
.login(admin);
|
||||
adminPage.navigateAndLogin(admin);
|
||||
},
|
||||
'navigate to the embed stream': (client) => {
|
||||
const embedStream = client.page.embedStream();
|
||||
@@ -81,12 +76,7 @@ module.exports = {
|
||||
const adminPage = client.page.admin();
|
||||
const {testData: {admin}} = client.globals;
|
||||
|
||||
adminPage
|
||||
.navigate()
|
||||
.expect.section('@login').to.be.visible;
|
||||
|
||||
adminPage.section.login
|
||||
.login(admin);
|
||||
adminPage.navigateAndLogin(admin);
|
||||
},
|
||||
'admin goes to community': (client) => {
|
||||
const adminPage = client.page.admin();
|
||||
|
||||
Reference in New Issue
Block a user