mirror of
https://github.com/wassname/talk.git
synced 2026-08-16 11:29:31 +08:00
Sign Up test
This commit is contained in:
@@ -9,6 +9,23 @@ const embedStreamCommands = {
|
||||
.waitForElementVisible('iframe#coralStreamIframe')
|
||||
.api.frame('coralStreamIframe');
|
||||
},
|
||||
signUp(user) {
|
||||
return this
|
||||
.waitForElementVisible('@signInButton', 2000)
|
||||
.click('@signInButton')
|
||||
.waitForElementVisible('@signInDialog')
|
||||
.waitForElementVisible('@registerButton')
|
||||
.click('@registerButton')
|
||||
.setValue('@signInDialogEmail', user.email)
|
||||
.setValue('@signInDialogPassword', user.pass)
|
||||
.setValue('@signUpDialogConfirmPassword', user.pass)
|
||||
.setValue('@signUpDialogDisplayName', user.displayName)
|
||||
.waitForElementVisible('@signUpButton')
|
||||
.click('@signUpButton')
|
||||
.waitForElementVisible('@logInButton')
|
||||
.click('@logInButton')
|
||||
.waitForElementVisible('@logoutButton', 5000);
|
||||
},
|
||||
login(user) {
|
||||
return this
|
||||
.waitForElementVisible('@signInButton', 2000)
|
||||
@@ -74,9 +91,18 @@ export default {
|
||||
signInDialogPassword: {
|
||||
selector: '#signInDialog #password'
|
||||
},
|
||||
signUpDialogConfirmPassword: {
|
||||
selector: '#signInDialog #confirmPassword'
|
||||
},
|
||||
signUpDialogDisplayName: {
|
||||
selector: '#signInDialog #displayName'
|
||||
},
|
||||
logInButton: {
|
||||
selector: '#coralLogInButton'
|
||||
},
|
||||
signUpButton: {
|
||||
selector: '#coralSignUpButton'
|
||||
},
|
||||
logoutButton: {
|
||||
selector: '.commentStream #logout'
|
||||
},
|
||||
@@ -128,5 +154,8 @@ export default {
|
||||
permalinkInput: {
|
||||
selector: '.comment .coral-plugin-permalinks-popover.active input'
|
||||
},
|
||||
registerButton: {
|
||||
selector: '#signInDialog #coralRegister'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
module.exports = {
|
||||
export default {
|
||||
'@tags': ['app'],
|
||||
'Base url and Hostname': browser => {
|
||||
const {baseUrl} = browser.globals;
|
||||
@@ -1,4 +1,4 @@
|
||||
module.exports = {
|
||||
export default {
|
||||
'@tags': ['like', 'comments', 'visitor'],
|
||||
before: client => {
|
||||
const embedStreamPage = client.page.embedStreamPage();
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
export default {
|
||||
'@tags': ['signup', 'visitor'],
|
||||
before: client => {
|
||||
const embedStreamPage = client.page.embedStreamPage();
|
||||
|
||||
embedStreamPage
|
||||
.navigate()
|
||||
.ready();
|
||||
},
|
||||
'Visitor signs up': client => {
|
||||
const embedStreamPage = client.page.embedStreamPage();
|
||||
|
||||
embedStreamPage
|
||||
.signUp({
|
||||
email: 'visitor@test.com',
|
||||
displayName: 'Visitor',
|
||||
pass: 'testtest'
|
||||
});
|
||||
},
|
||||
after: client => {
|
||||
client.end();
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user