@@ -29,10 +29,15 @@ test.describe("Form page in mobile view", () => {
2929 "CroCoder | Building Software that Builds Your Business" ,
3030 ) ;
3131 await expect ( page . getByText ( "get in touch" ) ) . toBeVisible ( ) ;
32- await expect ( page . getByPlaceholder ( "Full name *" ) ) . toBeVisible ( ) ;
33- await expect ( page . getByPlaceholder ( "E-mail *" ) ) . toBeVisible ( ) ;
3432 await expect (
35- page . getByPlaceholder ( "Tell us about your project *" ) ,
33+ page . getByRole ( "textbox" , { name : "Full name *" } ) ,
34+ ) . toBeVisible ( ) ;
35+ await expect ( page . getByRole ( "textbox" , { name : "E-mail *" } ) ) . toBeVisible ( ) ;
36+ await expect (
37+ page . getByRole ( "textbox" , { name : "Tell us about your project *" } ) ,
38+ ) . toBeVisible ( ) ;
39+ await expect (
40+ page . getByRole ( "checkbox" , { name : "I give consent to CroCoder to" } ) ,
3641 ) . toBeVisible ( ) ;
3742 await expect (
3843 page . getByText (
@@ -56,15 +61,13 @@ test.describe("Form page in mobile view", () => {
5661 } ) ,
5762 } ) ;
5863 } ) ;
59- await page . getByPlaceholder ( " Full name *") . fill ( "Test name" ) ;
60- await page . getByPlaceholder ( " E-mail *") . fill ( "test@test.com" ) ;
64+ await page . getByRole ( "textbox" , { name : " Full name *" } ) . fill ( "Test name" ) ;
65+ await page . getByRole ( "textbox" , { name : " E-mail *" } ) . fill ( "test@test.com" ) ;
6166 await page
62- . getByPlaceholder ( " Tell us about your project *")
67+ . getByRole ( "textbox" , { name : " Tell us about your project *" } )
6368 . fill ( "This is a test input" ) ;
6469 await page
65- . getByText (
66- "I give consent to CroCoder to use this information to contact me." ,
67- )
70+ . getByRole ( "checkbox" , { name : "I give consent to CroCoder to" } )
6871 . click ( ) ;
6972 await page . getByRole ( "button" , { name : "Get a free build review" } ) . click ( ) ;
7073
@@ -107,15 +110,13 @@ test.describe("Form submission in mobile view from home page", () => {
107110 await page . getByRole ( "link" , { name : "Contact us" , exact : true } ) . click ( ) ;
108111
109112 await expect ( page . getByText ( "get in touch" ) ) . toBeVisible ( ) ;
110- await page . getByPlaceholder ( " Full name *") . fill ( "Test name" ) ;
111- await page . getByPlaceholder ( " E-mail *") . fill ( "test@test.com" ) ;
113+ await page . getByRole ( "textbox" , { name : " Full name *" } ) . fill ( "Test name" ) ;
114+ await page . getByRole ( "textbox" , { name : " E-mail *" } ) . fill ( "test@test.com" ) ;
112115 await page
113- . getByPlaceholder ( " Tell us about your project *")
116+ . getByRole ( "textbox" , { name : " Tell us about your project *" } )
114117 . fill ( "This is a test input" ) ;
115118 await page
116- . getByText (
117- "I give consent to CroCoder to use this information to contact me." ,
118- )
119+ . getByRole ( "checkbox" , { name : "I give consent to CroCoder to" } )
119120 . click ( ) ;
120121 await page . getByRole ( "button" , { name : "Get a free build review" } ) . click ( ) ;
121122
@@ -142,15 +143,13 @@ test.describe("Form submission in mobile view from home page", () => {
142143 await page . getByRole ( "link" , { name : "Contact us" , exact : true } ) . click ( ) ;
143144
144145 await expect ( page . getByText ( "get in touch" ) ) . toBeVisible ( ) ;
145- await page . getByPlaceholder ( " Full name *") . fill ( "Test name" ) ;
146- await page . getByPlaceholder ( " E-mail *") . fill ( "test@test.com" ) ;
146+ await page . getByRole ( "textbox" , { name : " Full name *" } ) . fill ( "Test name" ) ;
147+ await page . getByRole ( "textbox" , { name : " E-mail *" } ) . fill ( "test@test.com" ) ;
147148 await page
148- . getByPlaceholder ( " Tell us about your project *")
149+ . getByRole ( "textbox" , { name : " Tell us about your project *" } )
149150 . fill ( "This is a test input" ) ;
150151 await page
151- . getByText (
152- "I give consent to CroCoder to use this information to contact me." ,
153- )
152+ . getByRole ( "checkbox" , { name : "I give consent to CroCoder to" } )
154153 . click ( ) ;
155154 await page . getByRole ( "button" , { name : "Get a free build review" } ) . click ( ) ;
156155
0 commit comments