From af76e6524647d20775c95b6b5f5d51400f7aacb4 Mon Sep 17 00:00:00 2001 From: David Jay Date: Wed, 16 Nov 2016 13:43:36 -0500 Subject: [PATCH 01/35] Posting comment in e2e test. --- .gitignore | 1 + nightwatch.conf.js | 44 +++++++++++++++++++++++++++++ package.json | 6 +++- tests/e2e/globals.js | 4 +++ tests/e2e/pages/embedStream.js | 31 ++++++++++++++++++++ tests/e2e/tests/AppTest.js | 13 +++++++++ tests/e2e/tests/EmbedStreamTests.js | 15 ++++++++++ views/home.ejs | 3 +- 8 files changed, 115 insertions(+), 2 deletions(-) create mode 100644 nightwatch.conf.js create mode 100644 tests/e2e/globals.js create mode 100644 tests/e2e/pages/embedStream.js create mode 100644 tests/e2e/tests/AppTest.js create mode 100644 tests/e2e/tests/EmbedStreamTests.js diff --git a/.gitignore b/.gitignore index eff774450..1ba4be442 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ npm-debug.log dist !dist/coral-admin dist/coral-admin/bundle.js +tests/e2e/reports .DS_Store *.iml .env diff --git a/nightwatch.conf.js b/nightwatch.conf.js new file mode 100644 index 000000000..a39ab128f --- /dev/null +++ b/nightwatch.conf.js @@ -0,0 +1,44 @@ +require('babel-core/register'); + +module.exports = { + 'src_folders': './tests/e2e/tests', + 'output_folder': './tests/e2e/reports', + 'page_objects_path': './tests/e2e/pages', + 'globals_path': './tests/e2e/globals', + 'custom_commands_path' : '', + 'custom_assertions_path' : '', + 'selenium': { + 'start_process': true, + 'server_path': 'node_modules/selenium-standalone/.selenium/selenium-server/2.53.1-server.jar', + 'log_path': './tests/e2e/reports', + 'host': '127.0.0.1', + 'port': 6666, + 'cli_args': { + 'webdriver.chrome.driver': 'node_modules/selenium-standalone/.selenium/chromedriver/2.25-x64-chromedriver' + } + }, + 'test_settings': { + 'default': { + 'selenium_port': 6666, + 'selenium_host': 'localhost', + 'silent': true, + 'desiredCapabilities': { + 'browserName': 'chrome', + 'javascriptEnabled': true, + 'acceptSslCerts': true, + 'webStorageEnabled' : true, + 'databaseEnabled' : true, + 'applicationCacheEnabled' : false, + 'nativeEvents' : true + }, + 'screenshots' : { + 'enabled' : true, + 'on_failure' : true, + 'on_error' : true, + 'path' : './tests/e2e/reports' + }, + 'exclude': [ + ] + } + } +}; diff --git a/package.json b/package.json index cbdaad174..034626afd 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,9 @@ "pretest": "npm install", "test": "mocha --compilers js:babel-core/register --recursive tests", "test-watch": "mocha --compilers js:babel-core/register --recursive -w tests", - "embed-start": "npm run build && ./bin/www" + "embed-start": "npm run build && ./bin/www", + "pree2e": "node_modules/selenium-standalone/bin/selenium-standalone install", + "e2e": "node_modules/.bin/nightwatch" }, "config": { "pre-git": { @@ -94,6 +96,7 @@ "material-design-lite": "^1.2.1", "mocha": "^3.1.2", "mocha-junit-reporter": "^1.12.1", + "nightwatch": "^0.9.9", "postcss-loader": "^1.1.0", "postcss-modules": "^0.5.2", "postcss-smart-import": "^0.5.1", @@ -110,6 +113,7 @@ "redux-mock-store": "^1.2.1", "redux-thunk": "^2.1.0", "regenerator": "^0.8.46", + "selenium-standalone": "^5.8.0", "style-loader": "^0.13.1", "supertest": "^2.0.1", "timeago.js": "^2.0.3", diff --git a/tests/e2e/globals.js b/tests/e2e/globals.js new file mode 100644 index 000000000..4b3f4eaef --- /dev/null +++ b/tests/e2e/globals.js @@ -0,0 +1,4 @@ +module.exports = { + waitForConditionTimeout: 20000, + baseUrl: 'http://localhost:3000' +}; diff --git a/tests/e2e/pages/embedStream.js b/tests/e2e/pages/embedStream.js new file mode 100644 index 000000000..db8f441f7 --- /dev/null +++ b/tests/e2e/pages/embedStream.js @@ -0,0 +1,31 @@ +const embedCommands = { + ready() { + return this + .waitForElementVisible('body', 1000); + }, + enterComment() { + const comment = 'This is a test comment'; + return this + .waitForElementVisible('@commentBox') + .setValue('@commentBox', comment) + .click('@postButton') + .waitForElementVisible('.comment', 1000); + }, + validateComment(comment) { + return this + .assert.equal(comment, '.comment'); + } +}; + +module.exports = { + commands: [embedCommands], + elements: { + + commentBox: { + selector: '#commentBox' + }, + postButton: { + selector: '#commentBox .coral-plugin-commentbox-button' + } + } +}; diff --git a/tests/e2e/tests/AppTest.js b/tests/e2e/tests/AppTest.js new file mode 100644 index 000000000..3e3b6d152 --- /dev/null +++ b/tests/e2e/tests/AppTest.js @@ -0,0 +1,13 @@ +export default { + '@tags': ['app'], + 'Base url and Hostname': browser => { + const { baseUrl } = browser.globals; + browser + .url(baseUrl) + .assert.title('Talk - Coral (Beta)') + .waitForElementPresent("body", 1000) + }, + after: client => { + client.end() + } +}; diff --git a/tests/e2e/tests/EmbedStreamTests.js b/tests/e2e/tests/EmbedStreamTests.js new file mode 100644 index 000000000..ec8cb92c0 --- /dev/null +++ b/tests/e2e/tests/EmbedStreamTests.js @@ -0,0 +1,15 @@ +const comment = 'This is a test comment.' + +module.exports = { + '@tags': ['embed-stream', 'post'], + 'User posts a comment': client => { + client.resizeWindow(1200, 800) + .url(`${client.globals.baseUrl}`) + .frame('coralStreamIframe') + .waitForElementVisible('#commentBox', 1000) + .setValue('#commentBox .coral-plugin-commentbox-textarea', comment) + .click('#commentBox .coral-plugin-commentbox-button') + .waitForElementVisible('.comment', 1000) + .expect.element('.coral-plugin-comment').to.equal(comment); + } +}; diff --git a/views/home.ejs b/views/home.ejs index 5654e1745..ed9d41446 100644 --- a/views/home.ejs +++ b/views/home.ejs @@ -1,5 +1,6 @@ + Talk - Coral (Beta)
@@ -9,7 +10,7 @@
From 9976464300ecdc4ef1bbcd8357ff7b305ba7163f Mon Sep 17 00:00:00 2001 From: David Jay Date: Wed, 16 Nov 2016 13:44:30 -0500 Subject: [PATCH 02/35] Posting comment in e2e test. --- tests/e2e/tests/AppTest.js | 8 ++++---- tests/e2e/tests/EmbedStreamTests.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/e2e/tests/AppTest.js b/tests/e2e/tests/AppTest.js index 3e3b6d152..17bca4236 100644 --- a/tests/e2e/tests/AppTest.js +++ b/tests/e2e/tests/AppTest.js @@ -1,13 +1,13 @@ -export default { +module.exports = { '@tags': ['app'], 'Base url and Hostname': browser => { - const { baseUrl } = browser.globals; + const {baseUrl} = browser.globals; browser .url(baseUrl) .assert.title('Talk - Coral (Beta)') - .waitForElementPresent("body", 1000) + .waitForElementPresent('body', 1000); }, after: client => { - client.end() + client.end(); } }; diff --git a/tests/e2e/tests/EmbedStreamTests.js b/tests/e2e/tests/EmbedStreamTests.js index ec8cb92c0..c974927e0 100644 --- a/tests/e2e/tests/EmbedStreamTests.js +++ b/tests/e2e/tests/EmbedStreamTests.js @@ -1,4 +1,4 @@ -const comment = 'This is a test comment.' +const comment = 'This is a test comment.'; module.exports = { '@tags': ['embed-stream', 'post'], From d389680224ed739a1def67bca5fe820c2ebace72 Mon Sep 17 00:00:00 2001 From: David Jay Date: Wed, 16 Nov 2016 17:18:17 -0500 Subject: [PATCH 03/35] Utilizing test db for e2e tests. --- package.json | 2 +- pree2e.sh | 5 +++++ tests/e2e/globals.js | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100755 pree2e.sh diff --git a/package.json b/package.json index 034626afd..371a23378 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "test": "mocha --compilers js:babel-core/register --recursive tests", "test-watch": "mocha --compilers js:babel-core/register --recursive -w tests", "embed-start": "npm run build && ./bin/www", - "pree2e": "node_modules/selenium-standalone/bin/selenium-standalone install", + "pree2e": "./pree2e.sh", "e2e": "node_modules/.bin/nightwatch" }, "config": { diff --git a/pree2e.sh b/pree2e.sh new file mode 100755 index 000000000..39c5f1297 --- /dev/null +++ b/pree2e.sh @@ -0,0 +1,5 @@ +node_modules/selenium-standalone/bin/selenium-standalone install +export TALK_PORT=3011 +export TALK_MONGO_URL='mongodb://localhost/talk_test' +npm start & +wait 2 diff --git a/tests/e2e/globals.js b/tests/e2e/globals.js index 4b3f4eaef..d90f024a4 100644 --- a/tests/e2e/globals.js +++ b/tests/e2e/globals.js @@ -1,4 +1,4 @@ module.exports = { waitForConditionTimeout: 20000, - baseUrl: 'http://localhost:3000' + baseUrl: 'http://localhost:3011' }; From a50a32ab667aae8b4dbc854f029fd50bb7609bad Mon Sep 17 00:00:00 2001 From: David Jay Date: Wed, 16 Nov 2016 18:31:23 -0500 Subject: [PATCH 04/35] Adding preconfiguration script. --- pree2e.sh | 1 - tests/e2e/tests/EmbedStreamTests.js | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pree2e.sh b/pree2e.sh index 39c5f1297..e61bceb1f 100755 --- a/pree2e.sh +++ b/pree2e.sh @@ -2,4 +2,3 @@ node_modules/selenium-standalone/bin/selenium-standalone install export TALK_PORT=3011 export TALK_MONGO_URL='mongodb://localhost/talk_test' npm start & -wait 2 diff --git a/tests/e2e/tests/EmbedStreamTests.js b/tests/e2e/tests/EmbedStreamTests.js index c974927e0..f4ed374da 100644 --- a/tests/e2e/tests/EmbedStreamTests.js +++ b/tests/e2e/tests/EmbedStreamTests.js @@ -4,12 +4,15 @@ module.exports = { '@tags': ['embed-stream', 'post'], 'User posts a comment': client => { client.resizeWindow(1200, 800) - .url(`${client.globals.baseUrl}`) + .url(client.globals.baseUrl) .frame('coralStreamIframe') .waitForElementVisible('#commentBox', 1000) .setValue('#commentBox .coral-plugin-commentbox-textarea', comment) .click('#commentBox .coral-plugin-commentbox-button') .waitForElementVisible('.comment', 1000) .expect.element('.coral-plugin-comment').to.equal(comment); + }, + after: client => { + client.end(); } }; From 87e06678dd33df32c71800ab0942067560b93c41 Mon Sep 17 00:00:00 2001 From: David Jay Date: Fri, 18 Nov 2016 12:56:17 -0500 Subject: [PATCH 05/35] Clearing db and manipulating settings on nightwatch tests. --- tests/e2e/tests/EmbedStreamTests.js | 6 ++++++ tests/utils/mongoose.js | 18 +++++++++--------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/tests/e2e/tests/EmbedStreamTests.js b/tests/e2e/tests/EmbedStreamTests.js index f4ed374da..106feee2b 100644 --- a/tests/e2e/tests/EmbedStreamTests.js +++ b/tests/e2e/tests/EmbedStreamTests.js @@ -1,7 +1,13 @@ +require('../../utils/mongoose'); +const Setting = require('../../../models/setting'); + const comment = 'This is a test comment.'; module.exports = { '@tags': ['embed-stream', 'post'], + before: () => { + Setting.create({moderation: 'post'}); + }, 'User posts a comment': client => { client.resizeWindow(1200, 800) .url(client.globals.baseUrl) diff --git a/tests/utils/mongoose.js b/tests/utils/mongoose.js index 1549440a6..213ee845a 100644 --- a/tests/utils/mongoose.js +++ b/tests/utils/mongoose.js @@ -3,29 +3,29 @@ const mongoose = require('../../mongoose'); // Ensure the NODE_ENV is set to 'test', // this is helpful when you would like to change behavior when testing. process.env.NODE_ENV = 'test'; +function clearDB(done) { + for (let i in mongoose.connection.collections) { + mongoose.connection.collections[i].remove(function() {}); + } + return done(); +} beforeEach(function (done) { - function clearDB() { - for (let i in mongoose.connection.collections) { - mongoose.connection.collections[i].remove(function() {}); - } - return done(); - } - if (mongoose.connection.readyState === 0) { mongoose.on('open', function() { if (err) { throw err; } - return clearDB(); + return clearDB(done); }); } else { - return clearDB(); + return clearDB(done); } }); after(function (done) { + clearDB(()=>{}); mongoose.disconnect(); return done(); }); From 15810e3ece781411aef26ac33662de60654751e7 Mon Sep 17 00:00:00 2001 From: David Jay Date: Mon, 21 Nov 2016 15:27:31 -0500 Subject: [PATCH 06/35] Running comment post test w/ proper settings. --- .gitignore | 2 +- package.json | 4 +-- pree2e.sh | 3 ++- tests/e2e/tests/EmbedStreamTests.js | 21 ++++++++++++---- tests/utils/e2e-mongoose.js | 39 +++++++++++++++++++++++++++++ 5 files changed, 60 insertions(+), 9 deletions(-) create mode 100644 tests/utils/e2e-mongoose.js diff --git a/.gitignore b/.gitignore index 1ba4be442..4fe8d7e31 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ node_modules -npm-debug.log +npm-debug.log* dist !dist/coral-admin dist/coral-admin/bundle.js diff --git a/package.json b/package.json index 371a23378..537887a56 100644 --- a/package.json +++ b/package.json @@ -97,6 +97,7 @@ "mocha": "^3.1.2", "mocha-junit-reporter": "^1.12.1", "nightwatch": "^0.9.9", + "node-fetch": "^1.6.3", "postcss-loader": "^1.1.0", "postcss-modules": "^0.5.2", "postcss-smart-import": "^0.5.1", @@ -117,8 +118,7 @@ "style-loader": "^0.13.1", "supertest": "^2.0.1", "timeago.js": "^2.0.3", - "webpack": "^1.13.3", - "whatwg-fetch": "^1.0.0" + "webpack": "^1.13.3" }, "engines": { "node": ">=7.0.0" diff --git a/pree2e.sh b/pree2e.sh index e61bceb1f..49b9a11f2 100755 --- a/pree2e.sh +++ b/pree2e.sh @@ -1,4 +1,5 @@ node_modules/selenium-standalone/bin/selenium-standalone install export TALK_PORT=3011 -export TALK_MONGO_URL='mongodb://localhost/talk_test' +export TALK_MONGO_URL='mongodb://localhost/test' +export TALK_DEBUG='talk*' npm start & diff --git a/tests/e2e/tests/EmbedStreamTests.js b/tests/e2e/tests/EmbedStreamTests.js index 106feee2b..716db93db 100644 --- a/tests/e2e/tests/EmbedStreamTests.js +++ b/tests/e2e/tests/EmbedStreamTests.js @@ -1,24 +1,35 @@ -require('../../utils/mongoose'); +const utils = require('../../utils/e2e-mongoose'); const Setting = require('../../../models/setting'); +const fetch = require('node-fetch'); const comment = 'This is a test comment.'; module.exports = { '@tags': ['embed-stream', 'post'], - before: () => { - Setting.create({moderation: 'post'}); + beforeEach: client => { + return fetch(`${client.globals.baseUrl}/api/v1/settings`, { + method: 'PUT', + headers: { + 'Content-Type': 'application/json', + 'Accept': 'application/json' + }, + body: JSON.stringify({ + moderation: 'post' + }) + }); }, 'User posts a comment': client => { client.resizeWindow(1200, 800) .url(client.globals.baseUrl) .frame('coralStreamIframe') - .waitForElementVisible('#commentBox', 1000) + .waitForElementVisible('#commentBox', 2000) .setValue('#commentBox .coral-plugin-commentbox-textarea', comment) .click('#commentBox .coral-plugin-commentbox-button') .waitForElementVisible('.comment', 1000) - .expect.element('.coral-plugin-comment').to.equal(comment); + .assert.containsText('.comment', comment); }, after: client => { + utils.after(); client.end(); } }; diff --git a/tests/utils/e2e-mongoose.js b/tests/utils/e2e-mongoose.js new file mode 100644 index 000000000..e5a0cb568 --- /dev/null +++ b/tests/utils/e2e-mongoose.js @@ -0,0 +1,39 @@ +const mongoose = require('../../mongoose'); + +// Ensure the NODE_ENV is set to 'test', +// this is helpful when you would like to change behavior when testing. +function clearDB() { + for (let i in mongoose.connection.collections) { + mongoose.connection.collections[i].remove(function() {}); + } +} + +module.exports = { + before: () => { + const url = process.env.TALK_MONGO_URL || 'mongodb://localhost'; + return mongoose.connect(url, (err) => { + if (err) { + throw err; + } + debug('Connected to MongoDB!'); + }); + }, + beforeEach: () => { + console.log('beforeEach', mongoose.connection.name); + if (mongoose.connection.readyState === 0) { + mongoose.on('open', function() { + if (err) { + throw err; + } + + return clearDB(); + }); + } else { + return clearDB(); + } + }, + after: () => { + clearDB(); + mongoose.disconnect(); + } +}; From 11478bbdb6800095124df4d5181c31f5459b8616 Mon Sep 17 00:00:00 2001 From: David Jay Date: Mon, 21 Nov 2016 15:53:26 -0500 Subject: [PATCH 07/35] Adding test env variables. --- .gitignore | 2 +- pree2e.sh | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 4fe8d7e31..98dc70fc5 100644 --- a/.gitignore +++ b/.gitignore @@ -6,5 +6,5 @@ dist/coral-admin/bundle.js tests/e2e/reports .DS_Store *.iml -.env +.env* gaba.cfg diff --git a/pree2e.sh b/pree2e.sh index 49b9a11f2..9b6089fa2 100755 --- a/pree2e.sh +++ b/pree2e.sh @@ -1,5 +1,3 @@ node_modules/selenium-standalone/bin/selenium-standalone install -export TALK_PORT=3011 -export TALK_MONGO_URL='mongodb://localhost/test' -export TALK_DEBUG='talk*' +source .env npm start & From 7aa893ba9e0d7f650591d49e6b8f3a5b75e8ff10 Mon Sep 17 00:00:00 2001 From: David Jay Date: Mon, 21 Nov 2016 17:26:04 -0500 Subject: [PATCH 08/35] Adding signing flow to tests. --- .../coral-sign-in/components/SignInContent.js | 2 +- .../coral-sign-in/components/SignUpContent.js | 2 +- .../containers/SignInContainer.js | 2 +- tests/e2e/tests/EmbedStreamTests.js | 23 +++++++++++++++---- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/client/coral-sign-in/components/SignInContent.js b/client/coral-sign-in/components/SignInContent.js index 76a93f56c..e7b97e529 100644 --- a/client/coral-sign-in/components/SignInContent.js +++ b/client/coral-sign-in/components/SignInContent.js @@ -56,7 +56,7 @@ const SignInContent = ({handleChange, formData, ...props}) => ( props.changeView('FORGOT')}>{lang.t('signIn.forgotYourPass')} {lang.t('signIn.needAnAccount')} - props.changeView('SIGNUP')}> + props.changeView('SIGNUP')} id='coralRegister'> {lang.t('signIn.register')} diff --git a/client/coral-sign-in/components/SignUpContent.js b/client/coral-sign-in/components/SignUpContent.js index 478971556..5d11ae90f 100644 --- a/client/coral-sign-in/components/SignUpContent.js +++ b/client/coral-sign-in/components/SignUpContent.js @@ -69,7 +69,7 @@ const SignUpContent = ({handleChange, formData, ...props}) => ( />
{ !props.auth.isLoading && !props.auth.successSignUp && ( - )} diff --git a/client/coral-sign-in/containers/SignInContainer.js b/client/coral-sign-in/containers/SignInContainer.js index fc85fd3c4..e52460acb 100644 --- a/client/coral-sign-in/containers/SignInContainer.js +++ b/client/coral-sign-in/containers/SignInContainer.js @@ -127,7 +127,7 @@ class SignInContainer extends Component { const {auth, showSignInDialog} = this.props; return (
- { + 'User signs in and posts a comment': client => { client.resizeWindow(1200, 800) .url(client.globals.baseUrl) .frame('coralStreamIframe') - .waitForElementVisible('#commentBox', 2000) - .setValue('#commentBox .coral-plugin-commentbox-textarea', comment) + .waitForElementVisible('#coralSignInButton', 2000) + .click('#coralSignInButton') + .waitForElementVisible('#coralRegister', 1000) + .click('#coralRegister') + .waitForElementVisible('#email', 1000) + .setValue('#email', mockUser.email) + .setValue('#password', mockUser.pw) + .setValue('#confirmPassword', mockUser.pw) + .click('#coralSignUpButton') + .waitForElementVisible('#commentBox', 1000) + .setValue('#commentBox .coral-plugin-commentbox-textarea', mockComment) .click('#commentBox .coral-plugin-commentbox-button') .waitForElementVisible('.comment', 1000) - .assert.containsText('.comment', comment); + .assert.containsText('.comment', mockComment); }, after: client => { utils.after(); From 4adba83c7b0dd27ec03d7954f1ab6d5c2e3d143a Mon Sep 17 00:00:00 2001 From: David Jay Date: Mon, 21 Nov 2016 18:13:05 -0500 Subject: [PATCH 09/35] Adding test environment vars. --- pree2e.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pree2e.sh b/pree2e.sh index 9b6089fa2..269e7cdb5 100755 --- a/pree2e.sh +++ b/pree2e.sh @@ -1,3 +1,3 @@ node_modules/selenium-standalone/bin/selenium-standalone install -source .env +source .env-test npm start & From dd060c5fd1a330a9ffc6eaa670f4cbf789381f68 Mon Sep 17 00:00:00 2001 From: David Jay Date: Mon, 21 Nov 2016 21:23:48 -0500 Subject: [PATCH 10/35] Signing in via e2e and posting comment. --- client/coral-sign-in/components/SignInContent.js | 2 +- client/coral-sign-in/containers/SignInContainer.js | 4 ++-- tests/e2e/tests/AppTest.js | 2 +- tests/e2e/tests/EmbedStreamTests.js | 11 ++++++++--- views/article.ejs | 3 ++- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/client/coral-sign-in/components/SignInContent.js b/client/coral-sign-in/components/SignInContent.js index e7b97e529..d55049e86 100644 --- a/client/coral-sign-in/components/SignInContent.js +++ b/client/coral-sign-in/components/SignInContent.js @@ -44,7 +44,7 @@ const SignInContent = ({handleChange, formData, ...props}) => (
{ !props.auth.isLoading ? - : diff --git a/client/coral-sign-in/containers/SignInContainer.js b/client/coral-sign-in/containers/SignInContainer.js index e52460acb..e47ffd3e3 100644 --- a/client/coral-sign-in/containers/SignInContainer.js +++ b/client/coral-sign-in/containers/SignInContainer.js @@ -126,8 +126,8 @@ class SignInContainer extends Component { render() { const {auth, showSignInDialog} = this.props; return ( -
- { diff --git a/tests/e2e/tests/EmbedStreamTests.js b/tests/e2e/tests/EmbedStreamTests.js index 427d744af..8902e021d 100644 --- a/tests/e2e/tests/EmbedStreamTests.js +++ b/tests/e2e/tests/EmbedStreamTests.js @@ -4,7 +4,8 @@ const fetch = require('node-fetch'); const mockComment = 'This is a test comment.'; const mockUser = { - email: 'test@test.com', + email: `${new Date().getTime()}@test4.com`, + name: 'Test User', pw: 'testtesttest' } @@ -26,16 +27,20 @@ module.exports = { client.resizeWindow(1200, 800) .url(client.globals.baseUrl) .frame('coralStreamIframe') + .waitForElementVisible('#commentBox', 1000) .waitForElementVisible('#coralSignInButton', 2000) - .click('#coralSignInButton') + .click('#coralSignInButton button') .waitForElementVisible('#coralRegister', 1000) .click('#coralRegister') .waitForElementVisible('#email', 1000) .setValue('#email', mockUser.email) + .setValue('#displayName', mockUser.name) .setValue('#password', mockUser.pw) .setValue('#confirmPassword', mockUser.pw) .click('#coralSignUpButton') - .waitForElementVisible('#commentBox', 1000) + .waitForElementVisible('#coralLogInButton', 10000) + .click('#coralLogInButton') + .waitForElementVisible('#commentBox', 3000) .setValue('#commentBox .coral-plugin-commentbox-textarea', mockComment) .click('#commentBox .coral-plugin-commentbox-button') .waitForElementVisible('.comment', 1000) diff --git a/views/article.ejs b/views/article.ejs index 7d168f960..6cbfc5681 100644 --- a/views/article.ejs +++ b/views/article.ejs @@ -13,6 +13,7 @@ width:500px; } + <%= title %>
@@ -33,7 +34,7 @@