From e4399b734e8ec28daa40872ce815d28d83cf1f6a Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Wed, 11 Oct 2017 21:02:46 +0700 Subject: [PATCH] Use TALK_ROOT_URL, global timeout, other improvements --- .gitignore | 1 + nightwatch.conf.js | 5 ++++- test/e2e/specs/embedStream.js | 13 ++++++++++--- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 1f87b52bf..bc6f0b4cd 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ client/coral-framework/graphql/introspection.json coverage/ test/e2e/tests_output/ test/e2e/bslocal.log +browserstack.err plugins.json plugins/* diff --git a/nightwatch.conf.js b/nightwatch.conf.js index 50b0b5a80..380eab428 100644 --- a/nightwatch.conf.js +++ b/nightwatch.conf.js @@ -10,7 +10,10 @@ const nightwatch_config = { test_settings: { default: { - launch_url: process.env.E2E_LAUNCH_URL || 'http://localhost:3000', + globals: { + waitForConditionTimeout: 5000, + }, + launch_url: process.env.TALK_ROOT_URL || 'http://localhost:3000', desiredCapabilities: { 'browserstack.user': process.env.BROWSERSTACK_USER || 'coralproject2', 'browserstack.key': process.env.BROWSERSTACK_KEY, diff --git a/test/e2e/specs/embedStream.js b/test/e2e/specs/embedStream.js index f9cfea172..3f752ce9c 100644 --- a/test/e2e/specs/embedStream.js +++ b/test/e2e/specs/embedStream.js @@ -1,6 +1,13 @@ const uuid = require('uuid'); const {murmur3} = require('murmurhash-js'); +const iframeId = 'coralStreamEmbed_iframe'; + +const $ = { + streamEmbedIframe: `#${iframeId}`, + streamTabContainer: '.talk-stream-tab-container', +}; + module.exports = { 'Creates a new asset': (client) => { const assetTitle = `test@${murmur3(uuid.v4())}`; @@ -8,9 +15,9 @@ module.exports = { client .url(`${client.launchUrl}/assets/title/${assetTitle}`) .assert.title(assetTitle) - .waitForElementVisible('#coralStreamEmbed_iframe', 1000) - .frame('coralStreamEmbed_iframe') - .waitForElementVisible('.talk-stream-tab-container', 1000) + .waitForElementVisible($.streamEmbedIframe) + .frame(iframeId) + .waitForElementVisible($.streamTabContainer) .frameParent() .end(); }