-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c65cf6b
commit d4ada0c
Showing
35 changed files
with
174 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
### Further Reading | ||
|
||
https://medium.com/@oroz.askarov/building-a-robust-automation-framework-in-playwright-typescript-version-b13be4e4bf56 https://github.com/alapanme/Playwright-Automation/blob/master/tests/2-checkBox.spec.ts |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
src/mobile/healthcheckAndroid.test.ts → ...mobile/example/healthcheckAndroid.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/mobile/healthcheckiOS.test.ts → ...sts/mobile/example/healthcheckiOS.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
import { defineConfig, devices } from "@playwright/test"; | ||
import * as dotenv from "dotenv"; | ||
|
||
switch (process.env.NODE_ENV) { | ||
case "local": | ||
dotenv.config({ path: "./environments/local.env" }); | ||
break; | ||
case "dev": | ||
dotenv.config({ path: "./environments/local.env" }); | ||
break; | ||
case "qa": | ||
dotenv.config({ path: "./environments/qa.env" }); | ||
break; | ||
case "prod": | ||
dotenv.config({ path: "./environments/prod.env" }); | ||
|
||
break; | ||
|
||
default: | ||
break; | ||
} | ||
export default defineConfig({ | ||
testDir: "./src", | ||
/* Run tests in files in parallel */ | ||
fullyParallel: true, | ||
/* Fail the build on CI if you accidentally left test.only in the source code. */ | ||
forbidOnly: !!process.env.CI, | ||
/* Retry on CI only */ | ||
retries: process.env.CI ? 2 : 0, | ||
/* Opt out of parallel tests on CI. */ | ||
workers: process.env.CI ? 1 : undefined, | ||
/* Reporter to use. See https://playwright.dev/docs/test-reporters */ | ||
reporter: "html", | ||
/* 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', | ||
|
||
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ | ||
trace: "on-first-retry", | ||
}, | ||
|
||
/* Configure projects for major browsers */ | ||
projects: [ | ||
// { | ||
// name: "chromium", | ||
// use: { ...devices["Desktop Chrome"] }, | ||
// }, | ||
|
||
// { | ||
// name: "firefox", | ||
// use: { ...devices["Desktop Firefox"] }, | ||
// }, | ||
|
||
// { | ||
// name: "webkit", | ||
// use: { ...devices["Desktop Safari"] }, | ||
// }, | ||
|
||
/* Test against mobile viewports. */ | ||
// { | ||
// name: 'Mobile Chrome', | ||
// use: { ...devices['Pixel 5'] }, | ||
// }, | ||
// { | ||
// name: 'Mobile Safari', | ||
// use: { ...devices['iPhone 12'] }, | ||
// }, | ||
|
||
/* Test against branded browsers. */ | ||
{ | ||
name: "Microsoft Edge", | ||
use: { ...devices["Desktop Edge"], channel: "msedge" }, | ||
}, | ||
// { | ||
// name: 'Google Chrome', | ||
// use: { ...devices['Desktop Chrome'], channel: 'chrome' }, | ||
// }, | ||
], | ||
|
||
/* Run your local dev server before starting the tests */ | ||
// webServer: { | ||
// command: 'npm run start', | ||
// url: 'http://127.0.0.1:3000', | ||
// reuseExistingServer: !process.env.CI, | ||
// }, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* This file enables Playwright client to connect to remote browsers. | ||
* It should be placed in the same directory as playwright.config.ts. | ||
*/ | ||
|
||
import { defineConfig } from "@playwright/test"; | ||
import config from "./playwright.config"; | ||
import dotenv from "dotenv"; | ||
|
||
// Define environment on the dev box in .env file: | ||
// .env: | ||
// PLAYWRIGHT_SERVICE_ACCESS_TOKEN=XXX | ||
// PLAYWRIGHT_SERVICE_URL=XXX | ||
|
||
// Define environment in your GitHub workflow spec. | ||
// env: | ||
// PLAYWRIGHT_SERVICE_ACCESS_TOKEN: ${{ secrets.PLAYWRIGHT_SERVICE_ACCESS_TOKEN }} | ||
// PLAYWRIGHT_SERVICE_URL: ${{ secrets.PLAYWRIGHT_SERVICE_URL }} | ||
// PLAYWRIGHT_SERVICE_RUN_ID: ${{ github.run_id }}-${{ github.run_attempt }}-${{ github.sha }} | ||
|
||
dotenv.config(); | ||
|
||
// Name the test run if it's not named yet. | ||
process.env.PLAYWRIGHT_SERVICE_RUN_ID = process.env.PLAYWRIGHT_SERVICE_RUN_ID || new Date().toISOString(); | ||
|
||
// Can be 'linux' or 'windows'. | ||
const os = process.env.PLAYWRIGHT_SERVICE_OS || "linux"; | ||
|
||
export default defineConfig(config, { | ||
// Define more generous timeout for the service operation if necessary. | ||
// timeout: 60000, | ||
// expect: { | ||
// timeout: 10000, | ||
// }, | ||
workers: 20, | ||
|
||
// Enable screenshot testing and configure directory with expectations. | ||
// https://learn.microsoft.com/azure/playwright-testing/how-to-configure-visual-comparisons | ||
ignoreSnapshots: false, | ||
snapshotPathTemplate: `{testDir}/__screenshots__/{testFilePath}/${os}/{arg}{ext}`, | ||
|
||
use: { | ||
// Specify the service endpoint. | ||
connectOptions: { | ||
wsEndpoint: `${process.env.PLAYWRIGHT_SERVICE_URL}?cap=${JSON.stringify({ | ||
// Can be 'linux' or 'windows'. | ||
os, | ||
runId: process.env.PLAYWRIGHT_SERVICE_RUN_ID, | ||
})}`, | ||
timeout: 30000, | ||
headers: { | ||
"x-mpt-access-key": process.env.PLAYWRIGHT_SERVICE_ACCESS_TOKEN!, | ||
}, | ||
// Allow service to access the localhost. | ||
exposeNetwork: "<loopback>", | ||
}, | ||
}, | ||
// Tenmp workaround for config merge bug in OSS https://github.com/microsoft/playwright/pull/28224 | ||
projects: config.projects ? config.projects : [{}], | ||
}); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
Empty file.
Empty file.
Empty file.