diff --git a/bigbluebutton-html5/.eslintrc.js b/bigbluebutton-html5/.eslintrc.js index a02fc91be907df47d4ee119e3294c49aafc3b346..9ab00665e1abf9f9c13f79704363d0f33b4c6c51 100644 --- a/bigbluebutton-html5/.eslintrc.js +++ b/bigbluebutton-html5/.eslintrc.js @@ -10,6 +10,7 @@ module.exports = { "node": true, "browser": true, "meteor": true, + "jasmine": true, }, "rules": { "no-underscore-dangle": 0, @@ -19,4 +20,7 @@ module.exports = { "import/no-extraneous-dependencies": 1, "react/prop-types": 1, }, + "globals": { + "browser": "writable", + }, }; diff --git a/bigbluebutton-html5/imports/ui/components/video-provider/fullscreen-button/component.jsx b/bigbluebutton-html5/imports/ui/components/video-provider/fullscreen-button/component.jsx index b4676487c64b916ef1cce02112967504bb25950b..c41f307171f92eaaadca34a9e8ed27e47da2742a 100755 --- a/bigbluebutton-html5/imports/ui/components/video-provider/fullscreen-button/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/video-provider/fullscreen-button/component.jsx @@ -62,6 +62,7 @@ const FullscreenButtonComponent = ({ hideLabel className={cx(styles.button, styles.fullScreenButton, className)} tooltipDistance={tooltipDistance} + data-test="presentationFullscreenButton" /> </div> ); diff --git a/bigbluebutton-html5/package-lock.json b/bigbluebutton-html5/package-lock.json index eb8cf8f2c11c6ccbca626bbb5e4dd3b28747751a..024b9c5be8e5b3d561481165a7b64f710f744f9b 100644 --- a/bigbluebutton-html5/package-lock.json +++ b/bigbluebutton-html5/package-lock.json @@ -139,7 +139,7 @@ }, "chalk": { "version": "1.1.3", - "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { @@ -286,6 +286,12 @@ "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" }, + "arch": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/arch/-/arch-2.1.1.tgz", + "integrity": "sha512-BLM56aPo9vLLFVa8+/+pJLnrZ7QGGTVHWsCwieAWT9o9K8UeGaQbzZbGoabWLOo2ksBCztoXdqBZBplqLDDCSg==", + "dev": true + }, "archiver": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/archiver/-/archiver-2.1.1.tgz", @@ -652,7 +658,7 @@ }, "bl": { "version": "1.2.2", - "resolved": "http://registry.npmjs.org/bl/-/bl-1.2.2.tgz", + "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.2.tgz", "integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==", "dev": true, "requires": { @@ -830,7 +836,7 @@ "dependencies": { "callsites": { "version": "2.0.0", - "resolved": "http://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", "integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=", "dev": true } @@ -1012,6 +1018,16 @@ "tiny-emitter": "^2.0.0" } }, + "clipboardy": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/clipboardy/-/clipboardy-2.1.0.tgz", + "integrity": "sha512-2pzOUxWcLlXWtn+Jd6js3o12TysNOOVes/aQfg+MT/35vrxWzedHlLwyoJpXjsFKWm95BTNEcMGD9+a7mKzZkQ==", + "dev": true, + "requires": { + "arch": "^2.1.1", + "execa": "^1.0.0" + } + }, "cliui": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", @@ -1508,7 +1524,7 @@ }, "enabled": { "version": "1.0.2", - "resolved": "http://registry.npmjs.org/enabled/-/enabled-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/enabled/-/enabled-1.0.2.tgz", "integrity": "sha1-ll9lE9LC0cX0ZStkouM5ZGf8L5M=", "requires": { "env-variable": "0.0.x" @@ -2112,7 +2128,7 @@ }, "fecha": { "version": "2.3.3", - "resolved": "http://registry.npmjs.org/fecha/-/fecha-2.3.3.tgz", + "resolved": "https://registry.npmjs.org/fecha/-/fecha-2.3.3.tgz", "integrity": "sha512-lUGBnIamTAwk4znq5BcqsDaxSmZ9nDVJaij6NvRt/Tg4R69gERA+otPKbS86ROw9nxVMw2/mp1fnaiWqbs6Sdg==" }, "fibers": { @@ -2424,7 +2440,7 @@ }, "globby": { "version": "6.1.0", - "resolved": "http://registry.npmjs.org/globby/-/globby-6.1.0.tgz", + "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", "dev": true, "requires": { @@ -3602,7 +3618,7 @@ }, "chalk": { "version": "1.1.3", - "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { @@ -4732,7 +4748,7 @@ }, "npm-install-package": { "version": "2.1.0", - "resolved": "http://registry.npmjs.org/npm-install-package/-/npm-install-package-2.1.0.tgz", + "resolved": "https://registry.npmjs.org/npm-install-package/-/npm-install-package-2.1.0.tgz", "integrity": "sha1-1+/jz816sAYUuJbqUxGdyaslkSU=", "dev": true }, @@ -4915,7 +4931,7 @@ "dependencies": { "minimist": { "version": "0.0.10", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", "dev": true }, @@ -5965,7 +5981,7 @@ }, "safe-regex": { "version": "1.1.0", - "resolved": "http://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", "dev": true, "requires": { @@ -7107,7 +7123,7 @@ }, "chalk": { "version": "1.1.3", - "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { @@ -7135,7 +7151,7 @@ }, "globby": { "version": "5.0.0", - "resolved": "http://registry.npmjs.org/globby/-/globby-5.0.0.tgz", + "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", "dev": true, "requires": { @@ -7205,7 +7221,7 @@ }, "external-editor": { "version": "2.2.0", - "resolved": "http://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", "dev": true, "requires": { diff --git a/bigbluebutton-html5/package.json b/bigbluebutton-html5/package.json index de74342e68c01153b4b2fb791b41fb7097c5b96c..9b26d4efb4101f67f06a2aedb1468ba12f3e43b2 100755 --- a/bigbluebutton-html5/package.json +++ b/bigbluebutton-html5/package.json @@ -78,6 +78,7 @@ }, "devDependencies": { "chai": "~4.2.0", + "clipboardy": "^2.1.0", "eslint": "~5.8.0", "eslint-config-airbnb": "~17.1.0", "eslint-config-airbnb-base": "~13.1.0", diff --git a/bigbluebutton-html5/tests/webdriverio/specs/chat.spec.js b/bigbluebutton-html5/tests/webdriverio/specs/chat.spec.js index a4c8b1e32d39476ad0f8a26a7194e08c09719585..abc95db0615742b20a73f8d2c5c1bdb284eeb656 100644 --- a/bigbluebutton-html5/tests/webdriverio/specs/chat.spec.js +++ b/bigbluebutton-html5/tests/webdriverio/specs/chat.spec.js @@ -1,16 +1,18 @@ - +const chai = require('chai'); +const clipboardy = require('clipboardy'); const LandingPage = require('../pageobjects/landing.page'); const ModalPage = require('../pageobjects/modal.page'); const ChatPage = require('../pageobjects/chat.page'); const Utils = require('../utils'); const WAIT_TIME = 10000; +const message = 'Hello'; -const loginWithoutAudio = function () { +const loginWithoutAudio = function (username) { // login LandingPage.open(); - browser.setValue(LandingPage.usernameInputSelector, 'user'); + browser.setValue(LandingPage.usernameInputSelector, username); LandingPage.joinWithEnterKey(); // close audio modal @@ -26,18 +28,20 @@ describe('Chat', () => { it('should be able to send a message', () => { - loginWithoutAudio(); + const username = 'chatUser1'; + loginWithoutAudio(username); browser.waitForExist(ChatPage.publicChatSelector, WAIT_TIME); - ChatPage.sendPublicChatMessage('Hello'); + ChatPage.sendPublicChatMessage(message); }); it('should be able to save chat', () => { - loginWithoutAudio(); + const username = 'chatUser2'; + loginWithoutAudio(username); browser.waitForExist(ChatPage.publicChatSelector, WAIT_TIME); - ChatPage.sendPublicChatMessage('Hello'); + ChatPage.sendPublicChatMessage(message); browser.waitForExist(ChatPage.chatDropdownTriggerSelector, WAIT_TIME); ChatPage.triggerChatDropdown(); @@ -48,24 +52,28 @@ describe('Chat', () => { it('should be able to copy chat', () => { - loginWithoutAudio(); + const username = 'chatUser3'; + loginWithoutAudio(username); browser.waitForExist(ChatPage.publicChatSelector, WAIT_TIME); - ChatPage.sendPublicChatMessage('Hello'); + ChatPage.sendPublicChatMessage(message); browser.waitForExist(ChatPage.chatDropdownTriggerSelector, WAIT_TIME); ChatPage.triggerChatDropdown(); browser.waitForExist(ChatPage.copyChatButtonSelector, WAIT_TIME); ChatPage.copyChat(); + const copiedChat = clipboardy.readSync(); + chai.expect(copiedChat).to.include(`${username} : ${message}`); }); it('should be able to clear chat', () => { - loginWithoutAudio(); + const username = 'chatUser4'; + loginWithoutAudio(username); browser.waitForExist(ChatPage.publicChatSelector, WAIT_TIME); - ChatPage.sendPublicChatMessage('Hello'); + ChatPage.sendPublicChatMessage(message); browser.waitForExist(ChatPage.chatDropdownTriggerSelector, WAIT_TIME); ChatPage.triggerChatDropdown(); diff --git a/bigbluebutton-html5/tests/webdriverio/specs/presentation.spec.js b/bigbluebutton-html5/tests/webdriverio/specs/presentation.spec.js new file mode 100644 index 0000000000000000000000000000000000000000..85a65cc26bdcf617494ae595be03eb9da5a17aab --- /dev/null +++ b/bigbluebutton-html5/tests/webdriverio/specs/presentation.spec.js @@ -0,0 +1,38 @@ +const LandingPage = require('../pageobjects/landing.page'); +const ModalPage = require('../pageobjects/modal.page'); +const ChatPage = require('../pageobjects/chat.page'); +const Utils = require('../utils'); + +const WAIT_TIME = 10000; + +const checkFullscreen = () => document.fullscreen; + +const loginWithoutAudio = function (username) { + // login + LandingPage.open(); + browser.setValue(LandingPage.usernameInputSelector, username); + LandingPage.joinWithEnterKey(); + + // close audio modal + browser.waitForExist(ModalPage.modalCloseSelector, WAIT_TIME); + ModalPage.closeAudioModal(); +}; + +describe('Presentation', () => { + beforeEach(() => { + Utils.configureViewport(); + jasmine.DEFAULT_TIMEOUT_INTERVAL = 30000; + }); + + it('should be able to enter fullscreen', + () => { + const username = 'presentationUser1'; + loginWithoutAudio(username); + + browser.waitForExist(ChatPage.publicChatSelector, WAIT_TIME); + browser.waitForExist('[data-test="presentationFullscreenButton"]', WAIT_TIME); + $('[data-test="presentationFullscreenButton"]').click(); + browser.pause(2000); + console.log(browser.execute(checkFullscreen)); + }); +});