mirror of https://github.com/OpenVidu/openvidu.git
openvidu-components: Fixed e2e tests
parent
a4c2955dd4
commit
6395e74f85
|
@ -4,7 +4,7 @@ import { Builder, By, until, WebDriver } from 'selenium-webdriver';
|
||||||
import { AngularConfig } from './selenium.conf';
|
import { AngularConfig } from './selenium.conf';
|
||||||
|
|
||||||
const url = AngularConfig.appUrl;
|
const url = AngularConfig.appUrl;
|
||||||
const TIMEOUT = 10000;
|
const TIMEOUT = 30000;
|
||||||
|
|
||||||
describe('Testing TOOLBAR STRUCTURAL DIRECTIVES', () => {
|
describe('Testing TOOLBAR STRUCTURAL DIRECTIVES', () => {
|
||||||
let browser: WebDriver;
|
let browser: WebDriver;
|
||||||
|
@ -1199,6 +1199,7 @@ describe('Testing ATTRIBUTE DIRECTIVES', () => {
|
||||||
expect(await element.isDisplayed()).to.be.true;
|
expect(await element.isDisplayed()).to.be.true;
|
||||||
await element.click();
|
await element.click();
|
||||||
|
|
||||||
|
await browser.wait(until.elementLocated(By.id('session-container')), TIMEOUT);
|
||||||
element = await browser.wait(until.elementLocated(By.id('custom-stream')), TIMEOUT);
|
element = await browser.wait(until.elementLocated(By.id('custom-stream')), TIMEOUT);
|
||||||
expect(await element.isDisplayed()).to.be.true;
|
expect(await element.isDisplayed()).to.be.true;
|
||||||
|
|
||||||
|
|
|
@ -130,8 +130,9 @@ describe('Testing API Directives', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should run the app with VIDEO MUTED in prejoin page', async () => {
|
it('should run the app with VIDEO MUTED in prejoin page', async () => {
|
||||||
let element, isVideoEnabled, icon;
|
let element, idVideoEnabled, icon;
|
||||||
const videoEnableScript = 'return document.getElementsByTagName("video")[0].srcObject.getVideoTracks()[0].enabled;';
|
const script = 'return document.getElementsByTagName("video")[0].srcObject.getVideoTracks()[0].enabled;';
|
||||||
|
|
||||||
|
|
||||||
await browser.get(`${url}?prejoin=true&videoMuted=true`);
|
await browser.get(`${url}?prejoin=true&videoMuted=true`);
|
||||||
|
|
||||||
|
@ -142,8 +143,8 @@ describe('Testing API Directives', () => {
|
||||||
expect(await element.isDisplayed()).to.be.true;
|
expect(await element.isDisplayed()).to.be.true;
|
||||||
|
|
||||||
// Checking if video track is disabled/muted
|
// Checking if video track is disabled/muted
|
||||||
isVideoEnabled = await browser.executeScript(videoEnableScript);
|
idVideoEnabled = await browser.executeScript<boolean>(script);
|
||||||
expect(isVideoEnabled).to.be.false;
|
expect(idVideoEnabled).to.be.false;
|
||||||
|
|
||||||
icon = await browser.findElement(By.id('videocam_off'));
|
icon = await browser.findElement(By.id('videocam_off'));
|
||||||
expect(await icon.isDisplayed()).to.be.true;
|
expect(await icon.isDisplayed()).to.be.true;
|
||||||
|
@ -153,8 +154,9 @@ describe('Testing API Directives', () => {
|
||||||
await joinButton.click();
|
await joinButton.click();
|
||||||
|
|
||||||
// Checking if video is muted after join the room
|
// Checking if video is muted after join the room
|
||||||
isVideoEnabled = await browser.executeScript(videoEnableScript);
|
await browser.wait(until.elementLocated(By.id('session-container')), TIMEOUT);
|
||||||
expect(isVideoEnabled).to.be.false;
|
idVideoEnabled = await browser.executeScript<boolean>(script);
|
||||||
|
expect(idVideoEnabled).to.be.false;
|
||||||
|
|
||||||
icon = await browser.findElement(By.id('videocam_off'));
|
icon = await browser.findElement(By.id('videocam_off'));
|
||||||
expect(await icon.isDisplayed()).to.be.true;
|
expect(await icon.isDisplayed()).to.be.true;
|
||||||
|
@ -185,7 +187,7 @@ describe('Testing API Directives', () => {
|
||||||
|
|
||||||
it('should run the app with AUDIO MUTED in prejoin page', async () => {
|
it('should run the app with AUDIO MUTED in prejoin page', async () => {
|
||||||
let element, isAudioEnabled, icon;
|
let element, isAudioEnabled, icon;
|
||||||
const audioEnableScript = 'return document.getElementsByTagName("video")[0].srcObject.getAudioTracks()[0].enabled;';
|
const script = 'return document.getElementsByTagName("video")[0].srcObject.getAudioTracks()[0].enabled;';
|
||||||
|
|
||||||
await browser.get(`${url}?audioMuted=true`);
|
await browser.get(`${url}?audioMuted=true`);
|
||||||
|
|
||||||
|
@ -196,7 +198,7 @@ describe('Testing API Directives', () => {
|
||||||
expect(await element.isDisplayed()).to.be.true;
|
expect(await element.isDisplayed()).to.be.true;
|
||||||
|
|
||||||
// Checking if audio track is disabled/muted
|
// Checking if audio track is disabled/muted
|
||||||
isAudioEnabled = await browser.executeScript(audioEnableScript);
|
isAudioEnabled = await browser.executeScript(script);
|
||||||
expect(isAudioEnabled).to.be.false;
|
expect(isAudioEnabled).to.be.false;
|
||||||
|
|
||||||
icon = await browser.findElement(By.id('mic_off'));
|
icon = await browser.findElement(By.id('mic_off'));
|
||||||
|
@ -207,7 +209,8 @@ describe('Testing API Directives', () => {
|
||||||
await joinButton.click();
|
await joinButton.click();
|
||||||
|
|
||||||
// Checking if audio is muted after join the room
|
// Checking if audio is muted after join the room
|
||||||
isAudioEnabled = await browser.executeScript(audioEnableScript);
|
await browser.wait(until.elementLocated(By.id('session-container')), TIMEOUT);
|
||||||
|
isAudioEnabled = await browser.executeScript(script);
|
||||||
expect(isAudioEnabled).to.be.false;
|
expect(isAudioEnabled).to.be.false;
|
||||||
|
|
||||||
icon = await browser.findElement(By.id('mic_off'));
|
icon = await browser.findElement(By.id('mic_off'));
|
||||||
|
@ -1223,6 +1226,7 @@ describe('Testing panels', () => {
|
||||||
expect(await backgroundButton.isDisplayed()).to.be.true;
|
expect(await backgroundButton.isDisplayed()).to.be.true;
|
||||||
expect(await backgroundButton.isEnabled()).to.be.true;
|
expect(await backgroundButton.isEnabled()).to.be.true;
|
||||||
await backgroundButton.click();
|
await backgroundButton.click();
|
||||||
|
await browser.sleep(500);
|
||||||
|
|
||||||
element = await browser.wait(until.elementLocated(By.id('background-effects-container')), TIMEOUT);
|
element = await browser.wait(until.elementLocated(By.id('background-effects-container')), TIMEOUT);
|
||||||
expect(await element.isDisplayed()).to.be.true;
|
expect(await element.isDisplayed()).to.be.true;
|
||||||
|
@ -1232,6 +1236,7 @@ describe('Testing panels', () => {
|
||||||
expect(await element.isEnabled()).to.be.true;
|
expect(await element.isEnabled()).to.be.true;
|
||||||
await element.click();
|
await element.click();
|
||||||
|
|
||||||
|
await browser.sleep(500);
|
||||||
element = await browser.wait(until.elementLocated(By.id('video-poster')), TIMEOUT);
|
element = await browser.wait(until.elementLocated(By.id('video-poster')), TIMEOUT);
|
||||||
expect(await element.isDisplayed()).to.be.true;
|
expect(await element.isDisplayed()).to.be.true;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue