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", () => {
1079
1079
let app = new PlaywrightFixture ( appFixture , page ) ;
1080
1080
let myFile = fixture . projectDir + "/myfile.txt" ;
1081
1081
1082
+ const formData = page . locator ( "#formData" ) ;
1083
+ const submit = page . locator ( "button" ) ;
1084
+
1082
1085
await app . goto ( "/file-upload" ) ;
1083
1086
await app . uploadFile ( `[name=filey]` , myFile ) ;
1084
1087
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 (
1089
1090
"filey=myfile.txt&filey2=myfile.txt&filey2=myfile.txt&filey3="
1090
1091
) ;
1091
1092
1092
1093
await app . goto ( "/file-upload?method=post" ) ;
1093
1094
await app . uploadFile ( `[name=filey]` , myFile ) ;
1094
1095
await app . uploadFile ( `[name=filey2]` , myFile , myFile ) ;
1095
- await page . locator ( "button" ) . click ( ) ;
1096
- await page . locator ( "#formData" ) . waitFor ( ) ;
1096
+ await submit . click ( ) ;
1097
1097
1098
- expect ( ( await app . getElement ( "# formData" ) ) . val ( ) ) . toBe (
1098
+ await expect ( formData ) . toHaveValue (
1099
1099
"filey=myfile.txt&filey2=myfile.txt&filey2=myfile.txt&filey3="
1100
1100
) ;
1101
1101
} ) ;
You can’t perform that action at this time.
0 commit comments