From 55f4685da933acbe214c082cc8bc193837805dd1 Mon Sep 17 00:00:00 2001 From: Sergio Eduardo Castro Ceballos <72516762+SergioCasCeb@users.noreply.github.com> Date: Fri, 5 Jan 2024 07:09:51 +0100 Subject: [PATCH] creating the server in the playwright config file --- packages/web-new/playwright.config.js | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/packages/web-new/playwright.config.js b/packages/web-new/playwright.config.js index 36d9a544..9f446c12 100644 --- a/packages/web-new/playwright.config.js +++ b/packages/web-new/playwright.config.js @@ -15,6 +15,20 @@ // @ts-check const { defineConfig, devices } = require('@playwright/test'); +//server +const express = require('express') +const port = 5100 + +const app = express() + +//Middleware +app.use(express.json()) +app.use(express.urlencoded({extended: false})) + +app.use('/', express.static('./dist/')) + +app.listen(port, () => console.log(`Running siteTest on port ${port}`)) + const isCI = process.env.CI; module.exports = defineConfig({ @@ -34,7 +48,7 @@ module.exports = defineConfig({ /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ use: { /* Base URL to use in actions like `await page.goto('/')`. */ - baseURL: isCI ? 'https://deploy-preview-515--thingweb-playground.netlify.app' : 'http://127.0.0.1:5100', + baseURL: 'http://127.0.0.1:5100', /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ trace: 'on-first-retry', @@ -65,9 +79,9 @@ module.exports = defineConfig({ ], /* Run your local dev server before starting the tests */ - webServer: { - command: isCI ? '' : 'npm run serve', - url: isCI ? 'https://deploy-preview-515--thingweb-playground.netlify.app' : 'http://127.0.0.1:5100', - reuseExistingServer: !isCI, - } + // webServer: { + // command: isCI ? '' : 'npm run serve', + // url: isCI ? '' : 'http://127.0.0.1:5100', + // reuseExistingServer: !isCI, + // } });