diff --git a/client/coral-embed-stream/src/components/Embed.js b/client/coral-embed-stream/src/components/Embed.js index 7fc6d1474..5ce7021fb 100644 --- a/client/coral-embed-stream/src/components/Embed.js +++ b/client/coral-embed-stream/src/components/Embed.js @@ -75,13 +75,13 @@ export default class Embed extends React.Component { activeTab={activeTab} id='talk-embed-stream-tab-content' > - + - + - + diff --git a/client/coral-embed-stream/src/components/StreamTabPanel.js b/client/coral-embed-stream/src/components/StreamTabPanel.js index 50f54c2a0..35c10d5d9 100644 --- a/client/coral-embed-stream/src/components/StreamTabPanel.js +++ b/client/coral-embed-stream/src/components/StreamTabPanel.js @@ -6,9 +6,9 @@ import styles from './StreamTabPanel.css'; class StreamTabPanel extends React.Component { render() { - const {activeTab, setActiveTab, tabs, tabPanes, sub, loading} = this.props; + const {activeTab, setActiveTab, tabs, tabPanes, sub, loading, ...rest} = this.props; return ( -
+
{tabs} @@ -26,6 +26,7 @@ class StreamTabPanel extends React.Component { StreamTabPanel.propTypes = { activeTab: PropTypes.string.isRequired, setActiveTab: PropTypes.func.isRequired, + loading: PropTypes.bool, tabs: PropTypes.oneOfType([ PropTypes.element, PropTypes.arrayOf(PropTypes.element) diff --git a/client/coral-settings/components/NotLoggedIn.js b/client/coral-settings/components/NotLoggedIn.js index 3531b4a6a..799579a05 100644 --- a/client/coral-settings/components/NotLoggedIn.js +++ b/client/coral-settings/components/NotLoggedIn.js @@ -1,10 +1,11 @@ import React from 'react'; import styles from './NotLoggedIn.css'; +import cn from 'classnames'; import t from 'coral-framework/services/i18n'; export default ({showSignInDialog}) => ( -
+
{t('settings.sign_in')} {t('settings.to_access')}
diff --git a/nightwatch.conf.js b/nightwatch.conf.js index 380eab428..a64c0c2e5 100644 --- a/nightwatch.conf.js +++ b/nightwatch.conf.js @@ -1,6 +1,7 @@ const nightwatch_config = { src_folders: './test/e2e/specs/', output_folder: './test/e2e/tests_output', + page_objects_path: './test/e2e/page_objects', selenium : { 'start_process': false, diff --git a/test/e2e/page_objects/embedStream.js b/test/e2e/page_objects/embedStream.js new file mode 100644 index 000000000..2f5734ab5 --- /dev/null +++ b/test/e2e/page_objects/embedStream.js @@ -0,0 +1,45 @@ +const iframeId = 'coralStreamEmbed_iframe'; + +module.exports = { + commands: [{ + navigateToAsset: function(asset) { + this.api.url(`${this.api.launchUrl}/assets/title/${asset}`); + return this; + }, + getEmbedSection: function() { + this.waitForElementVisible('@iframe'); + this.api.frame(iframeId); + this.expect.section('@embed').to.be.present; + return this.section.embed; + }, + }], + url: function() { + return this.api.launchUrl; + }, + elements: { + iframe: `#${iframeId}`, + }, + sections: { + embed: { + commands: [{ + getProfileSection: function() { + this.click('@profileTabButton'); + this.expect.section('@profile').to.be.present; + return this.section.profile; + }, + }], + selector: '#talk-embed-stream-container', + elements: { + profileTabButton: '.talk-embed-stream-profile-tab > button', + }, + sections: { + profile: { + selector: '.talk-embed-stream-profile-tab-pane', + elements: { + notLoggedIn: '.talk-embed-stream-not-logged-in', + }, + }, + }, + }, + }, +}; diff --git a/test/e2e/specs/embedStream.js b/test/e2e/specs/embedStream.js index 3f752ce9c..4486f2d9e 100644 --- a/test/e2e/specs/embedStream.js +++ b/test/e2e/specs/embedStream.js @@ -1,24 +1,34 @@ 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())}`; + const asset = `test@${murmur3(uuid.v4())}`; + const embedStream = client.page.embedStream(); + + embedStream + .navigateToAsset(asset) + .assert.title(asset) + .getEmbedSection(); client - .url(`${client.launchUrl}/assets/title/${assetTitle}`) - .assert.title(assetTitle) - .waitForElementVisible($.streamEmbedIframe) - .frame(iframeId) - .waitForElementVisible($.streamTabContainer) - .frameParent() .end(); - } + }, + + 'not logged in user clicks my profile tab': (client) => { + const embedStream = client.page.embedStream(); + + const embed = embedStream + .navigate() + .getEmbedSection(); + + const profile = embed + .getProfileSection(); + + profile + .assert.visible('@notLoggedIn'); + + client + .end(); + }, };