diff --git a/bigbluebutton-html5/tests/puppeteer/webcam.test.js b/bigbluebutton-html5/tests/puppeteer/webcam.test.js index d4088765e4d904f3e6ea33918886c3bac6d9ec46..f1107d4a9fd7dfdb72af10e9da6582ac09d1571f 100644 --- a/bigbluebutton-html5/tests/puppeteer/webcam.test.js +++ b/bigbluebutton-html5/tests/puppeteer/webcam.test.js @@ -1,6 +1,5 @@ const Page = require('./core/page'); const Share = require('./webcam/share'); -const Check = require('./webcam/check'); describe('Webcam', () => { test('Shares webcam', async () => { @@ -16,18 +15,4 @@ describe('Webcam', () => { } expect(response).toBe(true); }); - - test('Checks content of webcam', async () => { - const test = new Check(); - let response; - try { - await test.init(Page.getArgsWithVideo()); - response = await test.test(); - } catch (e) { - console.log(e); - } finally { - await test.close(); - } - expect(response).toBe(true); - }); }); diff --git a/bigbluebutton-html5/tests/puppeteer/webcam/check.js b/bigbluebutton-html5/tests/puppeteer/webcam/check.js deleted file mode 100644 index 6b3d436f5ed792bbfdad2e9e546024bd7f5f123c..0000000000000000000000000000000000000000 --- a/bigbluebutton-html5/tests/puppeteer/webcam/check.js +++ /dev/null @@ -1,56 +0,0 @@ -const Share = require('./share'); -const util = require('./util'); -const we = require('./elements'); - -class Check extends Share { - constructor() { - super('check-webcam-content'); - } - - async test() { - await util.enableWebcam(this.page); - await this.waitForSelector(we.videoContainer); - await this.page.waitFor(15000); - const LOOP_INTERVAL = 1000; - const repeats = 5; - let check; - console.log(`repeats ${repeats}`); - for (let i = repeats; i >= 1; i--) { - console.log(`loop ${i}`); - const checkCameras = function (i) { - const videos = document.querySelectorAll('video'); - const lastVideoColor = document.lastVideoColor || {}; - document.lastVideoColor = lastVideoColor; - - for (let v = 0; v < videos.length; v++) { - console.log(`video ${v}`); - const video = videos[v]; - const canvas = document.createElement('canvas'); - const context = canvas.getContext('2d'); - context.drawImage(video, 0, 0, video.videoWidth, video.videoHeight); - const pixel = context.getImageData(50, 50, 1, 1).data; - const pixelString = new Array(pixel).join(' ').toString(); - - if (lastVideoColor[v]) { - if (lastVideoColor[v] == pixelString) { - console.log(`Video N°${v} didn't change the color ! ${lastVideoColor[v]} = ${pixelString}`); - return false; - } - } - lastVideoColor[v] = pixelString; - console.log(`Check_${i} Video_${v}`); - return true; - } - }; - - check = await this.page.evaluate(checkCameras, i); - - if (check !== true) { - console.log(`Exiting with Failure due to checkCameras (${check}) !`); - } - await this.page.waitFor(LOOP_INTERVAL); - } - return check === true; - } -} -module.exports = exports = Check;