diff --git a/tests/e2e/pages/embedStreamPage.js b/tests/e2e/pages/embedStreamPage.js index 0b0ec225c..ad2c7275a 100644 --- a/tests/e2e/pages/embedStreamPage.js +++ b/tests/e2e/pages/embedStreamPage.js @@ -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' + } } }; diff --git a/tests/e2e/tests/AppTest.js b/tests/e2e/tests/01_AppTest.js similarity index 93% rename from tests/e2e/tests/AppTest.js rename to tests/e2e/tests/01_AppTest.js index 36281ed3f..491e952d7 100644 --- a/tests/e2e/tests/AppTest.js +++ b/tests/e2e/tests/01_AppTest.js @@ -1,4 +1,4 @@ -module.exports = { +export default { '@tags': ['app'], 'Base url and Hostname': browser => { const {baseUrl} = browser.globals; diff --git a/tests/e2e/tests/Visitor/LikeCommentTest.js b/tests/e2e/tests/Visitor/LikeCommentTest.js index 6aaca5b49..8fc5d72e4 100644 --- a/tests/e2e/tests/Visitor/LikeCommentTest.js +++ b/tests/e2e/tests/Visitor/LikeCommentTest.js @@ -1,4 +1,4 @@ -module.exports = { +export default { '@tags': ['like', 'comments', 'visitor'], before: client => { const embedStreamPage = client.page.embedStreamPage(); diff --git a/tests/e2e/tests/Visitor/SignUpTest.js b/tests/e2e/tests/Visitor/SignUpTest.js new file mode 100644 index 000000000..c33ec4e5c --- /dev/null +++ b/tests/e2e/tests/Visitor/SignUpTest.js @@ -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(); + } +};