From b024b69eee50e0fbc22b5cc04d7c0dbae3fcaa19 Mon Sep 17 00:00:00 2001 From: Gabe <41127686+Zidious@users.noreply.github.com> Date: Tue, 16 Jul 2024 19:47:06 +0100 Subject: [PATCH] make all consistent with headless=new --- .github/workflows/smoke-test.yml | 9 +++++++++ playwright-test/basic/playwright.config.js | 9 ++++++++- playwright-test/multi-page/playwright.config.ts | 9 ++++++++- puppeteer/basic/tests/login.js | 3 ++- puppeteer/typescript-multi-page/tests/setup.ts | 3 ++- wdio/test-runner/typescript/wdio.config.ts | 7 ++++++- wdio/typescript-multi-page/setup.ts | 3 ++- wdio/v7/typescript-basic/setup.ts | 3 ++- webdriverjs/basic/tests/login.js | 16 ++++++++++------ webdriverjs/testing/tests/login.js | 16 ++++++++++------ webdriverjs/typescript-multi-page/tests/setup.ts | 4 +++- 11 files changed, 62 insertions(+), 20 deletions(-) diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index a673529..49c1799 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -20,6 +20,8 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 18 + - run: cd cypress/iframes && npm install + - run: cd cypress/iframes && node server.js & - run: cd cypress/iframes && npm install && npm test env: API_KEY: ${{ secrets.AXE_DEVHUB_API_KEY }} @@ -51,6 +53,7 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 18 + - run: npx playwright install - run: cd playwright/basic && npm install && npm test env: API_KEY: ${{ secrets.AXE_DEVHUB_API_KEY }} @@ -61,6 +64,7 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 18 + - run: npx playwright install - run: cd playwright/manual-mode && npm install && npm test env: API_KEY: ${{ secrets.AXE_DEVHUB_API_KEY }} @@ -71,6 +75,7 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 18 + - run: npx playwright install - run: cd playwright/typescript-multi-page && npm install && npm test env: API_KEY: ${{ secrets.AXE_DEVHUB_API_KEY }} @@ -81,6 +86,7 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 18 + - run: npx playwright install - run: cd playwright-test/basic && npm install && npm test env: API_KEY: ${{ secrets.AXE_DEVHUB_API_KEY }} @@ -91,6 +97,7 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 18 + - run: npx playwright install - run: cd playwright-test/multi-page && npm install && npm test env: API_KEY: ${{ secrets.AXE_DEVHUB_API_KEY }} @@ -103,6 +110,8 @@ jobs: with: node-version: 18 - run: cd puppeteer/basic && npm install && npm test + env: + API_KEY: ${{ secrets.AXE_DEVHUB_API_KEY }} puppeteer-typescript-multi-page: runs-on: ubuntu-latest steps: diff --git a/playwright-test/basic/playwright.config.js b/playwright-test/basic/playwright.config.js index 509238f..795047a 100644 --- a/playwright-test/basic/playwright.config.js +++ b/playwright-test/basic/playwright.config.js @@ -1,3 +1,10 @@ const { defineConfig } = require('@playwright/test') -module.exports = defineConfig({ testDir: './tests' }) +module.exports = defineConfig({ + testDir: './tests', + use: { + launchOptions: { + args: ['--headless=new'] + } + } +}) diff --git a/playwright-test/multi-page/playwright.config.ts b/playwright-test/multi-page/playwright.config.ts index 356e88e..481e6bd 100644 --- a/playwright-test/multi-page/playwright.config.ts +++ b/playwright-test/multi-page/playwright.config.ts @@ -1,3 +1,10 @@ import { defineConfig } from '@playwright/test' -export default defineConfig({ testDir: './tests' }) +export default defineConfig({ + testDir: './tests', + use: { + launchOptions: { + args: ['--headless=new'] + } + } +}) diff --git a/puppeteer/basic/tests/login.js b/puppeteer/basic/tests/login.js index f55bace..e79bd0a 100644 --- a/puppeteer/basic/tests/login.js +++ b/puppeteer/basic/tests/login.js @@ -21,7 +21,8 @@ describe('My Login Application', () => { apiKey: API_KEY, serverURL: SERVER_URL }, - headless: false + headless: false, + args: ['--headless=new'] }) ) // Create a page instance, using your browser instance. diff --git a/puppeteer/typescript-multi-page/tests/setup.ts b/puppeteer/typescript-multi-page/tests/setup.ts index bc94abb..89ac374 100644 --- a/puppeteer/typescript-multi-page/tests/setup.ts +++ b/puppeteer/typescript-multi-page/tests/setup.ts @@ -21,7 +21,8 @@ before(async () => { apiKey: API_KEY, serverURL: SERVER_URL }, - headless: false + headless: false, + args: ['--headless=new'] }) ) }) diff --git a/wdio/test-runner/typescript/wdio.config.ts b/wdio/test-runner/typescript/wdio.config.ts index f961f07..cd961b1 100644 --- a/wdio/test-runner/typescript/wdio.config.ts +++ b/wdio/test-runner/typescript/wdio.config.ts @@ -6,7 +6,12 @@ const { API_KEY, SERVER_URL = 'https://axe.deque.com' } = process.env export const config = wdioTestRunner({ axe: { apiKey: API_KEY as string, serverURL: SERVER_URL }, specs: ['forgot-password.test.ts', 'login.test.ts', 'home.test.ts'], - capabilities: [{ browserName: 'chrome' }], + capabilities: [ + { + browserName: 'chrome', + 'goog:chromeOptions': { args: ['--headless=new'] } + } + ], baseUrl: 'https://the-internet.herokuapp.com', services: ['chromedriver'], framework: 'mocha', diff --git a/wdio/typescript-multi-page/setup.ts b/wdio/typescript-multi-page/setup.ts index d555f0d..14e923a 100644 --- a/wdio/typescript-multi-page/setup.ts +++ b/wdio/typescript-multi-page/setup.ts @@ -16,7 +16,8 @@ before(async () => { serverURL: SERVER_URL }, capabilities: { - browserName: 'chrome' + browserName: 'chrome', + 'goog:chromeOptions': { args: ['--headless=new'] } } }) ) diff --git a/wdio/v7/typescript-basic/setup.ts b/wdio/v7/typescript-basic/setup.ts index d191fcb..ddb695f 100644 --- a/wdio/v7/typescript-basic/setup.ts +++ b/wdio/v7/typescript-basic/setup.ts @@ -31,7 +31,8 @@ before(async () => { serverURL: SERVER_URL }, capabilities: { - browserName: 'chrome' + browserName: 'chrome', + 'goog:chromeOptions': { args: ['--headless=new'] } } }) ) diff --git a/webdriverjs/basic/tests/login.js b/webdriverjs/basic/tests/login.js index 3e724c7..3869ad2 100644 --- a/webdriverjs/basic/tests/login.js +++ b/webdriverjs/basic/tests/login.js @@ -4,6 +4,7 @@ const { webdriverConfig, WebdriverController } = require('@axe-core/watcher') +const { Options } = require('selenium-webdriver/chrome') /* Get your configuration from environment variables. */ const { API_KEY, SERVER_URL = 'https://axe.deque.com' } = process.env @@ -16,12 +17,15 @@ describe('My Login Application', () => { browser = await new Builder() .forBrowser('chrome') .setChromeOptions( - webdriverConfig({ - axe: { - apiKey: API_KEY, - serverURL: SERVER_URL - } - }) + webdriverConfig( + { + axe: { + apiKey: API_KEY, + serverURL: SERVER_URL + } + }, + ...new Options().addArguments('--headless=new') + ) ) .build() controller = new WebdriverController(browser) diff --git a/webdriverjs/testing/tests/login.js b/webdriverjs/testing/tests/login.js index f327f0b..7640289 100644 --- a/webdriverjs/testing/tests/login.js +++ b/webdriverjs/testing/tests/login.js @@ -5,6 +5,7 @@ const { webdriverConfig, WebdriverController } = require('@axe-core/watcher') +const { Options } = require('selenium-webdriver/chrome') /* Get your configuration from environment variables. */ const { API_KEY, SERVER_URL = 'https://axe.deque.com' } = process.env @@ -23,12 +24,15 @@ suite(env => { } else { browser = await builder .setChromeOptions( - webdriverConfig({ - axe: { - apiKey: API_KEY, - serverURL: SERVER_URL - } - }) + webdriverConfig( + { + axe: { + apiKey: API_KEY, + serverURL: SERVER_URL + } + }, + ...new Options().addArguments('--headless=new') + ) ) .build() diff --git a/webdriverjs/typescript-multi-page/tests/setup.ts b/webdriverjs/typescript-multi-page/tests/setup.ts index f66c7b1..a5acc77 100644 --- a/webdriverjs/typescript-multi-page/tests/setup.ts +++ b/webdriverjs/typescript-multi-page/tests/setup.ts @@ -5,6 +5,7 @@ import { webdriverConfig, WebdriverController } from '@axe-core/watcher' +import { Options } from 'selenium-webdriver/chrome' /* Get your configuration from environment variables. */ const { API_KEY, SERVER_URL = 'https://axe.deque.com' } = process.env @@ -20,7 +21,8 @@ before(async () => { axe: { apiKey: API_KEY as string, serverURL: SERVER_URL - } + }, + ...new Options().addArguments('--headless=new') }) ) .build()