From 1cba6761bbe2b75bef98210f23be83c84db97e9f Mon Sep 17 00:00:00 2001 From: Carlos Santos <4a.santos@gmail.com> Date: Tue, 20 May 2025 17:38:06 +0200 Subject: [PATCH] ov-components: update E2E test names and add chat feature tests --- .../openvidu-components-angular-tests.yml | 28 +++++-------------- .../e2e/{webcomponent-e2e => }/chat.test.ts | 19 +++++++------ openvidu-components-angular/package.json | 2 +- 3 files changed, 19 insertions(+), 30 deletions(-) rename openvidu-components-angular/e2e/{webcomponent-e2e => }/chat.test.ts (88%) diff --git a/.github/workflows/openvidu-components-angular-tests.yml b/.github/workflows/openvidu-components-angular-tests.yml index 2e0be58b..9c94115e 100644 --- a/.github/workflows/openvidu-components-angular-tests.yml +++ b/.github/workflows/openvidu-components-angular-tests.yml @@ -204,7 +204,7 @@ jobs: uses: ./.github/actions/setup-openvidu-call-backend - name: Build and Serve openvidu-components-angular Testapp uses: ./.github/actions/build-and-serve-components-testapp - - name: Run Webcomponent E2E + - name: Run Tests env: LAUNCH_MODE: CI run: npm run e2e:lib-directives --prefix openvidu-components-angular @@ -212,9 +212,9 @@ jobs: if: always() uses: ./.github/actions/cleanup - webcomponent_e2e_chat: + e2e_chat: needs: test_setup - name: Webcomponent chat + name: Chat E2E if: false runs-on: ubuntu-latest steps: @@ -236,26 +236,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: Run Webcomponent E2E + - name: Build and Serve openvidu-components-angular Testapp + uses: ./.github/actions/build-and-serve-components-testapp + - name: Run Tests env: LAUNCH_MODE: CI - run: npm run e2e:webcomponent-chat --prefix openvidu-components-angular + run: npm run e2e:lib-chat --prefix openvidu-components-angular - name: Cleanup if: always() uses: ./.github/actions/cleanup diff --git a/openvidu-components-angular/e2e/webcomponent-e2e/chat.test.ts b/openvidu-components-angular/e2e/chat.test.ts similarity index 88% rename from openvidu-components-angular/e2e/webcomponent-e2e/chat.test.ts rename to openvidu-components-angular/e2e/chat.test.ts index 22f475f4..120aa8bb 100644 --- a/openvidu-components-angular/e2e/webcomponent-e2e/chat.test.ts +++ b/openvidu-components-angular/e2e/chat.test.ts @@ -1,9 +1,8 @@ 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 CHAT features', () => { let browser: WebDriver; @@ -11,10 +10,10 @@ describe('Testing CHAT features', () => { async function createChromeBrowser(): Promise { 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(); } @@ -24,6 +23,10 @@ describe('Testing CHAT features', () => { }); afterEach(async () => { + try { + // leaving room if connected + await utils.leaveRoom(); + } catch (error) {} await browser.quit(); }); diff --git a/openvidu-components-angular/package.json b/openvidu-components-angular/package.json index 5ea782b0..c5b79b89 100644 --- a/openvidu-components-angular/package.json +++ b/openvidu-components-angular/package.json @@ -90,8 +90,8 @@ "e2e:nested-events": "tsc --project ./e2e && npx jasmine --fail-fast ./e2e/dist/nested-components/events.test.js", "e2e:nested-structural-directives": "tsc --project ./e2e && npx jasmine --fail-fast ./e2e/dist/nested-components/structural-directives.test.js", "e2e:nested-attribute-directives": "tsc --project ./e2e && npx jasmine --fail-fast ./e2e/dist/nested-components/attribute-directives.test.js", - "e2e:lib-directives": "tsc --project ./e2e && npx jasmine --fail-fast ./e2e/dist/api-directives.test.js", + "e2e:lib-chat": "tsc --project ./e2e && npx jasmine --fail-fast ./e2e/dist/chat.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",