diff --git a/Tests/TutorialTests/openvidu-angular-web-tutorial.spec.js b/Tests/TutorialTests/openvidu-angular-web-tutorial.spec.js index 066590b1..9ed53c59 100644 --- a/Tests/TutorialTests/openvidu-angular-web-tutorial.spec.js +++ b/Tests/TutorialTests/openvidu-angular-web-tutorial.spec.js @@ -61,9 +61,10 @@ test('Checking for the presence of two active webcams in an OpenVidu session', a await page2.screenshot({ path: '../results/screenshots/page2_screenshot.png' }); // Find HTML elements that contain video streams on page2. - videoElements = await page2.$$('video'); + videoElements = await page2.$$('video'); - expect(videoElements.length).toEqual(2); + // Check that there are exactly three elements found (should it be three or two?). + expect(videoElements.length).toEqual(3); for (const videoElement of videoElements) { @@ -73,8 +74,7 @@ test('Checking for the presence of two active webcams in an OpenVidu session', a } - // Check that there are exactly three elements found (should it be three or two?). - expect(videoElements.length).toEqual(3); + // Close the pages and the browser. await Promise.all([page1.close(), page2.close()]); diff --git a/Tests/TutorialTests/openvidu-getaroom-test.spec.js b/Tests/TutorialTests/openvidu-getaroom-test.spec.js index 6afdf64d..1115800a 100644 --- a/Tests/TutorialTests/openvidu-getaroom-test.spec.js +++ b/Tests/TutorialTests/openvidu-getaroom-test.spec.js @@ -63,7 +63,7 @@ test('Checking for the presence of two active webcams in an OpenVidu session', a await page2.screenshot({ path: '../results/screenshots/page2_screenshot.png' }); // Find HTML elements that contain video streams on page2. - videoElements = await page2.$$('video'); + videoElements = await page2.$$('video'); expect(videoElements.length).toEqual(2); @@ -74,9 +74,7 @@ test('Checking for the presence of two active webcams in an OpenVidu session', a expect(isPaused).not.toBe(true); } - - // Check that there are exactly two elements found. - expect(videoElements.length).toEqual(2); + // Close page1 and the browser. await Promise.all([page1.close(), browser.close()]); diff --git a/Tests/TutorialTests/openvidu-iframe-tutorial.spec.js b/Tests/TutorialTests/openvidu-iframe-tutorial.spec.js index 2ca8ed5d..6089e441 100644 --- a/Tests/TutorialTests/openvidu-iframe-tutorial.spec.js +++ b/Tests/TutorialTests/openvidu-iframe-tutorial.spec.js @@ -61,10 +61,18 @@ test('Checking for the presence of two active webcams in an OpenVidu session', a // Find HTML elements within the frame that contain video streams. videoElements = await frame.$$('video'); - + // Check that there are exactly two elements found. expect(videoElements.length).toEqual(2); + for (const videoElement of videoElements) { + + const isPaused = await videoElement.evaluate(video => video.paused); + + expect(isPaused).not.toBe(true); + + } + // Close the pages and the browser. await Promise.all([page1.close(), page2.close()]); await browser.close(); diff --git a/Tests/TutorialTests/openvidu-js-screen-share-tutorial.spec.js b/Tests/TutorialTests/openvidu-js-screen-share-tutorial.spec.js index 50815cae..587b448e 100644 --- a/Tests/TutorialTests/openvidu-js-screen-share-tutorial.spec.js +++ b/Tests/TutorialTests/openvidu-js-screen-share-tutorial.spec.js @@ -29,9 +29,10 @@ test('Checking for the presence of two active webcams in an OpenVidu session', a await page1.waitForTimeout(5000); var videoElements = await page1.$$('video'); - + expect(videoElements.length).toEqual(2); - + + for (const videoElement of videoElements) { const isPaused = await videoElement.evaluate(video => video.paused); @@ -39,9 +40,7 @@ test('Checking for the presence of two active webcams in an OpenVidu session', a expect(isPaused).not.toBe(true); } - - // Capture a screenshot of page1 and save it to 'results/screenshot/page1.png'. await page1.screenshot({ path: '../results/screenshots/page1.png' }); @@ -62,6 +61,15 @@ test('Checking for the presence of two active webcams in an OpenVidu session', a // Check that there are exactly four elements found. expect(videoElements.length).toEqual(4); + + + for (const videoElement of videoElements) { + + const isPaused = await videoElement.evaluate(video => video.paused); + + expect(isPaused).not.toBe(true); + + } // Capture a screenshot of page2 and save it to 'results/screenshot/page2.png'. await page2.screenshot({ path: '../results/screenshots/page2.png' }); diff --git a/Tests/TutorialTests/openvidu-js-web-tutorial.spec.js b/Tests/TutorialTests/openvidu-js-web-tutorial.spec.js index 791c0aae..f14b6099 100644 --- a/Tests/TutorialTests/openvidu-js-web-tutorial.spec.js +++ b/Tests/TutorialTests/openvidu-js-web-tutorial.spec.js @@ -66,9 +66,10 @@ test('Checking for the presence of two active webcams in an OpenVidu session', a await page2.screenshot({ path: '../results/screenshots/page2.png' }); // Find HTML elements within page2 that contain video streams. - videoElements = await page2.$$('video'); + videoElements = await page2.$$('video'); - expect(videoElements.length).toEqual(2); + // Check that there are exactly three elements found. + expect(videoElements.length).toEqual(3); for (const videoElement of videoElements) { @@ -78,8 +79,7 @@ test('Checking for the presence of two active webcams in an OpenVidu session', a } - // Check that there are exactly three elements found. - expect(videoElements.length).toEqual(3); + // Close the pages and the browser. await Promise.all([page1.close(), page2.close()]); diff --git a/Tests/TutorialTests/openvidu-recording-java-tutorial.spec.js b/Tests/TutorialTests/openvidu-recording-java-tutorial.spec.js index dfb96cdb..92e63c0c 100644 --- a/Tests/TutorialTests/openvidu-recording-java-tutorial.spec.js +++ b/Tests/TutorialTests/openvidu-recording-java-tutorial.spec.js @@ -74,7 +74,6 @@ test('Checking for the presence of two active webcams in an OpenVidu session', a expect(isPaused).not.toBe(true); } - expect(videoElements.length).toEqual(2); // Close the pages and the browser. await Promise.all([page1.close(), page2.close()]); diff --git a/Tests/TutorialTests/openvidu-recording-node-tutorial.spec.js b/Tests/TutorialTests/openvidu-recording-node-tutorial.spec.js index 493b57aa..6fce7114 100644 --- a/Tests/TutorialTests/openvidu-recording-node-tutorial.spec.js +++ b/Tests/TutorialTests/openvidu-recording-node-tutorial.spec.js @@ -74,7 +74,7 @@ test('Checking for the presence of two active webcams in an OpenVidu session', a expect(isPaused).not.toBe(true); } - expect(videoElements.length).toEqual(2); + // Close the pages and the browser. await Promise.all([page1.close(), page2.close()]); diff --git a/Tests/TutorialTests/openvidu-vue-tutorial.spec.js b/Tests/TutorialTests/openvidu-vue-tutorial.spec.js index aa8a2b8e..0075e2ac 100644 --- a/Tests/TutorialTests/openvidu-vue-tutorial.spec.js +++ b/Tests/TutorialTests/openvidu-vue-tutorial.spec.js @@ -55,8 +55,17 @@ test('Checking for the presence of two active webcams in an OpenVidu session', a // Find video elements on page 2 and verify there are exactly two of them. videoElements = await page2.$$('video'); + expect(videoElements.length).toEqual(3); + for (const videoElement of videoElements) { + + const isPaused = await videoElement.evaluate(video => video.paused); + + expect(isPaused).not.toBe(true); + + } + // Capture a screenshot of page 2 and save it to a file. await page2.screenshot({ path: '../results/screenshots/page2_screenshot.png' });