File tree Expand file tree Collapse file tree 5 files changed +38
-9
lines changed Expand file tree Collapse file tree 5 files changed +38
-9
lines changed Original file line number Diff line number Diff line change 1313 "prepare" : " husky" ,
1414 "test" : " vitest" ,
1515 "test:coverage" : " vitest run --coverage" ,
16- "test:e2e" : " playwright test --config=tests/setup/playwright.config.ts"
16+ "test:e2e" : " playwright test --config=tests/setup/playwright.config.ts" ,
17+ "test:e2e:ui" : " playwright test --config=tests/setup/playwright.config.ts --ui" ,
18+ "test:e2e:headed" : " playwright test --config=tests/setup/playwright.config.ts --headed" ,
19+ "test:e2e:debug" : " playwright test --config=tests/setup/playwright.config.ts --debug"
1720 },
1821 "husky" : {
1922 "hooks" : {
Original file line number Diff line number Diff line change 6666 "enter-email" : " Masukan Email" ,
6767 "enter-password" : " Masukan Password" ,
6868 "no-account" : " Apakah Belum Punya Akun?" ,
69- "sign-in" : " Sign In " ,
69+ "sign-in" : " Masuk " ,
7070 "sign-up" : " Sign Up" ,
7171 "forgot-password" : " Lupa Password?"
7272 },
Original file line number Diff line number Diff line change 1+ import { test , expect } from "@playwright/test" ;
2+
3+ test . describe ( "Sign In Page" , ( ) => {
4+ test . describe ( "English (Default)" , ( ) => {
5+ test . beforeEach ( async ( { page } ) => {
6+ await page . goto ( "/sign-in" ) ;
7+ } ) ;
8+
9+ test ( "should display sign in form elements" , async ( { page } ) => {
10+ await expect ( page . getByRole ( "heading" , { name : / w e l c o m e b a c k 👋 / i } ) ) . toBeVisible ( ) ;
11+ await expect ( page . getByText ( / s i g n i n t o c o n n e c t , l e a r n , a n d g r o w t o g e t h e r ./ i) ) . toBeVisible ( ) ;
12+
13+ await expect ( page . locator ( 'input[name="email"]' ) ) . toBeVisible ( ) ;
14+ await expect ( page . locator ( 'input[name="password"]' ) ) . toBeVisible ( ) ;
15+ await expect ( page . getByRole ( "button" , { name : / s i g n i n / i } ) ) . toBeVisible ( ) ;
16+
17+ const forgotPasswordLink = page . getByRole ( "link" , { name : / f o r g o t p a s s w o r d \? / i } ) ;
18+ await expect ( forgotPasswordLink ) . toBeVisible ( ) ;
19+ await expect ( forgotPasswordLink ) . toHaveAttribute ( "href" , "/en/forgot-password/" ) ;
20+
21+ const signUpLink = page . getByRole ( "link" , { name : / s i g n u p / i } ) ;
22+ await expect ( signUpLink ) . toBeVisible ( ) ;
23+ await expect ( signUpLink ) . toHaveAttribute ( "href" , "/en/sign-up/" ) ;
24+ } ) ;
25+ } ) ;
26+ } ) ;
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ test("has title", async ({ page }) => {
44 await page . goto ( "https://playwright.dev/" ) ;
55
66 // Expect a title "to contain" a substring.
7- await expect ( page ) . toHaveTitle ( / P l a y w r i g h t / ) ;
7+ await expect ( page ) . toHaveTitle ( / P l a y w r i g h a s d a s d t / ) ;
88} ) ;
99
1010test ( "get started link" , async ( { page } ) => {
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ export default defineConfig({
2626 /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
2727 use : {
2828 /* Base URL to use in actions like `await page.goto('/')`. */
29- // baseURL: ' http://localhost:3000' ,
29+ baseURL : " http://localhost:3000" ,
3030
3131 /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
3232 trace : "on-first-retry" ,
@@ -71,9 +71,9 @@ export default defineConfig({
7171 ] ,
7272
7373 /* Run your local dev server before starting the tests */
74- // webServer: {
75- // command: 'npm run start' ,
76- // url: ' http://localhost:3000' ,
77- // reuseExistingServer: !process.env.CI,
78- // },
74+ webServer : {
75+ command : "pnpm run dev" ,
76+ url : " http://localhost:3000" ,
77+ reuseExistingServer : ! process . env . CI ,
78+ } ,
7979} ) ;
You can’t perform that action at this time.
0 commit comments