ov-components: add E2E tests for toolbar

master
Carlos Santos 2025-05-21 13:20:18 +02:00
parent 28e96647fa
commit 042f9b5a89
3 changed files with 19 additions and 31 deletions

View File

@ -385,9 +385,9 @@ jobs:
if: always()
uses: ./.github/actions/cleanup
webcomponent_e2e_toolbar:
e2e_toolbar:
needs: test_setup
name: Webcomponent toolbar
name: Toolbar E2E
if: false
runs-on: ubuntu-latest
steps:
@ -409,26 +409,12 @@ jobs:
uses: ./.github/actions/setup-local-deployment
- name: Setup OpenVidu Call Backend
uses: ./.github/actions/setup-openvidu-call-backend
- name: Install dependencies
run: |
cd openvidu-components-angular
npm install
- name: Build openvidu-angular
run: npm run lib:build --prefix openvidu-components-angular
- name: Build openvidu-webcomponent
run: npm run webcomponent:testing-build --prefix openvidu-components-angular
- name: Serve Webcomponent Testapp
run: npm run webcomponent:serve-testapp --prefix openvidu-components-angular &
- name: Wait for openvidu-components-angular Testapp
run: |
until curl -s -f -o /dev/null http://localhost:8080; do
echo "Waiting for openvidu-components-angular Testapp to be ready..."
sleep 5
done
- name: Build and Serve openvidu-components-angular Testapp
uses: ./.github/actions/build-and-serve-components-testapp
- name: Run Webcomponent E2E
env:
LAUNCH_MODE: CI
run: npm run e2e:webcomponent-toolbar --prefix openvidu-components-angular
run: npm run e2e:lib-toolbar --prefix openvidu-components-angular
- name: Cleanup
if: always()
uses: ./.github/actions/cleanup

View File

@ -1,19 +1,18 @@
import { Builder, WebDriver } from 'selenium-webdriver';
import { OPENVIDU_CALL_SERVER } from '../config';
import { WebComponentConfig } from '../selenium.conf';
import { OpenViduComponentsPO } from '../utils.po.test';
import { TestAppConfig } from './selenium.conf';
import { OpenViduComponentsPO } from './utils.po.test';
const url = `${WebComponentConfig.appUrl}?OV_URL=${OPENVIDU_CALL_SERVER}`;
const url = TestAppConfig.appUrl;
describe('Testing TOOLBAR features', () => {
describe('Toolbar button functionality for local media control', () => {
let browser: WebDriver;
let utils: OpenViduComponentsPO;
async function createChromeBrowser(): Promise<WebDriver> {
return await new Builder()
.forBrowser(WebComponentConfig.browserName)
.withCapabilities(WebComponentConfig.browserCapabilities)
.setChromeOptions(WebComponentConfig.browserOptions)
.usingServer(WebComponentConfig.seleniumAddress)
.forBrowser(TestAppConfig.browserName)
.withCapabilities(TestAppConfig.browserCapabilities)
.setChromeOptions(TestAppConfig.browserOptions)
.usingServer(TestAppConfig.seleniumAddress)
.build();
}
@ -23,10 +22,13 @@ describe('Testing TOOLBAR features', () => {
});
afterEach(async () => {
try {
await utils.leaveRoom();
} catch (error) {}
await browser.quit();
});
it('should mute and unmute the local microphone', async () => {
it('should toggle mute/unmute on the local microphone and update the icon accordingly', async () => {
await browser.get(`${url}&prejoin=false`);
await utils.checkLayoutPresent();
@ -43,7 +45,7 @@ describe('Testing TOOLBAR features', () => {
expect(await utils.isPresent('#mic-btn #mic')).toBeTrue();
});
it('should mute and unmute the local camera', async () => {
it('should toggle mute/unmute on the local camera and update the icon accordingly', async () => {
await browser.get(`${url}&prejoin=false`);
await utils.checkLayoutPresent();

View File

@ -97,10 +97,10 @@
"e2e:lib-panels": "tsc --project ./e2e && npx jasmine --fail-fast ./e2e/dist/panels.test.js",
"e2e:lib-screensharing": "tsc --project ./e2e && npx jasmine --fail-fast ./e2e/dist/screensharing.test.js",
"e2e:lib-stream": "tsc --project ./e2e && npx jasmine --fail-fast ./e2e/dist/stream.test.js",
"e2e:lib-toolbar": "tsc --project ./e2e && npx jasmine --fail-fast ./e2e/dist/toolbar.test.js",
"e2e:webcomponent-all": "tsc --project ./e2e && npx jasmine --fail-fast ./e2e/dist/webcomponent-e2e/**/*.test.js",
"e2e:webcomponent-captions": "tsc --project ./e2e && npx jasmine --fail-fast ./e2e/dist/webcomponent-e2e/captions.test.js",
"e2e:webcomponent-toolbar": "tsc --project ./e2e && npx jasmine --fail-fast ./e2e/dist/webcomponent-e2e/toolbar.test.js",
"webcomponent:testing-build": "./node_modules/@angular/cli/bin/ng.js build openvidu-webcomponent --configuration testing && node ./openvidu-webcomponent-build.js",
"webcomponent:build": "./node_modules/@angular/cli/bin/ng.js build openvidu-webcomponent --configuration production && node ./openvidu-webcomponent-build.js",
"webcomponent:serve-testapp": "npx http-server ./e2e/webcomponent-app/",