diff --git a/playwright-tests/README.md b/playwright-tests/README.md index d9217787b..b9124727e 100644 --- a/playwright-tests/README.md +++ b/playwright-tests/README.md @@ -215,7 +215,7 @@ npx playwright test npx playwright test tests/0000__M.test.ts ### Run tests with specific tag (cognitive approach) -npx playwright test --grep "@smoke" +npx playwright test --grep "@Alert" ## Test Reports Test results are available in: diff --git a/playwright-tests/playwright.config.ts b/playwright-tests/playwright.config.ts index a77283e51..93de9ce98 100644 --- a/playwright-tests/playwright.config.ts +++ b/playwright-tests/playwright.config.ts @@ -1,18 +1,26 @@ import { defineConfig, devices } from '@playwright/test'; import dotenv from 'dotenv-safe'; import { OrtoniReportConfig } from "ortoni-report"; +import path from 'path'; if (!process.env.CI) { // Environment variables are present in CI environment, no need to read from file + const basePath = __dirname; // This gets the directory where the config file is located + if (process.env.NODE_ENV == 'undefined' || process.env.NODE_ENV == null) { - dotenv.config({ path: `playwright-tests/.env.dev`, example: 'playwright-tests/.env.example' }); + dotenv.config({ + path: path.join(basePath, '.env.dev'), + example: path.join(basePath, '.env.example') + }); } else { - dotenv.config({ path: `playwright-tests/.env.${process.env.NODE_ENV}`, example: 'playwright-tests/.env.example' }); + dotenv.config({ + path: path.join(basePath, `.env.${process.env.NODE_ENV}`), + example: path.join(basePath, '.env.example') + }); } } - /** * Read environment variables from file. * https://github.com/motdotla/dotenv @@ -27,7 +35,7 @@ if (!process.env.CI) { const reportConfig: OrtoniReportConfig = { port: 1994, open: "never", - folderPath: "playwright-tests/artifacts/test-results", + folderPath: "artifacts/test-results", filename: "index.html", logo: "../data/logo.png", title: "Test Report",