Skip to content

Commit

Permalink
make all consistent with headless=new
Browse files Browse the repository at this point in the history
  • Loading branch information
Zidious committed Jul 16, 2024
1 parent f3c6ce2 commit b024b69
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 20 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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 }}
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand All @@ -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:
Expand Down
9 changes: 8 additions & 1 deletion playwright-test/basic/playwright.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
const { defineConfig } = require('@playwright/test')

module.exports = defineConfig({ testDir: './tests' })
module.exports = defineConfig({
testDir: './tests',
use: {
launchOptions: {
args: ['--headless=new']
}
}
})
9 changes: 8 additions & 1 deletion playwright-test/multi-page/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
import { defineConfig } from '@playwright/test'

export default defineConfig({ testDir: './tests' })
export default defineConfig({
testDir: './tests',
use: {
launchOptions: {
args: ['--headless=new']
}
}
})
3 changes: 2 additions & 1 deletion puppeteer/basic/tests/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion puppeteer/typescript-multi-page/tests/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ before(async () => {
apiKey: API_KEY,
serverURL: SERVER_URL
},
headless: false
headless: false,
args: ['--headless=new']
})
)
})
Expand Down
7 changes: 6 additions & 1 deletion wdio/test-runner/typescript/wdio.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
3 changes: 2 additions & 1 deletion wdio/typescript-multi-page/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ before(async () => {
serverURL: SERVER_URL
},
capabilities: {
browserName: 'chrome'
browserName: 'chrome',
'goog:chromeOptions': { args: ['--headless=new'] }
}
})
)
Expand Down
3 changes: 2 additions & 1 deletion wdio/v7/typescript-basic/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ before(async () => {
serverURL: SERVER_URL
},
capabilities: {
browserName: 'chrome'
browserName: 'chrome',
'goog:chromeOptions': { args: ['--headless=new'] }
}
})
)
Expand Down
16 changes: 10 additions & 6 deletions webdriverjs/basic/tests/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
16 changes: 10 additions & 6 deletions webdriverjs/testing/tests/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()

Expand Down
4 changes: 3 additions & 1 deletion webdriverjs/typescript-multi-page/tests/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -20,7 +21,8 @@ before(async () => {
axe: {
apiKey: API_KEY as string,
serverURL: SERVER_URL
}
},
...new Options().addArguments('--headless=new')
})
)
.build()
Expand Down

0 comments on commit b024b69

Please sign in to comment.