From ff6e52b8ec9b222866538faf58508edce789f136 Mon Sep 17 00:00:00 2001 From: Carlos Santos <4a.santos@gmail.com> Date: Mon, 17 Feb 2025 10:46:51 +0100 Subject: [PATCH] e2e: Updated download dir --- frontend/test/e2e/recording.test.ts | 2 ++ frontend/test/e2e/selenium.conf.ts | 13 ++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/frontend/test/e2e/recording.test.ts b/frontend/test/e2e/recording.test.ts index eb28d57d..d3779e58 100644 --- a/frontend/test/e2e/recording.test.ts +++ b/frontend/test/e2e/recording.test.ts @@ -104,6 +104,8 @@ describe('Testing Recording Functionality', () => { } const files = fs.readdirSync(downloadDir); + console.log('downloadDir:', downloadDir); + console.log('Files in download directory:', files); const downloadedFile = files.find((file) => file.includes(randomRoomName)); expect(downloadedFile).to.not.be.undefined; diff --git a/frontend/test/e2e/selenium.conf.ts b/frontend/test/e2e/selenium.conf.ts index c31cb871..5cd63e09 100644 --- a/frontend/test/e2e/selenium.conf.ts +++ b/frontend/test/e2e/selenium.conf.ts @@ -1,8 +1,7 @@ import { Capabilities } from 'selenium-webdriver'; import * as chrome from 'selenium-webdriver/chrome.js'; import { APP_URL, LAUNCH_MODE } from './config'; -import * as path from 'path'; - +import * as fs from 'fs'; interface BrowserConfig { appUrl: string; @@ -32,12 +31,16 @@ const chromeArgumentsCI = [ '--use-fake-ui-for-media-stream', '--use-fake-device-for-media-stream' ]; -const downloadDir = path.resolve(__dirname, 'Downloads'); +const downloadPath = '/tmp/downloads' + +if (!fs.existsSync(downloadPath)) { + fs.mkdirSync(downloadPath, { recursive: true }); +} const chromeOptions: chrome.Options = new chrome.Options(); chromeOptions.addArguments(...(LAUNCH_MODE === 'CI' ? chromeArgumentsCI : chromeArguments)); chromeOptions.setUserPreferences({ - 'download.default_directory': downloadDir, // Forzar descargas aquĆ­ + 'download.default_directory': downloadPath, 'download.prompt_for_download': false, 'download.directory_upgrade': true, 'safebrowsing.enabled': true @@ -48,5 +51,5 @@ export const OpenViduCallConfig: BrowserConfig = { browserName: 'ChromeTest', browserCapabilities: Capabilities.chrome().set('acceptInsecureCerts', true), browserOptions: chromeOptions, - downloadDir: downloadDir + downloadDir: downloadPath };