From e6618c68ac83df3414985b9312e8a5fb1e19917b Mon Sep 17 00:00:00 2001 From: Abhay Bharti Date: Sun, 21 Jan 2024 16:45:45 +0530 Subject: [PATCH] config corrected --- playwright.service.config.ts | 60 ------------------- .../config/artillery/artillery-script.yml | 0 .../utils/config/azure/azure-pipeline.yml | 0 3 files changed, 60 deletions(-) delete mode 100644 playwright.service.config.ts rename artillery-script.yml => src/utils/config/artillery/artillery-script.yml (100%) rename azure-pipeline.yml => src/utils/config/azure/azure-pipeline.yml (100%) diff --git a/playwright.service.config.ts b/playwright.service.config.ts deleted file mode 100644 index ebde07a..0000000 --- a/playwright.service.config.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * This file enables Playwright client to connect to remote browsers. - * It should be placed in the same directory as playwright.config.ts. - */ - -import { defineConfig } from "@playwright/test"; -import config from "./playwright.config"; -import dotenv from "dotenv"; - -// Define environment on the dev box in .env file: -// .env: -// PLAYWRIGHT_SERVICE_ACCESS_TOKEN=XXX -// PLAYWRIGHT_SERVICE_URL=XXX - -// Define environment in your GitHub workflow spec. -// env: -// PLAYWRIGHT_SERVICE_ACCESS_TOKEN: ${{ secrets.PLAYWRIGHT_SERVICE_ACCESS_TOKEN }} -// PLAYWRIGHT_SERVICE_URL: ${{ secrets.PLAYWRIGHT_SERVICE_URL }} -// PLAYWRIGHT_SERVICE_RUN_ID: ${{ github.run_id }}-${{ github.run_attempt }}-${{ github.sha }} - -dotenv.config(); - -// Name the test run if it's not named yet. -process.env.PLAYWRIGHT_SERVICE_RUN_ID = process.env.PLAYWRIGHT_SERVICE_RUN_ID || new Date().toISOString(); - -// Can be 'linux' or 'windows'. -const os = process.env.PLAYWRIGHT_SERVICE_OS || "linux"; - -export default defineConfig(config, { - // Define more generous timeout for the service operation if necessary. - // timeout: 60000, - // expect: { - // timeout: 10000, - // }, - workers: 20, - - // Enable screenshot testing and configure directory with expectations. - // https://learn.microsoft.com/azure/playwright-testing/how-to-configure-visual-comparisons - ignoreSnapshots: false, - snapshotPathTemplate: `{testDir}/__screenshots__/{testFilePath}/${os}/{arg}{ext}`, - - use: { - // Specify the service endpoint. - connectOptions: { - wsEndpoint: `${process.env.PLAYWRIGHT_SERVICE_URL}?cap=${JSON.stringify({ - // Can be 'linux' or 'windows'. - os, - runId: process.env.PLAYWRIGHT_SERVICE_RUN_ID, - })}`, - timeout: 30000, - headers: { - "x-mpt-access-key": process.env.PLAYWRIGHT_SERVICE_ACCESS_TOKEN!, - }, - // Allow service to access the localhost. - exposeNetwork: "", - }, - }, - // Tenmp workaround for config merge bug in OSS https://github.com/microsoft/playwright/pull/28224 - projects: config.projects ? config.projects : [{}], -}); diff --git a/artillery-script.yml b/src/utils/config/artillery/artillery-script.yml similarity index 100% rename from artillery-script.yml rename to src/utils/config/artillery/artillery-script.yml diff --git a/azure-pipeline.yml b/src/utils/config/azure/azure-pipeline.yml similarity index 100% rename from azure-pipeline.yml rename to src/utils/config/azure/azure-pipeline.yml