From 073638dd773bb5f2d27ec0244b10ce76a2f3b1b7 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Mon, 18 Dec 2023 13:33:39 -0600 Subject: [PATCH] setting base url as variable --- tests/playwright.config.ts | 2 +- tests/tests/example.spec.ts | 13 +------------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/tests/playwright.config.ts b/tests/playwright.config.ts index 301801ee1d..87aa9d26fe 100644 --- a/tests/playwright.config.ts +++ b/tests/playwright.config.ts @@ -24,7 +24,7 @@ export default 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: 'http://127.0.0.1:3000', + baseURL: process.env.GITHUB_PR_NUMBER ? 'https://pr-' + process.env.GITHUB_PR_NUMBER + '-documentation.appa.pantheon.site' : 'http://localhost:8000', /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ trace: 'on-first-retry', diff --git a/tests/tests/example.spec.ts b/tests/tests/example.spec.ts index 67ea69a828..3517fc36c5 100644 --- a/tests/tests/example.spec.ts +++ b/tests/tests/example.spec.ts @@ -1,19 +1,8 @@ import { test, expect } from '@playwright/test'; test('has title', async ({ page }) => { - await page.goto('https://pr-8804-documentation.appa.pantheon.site/release-notes'); + await page.goto('/release-notes'); // Expect a title "to contain" a substring. await expect(page).toHaveTitle(/Pantheon Release Notes/); }); -/* -test('get started link', async ({ page }) => { - await page.goto('https://playwright.dev/'); - - // Click the get started link. - await page.getByRole('link', { name: 'Get started' }).click(); - - // Expects page to have a heading with the name of Installation. - await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible(); -}); -*/