Skip to content

Commit

Permalink
Actualizando pruebas de tutoriales de OpenVidu.
Browse files Browse the repository at this point in the history
  • Loading branch information
IsmailJniah committed Apr 24, 2024
1 parent 4ae5778 commit fdacd13
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 19 deletions.
8 changes: 4 additions & 4 deletions Tests/TutorialTests/openvidu-angular-web-tutorial.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Expand All @@ -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()]);
Expand Down
6 changes: 2 additions & 4 deletions Tests/TutorialTests/openvidu-getaroom-test.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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()]);
Expand Down
10 changes: 9 additions & 1 deletion Tests/TutorialTests/openvidu-iframe-tutorial.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
16 changes: 12 additions & 4 deletions Tests/TutorialTests/openvidu-js-screen-share-tutorial.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,18 @@ 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);

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' });

Expand All @@ -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' });
Expand Down
8 changes: 4 additions & 4 deletions Tests/TutorialTests/openvidu-js-web-tutorial.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Expand All @@ -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()]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()]);
Expand Down
9 changes: 9 additions & 0 deletions Tests/TutorialTests/openvidu-vue-tutorial.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' });

Expand Down

0 comments on commit fdacd13

Please sign in to comment.