diff --git a/openvidu-components-angular/e2e/angular.test.ts b/openvidu-components-angular/e2e/nested-components/directives.test.ts similarity index 87% rename from openvidu-components-angular/e2e/angular.test.ts rename to openvidu-components-angular/e2e/nested-components/directives.test.ts index 58f79ad1..5c654224 100644 --- a/openvidu-components-angular/e2e/angular.test.ts +++ b/openvidu-components-angular/e2e/nested-components/directives.test.ts @@ -1,8 +1,8 @@ import { expect } from 'chai'; import { Builder, By, WebDriver } from 'selenium-webdriver'; -import { AngularConfig } from './selenium.conf'; -import { OpenViduComponentsPO } from './utils.po.test'; +import { AngularConfig } from '../selenium.conf'; +import { OpenViduComponentsPO } from '../utils.po.test'; const url = AngularConfig.appUrl; @@ -1077,178 +1077,3 @@ describe('Testing ATTRIBUTE DIRECTIVES', () => { expect(await error.getAttribute('innerText')).equals('TEST_ERROR'); }); }); - -describe('Testing EVENTS', () => { - let browser: WebDriver; - let utils: OpenViduComponentsPO; - - async function createChromeBrowser(): Promise { - return await new Builder() - .forBrowser(AngularConfig.browserName) - .withCapabilities(AngularConfig.browserCapabilities) - .setChromeOptions(AngularConfig.browserOptions) - .usingServer(AngularConfig.seleniumAddress) - .build(); - } - - beforeEach(async () => { - browser = await createChromeBrowser(); - utils = new OpenViduComponentsPO(browser); - }); - - afterEach(async () => { - await browser.quit(); - }); - - it('should receive the onRoomDisconnected event', async () => { - await browser.get(`${url}`); - - await utils.clickOn('#ovToolbar-checkbox'); - - await utils.clickOn('#apply-btn'); - - await utils.checkToolbarIsPresent(); - - // Clicking to leave button - await utils.clickOn('#leave-btn'); - - // Checking if onLeaveButtonClicked has been received - await utils.waitForElement('#onRoomDisconnected'); - expect(await utils.isPresent('#onRoomDisconnected')).to.be.true; - }); - - it('should receive the onVideoEnabledChanged event', async () => { - await browser.get(`${url}`); - - await utils.clickOn('#ovToolbar-checkbox'); - - await utils.clickOn('#apply-btn'); - - await utils.checkToolbarIsPresent(); - - await utils.clickOn('#camera-btn'); - - await utils.waitForElement('#onVideoEnabledChanged'); - expect(await utils.isPresent('#onVideoEnabledChanged')).to.be.true; - }); - - it('should receive the onAudioEnabledChanged event', async () => { - await browser.get(`${url}`); - - await utils.clickOn('#ovToolbar-checkbox'); - - await utils.clickOn('#apply-btn'); - - await utils.checkToolbarIsPresent(); - - await utils.clickOn('#mic-btn'); - - await utils.waitForElement('#onAudioEnabledChanged'); - expect(await utils.isPresent('#onAudioEnabledChanged')).to.be.true; - }); - - it('should receive the onScreenShareEnabledChanged event', async () => { - await browser.get(`${url}`); - - await utils.clickOn('#ovToolbar-checkbox'); - - await utils.clickOn('#apply-btn'); - - await utils.checkToolbarIsPresent(); - - await utils.clickOn('#screenshare-btn'); - - await utils.waitForElement('#onScreenShareEnabledChanged'); - expect(await utils.isPresent('#onScreenShareEnabledChanged')).to.be.true; - }); - - it('should receive the onFullscreenEnabledChanged event', async () => { - await browser.get(`${url}`); - - await utils.clickOn('#ovToolbar-checkbox'); - - await utils.clickOn('#apply-btn'); - - await utils.checkToolbarIsPresent(); - - await utils.toggleFullscreenFromToolbar(); - - await utils.waitForElement('#onFullscreenEnabledChanged'); - expect(await utils.isPresent('#onFullscreenEnabledChanged')).to.be.true; - }); - - it('should receive the onRecordingStartRequested event', async () => { - await browser.get(`${url}`); - - await utils.clickOn('#ovToolbar-checkbox'); - - await utils.clickOn('#apply-btn'); - - await utils.checkToolbarIsPresent(); - - await utils.toggleRecordingFromToolbar(); - - await utils.waitForElement('#onRecordingStartRequested'); - expect(await utils.isPresent('#onRecordingStartRequested')).to.be.true; - }); - - it('should receive the onParticipantsPanelStatusChanged event', async () => { - await browser.get(`${url}`); - - await utils.clickOn('#ovPanel-checkbox'); - - await utils.clickOn('#apply-btn'); - - await utils.checkToolbarIsPresent(); - - await utils.togglePanel('participants'); - - await utils.waitForElement('#onParticipantsPanelStatusChanged'); - expect(await utils.isPresent('#onParticipantsPanelStatusChanged')).to.be.true; - }); - - it('should receive the onChatPanelStatusChanged event', async () => { - await browser.get(`${url}`); - - await utils.clickOn('#ovPanel-checkbox'); - - await utils.clickOn('#apply-btn'); - - await utils.checkToolbarIsPresent(); - - await utils.togglePanel('chat'); - - await utils.waitForElement('#onChatPanelStatusChanged'); - expect(await utils.isPresent('#onChatPanelStatusChanged')).to.be.true; - }); - - it('should receive the onActivitiesPanelStatusChanged event', async () => { - await browser.get(`${url}`); - - await utils.clickOn('#ovPanel-checkbox'); - - await utils.clickOn('#apply-btn'); - - await utils.checkToolbarIsPresent(); - - await utils.togglePanel('activities'); - - await utils.waitForElement('#onActivitiesPanelStatusChanged'); - expect(await utils.isPresent('#onActivitiesPanelStatusChanged')).to.be.true; - }); - - it('should receive the onSettingsPanelStatusChanged event', async () => { - await browser.get(`${url}`); - - await utils.clickOn('#ovPanel-checkbox'); - - await utils.clickOn('#apply-btn'); - - await utils.checkToolbarIsPresent(); - - await utils.togglePanel('settings'); - - await utils.waitForElement('#onSettingsPanelStatusChanged'); - expect(await utils.isPresent('#onSettingsPanelStatusChanged')).to.be.true; - }); -}); diff --git a/openvidu-components-angular/e2e/nested-components/events.test.ts b/openvidu-components-angular/e2e/nested-components/events.test.ts new file mode 100644 index 00000000..b4be7b71 --- /dev/null +++ b/openvidu-components-angular/e2e/nested-components/events.test.ts @@ -0,0 +1,182 @@ +import { expect } from 'chai'; +import { Builder, By, WebDriver } from 'selenium-webdriver'; + +import { AngularConfig } from '../selenium.conf'; +import { OpenViduComponentsPO } from '../utils.po.test'; + +const url = AngularConfig.appUrl; + +describe('Testing EVENTS', () => { + let browser: WebDriver; + let utils: OpenViduComponentsPO; + + async function createChromeBrowser(): Promise { + return await new Builder() + .forBrowser(AngularConfig.browserName) + .withCapabilities(AngularConfig.browserCapabilities) + .setChromeOptions(AngularConfig.browserOptions) + .usingServer(AngularConfig.seleniumAddress) + .build(); + } + + beforeEach(async () => { + browser = await createChromeBrowser(); + utils = new OpenViduComponentsPO(browser); + }); + + afterEach(async () => { + await browser.quit(); + }); + + it('should receive the onRoomDisconnected event', async () => { + await browser.get(`${url}`); + + await utils.clickOn('#ovToolbar-checkbox'); + + await utils.clickOn('#apply-btn'); + + await utils.checkToolbarIsPresent(); + + // Clicking to leave button + await utils.clickOn('#leave-btn'); + + // Checking if onLeaveButtonClicked has been received + await utils.waitForElement('#onRoomDisconnected'); + expect(await utils.isPresent('#onRoomDisconnected')).to.be.true; + }); + + it('should receive the onVideoEnabledChanged event', async () => { + await browser.get(`${url}`); + + await utils.clickOn('#ovToolbar-checkbox'); + + await utils.clickOn('#apply-btn'); + + await utils.checkToolbarIsPresent(); + + await utils.clickOn('#camera-btn'); + + await utils.waitForElement('#onVideoEnabledChanged'); + expect(await utils.isPresent('#onVideoEnabledChanged')).to.be.true; + }); + + it('should receive the onAudioEnabledChanged event', async () => { + await browser.get(`${url}`); + + await utils.clickOn('#ovToolbar-checkbox'); + + await utils.clickOn('#apply-btn'); + + await utils.checkToolbarIsPresent(); + + await utils.clickOn('#mic-btn'); + + await utils.waitForElement('#onAudioEnabledChanged'); + expect(await utils.isPresent('#onAudioEnabledChanged')).to.be.true; + }); + + it('should receive the onScreenShareEnabledChanged event', async () => { + await browser.get(`${url}`); + + await utils.clickOn('#ovToolbar-checkbox'); + + await utils.clickOn('#apply-btn'); + + await utils.checkToolbarIsPresent(); + + await utils.clickOn('#screenshare-btn'); + + await utils.waitForElement('#onScreenShareEnabledChanged'); + expect(await utils.isPresent('#onScreenShareEnabledChanged')).to.be.true; + }); + + it('should receive the onFullscreenEnabledChanged event', async () => { + await browser.get(`${url}`); + + await utils.clickOn('#ovToolbar-checkbox'); + + await utils.clickOn('#apply-btn'); + + await utils.checkToolbarIsPresent(); + + await utils.toggleFullscreenFromToolbar(); + + await utils.waitForElement('#onFullscreenEnabledChanged'); + expect(await utils.isPresent('#onFullscreenEnabledChanged')).to.be.true; + }); + + it('should receive the onRecordingStartRequested event', async () => { + await browser.get(`${url}`); + + await utils.clickOn('#ovToolbar-checkbox'); + + await utils.clickOn('#apply-btn'); + + await utils.checkToolbarIsPresent(); + + await utils.toggleRecordingFromToolbar(); + + await utils.waitForElement('#onRecordingStartRequested'); + expect(await utils.isPresent('#onRecordingStartRequested')).to.be.true; + }); + + it('should receive the onParticipantsPanelStatusChanged event', async () => { + await browser.get(`${url}`); + + await utils.clickOn('#ovPanel-checkbox'); + + await utils.clickOn('#apply-btn'); + + await utils.checkToolbarIsPresent(); + + await utils.togglePanel('participants'); + + await utils.waitForElement('#onParticipantsPanelStatusChanged'); + expect(await utils.isPresent('#onParticipantsPanelStatusChanged')).to.be.true; + }); + + it('should receive the onChatPanelStatusChanged event', async () => { + await browser.get(`${url}`); + + await utils.clickOn('#ovPanel-checkbox'); + + await utils.clickOn('#apply-btn'); + + await utils.checkToolbarIsPresent(); + + await utils.togglePanel('chat'); + + await utils.waitForElement('#onChatPanelStatusChanged'); + expect(await utils.isPresent('#onChatPanelStatusChanged')).to.be.true; + }); + + it('should receive the onActivitiesPanelStatusChanged event', async () => { + await browser.get(`${url}`); + + await utils.clickOn('#ovPanel-checkbox'); + + await utils.clickOn('#apply-btn'); + + await utils.checkToolbarIsPresent(); + + await utils.togglePanel('activities'); + + await utils.waitForElement('#onActivitiesPanelStatusChanged'); + expect(await utils.isPresent('#onActivitiesPanelStatusChanged')).to.be.true; + }); + + it('should receive the onSettingsPanelStatusChanged event', async () => { + await browser.get(`${url}`); + + await utils.clickOn('#ovPanel-checkbox'); + + await utils.clickOn('#apply-btn'); + + await utils.checkToolbarIsPresent(); + + await utils.togglePanel('settings'); + + await utils.waitForElement('#onSettingsPanelStatusChanged'); + expect(await utils.isPresent('#onSettingsPanelStatusChanged')).to.be.true; + }); +}); diff --git a/openvidu-components-angular/package.json b/openvidu-components-angular/package.json index 285ef02a..17634bfa 100644 --- a/openvidu-components-angular/package.json +++ b/openvidu-components-angular/package.json @@ -83,13 +83,20 @@ "doc:clean-copy": "rm -rf ../../openvidu-docs/docs/docs/reference-docs/openvidu-components-angular && cp -r ./docs/openvidu-components-angular/ ../../openvidu-docs/docs/docs/reference-docs/openvidu-components-angular", "doc:serve": "npx compodoc -c ../openvidu-components-angular/projects/openvidu-components-angular/doc/.compodocrc.json --serve --port 7000", "doc:serve-watch": "npm-watch doc:serve", + "lib:serve": "ng build openvidu-components-angular --watch", "lib:build": "ng build openvidu-components-angular --configuration development && cd ./dist/openvidu-components-angular", "lib:pack": "cd ./dist/openvidu-components-angular && npm pack", "lib:copy": "cp dist/openvidu-components-angular/openvidu-components-angular-*.tgz ../../openvidu-call/openvidu-call-front", - "lib:e2e": "tsc --project ./e2e && npx mocha --recursive --timeout 30000 ./e2e/dist/angular.test.js", - "lib:e2e-ci": "cross-env LAUNCH_MODE=CI npm run lib:e2e", - "lib:serve": "ng build openvidu-components-angular --watch", "lib:test": "ng test openvidu-components-angular --no-watch --code-coverage", + + "e2e:nested-all": "tsc --project ./e2e && npx mocha --recursive --timeout 30000 ./e2e/dist/nested-components/*.test.js", + "e2e:nested-events": "tsc --project ./e2e && npx mocha --recursive --timeout 30000 ./e2e/dist/nested-components/events.test.js", + "e2e:nested-directives": "tsc --project ./e2e && npx mocha --recursive --timeout 30000 ./e2e/dist/nested-components/directives.test.js", + "e2e:nested-all-ci": "cross-env LAUNCH_MODE=CI npm run e2e:nested-all", + "e2e:nested-events-ci": "cross-env LAUNCH_MODE=CI npm run e2e:nested-events", + "e2e:nested-directives-ci": "cross-env LAUNCH_MODE=CI npm run e2e:nested-directives", + + "lint": "ng lint", "start": "ng serve --configuration development --open", "start-prod": "npx http-server ./dist/openvidu-components-testapp/browser --port 4200",