From 4ac3cb4157eaf35494a9b9ff5c07bd07ed079960 Mon Sep 17 00:00:00 2001 From: Carlos Santos <4a.santos@gmail.com> Date: Tue, 11 Feb 2025 10:51:59 +0100 Subject: [PATCH] frontend: Updated e2e routes tests --- frontend/e2e/config.ts | 1 + frontend/e2e/routes.test.ts | 7 ++++--- frontend/e2e/utils.po.test.ts | 1 - 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/frontend/e2e/config.ts b/frontend/e2e/config.ts index ce5f43ac..22e786f0 100644 --- a/frontend/e2e/config.ts +++ b/frontend/e2e/config.ts @@ -1 +1,2 @@ export const LAUNCH_MODE = process.env.LAUNCH_MODE || 'DEV'; +export const EDITION = process.env.EDITION || 'CE'; diff --git a/frontend/e2e/routes.test.ts b/frontend/e2e/routes.test.ts index 13a0b120..1b906b8c 100644 --- a/frontend/e2e/routes.test.ts +++ b/frontend/e2e/routes.test.ts @@ -2,6 +2,7 @@ import { expect } from 'chai'; import { Builder, WebDriver } from 'selenium-webdriver'; import { OpenViduCallConfig } from './selenium.conf'; import { OpenViduCallPO } from './utils.po.test'; +import { EDITION } from './config'; const url = OpenViduCallConfig.appUrl; @@ -48,7 +49,7 @@ describe('Testing Embedded Mode', () => { it('should allow access if accessed from iframe with valid token', async () => { // access to a page under the same domain - await browser.get('http://localhost:5080/unauthorized'); + await browser.get(`${url}/unauthorized`); const token = await utils.getJWTToken(); // Inject an iframe with the token await utils.buildIframeAndSwitch(`${url}/embedded?token=${token}`); @@ -63,7 +64,7 @@ describe('Testing Embedded Mode', () => { it('should redirect to "unauthorized" if token is expired in embedded mode', async () => { // access to a page under the same domain - await browser.get('http://localhost:5080/unauthorized'); + await browser.get(`${url}/unauthorized`); const expiredToken = await utils.getExpiredJWTToken(); await utils.buildIframeAndSwitch(url + `/embedded?token=${expiredToken}`); @@ -194,7 +195,7 @@ describe('Testing Console Routes', () => { await utils.waitForElement('ov-access-permissions'); }); - it('should load the "appearance" route inside "console"', async () => { + (EDITION === 'CE' ? it : it.skip)('should load the "appearance" route inside "console"', async () => { await browser.get(url + '/console/appearance'); await utils.waitForElement('ov-appearance'); await utils.waitForElement('ov-pro-feature-card'); diff --git a/frontend/e2e/utils.po.test.ts b/frontend/e2e/utils.po.test.ts index 74f6d3c7..c8eaad57 100644 --- a/frontend/e2e/utils.po.test.ts +++ b/frontend/e2e/utils.po.test.ts @@ -58,7 +58,6 @@ export class OpenViduCallPO { }); const tokenJson: any = await token.json(); - console.log(tokenJson); return tokenJson.token; }