-
Notifications
You must be signed in to change notification settings - Fork 0
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
0 parents
commit b89efba
Showing
13 changed files
with
1,533 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
version: 2.1 | ||
|
||
jobs: | ||
test: | ||
parallelism: 3 | ||
docker: | ||
- image: openstax/python3-chrome-base | ||
steps: | ||
- checkout | ||
- run: npx pwc --key $CURRENTS_RECORD_KEY --project-id $CURRENTS_PROJECT_ID | ||
workflows: | ||
playwright: | ||
jobs: | ||
- test: | ||
context: currents |
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,50 @@ | ||
version: 2.1 | ||
|
||
aliases: | ||
- &cache_restore | ||
restore_cache: | ||
keys: | ||
- v2-dependencies-{{ checksum "yarn.lock" }} | ||
|
||
- &cache_save | ||
save_cache: | ||
paths: | ||
- node_modules | ||
- ~/.cache/yarn | ||
key: v2-dependencies-{{ checksum "yarn.lock" }} | ||
|
||
- &install_dependencies | ||
run: yarn install --frozen-lockfile --cache-folder ~/.cache/yarn | ||
|
||
jobs: | ||
playwright-run: | ||
executor: plugin-e2e-tester | ||
parallelism: 1 | ||
steps: | ||
- checkout | ||
- *cache_restore | ||
- *install_dependencies | ||
- *cache_save | ||
|
||
- run: | ||
name: Install playwright | ||
command: | | ||
npx playwright install --with-deps chromium | ||
- run: | ||
name: Run E2E tests | ||
command: | | ||
yarn pwc --key $CURRENTS_RECORD_KEY --project-id $CURRENTS_PROJECT_ID | ||
- store_test_results: | ||
path: ~/repo/apps/plugin/e2e/reports/junit | ||
|
||
- store_artifacts: | ||
path: ~/repo/apps/plugin/e2e/recordings | ||
destination: artifacts | ||
|
||
workflows: | ||
version: 2 | ||
all: | ||
jobs: | ||
- playwright-run |
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,5 @@ | ||
node_modules/ | ||
/test-results/ | ||
/playwright-report/ | ||
/playwright/.cache/ | ||
.DS_Store |
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,15 @@ | ||
# Currents.dev - CircleCI Playwright Example | ||
|
||
This is an example repository that showcases using [CircleCI](https://circleci.com) with [Currents.dev](https://currents.dev). | ||
|
||
The example [config file](https://github.com/currents-dev/circleci-example/blob/master/.circleci/config.yml): | ||
|
||
- uses [Test CLI commands](https://playwright.dev/docs/test-cli) to run `@currents/playwright` for recording test results and parallelization with [Currents.dev](https://currents.dev) | ||
|
||
- Note: set the `CURRENTS_PROJECT_ID` [Environment variable](https://circleci.com/docs/2.0/env-vars/) - obtain the project id from [Currents.dev](https://app.currents.dev) | ||
|
||
- Note: use CLI arguments to customize your Playwright runs, e.g.: `pwc --key <your Currents.dev key>` | ||
|
||
- Note: create an organization, get your record key at [Currents.dev](https://app.currents.dev) and set [Environment variable](https://circleci.com/docs/2.0/env-vars/) `CURRENTS_RECORD_KEY` | ||
|
||
--- |
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,21 @@ | ||
{ | ||
"name": "circleci-pw-example", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": { | ||
"start": "node index.js" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"typescript": "^5.0.2" | ||
}, | ||
"devDependencies": { | ||
"@currents/playwright": "^0.8.1", | ||
"@playwright/test": "^1.38.1", | ||
"@types/node": "^20.8.2", | ||
"playwright": "^1.38.1" | ||
} | ||
} |
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,52 @@ | ||
import { defineConfig, devices } from "@playwright/test"; | ||
|
||
/** | ||
* Read environment variables from file. | ||
* https://github.com/motdotla/dotenv | ||
*/ | ||
// require('dotenv').config(); | ||
|
||
/** | ||
* See https://playwright.dev/docs/test-configuration. | ||
*/ | ||
export default defineConfig({ | ||
testDir: "./tests", | ||
/* 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", | ||
video: "on", | ||
screenshot: "on", | ||
}, | ||
|
||
/* Configure projects for major browsers */ | ||
projects: [ | ||
{ | ||
name: "chromium", | ||
use: { ...devices["Desktop Chrome"] }, | ||
}, | ||
|
||
{ | ||
name: "firefox", | ||
use: { ...devices["Desktop Firefox"] }, | ||
}, | ||
|
||
{ | ||
name: "webkit", | ||
use: { ...devices["Desktop Safari"] }, | ||
}, | ||
], | ||
}); |
Oops, something went wrong.