-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#74 Installed Playwright and add in to CI/CD pipeline #92
Changes from 7 commits
e54ead8
d2aef6b
3d09d74
79b106b
4e71119
3462e33
b4fdbbc
817946c
d747643
20f9a70
5dcc157
5d3b1b1
bc64c6c
9e861f9
e153ccd
5109973
4c45998
fc231e0
0e434f0
92bb771
b41cc39
3ff72a5
acf6714
0b275fe
02c3c70
fcb1964
19e3a05
92e90bc
c7ba282
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,3 +103,37 @@ Run Storybook in the project root | |
``` | ||
npm run storybook | ||
``` | ||
|
||
## React Testing Library (RTL) && Jest | ||
|
||
Install dependencies | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to remove the installation from our dependencies. 1 installation is all a new user would need to run. Then the specific commands would be needed for the docs. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @shashilo Thanks for clarifying. I removed the |
||
|
||
``` | ||
pnpm i | ||
``` | ||
|
||
Run RTL && Jest in the project root | ||
|
||
``` | ||
pnpm test | ||
``` | ||
|
||
## Playwright Testing | ||
|
||
Install dependencies | ||
|
||
``` | ||
pnpm i | ||
``` | ||
|
||
Run all Playwright tests | ||
|
||
``` | ||
pnpm playwright test | ||
``` | ||
|
||
Run sing Playwright tests | ||
|
||
``` | ||
pnpm playwright test (name of file) | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { defineConfig, devices } from "@playwright/test"; | ||
|
||
export default defineConfig({ | ||
testDir: "./", | ||
/* 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. */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove unused code. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hey Shashi! Would you please elaborate as to why Desktop Safari should be removed? I believe it's not as popular but I can still see Safari being used to this day. Please let me know. :) Thanks! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I figured you removed it because they are commented out. If it's not meant to be commented out, bring it back. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I deleted the commented code. |
||
{ | ||
name: "Mobile Chrome", | ||
use: { ...devices["Pixel 5"] }, | ||
}, | ||
], | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this something we want to ignore? We will eventually create a deployment that can output the Playwright report so the person creating the PR can see this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shashilo Thanks for explaining, Shashi. I will remove from the .gitignore file.