From f0c8fb12bde9ff879f9c105212b4f4294b001726 Mon Sep 17 00:00:00 2001
From: Michele Alberti <michele.alberti@cea.fr>
Date: Mon, 16 Oct 2023 09:32:57 +0200
Subject: [PATCH] [ivette/tests] Configure outputDir directory to be under
 /tests.

---
 .gitlab-ci.yml              |  2 +-
 ivette/.gitignore           |  2 +-
 ivette/playwright.config.ts | 17 +++++++++++------
 3 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 92e290a5633..47c58a8fc25 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -236,7 +236,7 @@ ivette-tests:
     - xvfb-run --auto-servernum -e /dev/stdout -s "-screen 0 1920x1080x24 -ac -nolisten tcp -nolisten unix" dune exec -- yarn playwright test --headed
   artifacts:
     paths:
-      - ivette/test-results
+      - ivette/tests/test-results
       - ivette/screenshots
     when: always
     expire_in: 1 day
diff --git a/ivette/.gitignore b/ivette/.gitignore
index 5044834513c..17050941e3b 100644
--- a/ivette/.gitignore
+++ b/ivette/.gitignore
@@ -18,7 +18,7 @@ yarn-error.log
 /icon.icns
 
 # --------------------------------------------------------------------------
-/test-results/
+/tests/test-results/
 /screenshots/*
 /playwright-report/
 /playwright/.cache/
diff --git a/ivette/playwright.config.ts b/ivette/playwright.config.ts
index 719c21ab9ed..b7a7d30b501 100644
--- a/ivette/playwright.config.ts
+++ b/ivette/playwright.config.ts
@@ -28,16 +28,21 @@ import { defineConfig, devices } from '@playwright/test';
  */
 // require('dotenv').config();
 
+const testDir = './tests';
+
 /**
  * See https://playwright.dev/docs/test-configuration.
  */
 export default defineConfig({
-  testDir: './tests',
-  /* Run tests in files in parallel (set to false to avoid concurrency issues with Electron) */
+  /* Directory to look for tests when executing 'yarn playwright test'. */
+  testDir: testDir,
+  /* Directory for test artifacts. */
+  outputDir: testDir.concat('/test-results'),
+  /* Run tests in files in parallel (set to false to avoid concurrency issues with Electron). */
   fullyParallel: false,
   /* Fail the build on CI if you accidentally left test.only in the source code. */
   forbidOnly: !!process.env.CI,
-  /* Retry on CI only */
+  /* Retry on CI only. */
   retries: process.env.CI ? 2 : 0,
   /* Opt out of parallel tests on CI. */
   workers: 1,
@@ -48,11 +53,11 @@ export default defineConfig({
     /* Base URL to use in actions like `await page.goto('/')`. */
     // baseURL: 'http://127.0.0.1:3000',
 
-    /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
+    /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer. */
     trace: 'on-first-retry',
   },
 
-  /* Configure projects for major browsers */
+  /* Configure projects for major browsers. */
   projects: [
     {
       name: 'chromium',
@@ -80,7 +85,7 @@ export default defineConfig({
     // },
   ],
 
-  /* Run your local dev server before starting the tests */
+  /* Run your local dev server before starting the tests. */
   // webServer: {
   //   command: 'npm run start',
   //   url: 'http://127.0.0.1:3000',
-- 
GitLab