From d495374e1c64db2ab2088f3a867d79640c33ae0d Mon Sep 17 00:00:00 2001 From: ismail Date: Wed, 24 Apr 2024 14:22:30 +0200 Subject: [PATCH] cambios en Tests --- .../openvidu-getaroom-test.spec.js | 2 -- .../openvidu-iframe-tutorial.spec.js | 1 + .../openvidu-js-screen-share-tutorial.spec.js | 18 ++++-------------- .../openvidu-js-web-tutorial.spec.js | 4 ++-- .../openvidu-recording-java-tutorial.spec.js | 2 +- .../openvidu-recording-node-tutorial.spec.js | 2 +- .../openvidu-vue-tutorial.spec.js | 16 +++------------- 7 files changed, 12 insertions(+), 33 deletions(-) diff --git a/Tests/TutorialTests/openvidu-getaroom-test.spec.js b/Tests/TutorialTests/openvidu-getaroom-test.spec.js index 19e70c81..6afdf64d 100644 --- a/Tests/TutorialTests/openvidu-getaroom-test.spec.js +++ b/Tests/TutorialTests/openvidu-getaroom-test.spec.js @@ -48,8 +48,6 @@ test('Checking for the presence of two active webcams in an OpenVidu session', a } - expect(videoElements.length).toEqual(1); - // Capture a screenshot of page1 and save it to a file. await page1.screenshot({ path: '../results/screenshots/page1_screenshot.png' }); diff --git a/Tests/TutorialTests/openvidu-iframe-tutorial.spec.js b/Tests/TutorialTests/openvidu-iframe-tutorial.spec.js index 2ca8ed5d..cbcf945c 100644 --- a/Tests/TutorialTests/openvidu-iframe-tutorial.spec.js +++ b/Tests/TutorialTests/openvidu-iframe-tutorial.spec.js @@ -36,6 +36,7 @@ test('Checking for the presence of two active webcams in an OpenVidu session', a expect(videoElements.length).toEqual(1); + for (const videoElement of videoElements) { const isPaused = await videoElement.evaluate(video => video.paused); diff --git a/Tests/TutorialTests/openvidu-js-screen-share-tutorial.spec.js b/Tests/TutorialTests/openvidu-js-screen-share-tutorial.spec.js index 61e10059..50815cae 100644 --- a/Tests/TutorialTests/openvidu-js-screen-share-tutorial.spec.js +++ b/Tests/TutorialTests/openvidu-js-screen-share-tutorial.spec.js @@ -30,8 +30,8 @@ test('Checking for the presence of two active webcams in an OpenVidu session', a var videoElements = await page1.$$('video'); - expect(videoElements.length).toEqual(1); - + expect(videoElements.length).toEqual(2); + for (const videoElement of videoElements) { const isPaused = await videoElement.evaluate(video => video.paused); @@ -40,7 +40,7 @@ test('Checking for the presence of two active webcams in an OpenVidu session', a } - expect(videoElements.length).toEqual(2); + // Capture a screenshot of page1 and save it to 'results/screenshot/page1.png'. await page1.screenshot({ path: '../results/screenshots/page1.png' }); @@ -58,17 +58,7 @@ test('Checking for the presence of two active webcams in an OpenVidu session', a // Find HTML elements within page2 that contain video streams. - videoElements = await page2.$$('video'); - - expect(videoElements.length).toEqual(2); - - for (const videoElement of videoElements) { - - const isPaused = await videoElement.evaluate(video => video.paused); - - expect(isPaused).not.toBe(true); - - } + videoElements = await page2.$$('video'); // Check that there are exactly four elements found. expect(videoElements.length).toEqual(4); diff --git a/Tests/TutorialTests/openvidu-js-web-tutorial.spec.js b/Tests/TutorialTests/openvidu-js-web-tutorial.spec.js index 385599a6..791c0aae 100644 --- a/Tests/TutorialTests/openvidu-js-web-tutorial.spec.js +++ b/Tests/TutorialTests/openvidu-js-web-tutorial.spec.js @@ -36,7 +36,7 @@ test('Checking for the presence of two active webcams in an OpenVidu session', a var videoElements = await page1.$$('video'); - expect(videoElements.length).toEqual(1); + expect(videoElements.length).toEqual(2); for (const videoElement of videoElements) { @@ -46,7 +46,7 @@ test('Checking for the presence of two active webcams in an OpenVidu session', a } - expect(videoElements.length).toEqual(2); + // Capture a screenshot of page1 and save it to a specific location. await page1.screenshot({ path: '../results/screenshots/page1.png' }); diff --git a/Tests/TutorialTests/openvidu-recording-java-tutorial.spec.js b/Tests/TutorialTests/openvidu-recording-java-tutorial.spec.js index 2aeceb76..dfb96cdb 100644 --- a/Tests/TutorialTests/openvidu-recording-java-tutorial.spec.js +++ b/Tests/TutorialTests/openvidu-recording-java-tutorial.spec.js @@ -43,7 +43,7 @@ test('Checking for the presence of two active webcams in an OpenVidu session', a expect(isPaused).not.toBe(true); } - expect(videoElements.length).toEqual(1); + // Capture a screenshot of the first page and save it to a file. await page1.screenshot({ path: '../results/screenshots/page1_screenshot.png' }); diff --git a/Tests/TutorialTests/openvidu-recording-node-tutorial.spec.js b/Tests/TutorialTests/openvidu-recording-node-tutorial.spec.js index 5eaf6b79..493b57aa 100644 --- a/Tests/TutorialTests/openvidu-recording-node-tutorial.spec.js +++ b/Tests/TutorialTests/openvidu-recording-node-tutorial.spec.js @@ -43,7 +43,7 @@ test('Checking for the presence of two active webcams in an OpenVidu session', a expect(isPaused).not.toBe(true); } - expect(videoElements.length).toEqual(1); + // Capture a screenshot of the first page and save it to a file. await page1.screenshot({ path: '../results/screenshots/page1_screenshot.png' }); diff --git a/Tests/TutorialTests/openvidu-vue-tutorial.spec.js b/Tests/TutorialTests/openvidu-vue-tutorial.spec.js index 9405be2d..aa8a2b8e 100644 --- a/Tests/TutorialTests/openvidu-vue-tutorial.spec.js +++ b/Tests/TutorialTests/openvidu-vue-tutorial.spec.js @@ -32,7 +32,7 @@ test('Checking for the presence of two active webcams in an OpenVidu session', a // Find video elements on page 1 and verify there are exactly two of them. var videoElements = await page1.$$('video'); - expect(videoElements.length).toEqual(1); + expect(videoElements.length).toEqual(2); for (const videoElement of videoElements) { @@ -41,7 +41,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); + // Capture a screenshot of page 1 and save it to a file. await page1.screenshot({ path: '../results/screenshots/page1_screenshot.png' }); @@ -54,17 +54,7 @@ test('Checking for the presence of two active webcams in an OpenVidu session', a await page2.waitForTimeout(5000); // Find video elements on page 2 and verify there are exactly two of them. - videoElements = await page2.$$('video'); - - expect(videoElements.length).toEqual(2); - - for (const videoElement of videoElements) { - - const isPaused = await videoElement.evaluate(video => video.paused); - - expect(isPaused).not.toBe(true); - - } + videoElements = await page2.$$('video'); expect(videoElements.length).toEqual(3); // Capture a screenshot of page 2 and save it to a file.