Skip to content

Commit

Permalink
made modifications to readME to add exec
Browse files Browse the repository at this point in the history
  • Loading branch information
vmaineng committed Apr 4, 2024
2 parents b41cc39 + 2465fd0 commit 3ff72a5
Show file tree
Hide file tree
Showing 10 changed files with 569 additions and 40 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,18 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
node-version: lts/*
- name: Install dependencies
run: pnpm install --frozen-lockfile #equivalent to npm ci
run: npm install -g pnpm && pnpm install
- name: Install Playwright Browsers
run: pnpm playwright install --with-deps
run: pnpm exec playwright install --with-deps
- name: Run Playwright tests
run: pnpm playwright test
run: pnpm exec playwright test
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30


22 changes: 22 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

# jobs:
# test:
# timeout-minutes: 60
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-node@v4
# with:
# node-version: lts/*
# - name: Install dependencies
# run: npm install -g pnpm && pnpm install
# - name: Install Playwright Browsers
# run: pnpm exec playwright install --with-deps
# - name: Run Playwright tests
# run: pnpm exec playwright test
# - uses: actions/upload-artifact@v4
# if: always()
# with:
# name: playwright-report
# path: playwright-report/
# retention-days: 30
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,7 @@ next-env.d.ts
/playwright/.cache/

*storybook.log

/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@ pnpm test
Run all Playwright tests

```
pnpm playwright test
pnpm exec playwright test
```

Run sing Playwright tests
Run single Playwright tests

```
pnpm playwright test (name of file)
pnpm exec playwright test (name of file)
```
32 changes: 16 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"private": true,
"version": "0.1.0",
"scripts": {
"dev": "next dev",
"build": "next build",
Expand Down Expand Up @@ -30,6 +31,7 @@
},
"devDependencies": {
"@chromatic-com/storybook": "^1.2.25",
"@playwright/test": "^1.42.1",
"@storybook/addon-essentials": "^8.0.4",
"@storybook/addon-interactions": "^8.0.4",
"@storybook/addon-links": "^8.0.4",
Expand Down
42 changes: 26 additions & 16 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
import { defineConfig, devices } from "@playwright/test";
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: "./",
testDir: './',
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
Expand All @@ -11,37 +20,38 @@ export default defineConfig({
/* 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",
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",
trace: 'on-first-retry',
},

/* Configure projects for major browsers */
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},

{
name: "firefox",
use: { ...devices["Desktop Firefox"] },
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
},

{
name: "webkit",
use: { ...devices["Desktop Safari"] },
},

/* Test against mobile viewports. */
{
name: "Mobile Chrome",
use: { ...devices["Pixel 5"] },
name: 'webkit',
use: { ...devices['Desktop Safari'] },
},
],

/* 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,
// },
});
35 changes: 35 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3ff72a5

Please sign in to comment.