Skip to content

Commit

Permalink
Changes on Test
Browse files Browse the repository at this point in the history
  • Loading branch information
IsmailJniah committed Apr 19, 2024
1 parent b9fe530 commit 8e7e397
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 17 deletions.
6 changes: 5 additions & 1 deletion tests/openvidu-angular-web-tutorial.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ test('Checking for the presence of two active webcams in an OpenVidu session', a
await page1.waitForSelector('#session', { visible: true });
await page1.waitForTimeout(5000);

var videoElements = await page1.$$('video');

expect(videoElements.length).toEqual(2);

// Capture a screenshot of page1 and save it to a file.
await page1.screenshot({ path: '../results/screenshots/page1_screenshot.png' });

Expand All @@ -47,7 +51,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.
const videoElements = await page2.$$('video');
videoElements = await page2.$$('video');

// Check that there are exactly three elements found (should it be three or two?).
expect(videoElements.length).toEqual(3);
Expand Down
6 changes: 5 additions & 1 deletion tests/openvidu-getaroom-test.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ test('Checking for the presence of two active webcams in an OpenVidu session', a
// Get the value of the 'input#copy-input' element.
const inputValue = await page1.$eval('input#copy-input', (input) => input.value);

var videoElements = await page1.$$('video');

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

Expand All @@ -50,7 +54,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.
const videoElements = await page2.$$('video');
videoElements = await page2.$$('video');

// Check that there are exactly two elements found.
expect(videoElements.length).toEqual(2);
Expand Down
8 changes: 6 additions & 2 deletions tests/openvidu-hello-world-test.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ test('Checking for the presence of two active webcams in an OpenVidu session', a
// Interact with page1, such as clicking a button and waiting for a specific element to become visible, then wait for a timeout..
await page1.click('#join input[type="submit"]');
await page1.waitForSelector('#session', { visible: true });
await page2.waitForTimeout(5000);
await page1.waitForTimeout(5000);

var videoElements = await page1.$$('video');

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' });
Expand All @@ -43,7 +47,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 containing video streams on page2 and check if there are exactly two of them.
const videoElements = await page2.$$('video');
videoElements = await page2.$$('video');
expect(videoElements.length).toEqual(2);

// Close the pages and the browser.
Expand Down
10 changes: 8 additions & 2 deletions tests/openvidu-iframe-tutorial.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,18 @@ test('Checking for the presence of two active webcams in an OpenVidu session', a
let iframeHandle = await page1.waitForSelector('iframe.openvidu-iframe');
let frame = await iframeHandle.contentFrame();

await page1.screenshot({ path: '../results/screenshots/page1_screensho.png' });


// Click the "JOIN" button within the iframe and wait for the '#session' element to become visible.
await frame.click('input[type="submit"]');
await frame.waitForSelector('#session', { visible: true });

videoElements = await frame.$$('video');

expect(videoElements.length).toEqual(1);

await page1.screenshot({ path: '../results/screenshots/page1_screenshot.png' });

// Navigate to the specified URL on page2.
await page2.goto('http://localhost:8081/');
iframeHandle = await page2.waitForSelector('iframe.openvidu-iframe');
Expand All @@ -47,7 +53,7 @@ test('Checking for the presence of two active webcams in an OpenVidu session', a
await page2.screenshot({ path: '../results/screenshots/page2_screensho.png' });

// Find HTML elements within the frame that contain video streams.
const videoElements = await frame.$$('video');
videoElements = await frame.$$('video');

// Check that there are exactly two elements found.
expect(videoElements.length).toEqual(2);
Expand Down
6 changes: 5 additions & 1 deletion tests/openvidu-js-screen-share-tutorial.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ test('Checking for the presence of two active webcams in an OpenVidu session', a
await page1.waitForSelector('#session', { visible: true });
await page1.waitForTimeout(5000);

videoElements = await page1.$$('video');

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

Expand All @@ -45,7 +49,7 @@ 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.
const videoElements = await page2.$$('video');
videoElements = await page2.$$('video');

// Check that there are exactly four elements found.
expect(videoElements.length).toEqual(4);
Expand Down
2 changes: 1 addition & 1 deletion tests/openvidu-js-web-tutorial.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ test('Checking for the presence of two active webcams in an OpenVidu session', a
await page1.waitForSelector('#session', { visible: true });
await page1.waitForTimeout(5000);

// Find HTML elements within page2 that contain video streams.

var videoElements = await page1.$$('video');

expect(videoElements.length).toEqual(2);
Expand Down
6 changes: 5 additions & 1 deletion tests/openvidu-react-web-tutorial.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ test('Checking for the presence of two active webcams in an OpenVidu session', a
await page1.waitForSelector('#session', { visible: true });
await page1.waitForTimeout(5000);

var videoElements = await page1.$$('video');

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

Expand All @@ -47,7 +51,7 @@ 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.
const videoElements = await page2.$$('video');
videoElements = await page2.$$('video');

// Check that there are exactly three elements found.
expect(videoElements.length).toEqual(3);
Expand Down
7 changes: 6 additions & 1 deletion tests/openvidu-recording-java-tutorial.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ test('Checking for the presence of two active webcams in an OpenVidu session', a

await page1.click('#join-btn');
await page1.waitForSelector('#session', { visible: true });

videoElements = await page1.$$('video');

expect(videoElements.length).toEqual(1);

await page1.screenshot({ path: '../results/screenshots/page1_screenshot.png' });

await page2.goto('https://localhost:5000');
Expand All @@ -40,7 +45,7 @@ test('Checking for the presence of two active webcams in an OpenVidu session', a
await page2.screenshot({ path: '../results/screenshots/page2_stoprecording_screenshot.png' });

// Buscar los elementos HTML que contienen los streams de video
const videoElements = await page2.$$('video');
videoElements = await page2.$$('video');

// Comprobar que hay exactamente dos elementos encontrados
expect(videoElements.length).toEqual(2);
Expand Down
7 changes: 6 additions & 1 deletion tests/openvidu-recording-node-tutorial.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ test('Checking for the presence of two active webcams in an OpenVidu session', a

await page1.click('#join-btn');
await page1.waitForSelector('#session', { visible: true });

var videoElements = await page1.$$('video');

expect(videoElements.length).toEqual(1);

await page1.screenshot({ path: '../results/screenshots/page1_screenshot.png' });

await page2.goto('http://localhost:5000');
Expand All @@ -39,7 +44,7 @@ test('Checking for the presence of two active webcams in an OpenVidu session', a
await page2.screenshot({ path: '../results/screenshots/page2_stoprecording_screenshot.png' });

// Buscar los elementos HTML que contienen los streams de video
const videoElements = await page2.$$('video');
videoElements = await page2.$$('video');

// Comprobar que hay exactamente dos elementos encontrados
expect(videoElements.length).toEqual(2);
Expand Down
17 changes: 11 additions & 6 deletions tests/openvidu-vue-tutorial.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,28 @@ test('Checking for the presence of two active webcams in an OpenVidu session', a
await page1.fill('input[type="text"]', 'User1');
await page1.click('button.btn.btn-lg.btn-success');
await page1.waitForSelector('#session', { visible: true });


videoElements = await page1.$$('video');

expect(videoElements.length).toEqual(2);

await page1.screenshot({ path: '../results/screenshots/page1_screenshot.png' });

await page2.goto('http://localhost:8080');
await page2.fill('input[type="text"]', 'User2');
await page2.click('button.btn.btn-lg.btn-success');
await page2.waitForSelector('#session', { visible: true });
await page2.waitForTimeout(5000);

await page1.screenshot({ path: 'page1.png' });
await page2.screenshot({ path: 'page2.png' });

// Buscar los elementos HTML que contienen los streams de video
const videoElements = await page2.$$('video');
videoElements = await page2.$$('video');

// Comprobar que hay exactamente dos elementos encontrados
expect(videoElements.length).toEqual(3);



await page2.screenshot({ path: '../results/screenshots/page2_screenshot.png' });

// Cerrar las páginas y el navegador.

await Promise.all([page1.close(), page2.close()]);
Expand Down

0 comments on commit 8e7e397

Please sign in to comment.