diff --git a/.github/workflows/notification.yml b/.github/workflows/notification.yml index 810345ea2..fb39b1140 100644 --- a/.github/workflows/notification.yml +++ b/.github/workflows/notification.yml @@ -3,7 +3,6 @@ on: workflow_run: branches: [main] workflows: - - "UI validation on prod" - "QE LinkChecker" - "Check for Broken Links" types: [completed] diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml deleted file mode 100644 index 23c486e67..000000000 --- a/.github/workflows/playwright.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: UI validation on prod -on: - workflow_dispatch: - schedule: - - cron: "0 * * * *" - -jobs: - run-playwright-tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v5 - - uses: actions/setup-node@v4 - with: - node-version: lts/* - - name: Install dependencies - run: npm ci - - name: Install Playwright Browsers - run: npx playwright install --with-deps - - name: Run Playwright tests - run: npx playwright test --retries=2 - - uses: actions/upload-artifact@v4 - if: ${{ !cancelled() }} - with: - name: playwright-report - path: tests/playwright-report/ - retention-days: 30 - - uses: actions/upload-artifact@v4 - if: ${{ !cancelled() }} - with: - name: test-results - path: tests/test-results/ - retention-days: 30 diff --git a/.gitignore b/.gitignore index 15fbca634..1573f641d 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,6 @@ # testing /coverage */test-results -*/playwright-report # production ./public diff --git a/package-lock.json b/package-lock.json index 7d3ee0691..6e464f1ee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,6 @@ "puppeteer": "^23.8.0" }, "devDependencies": { - "@playwright/test": "^1.48.0", "hugo-bin": "^0.111.3" } }, @@ -95,22 +94,6 @@ "integrity": "sha512-KxWFdRNbv13U8bhYaQvH6gLG9CVEt2jKeosyOOYILVntWEVWhovbgDrbOiZ12pJO3vjZs0Zgbd3/Zgde98woEA==", "license": "BSD-3-Clause" }, - "node_modules/@playwright/test": { - "version": "1.48.0", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.48.0.tgz", - "integrity": "sha512-W5lhqPUVPqhtc/ySvZI5Q8X2ztBOUgZ8LbAFy0JQgrXZs2xaILrUcNO3rQjwbLPfGK13+rZsDa1FpG+tqYkT5w==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "playwright": "1.48.0" - }, - "bin": { - "playwright": "cli.js" - }, - "engines": { - "node": ">=18" - } - }, "node_modules/@puppeteer/browsers": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-2.4.1.tgz", @@ -1322,21 +1305,6 @@ "node": ">=14.14" } }, - "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -2303,38 +2271,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/playwright": { - "version": "1.48.0", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.48.0.tgz", - "integrity": "sha512-qPqFaMEHuY/ug8o0uteYJSRfMGFikhUysk8ZvAtfKmUK3kc/6oNl/y3EczF8OFGYIi/Ex2HspMfzYArk6+XQSA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "playwright-core": "1.48.0" - }, - "bin": { - "playwright": "cli.js" - }, - "engines": { - "node": ">=18" - }, - "optionalDependencies": { - "fsevents": "2.3.2" - } - }, - "node_modules/playwright-core": { - "version": "1.48.0", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.48.0.tgz", - "integrity": "sha512-RBvzjM9rdpP7UUFrQzRwR8L/xR4HyC1QXMzGYTbf1vjw25/ya9NRAVnXi/0fvFopjebvyPzsmoK58xxeEOaVvA==", - "dev": true, - "license": "Apache-2.0", - "bin": { - "playwright-core": "cli.js" - }, - "engines": { - "node": ">=18" - } - }, "node_modules/progress": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", diff --git a/package.json b/package.json index d4f7c6bce..240394886 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,6 @@ "buildTags": "extended" }, "devDependencies": { - "@playwright/test": "^1.48.0", "hugo-bin": "^0.111.3" }, "dependencies": { diff --git a/playwright.config.ts b/playwright.config.ts deleted file mode 100644 index 0a6065adb..000000000 --- a/playwright.config.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { defineConfig, devices } from '@playwright/test'; - -export default defineConfig({ - testDir: 'tests', - fullyParallel: true, - workers: 1, - outputDir: 'tests/test-results', - reporter: [['html', { outputFolder: 'tests/playwright-report' }]], - projects: [ - { - name: 'chromium', - use: { ...devices['Desktop Chrome'] }, - }, - { - name: 'firefox', - use: { ...devices['Desktop Firefox'] }, - }, - { - name: 'webkit', - use: { ...devices['Desktop Safari'] }, - }, - { - name: 'Mobile Chrome', - use: { ...devices['Pixel 5'] }, - }, - ], - use: { - // Base URL to use in actions like `await page.goto('/')`. - baseURL: 'https://docs.nginx.com', - // Set Geolocation to Cork, Ireland - geolocation: { longitude: -8.486316, latitude: 51.896893 }, - permissions: ['geolocation'], - video: 'retain-on-failure' - }, -}) \ No newline at end of file diff --git a/tests/constants.ts b/tests/constants.ts deleted file mode 100644 index 6484baac2..000000000 --- a/tests/constants.ts +++ /dev/null @@ -1,4 +0,0 @@ -/* - Place to store constant values. -*/ -export const TIMEOUT = 4000 \ No newline at end of file diff --git a/tests/search.spec.ts b/tests/search.spec.ts deleted file mode 100644 index 4640f46a9..000000000 --- a/tests/search.spec.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { test, expect} from '@playwright/test'; -import { handleConsentPopup, waitFor } from '../tests/utils/commonUtils.ts' - -test.describe("Testing search page", () => { - test('Searchbar is visible', async ({ page }) => { - await page.goto('/'); - await waitFor(async () => await handleConsentPopup(page)); - - const searchBox = page.locator('.CoveoSearchbox').first(); - const searchButton = page.locator('.CoveoSearchButton'); - const searchValue = "proxy"; - expect(searchBox).toBeVisible(); - - await searchBox.click(); - await page.keyboard.insertText(searchValue); - await searchButton.click(); - await page.waitForURL(`/search.html#q=${searchValue}&sort=relevancy`); - expect(await page.locator('div h1').innerHTML()).toBe('Search Results'); - }); - - test('Search page returns results without error', async ({ page }) => { - await page.goto("/search.html#q=proxy&sort=relevancy"); - await waitFor(() => handleConsentPopup(page)); - - await page.waitForSelector('div.coveo-result-list-container'); - const coveoErrorReport = page.locator('div.CoveoErrorReport'); - const errorReportDisplay = await coveoErrorReport.evaluate(e => window.getComputedStyle(e).display); - expect(errorReportDisplay).toBe('none'); - }); -}) \ No newline at end of file diff --git a/tests/utils/commonUtils.ts b/tests/utils/commonUtils.ts deleted file mode 100644 index 4a20e87b7..000000000 --- a/tests/utils/commonUtils.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { expect, type Page } from '@playwright/test'; -import { TIMEOUT } from '../../tests/constants.ts'; - -// THE GDPR Consent button appears when test is run from EU locations. This handles that popup. -export async function handleConsentPopup(page: Page) { - const consentContent = page.locator('#truste-consent-content'); - const isConsentContentVisibile = await consentContent.isVisible(); - if(isConsentContentVisibile) { - const consentButton = page.locator('#truste-consent-required'); - expect(consentButton).toBeVisible(); - await consentButton.click(); - } -} - -let sleep = ms => new Promise(r => setTimeout(r, ms)); -export let waitFor = async function waitFor(f, ftimeout=TIMEOUT){ - while(!f()) await sleep(ftimeout); - return f(); -}; \ No newline at end of file