File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -1079,23 +1079,23 @@ test.describe("Forms", () => {
10791079 let app = new PlaywrightFixture ( appFixture , page ) ;
10801080 let myFile = fixture . projectDir + "/myfile.txt" ;
10811081
1082+ const formData = page . locator ( "#formData" ) ;
1083+ const submit = page . locator ( "button" ) ;
1084+
10821085 await app . goto ( "/file-upload" ) ;
10831086 await app . uploadFile ( `[name=filey]` , myFile ) ;
10841087 await app . uploadFile ( `[name=filey2]` , myFile , myFile ) ;
1085- await page . locator ( "button" ) . click ( ) ;
1086- await page . locator ( "#formData" ) . waitFor ( ) ;
1087-
1088- expect ( ( await app . getElement ( "#formData" ) ) . val ( ) ) . toBe (
1088+ await submit . click ( ) ;
1089+ await expect ( formData ) . toHaveValue (
10891090 "filey=myfile.txt&filey2=myfile.txt&filey2=myfile.txt&filey3="
10901091 ) ;
10911092
10921093 await app . goto ( "/file-upload?method=post" ) ;
10931094 await app . uploadFile ( `[name=filey]` , myFile ) ;
10941095 await app . uploadFile ( `[name=filey2]` , myFile , myFile ) ;
1095- await page . locator ( "button" ) . click ( ) ;
1096- await page . locator ( "#formData" ) . waitFor ( ) ;
1096+ await submit . click ( ) ;
10971097
1098- expect ( ( await app . getElement ( "# formData" ) ) . val ( ) ) . toBe (
1098+ await expect ( formData ) . toHaveValue (
10991099 "filey=myfile.txt&filey2=myfile.txt&filey2=myfile.txt&filey3="
11001100 ) ;
11011101 } ) ;
You can’t perform that action at this time.
0 commit comments