@@ -471,10 +471,10 @@ void shouldUploadAFolder(@TempDir Path tmpDir) throws IOException {
471
471
}
472
472
473
473
@ Test
474
- void shouldUploadAFolderAndThrowForMultipleDirectories () throws IOException {
474
+ void shouldUploadAFolderAndThrowForMultipleDirectories (@ TempDir Path tmpDir ) throws IOException {
475
475
page .navigate (server .PREFIX + "/input/folderupload.html" );
476
476
Locator input = page .locator ("input[name=\" file1\" ]" );
477
- Path dir = Paths . get ("file-upload-test" ); // Adjust path as necessary
477
+ Path dir = tmpDir . resolve ("file-upload-test" );
478
478
Files .createDirectories (dir .resolve ("folder1" ));
479
479
writeFile (dir .resolve ("folder1" ).resolve ("file1.txt" ), "file1 content" );
480
480
Files .createDirectories (dir .resolve ("folder2" ));
@@ -485,11 +485,11 @@ void shouldUploadAFolderAndThrowForMultipleDirectories() throws IOException {
485
485
}
486
486
487
487
@ Test
488
- void shouldThrowIfADirectoryAndFilesArePassed () throws IOException {
488
+ void shouldThrowIfADirectoryAndFilesArePassed (@ TempDir Path tmpDir ) throws IOException {
489
489
// Skipping conditions based on environment not directly translatable to Java; needs custom implementation
490
490
page .navigate (server .PREFIX + "/input/folderupload.html" );
491
491
Locator input = page .locator ("input[name=\" file1\" ]" );
492
- Path dir = Paths . get ("file-upload-test" ); // Adjust path as necessary
492
+ Path dir = tmpDir . resolve ("file-upload-test" );
493
493
Files .createDirectories (dir .resolve ("folder1" ));
494
494
writeFile (dir .resolve ("folder1" ).resolve ("file1.txt" ), "file1 content" );
495
495
PlaywrightException e = assertThrows (PlaywrightException .class ,
@@ -498,10 +498,10 @@ void shouldThrowIfADirectoryAndFilesArePassed() throws IOException {
498
498
}
499
499
500
500
@ Test
501
- void shouldThrowWhenUploadingAFolderInANormalFileUploadInput () throws IOException {
501
+ void shouldThrowWhenUploadingAFolderInANormalFileUploadInput (@ TempDir Path tmpDir ) throws IOException {
502
502
page .navigate (server .PREFIX + "/input/fileupload.html" );
503
503
Locator input = page .locator ("input[name=\" file1\" ]" );
504
- Path dir = Paths . get ("file-upload-test" ); // Adjust path as necessary
504
+ Path dir = tmpDir . resolve ("file-upload-test" );
505
505
Files .createDirectories (dir );
506
506
writeFile (dir .resolve ("file1.txt" ), "file1 content" );
507
507
PlaywrightException e = assertThrows (PlaywrightException .class ,
0 commit comments