Skip to content

Commit

Permalink
e2e: Updated download dir
Browse files Browse the repository at this point in the history
  • Loading branch information
CSantosM committed Feb 17, 2025
1 parent d3c0cbf commit ff6e52b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 2 additions & 0 deletions frontend/test/e2e/recording.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
13 changes: 8 additions & 5 deletions frontend/test/e2e/selenium.conf.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -48,5 +51,5 @@ export const OpenViduCallConfig: BrowserConfig = {
browserName: 'ChromeTest',
browserCapabilities: Capabilities.chrome().set('acceptInsecureCerts', true),
browserOptions: chromeOptions,
downloadDir: downloadDir
downloadDir: downloadPath
};

0 comments on commit ff6e52b

Please sign in to comment.