From b84daf0422cf967f616265b7db82c8ae70f0a8b4 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Thu, 26 Oct 2017 17:30:55 +0200 Subject: [PATCH 01/32] Set resolution to 1600x1200 bs --- nightwatch-browserstack.conf.js | 1 + 1 file changed, 1 insertion(+) diff --git a/nightwatch-browserstack.conf.js b/nightwatch-browserstack.conf.js index 9e8e334c5..ac8f90d27 100644 --- a/nightwatch-browserstack.conf.js +++ b/nightwatch-browserstack.conf.js @@ -26,6 +26,7 @@ const nightwatch_config = { // Disable this, as it makes bs slow and brittle. 'browserstack.networkLogs': false, + 'browserstack.resolution': '1600x1200', } }, chrome: { From ad4a5595f9e8b184c5f798421c8688c3a0f52c05 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Fri, 27 Oct 2017 13:19:00 +0200 Subject: [PATCH 02/32] Enable screenshot on failure for bs --- nightwatch-browserstack.conf.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nightwatch-browserstack.conf.js b/nightwatch-browserstack.conf.js index ac8f90d27..bf0ca2284 100644 --- a/nightwatch-browserstack.conf.js +++ b/nightwatch-browserstack.conf.js @@ -27,7 +27,13 @@ const nightwatch_config = { // Disable this, as it makes bs slow and brittle. 'browserstack.networkLogs': false, 'browserstack.resolution': '1600x1200', - } + }, + screenshots : { + enabled: true, + on_failure: true, + on_error: true, + path: process.env.REPORTS_FOLDER || './test/e2e/reports', + }, }, chrome: { desiredCapabilities: { From 5f5c64870ab9ee43dda0dbdaae875caeccae3b58 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Fri, 27 Oct 2017 19:00:48 +0200 Subject: [PATCH 03/32] Stabilize e2e --- scripts/e2e-ci.sh | 3 ++ test/e2e/specs/02_admin.js | 6 ++-- test/e2e/specs/03_embedStream.js | 52 +++++++++++++++++++++++++++----- 3 files changed, 49 insertions(+), 12 deletions(-) diff --git a/scripts/e2e-ci.sh b/scripts/e2e-ci.sh index e0e94b4bf..f64223f32 100755 --- a/scripts/e2e-ci.sh +++ b/scripts/e2e-ci.sh @@ -1,5 +1,8 @@ #!/bin/bash +CIRCLE_TEST_REPORTS=${CIRCLE_TEST_REPORTS:-./test/e2e/reports} +CIRCLE_BRANCH=${CIRCLE_BRANCH:-master} + if [[ "${CIRCLE_BRANCH}" == "master" ]]; then exitCode=0 diff --git a/test/e2e/specs/02_admin.js b/test/e2e/specs/02_admin.js index 4a60780bb..4744d2116 100644 --- a/test/e2e/specs/02_admin.js +++ b/test/e2e/specs/02_admin.js @@ -1,9 +1,9 @@ module.exports = { '@tags': ['admin', 'login'], beforeEach: (client) => { - + client.resizeWindow(1024, 800); - }, + }, 'Admin logs in': (client) => { const adminPage = client.page.admin(); const {testData: {admin}} = client.globals; @@ -17,8 +17,6 @@ module.exports = { .waitForElementVisible('@signInButton') .click('@signInButton'); - client.pause(3000); - adminPage .waitForElementVisible('@moderationContainer'); }, diff --git a/test/e2e/specs/03_embedStream.js b/test/e2e/specs/03_embedStream.js index 57f9a8fd2..5381a5558 100644 --- a/test/e2e/specs/03_embedStream.js +++ b/test/e2e/specs/03_embedStream.js @@ -1,3 +1,31 @@ +class SortedWindowHandler { + + constructor(client) { + this.client = client; + this.client.windowHandles((result) => { + this.handles = result.value; + if (this.handles.length > 2) { + throw new Error('SortedWindowHandler must be created before new windows were created.'); + } + }); + } + + windowHandles(callback) { + this.client.windowHandles((result) => { + console.log(result); + this.handles = this.handles.filter((handle) => result.value.includes(handle)); + const remaining = result.value.filter((handle) => !this.handles.includes(handle)); + if (remaining.length === 1) { + this.handles.push(remaining[0]); + } + if (remaining.length > 1) { + throw new Error('Cannot detect new window handle, because more than one windows was created.'); + } + callback(this.handles); + }); + } +} + module.exports = { '@tags': ['embedStream', 'login'], 'creates a new asset': (client) => { @@ -18,16 +46,15 @@ module.exports = { .navigate() .getEmbedSection(); + const windowHandler = new SortedWindowHandler(client); + embed .waitForElementVisible('@signInButton') .click('@signInButton'); - client.pause(3000); - // Focusing on the Login PopUp - client.windowHandles((result) => { - const handle = result.value[1]; - client.switchWindow(handle); + windowHandler.windowHandles((handles) => { + client.switchWindow(handles[1]); }); const login = client.page.login(); @@ -45,10 +72,19 @@ module.exports = { .waitForElementVisible('@loginButton') .click('@loginButton'); + // Give a tiny bit of time to let popup close. + client.pause(50); + + if (client.capabilities.browserName === 'MicrosoftEdge') { + + // More time for edge. + // https://www.browserstack.com/automate/builds/1ceccf4efb4683b7feb890f45a32b5922b40ed3f/sessions/7393dbfda8387e43b6d5851f359b0c07db414973 + client.pause(1000); + } + // Focusing on the Embed Window - client.windowHandles((result) => { - const handle = result.value[0]; - client.switchWindow(handle); + windowHandler.windowHandles((handles) => { + client.switchWindow(handles[0]); }); }, 'user posts a comment': (client) => { From bfe82218ed44b21ffa041f7480875359c3996e22 Mon Sep 17 00:00:00 2001 From: blackcathacker Date: Sun, 29 Oct 2017 18:09:18 -0700 Subject: [PATCH 04/32] Send user an email when they are banned #1050 --- services/email/banned.html.ejs | 1 + services/email/banned.txt.ejs | 1 + services/users.js | 21 ++++++++++++++++++++- test/server/services/users.js | 21 ++++++++++++++++++++- 4 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 services/email/banned.html.ejs create mode 100644 services/email/banned.txt.ejs diff --git a/services/email/banned.html.ejs b/services/email/banned.html.ejs new file mode 100644 index 000000000..4fd8f191c --- /dev/null +++ b/services/email/banned.html.ejs @@ -0,0 +1 @@ +<%= body.replace(/\n/g, '
') %> diff --git a/services/email/banned.txt.ejs b/services/email/banned.txt.ejs new file mode 100644 index 000000000..b36560ec5 --- /dev/null +++ b/services/email/banned.txt.ejs @@ -0,0 +1 @@ +<%= body %> diff --git a/services/users.js b/services/users.js index 9906ef6c0..2e5c66d40 100644 --- a/services/users.js +++ b/services/users.js @@ -398,7 +398,7 @@ module.exports = class UsersService { // TODO: current updating status behavior is weird. // once a user has been `APPROVED` its status cannot be // changed anymore. - return UserModel.findOneAndUpdate({ + const user = await UserModel.findOneAndUpdate({ id, status: { $ne: 'APPROVED' @@ -410,6 +410,25 @@ module.exports = class UsersService { }, { new: true, }); + + if (status === 'BANNED') { + let localProfile = user.profiles.find((profile) => profile.provider === 'local'); + if (localProfile) { + const options = + { + template: 'banned', // needed to know which template to render! + locals: { // specifies the template locals. + body: 'In accordance with The Coral Project’s community guidelines, your account has been banned. You are now longer allowed to comment, flag or engage with our community.' + }, + subject: '[Talk] Your account has been banned', + to: localProfile.id // This only works if the user has registered via e-mail. + // We may want a standard way to access a user's e-mail address in the future + }; + await MailerService.sendSimple(options); + } + + } + return user; } /** diff --git a/test/server/services/users.js b/test/server/services/users.js index dddd5eda8..b4a15e3ba 100644 --- a/test/server/services/users.js +++ b/test/server/services/users.js @@ -1,8 +1,11 @@ const UsersService = require('../../../services/users'); const SettingsService = require('../../../services/settings'); +const MailerService = require('../../../services/mailer'); const chai = require('chai'); chai.use(require('chai-as-promised')); +const sinon = require('sinon'); +chai.use(require('sinon-chai')); const expect = chai.expect; describe('services.UsersService', () => { @@ -15,7 +18,7 @@ describe('services.UsersService', () => { mockUsers = await UsersService.createLocalUsers([{ email: 'stampi@gmail.com', username: 'Stampi', - password: '1Coral!-' + password: '1Coral!-', }, { email: 'sockmonster@gmail.com', username: 'Sockmonster', @@ -25,6 +28,12 @@ describe('services.UsersService', () => { username: 'Marvel', password: '3Coral!3' }]); + + sinon.spy(MailerService, 'sendSimple'); + }); + + afterEach(() => { + MailerService.sendSimple.restore(); }); describe('#findById()', () => { @@ -149,7 +158,11 @@ describe('services.UsersService', () => { .then(() => UsersService.findById(mockUsers[0].id)) .then((user) => { expect(user).to.have.property('status', 'ACTIVE'); + }) + .then(() => { + expect(MailerService.sendSimple).to.not.have.been.called; }); + }); }); @@ -188,6 +201,12 @@ describe('services.UsersService', () => { .then(() => UsersService.findById(mockUsers[0].id)) .then((user) => { expect(user).to.have.property('status', 'BANNED'); + }) + .then(() => { + expect(MailerService.sendSimple).to.have.been.calledWithMatch({ + template: 'banned', + to: mockUsers[0].profiles[0].id + }); }); }); From 12a71fa11718d0a7863456075975a815273ca86a Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Mon, 30 Oct 2017 13:11:41 +0100 Subject: [PATCH 05/32] Wait before click --- test/e2e/page_objects/embedStream.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/e2e/page_objects/embedStream.js b/test/e2e/page_objects/embedStream.js index 76065ba5e..2ee8b31fd 100644 --- a/test/e2e/page_objects/embedStream.js +++ b/test/e2e/page_objects/embedStream.js @@ -23,11 +23,13 @@ module.exports = { embed: { commands: [{ getProfileSection: function() { + this.waitForElementVisible('@profileTabButton'); this.click('@profileTabButton'); this.expect.section('@profile').to.be.present; return this.section.profile; }, getCommentsSection: function() { + this.waitForElementVisible('@commentsTabButton'); this.click('@commentsTabButton'); this.expect.section('@comments').to.be.present; return this.section.comments; From 511f4f0975f253a05cc04a52d8d197905ab94b19 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Mon, 30 Oct 2017 13:26:50 +0100 Subject: [PATCH 06/32] Refactor --- test/e2e/specs/03_embedStream.js | 28 +-------------------------- test/e2e/utils/SortedWindowHandler.js | 28 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 27 deletions(-) create mode 100644 test/e2e/utils/SortedWindowHandler.js diff --git a/test/e2e/specs/03_embedStream.js b/test/e2e/specs/03_embedStream.js index 5381a5558..4c7e620e8 100644 --- a/test/e2e/specs/03_embedStream.js +++ b/test/e2e/specs/03_embedStream.js @@ -1,30 +1,4 @@ -class SortedWindowHandler { - - constructor(client) { - this.client = client; - this.client.windowHandles((result) => { - this.handles = result.value; - if (this.handles.length > 2) { - throw new Error('SortedWindowHandler must be created before new windows were created.'); - } - }); - } - - windowHandles(callback) { - this.client.windowHandles((result) => { - console.log(result); - this.handles = this.handles.filter((handle) => result.value.includes(handle)); - const remaining = result.value.filter((handle) => !this.handles.includes(handle)); - if (remaining.length === 1) { - this.handles.push(remaining[0]); - } - if (remaining.length > 1) { - throw new Error('Cannot detect new window handle, because more than one windows was created.'); - } - callback(this.handles); - }); - } -} +const SortedWindowHandler = require('../utils/SortedWindowHandler'); module.exports = { '@tags': ['embedStream', 'login'], diff --git a/test/e2e/utils/SortedWindowHandler.js b/test/e2e/utils/SortedWindowHandler.js new file mode 100644 index 000000000..c736547ed --- /dev/null +++ b/test/e2e/utils/SortedWindowHandler.js @@ -0,0 +1,28 @@ +class SortedWindowHandler { + + constructor(client) { + this.client = client; + this.client.windowHandles((result) => { + this.handles = result.value; + if (this.handles.length > 2) { + throw new Error('SortedWindowHandler must be created before new windows were created.'); + } + }); + } + + windowHandles(callback) { + this.client.windowHandles((result) => { + this.handles = this.handles.filter((handle) => result.value.includes(handle)); + const remaining = result.value.filter((handle) => !this.handles.includes(handle)); + if (remaining.length === 1) { + this.handles.push(remaining[0]); + } + if (remaining.length > 1) { + throw new Error('Cannot detect new window handle, because more than one windows was created.'); + } + callback(this.handles); + }); + } +} + +module.exports = SortedWindowHandler; From 0c3a9db443d0d799b1b48d67d720733f65ed4045 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Mon, 30 Oct 2017 13:52:11 +0100 Subject: [PATCH 07/32] Add more console logs --- scripts/e2e-ci.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/e2e-ci.sh b/scripts/e2e-ci.sh index f64223f32..f805c8e20 100755 --- a/scripts/e2e-ci.sh +++ b/scripts/e2e-ci.sh @@ -8,13 +8,17 @@ if [[ "${CIRCLE_BRANCH}" == "master" ]]; then exitCode=0 browserstack() { + echo "-- Start e2e for $1 --" REPORTS_FOLDER="$CIRCLE_TEST_REPORTS/$1" yarn e2e-browserstack -- --env "$1" # Determine exit code. result=$? if [ "$result" -gt "0" ] then + echo "-- Success e2e for $1 --" exitCode=$result + else + echo "-- Failed e2e for $1 --" fi # Sleep a bit to let browserstack-local to close properly. From 9af206da1a2450804df0adca7aecd05901df6e5d Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Mon, 30 Oct 2017 14:08:13 +0100 Subject: [PATCH 08/32] Correct echo output --- scripts/e2e-ci.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/e2e-ci.sh b/scripts/e2e-ci.sh index f805c8e20..a7cbbc23a 100755 --- a/scripts/e2e-ci.sh +++ b/scripts/e2e-ci.sh @@ -15,10 +15,10 @@ if [[ "${CIRCLE_BRANCH}" == "master" ]]; then result=$? if [ "$result" -gt "0" ] then - echo "-- Success e2e for $1 --" + echo "-- Failed e2e for $1 --" exitCode=$result else - echo "-- Failed e2e for $1 --" + echo "-- Success e2e for $1 --" fi # Sleep a bit to let browserstack-local to close properly. From 05b326b91c0e50ab682f103324b768c26a095688 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Mon, 30 Oct 2017 14:14:49 +0100 Subject: [PATCH 09/32] Add comments --- test/e2e/utils/SortedWindowHandler.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/e2e/utils/SortedWindowHandler.js b/test/e2e/utils/SortedWindowHandler.js index c736547ed..f57856814 100644 --- a/test/e2e/utils/SortedWindowHandler.js +++ b/test/e2e/utils/SortedWindowHandler.js @@ -1,5 +1,15 @@ + +/** + * SortedWindowHandler assists in making e2e tests more robust by returning + * deterministic window handles. An instance must be created before new windows + * are created and windowHandles must be called each time a window was created or + * closed. + */ class SortedWindowHandler { + /** + * Constructor, must be called before new windows were created. + */ constructor(client) { this.client = client; this.client.windowHandles((result) => { @@ -10,6 +20,9 @@ class SortedWindowHandler { }); } + /** + * windowHandles will call given `callback` with an array of window handles. + */ windowHandles(callback) { this.client.windowHandles((result) => { this.handles = this.handles.filter((handle) => result.value.includes(handle)); From 97a8f95b93f5fcf60eb70133af04fc345217fe25 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Mon, 30 Oct 2017 14:25:18 +0100 Subject: [PATCH 10/32] Use win10 for ie browsers --- nightwatch-browserstack.conf.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nightwatch-browserstack.conf.js b/nightwatch-browserstack.conf.js index bf0ca2284..17ce3f3c0 100644 --- a/nightwatch-browserstack.conf.js +++ b/nightwatch-browserstack.conf.js @@ -59,7 +59,7 @@ const nightwatch_config = { desiredCapabilities: { browser: 'internet explorer', os: 'Windows', - os_version: '8.1', + os_version: '10', browser_version: '11', }, }, @@ -67,6 +67,8 @@ const nightwatch_config = { desiredCapabilities: { browser: 'edge', browser_version: '15', + os: 'Windows', + os_version: '10', }, }, } From 8adff1426309a362223510b20c18f22f7d8f2a76 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Mon, 30 Oct 2017 15:53:52 +0100 Subject: [PATCH 11/32] Reactivate e2e on ci --- circle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index 932643ff6..9f35736c6 100644 --- a/circle.yml +++ b/circle.yml @@ -50,7 +50,7 @@ test: - MOCHA_FILE=$CIRCLE_TEST_REPORTS/junit/test-results.xml MOCHA_REPORTER=mocha-junit-reporter yarn test # Check dependancies using nsp. - nsp check - # - yarn e2e-ci + - yarn e2e-ci deployment: release: From 975fe550e0bb731fc085f746df1b6c37925b67d3 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Mon, 30 Oct 2017 16:08:03 +0100 Subject: [PATCH 12/32] Harmonize local chrome headless window-size --- nightwatch.conf.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nightwatch.conf.js b/nightwatch.conf.js index f843b881a..5c3ffcaa5 100644 --- a/nightwatch.conf.js +++ b/nightwatch.conf.js @@ -43,7 +43,7 @@ module.exports = { 'chrome-headless': { desiredCapabilities: { chromeOptions : { - args: ['--headless', '--disable-gpu', 'window-size=1280,800'], + args: ['--headless', '--disable-gpu', 'window-size=1600,1200'], }, }, }, From 53b1104cf88e5263145bb284d308e579b79dc314 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Mon, 30 Oct 2017 16:09:16 +0100 Subject: [PATCH 13/32] Add little pause waiting for popup to open --- test/e2e/specs/03_embedStream.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/e2e/specs/03_embedStream.js b/test/e2e/specs/03_embedStream.js index 4c7e620e8..53da1e87d 100644 --- a/test/e2e/specs/03_embedStream.js +++ b/test/e2e/specs/03_embedStream.js @@ -26,6 +26,10 @@ module.exports = { .waitForElementVisible('@signInButton') .click('@signInButton'); + // Wait for window to be created + // https://www.browserstack.com/automate/builds/1ceccf4efb4683b7feb890f45a32b5922b40ed3f/sessions/17b1a79682bef2498cb0be86eac317a08c976b0a#automate_button + client.pause(200); + // Focusing on the Login PopUp windowHandler.windowHandles((handles) => { client.switchWindow(handles[1]); From e091fa552ab7ba0c39c2c57ef2b109ff66bc4604 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Mon, 30 Oct 2017 17:02:20 +0100 Subject: [PATCH 14/32] Upgrade selenium standalone --- nightwatch.conf.js | 6 +++--- package.json | 2 +- yarn.lock | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/nightwatch.conf.js b/nightwatch.conf.js index 5c3ffcaa5..97eee0e81 100644 --- a/nightwatch.conf.js +++ b/nightwatch.conf.js @@ -9,13 +9,13 @@ module.exports = { globals_path: './test/e2e/globals', selenium: { start_process: true, - server_path: 'node_modules/selenium-standalone/.selenium/selenium-server/3.5.3-server.jar', + server_path: 'node_modules/selenium-standalone/.selenium/selenium-server/3.6.0-server.jar', log_path: './test/e2e/', host: '127.0.0.1', port: 6666, cli_args: { - 'webdriver.chrome.driver': 'node_modules/selenium-standalone/.selenium/chromedriver/2.32-x64-chromedriver', - 'webdriver.gecko.driver': 'node_modules/selenium-standalone/.selenium/geckodriver/0.18.0-x64-geckodriver', + 'webdriver.chrome.driver': 'node_modules/selenium-standalone/.selenium/chromedriver/2.33-x64-chromedriver', + 'webdriver.gecko.driver': 'node_modules/selenium-standalone/.selenium/geckodriver/0.19.0-x64-geckodriver', } }, test_settings: { diff --git a/package.json b/package.json index 3e9d5fb05..897efc819 100644 --- a/package.json +++ b/package.json @@ -172,7 +172,7 @@ "redux": "^3.6.0", "redux-thunk": "^2.1.0", "resolve": "^1.4.0", - "selenium-standalone": "6.9.0", + "selenium-standalone": "^6.11.0", "semver": "^5.4.1", "simplemde": "^1.11.2", "smoothscroll-polyfill": "^0.3.5", diff --git a/yarn.lock b/yarn.lock index 6ea60fc82..7996e549f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7953,9 +7953,9 @@ select@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/select/-/select-1.1.2.tgz#0e7350acdec80b1108528786ec1d4418d11b396d" -selenium-standalone@6.9.0: - version "6.9.0" - resolved "https://registry.yarnpkg.com/selenium-standalone/-/selenium-standalone-6.9.0.tgz#5805f403c82b48b4e136d8a97f1832aad7852bd5" +selenium-standalone@^6.11.0: + version "6.11.0" + resolved "https://registry.yarnpkg.com/selenium-standalone/-/selenium-standalone-6.11.0.tgz#eb21ff65f3b2ece75061b35d4f9e7572ac0280c2" dependencies: async "^2.1.4" commander "^2.9.0" From e4688f987672112f3f353534b9aca3b2bbb3e3cc Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Mon, 30 Oct 2017 19:08:42 +0100 Subject: [PATCH 15/32] Pause to let iframe load --- test/e2e/page_objects/embedStream.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/e2e/page_objects/embedStream.js b/test/e2e/page_objects/embedStream.js index 2ee8b31fd..f148ae7bc 100644 --- a/test/e2e/page_objects/embedStream.js +++ b/test/e2e/page_objects/embedStream.js @@ -8,6 +8,11 @@ module.exports = { }, getEmbedSection: function() { this.waitForElementVisible('@iframe'); + + // Pause a bit to let iframe initialize in the hope that it'll + // fix https://www.browserstack.com/automate/builds/96419cf46e3d6376a36ae6d3f90934112df1ed91/sessions/224f1a1566c1c8c7859e2e76ece51862200f0173#automate_button + this.api.pause(200); + this.api.frame(iframeId); this.expect.section('@embed').to.be.present; return this.section.embed; From 0cdefa0066f96b1f591f0d00ace0c3fbd3c81277 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Mon, 30 Oct 2017 21:52:36 +0100 Subject: [PATCH 16/32] Fix wrong typed characters --- nightwatch-browserstack.conf.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nightwatch-browserstack.conf.js b/nightwatch-browserstack.conf.js index 17ce3f3c0..65cc6cd9d 100644 --- a/nightwatch-browserstack.conf.js +++ b/nightwatch-browserstack.conf.js @@ -61,6 +61,11 @@ const nightwatch_config = { os: 'Windows', os_version: '10', browser_version: '11', + + // The x64 bit IEDriver that is used by IE 11 has a known issue with sendKeys where + // it may enter incorrect keys (shift + key). + // This adds a delay for each character as temporary fix as advised from the browserstack support. + 'browserstack.customSendKeys': 800, }, }, edge: { From 88d012755cd0d88a1dca3135d44dfd2fd44271c7 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Mon, 30 Oct 2017 23:16:23 +0100 Subject: [PATCH 17/32] Always use windows 10 --- nightwatch-browserstack.conf.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nightwatch-browserstack.conf.js b/nightwatch-browserstack.conf.js index 65cc6cd9d..d79f6917a 100644 --- a/nightwatch-browserstack.conf.js +++ b/nightwatch-browserstack.conf.js @@ -39,12 +39,16 @@ const nightwatch_config = { desiredCapabilities: { browser: 'chrome', browser_version: '62', + os: 'Windows', + os_version: '10', }, }, firefox: { desiredCapabilities: { browser: 'firefox', browser_version: '56', + os: 'Windows', + os_version: '10', }, }, safari: { From 2d44f7abf47b0432a9729a3ab72576aec1426775 Mon Sep 17 00:00:00 2001 From: Kim Gardner Date: Tue, 31 Oct 2017 11:12:14 +0000 Subject: [PATCH 18/32] Spruce up README --- LICENSE | 16 ++++++++++------ README.md | 41 +++++++++++++++-------------------------- 2 files changed, 25 insertions(+), 32 deletions(-) diff --git a/LICENSE b/LICENSE index 597d8fa73..52faa90b7 100644 --- a/LICENSE +++ b/LICENSE @@ -1,11 +1,15 @@ -Copyright 2017 Mozilla Foundation + Copyright 2017 Mozilla Foundation -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + either express or implied. -See the License for the specific language governing permissions and limitations under the License. + See the License for the specific language governing permissions + and limitations under the License. diff --git a/README.md b/README.md index a089f040c..33ffc7947 100644 --- a/README.md +++ b/README.md @@ -1,46 +1,35 @@ # Talk [![CircleCI](https://circleci.com/gh/coralproject/talk.svg?style=svg)](https://circleci.com/gh/coralproject/talk) -[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://dashboard.heroku.com/new?template=https%3A%2F%2Fgithub.com%2Fcoralproject%2Ftalk&env[TALK_FACEBOOK_APP_ID]=ignore&env[TALK_FACEBOOK_APP_SECRET]=ignore) [![NSP Status](https://nodesecurity.io/orgs/coralproject/projects/07ce2e4c-99fb-48f8-b50b-69d2d2c081b8/badge)](https://nodesecurity.io/orgs/coralproject/projects/07ce2e4c-99fb-48f8-b50b-69d2d2c081b8) +[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://dashboard.heroku.com/new?template=https%3A%2F%2Fgithub.com%2Fcoralproject%2Ftalk&env[TALK_FACEBOOK_APP_ID]=ignore&env[TALK_FACEBOOK_APP_SECRET]=ignore) -Online comments are broken. Our open-source Talk tool rethinks how moderation, comment display, and conversation function, creating the opportunity for safer, smarter discussions around your work. [Read more about Talk here](https://coralproject.net/products/talk.html). +Online comments are broken. Our open-source commenting platform, Talk, rethinks how moderation, comment display, and conversation function, creating the opportunity for safer, smarter discussions around your work. [Read more about Talk here](https://coralproject.net/products/talk.html). Built with <3 by The Coral Project & Mozilla. -## Getting Started +## Technical Documentation -Check out our Docs: https://coralproject.github.io/talk/ +From getting up and running, to advanced configuration, to how to scale Talk, our [Talk Technical Docs](https://coralproject.github.io/talk/) have everything you need to know. + +## Product Guide + +Learn more about Talk, including a deep dive into features for commenters and moderators, and FAQs in our [Talk Product Guide](https://coralproject.github.io/talk/how-talk-works). ## Relevant Links -- Blog: https://blog.coralproject.net/ -- Community Forums: https://community.coralproject.net/ -- Community Guides for Journalism: https://guides.coralproject.net/ -- Project: https://coralproject.net/ -- Roadmap: https://www.pivotaltracker.com/n/projects/1863625 +- [Our Blog](https://blog.coralproject.net/) +- [Community Forums](https://community.coralproject.net/) +- [Community Guides for Journalism](https://guides.coralproject.net/) +- [More About Us](https://coralproject.net/) +- [Talk Roadmap](https://www.pivotaltracker.com/n/projects/1863625) ## End-to-End Testing -Talk uses [Nightwatch](http://nightwatchjs.org/) to write e2e tests. The testing infrastructure that allows us to run our tests in real browsers is provided with love by our friends at Browserstack. - +Talk uses [Nightwatch](https://nightwatchjs.org/) as our e2e testing framework. The testing infrastructure that allows us to run our tests in real browsers is provided with love by our friends at [Browserstack](https://browserstack.com). ![](/public/img/browserstack_logo.png) ## License - Copyright 2017 Mozilla Foundation - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, - either express or implied. - - See the License for the specific language governing permissions - and limitations under the License. +Talk is licensed under the [Apache License v2.0](/LICENSE). From 62660ed144e150a0fad05d081b8431b9f7ad115c Mon Sep 17 00:00:00 2001 From: Kim Gardner Date: Tue, 31 Oct 2017 11:18:24 +0000 Subject: [PATCH 19/32] Fix header --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 33ffc7947..e9fe86e1b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ -# Talk +# Talk · [![CircleCI](https://circleci.com/gh/coralproject/talk.svg?style=svg)](https://circleci.com/gh/coralproject/talk) [![NSP Status](https://nodesecurity.io/orgs/coralproject/projects/07ce2e4c-99fb-48f8-b50b-69d2d2c081b8/badge)](https://nodesecurity.io/orgs/coralproject/projects/07ce2e4c-99fb-48f8-b50b-69d2d2c081b8) -[![CircleCI](https://circleci.com/gh/coralproject/talk.svg?style=svg)](https://circleci.com/gh/coralproject/talk) -[![NSP Status](https://nodesecurity.io/orgs/coralproject/projects/07ce2e4c-99fb-48f8-b50b-69d2d2c081b8/badge)](https://nodesecurity.io/orgs/coralproject/projects/07ce2e4c-99fb-48f8-b50b-69d2d2c081b8) [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://dashboard.heroku.com/new?template=https%3A%2F%2Fgithub.com%2Fcoralproject%2Ftalk&env[TALK_FACEBOOK_APP_ID]=ignore&env[TALK_FACEBOOK_APP_SECRET]=ignore) Online comments are broken. Our open-source commenting platform, Talk, rethinks how moderation, comment display, and conversation function, creating the opportunity for safer, smarter discussions around your work. [Read more about Talk here](https://coralproject.net/products/talk.html). @@ -32,4 +30,4 @@ Talk uses [Nightwatch](https://nightwatchjs.org/) as our e2e testing framework. ## License -Talk is licensed under the [Apache License v2.0](/LICENSE). +Talk is released under the [Apache License, v2.0](/LICENSE). From 4e5e989d22946f61596a22c171daaa94e05d4fb2 Mon Sep 17 00:00:00 2001 From: Kim Gardner Date: Tue, 31 Oct 2017 11:25:22 +0000 Subject: [PATCH 20/32] Update one-click directions --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e9fe86e1b..dfc5553b9 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,15 @@ # Talk · [![CircleCI](https://circleci.com/gh/coralproject/talk.svg?style=svg)](https://circleci.com/gh/coralproject/talk) [![NSP Status](https://nodesecurity.io/orgs/coralproject/projects/07ce2e4c-99fb-48f8-b50b-69d2d2c081b8/badge)](https://nodesecurity.io/orgs/coralproject/projects/07ce2e4c-99fb-48f8-b50b-69d2d2c081b8) -[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://dashboard.heroku.com/new?template=https%3A%2F%2Fgithub.com%2Fcoralproject%2Ftalk&env[TALK_FACEBOOK_APP_ID]=ignore&env[TALK_FACEBOOK_APP_SECRET]=ignore) - Online comments are broken. Our open-source commenting platform, Talk, rethinks how moderation, comment display, and conversation function, creating the opportunity for safer, smarter discussions around your work. [Read more about Talk here](https://coralproject.net/products/talk.html). Built with <3 by The Coral Project & Mozilla. +## Try Talk + +You're one click away from trying Talk - all you need is a Heroku account and a few minutes of your time! + +[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://dashboard.heroku.com/new?template=https%3A%2F%2Fgithub.com%2Fcoralproject%2Ftalk&env[TALK_FACEBOOK_APP_ID]=ignore&env[TALK_FACEBOOK_APP_SECRET]=ignore) + ## Technical Documentation From getting up and running, to advanced configuration, to how to scale Talk, our [Talk Technical Docs](https://coralproject.github.io/talk/) have everything you need to know. From 3cdf2a3118cfbb1142ce20c5849d4b6dbcd9ed5b Mon Sep 17 00:00:00 2001 From: Kim Gardner Date: Tue, 31 Oct 2017 11:31:13 +0000 Subject: [PATCH 21/32] Formatting --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dfc5553b9..f8c959ad6 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Talk · [![CircleCI](https://circleci.com/gh/coralproject/talk.svg?style=svg)](https://circleci.com/gh/coralproject/talk) [![NSP Status](https://nodesecurity.io/orgs/coralproject/projects/07ce2e4c-99fb-48f8-b50b-69d2d2c081b8/badge)](https://nodesecurity.io/orgs/coralproject/projects/07ce2e4c-99fb-48f8-b50b-69d2d2c081b8) +# Talk · [![CircleCI](https://circleci.com/gh/coralproject/talk.svg?style=svg)](https://circleci.com/gh/coralproject/talk) · [![NSP Status](https://nodesecurity.io/orgs/coralproject/projects/07ce2e4c-99fb-48f8-b50b-69d2d2c081b8/badge)](https://nodesecurity.io/orgs/coralproject/projects/07ce2e4c-99fb-48f8-b50b-69d2d2c081b8) · [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md#pull-requests) Online comments are broken. Our open-source commenting platform, Talk, rethinks how moderation, comment display, and conversation function, creating the opportunity for safer, smarter discussions around your work. [Read more about Talk here](https://coralproject.net/products/talk.html). From 5c033dbfdfb75b9e39782cab40416f16d2e258d7 Mon Sep 17 00:00:00 2001 From: Kim Gardner Date: Tue, 31 Oct 2017 11:40:33 +0000 Subject: [PATCH 22/32] Tweaks --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f8c959ad6..b335887bf 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ Online comments are broken. Our open-source commenting platform, Talk, rethinks Built with <3 by The Coral Project & Mozilla. -## Try Talk +## Try Talk! -You're one click away from trying Talk - all you need is a Heroku account and a few minutes of your time! +You're just one click away from trying Talk - all you need is a Heroku account and a few minutes of your time. [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://dashboard.heroku.com/new?template=https%3A%2F%2Fgithub.com%2Fcoralproject%2Ftalk&env[TALK_FACEBOOK_APP_ID]=ignore&env[TALK_FACEBOOK_APP_SECRET]=ignore) From 1578316363b50bab795389f99b8b14da74f5fbc6 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Tue, 31 Oct 2017 14:25:58 +0100 Subject: [PATCH 23/32] Retry browsers when failed, print summary --- scripts/e2e-ci.sh | 60 +++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 50 insertions(+), 10 deletions(-) diff --git a/scripts/e2e-ci.sh b/scripts/e2e-ci.sh index a7cbbc23a..cc0146c4f 100755 --- a/scripts/e2e-ci.sh +++ b/scripts/e2e-ci.sh @@ -3,22 +3,53 @@ CIRCLE_TEST_REPORTS=${CIRCLE_TEST_REPORTS:-./test/e2e/reports} CIRCLE_BRANCH=${CIRCLE_BRANCH:-master} +MAX_RETRIES=1 + +# Safari >= 8 has issues connecting to browserstack-local. Safari < 8 is too old. +BROWSERS="chrome firefox ie edge" #safari + if [[ "${CIRCLE_BRANCH}" == "master" ]]; then + # List of failed browsers + failedBrowsers= + + # List of succeeded browsers + succeededBrowsers= + exitCode=0 browserstack() { - echo "-- Start e2e for $1 --" - REPORTS_FOLDER="$CIRCLE_TEST_REPORTS/$1" yarn e2e-browserstack -- --env "$1" + + # Current number of tries. + try=${2:-0} + + echo "-- Start e2e for $1 #$try --" + + REPORTS_FOLDER="$CIRCLE_TEST_REPORTS/$1" yarn e2e-browserstack --env "$1" # Determine exit code. result=$? - if [ "$result" -gt "0" ] - then + if [ "$result" -gt "0" ]; then echo "-- Failed e2e for $1 --" + + # Try again of MAX_RETRIES is not reached. + if [ "$try" -lt $MAX_RETRIES ]; then + let try=try+1 + browserstack "$1" "$try" + return + fi + + # Failed, add to list of failed browsers. + failedBrowsers="$failedBrowsers $1" + + # Remember exit code. exitCode=$result else echo "-- Success e2e for $1 --" + + # Succeeded, add to list of succeeded browsers. + succeededBrowsers="$succeededBrowsers $1" + eval "browser_${1}_succeeded_at=$try" fi # Sleep a bit to let browserstack-local to close properly. @@ -26,14 +57,23 @@ if [[ "${CIRCLE_BRANCH}" == "master" ]]; then } # Test using browserstack. - browserstack chrome - browserstack firefox - browserstack ie - browserstack edge + for browser in $BROWSERS + do + browserstack "$browser" + done - # Safari >= 8 has issues connecting to browserstack-local. Safari < 8 is too old. - # browserstack safari + # Print information about succeeded browsers. + for x in $succeededBrowsers + do + echo "Succeeded $x at try #$(eval "echo \$browser_${x}_succeeded_at")" + done + + # Print information about failed browsers. + for x in $failedBrowsers + do + echo "Failed $x" + done exit $exitCode else # When browserstack is not available test locally using chrome headless. From 42f0d76d98513264eff41a33a2fc6cb6563d132c Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Tue, 31 Oct 2017 14:58:25 +0100 Subject: [PATCH 24/32] Add retry number to console outpu --- scripts/e2e-ci.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/e2e-ci.sh b/scripts/e2e-ci.sh index cc0146c4f..7fe912f95 100755 --- a/scripts/e2e-ci.sh +++ b/scripts/e2e-ci.sh @@ -30,7 +30,7 @@ if [[ "${CIRCLE_BRANCH}" == "master" ]]; then # Determine exit code. result=$? if [ "$result" -gt "0" ]; then - echo "-- Failed e2e for $1 --" + echo "-- Failed e2e for $1 #$try --" # Try again of MAX_RETRIES is not reached. if [ "$try" -lt $MAX_RETRIES ]; then @@ -45,7 +45,7 @@ if [[ "${CIRCLE_BRANCH}" == "master" ]]; then # Remember exit code. exitCode=$result else - echo "-- Success e2e for $1 --" + echo "-- Success e2e for $1 #$try --" # Succeeded, add to list of succeeded browsers. succeededBrowsers="$succeededBrowsers $1" From 7f442ce91e5524b2a2b03aacd145479a4a4f2471 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Tue, 31 Oct 2017 14:58:40 +0100 Subject: [PATCH 25/32] Let MAX_RETRIES be customizable --- scripts/e2e-ci.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/e2e-ci.sh b/scripts/e2e-ci.sh index 7fe912f95..f0eae055e 100755 --- a/scripts/e2e-ci.sh +++ b/scripts/e2e-ci.sh @@ -3,7 +3,8 @@ CIRCLE_TEST_REPORTS=${CIRCLE_TEST_REPORTS:-./test/e2e/reports} CIRCLE_BRANCH=${CIRCLE_BRANCH:-master} -MAX_RETRIES=1 +# Amount of retries before failure. +MAX_RETRIES=${MAX_RETRIES:-1} # Safari >= 8 has issues connecting to browserstack-local. Safari < 8 is too old. BROWSERS="chrome firefox ie edge" #safari @@ -33,7 +34,7 @@ if [[ "${CIRCLE_BRANCH}" == "master" ]]; then echo "-- Failed e2e for $1 #$try --" # Try again of MAX_RETRIES is not reached. - if [ "$try" -lt $MAX_RETRIES ]; then + if [ "$try" -lt "$MAX_RETRIES" ]; then let try=try+1 browserstack "$1" "$try" return From 93363a06504ecde1ca8c7bfd1fadccef99cb32c5 Mon Sep 17 00:00:00 2001 From: Kim Gardner Date: Tue, 31 Oct 2017 14:27:38 +0000 Subject: [PATCH 26/32] Remove indenting --- LICENSE | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/LICENSE b/LICENSE index 52faa90b7..e0a687532 100644 --- a/LICENSE +++ b/LICENSE @@ -1,15 +1,15 @@ - Copyright 2017 Mozilla Foundation +Copyright 2017 Mozilla Foundation - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 +http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, - either express or implied. +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +either express or implied. - See the License for the specific language governing permissions - and limitations under the License. +See the License for the specific language governing permissions +and limitations under the License. From 9ba8cbcbe179364f4c6619e96b8b2984e4e149b5 Mon Sep 17 00:00:00 2001 From: Kim Gardner Date: Tue, 31 Oct 2017 14:30:32 +0000 Subject: [PATCH 27/32] Fix logo link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b335887bf..89474bf6d 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Learn more about Talk, including a deep dive into features for commenters and mo Talk uses [Nightwatch](https://nightwatchjs.org/) as our e2e testing framework. The testing infrastructure that allows us to run our tests in real browsers is provided with love by our friends at [Browserstack](https://browserstack.com). -![](/public/img/browserstack_logo.png) +[![Browserstack](/public/img/browserstack_logo.png)](https://browserstack.com) ## License From c31e6347d09ec977b313ddf35483811db4a546c8 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Tue, 31 Oct 2017 16:29:32 +0100 Subject: [PATCH 28/32] Sleep between retries --- scripts/e2e-ci.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/e2e-ci.sh b/scripts/e2e-ci.sh index f0eae055e..66554cf74 100755 --- a/scripts/e2e-ci.sh +++ b/scripts/e2e-ci.sh @@ -6,6 +6,9 @@ CIRCLE_BRANCH=${CIRCLE_BRANCH:-master} # Amount of retries before failure. MAX_RETRIES=${MAX_RETRIES:-1} +# Amount of seconds between tests. +SLEEP_BETWEEN_TESTS=${SLEEP_BETWEEN_TESTS:-1} + # Safari >= 8 has issues connecting to browserstack-local. Safari < 8 is too old. BROWSERS="chrome firefox ie edge" #safari @@ -36,6 +39,10 @@ if [[ "${CIRCLE_BRANCH}" == "master" ]]; then # Try again of MAX_RETRIES is not reached. if [ "$try" -lt "$MAX_RETRIES" ]; then let try=try+1 + + # Sleep a bit to let browserstack-local to close properly. + sleep "$SLEEP_BETWEEN_TESTS" + browserstack "$1" "$try" return fi @@ -54,7 +61,7 @@ if [[ "${CIRCLE_BRANCH}" == "master" ]]; then fi # Sleep a bit to let browserstack-local to close properly. - sleep 2 + sleep "$SLEEP_BETWEEN_TESTS" } # Test using browserstack. From 96b44b2b99e42ac71d9bea1c38bbd2e0b96da3d3 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Tue, 31 Oct 2017 16:39:41 +0100 Subject: [PATCH 29/32] Prefix env variables --- scripts/e2e-ci.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/e2e-ci.sh b/scripts/e2e-ci.sh index 66554cf74..6d8514797 100755 --- a/scripts/e2e-ci.sh +++ b/scripts/e2e-ci.sh @@ -4,10 +4,10 @@ CIRCLE_TEST_REPORTS=${CIRCLE_TEST_REPORTS:-./test/e2e/reports} CIRCLE_BRANCH=${CIRCLE_BRANCH:-master} # Amount of retries before failure. -MAX_RETRIES=${MAX_RETRIES:-1} +E2E_MAX_RETRIES=${E2E_MAX_RETRIES:-1} # Amount of seconds between tests. -SLEEP_BETWEEN_TESTS=${SLEEP_BETWEEN_TESTS:-1} +E2E_SLEEP_BETWEEN_TESTS=${E2E_SLEEP_BETWEEN_TESTS:-1} # Safari >= 8 has issues connecting to browserstack-local. Safari < 8 is too old. BROWSERS="chrome firefox ie edge" #safari @@ -36,12 +36,12 @@ if [[ "${CIRCLE_BRANCH}" == "master" ]]; then if [ "$result" -gt "0" ]; then echo "-- Failed e2e for $1 #$try --" - # Try again of MAX_RETRIES is not reached. - if [ "$try" -lt "$MAX_RETRIES" ]; then + # Try again of E2E_MAX_RETRIES is not reached. + if [ "$try" -lt "$E2E_MAX_RETRIES" ]; then let try=try+1 # Sleep a bit to let browserstack-local to close properly. - sleep "$SLEEP_BETWEEN_TESTS" + sleep "$E2E_SLEEP_BETWEEN_TESTS" browserstack "$1" "$try" return @@ -61,7 +61,7 @@ if [[ "${CIRCLE_BRANCH}" == "master" ]]; then fi # Sleep a bit to let browserstack-local to close properly. - sleep "$SLEEP_BETWEEN_TESTS" + sleep "$E2E_SLEEP_BETWEEN_TESTS" } # Test using browserstack. From d20666adb929874c70368dab0bce18d62ed313b3 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Tue, 31 Oct 2017 10:00:47 -0600 Subject: [PATCH 30/32] Update users.js Prefix added by mailer service --- services/users.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/users.js b/services/users.js index 2e5c66d40..e0f7d1599 100644 --- a/services/users.js +++ b/services/users.js @@ -420,7 +420,7 @@ module.exports = class UsersService { locals: { // specifies the template locals. body: 'In accordance with The Coral Project’s community guidelines, your account has been banned. You are now longer allowed to comment, flag or engage with our community.' }, - subject: '[Talk] Your account has been banned', + subject: 'Your account has been banned', to: localProfile.id // This only works if the user has registered via e-mail. // We may want a standard way to access a user's e-mail address in the future }; From 8821c0aa5c64942258c12466608bd7a24f3b49e3 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Tue, 31 Oct 2017 17:33:44 +0100 Subject: [PATCH 31/32] Typos --- scripts/e2e-ci.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/e2e-ci.sh b/scripts/e2e-ci.sh index 6d8514797..1ae851360 100755 --- a/scripts/e2e-ci.sh +++ b/scripts/e2e-ci.sh @@ -14,10 +14,10 @@ BROWSERS="chrome firefox ie edge" #safari if [[ "${CIRCLE_BRANCH}" == "master" ]]; then - # List of failed browsers + # List of failed browsers. failedBrowsers= - # List of succeeded browsers + # List of succeeded browsers. succeededBrowsers= exitCode=0 @@ -36,11 +36,11 @@ if [[ "${CIRCLE_BRANCH}" == "master" ]]; then if [ "$result" -gt "0" ]; then echo "-- Failed e2e for $1 #$try --" - # Try again of E2E_MAX_RETRIES is not reached. + # Try again until E2E_MAX_RETRIES is reached. if [ "$try" -lt "$E2E_MAX_RETRIES" ]; then let try=try+1 - # Sleep a bit to let browserstack-local to close properly. + # Sleep a bit to let browserstack-local close properly. sleep "$E2E_SLEEP_BETWEEN_TESTS" browserstack "$1" "$try" @@ -60,7 +60,7 @@ if [[ "${CIRCLE_BRANCH}" == "master" ]]; then eval "browser_${1}_succeeded_at=$try" fi - # Sleep a bit to let browserstack-local to close properly. + # Sleep a bit to let browserstack-local close properly. sleep "$E2E_SLEEP_BETWEEN_TESTS" } From bfb2da519fbb01fd20ece50b737b537f02617646 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Tue, 31 Oct 2017 17:34:28 +0100 Subject: [PATCH 32/32] Exit code can be negative --- scripts/e2e-ci.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/e2e-ci.sh b/scripts/e2e-ci.sh index 1ae851360..e72d1a6ce 100755 --- a/scripts/e2e-ci.sh +++ b/scripts/e2e-ci.sh @@ -33,7 +33,7 @@ if [[ "${CIRCLE_BRANCH}" == "master" ]]; then # Determine exit code. result=$? - if [ "$result" -gt "0" ]; then + if [ "$result" -ne "0" ]; then echo "-- Failed e2e for $1 #$try --" # Try again until E2E_MAX_RETRIES is reached.