Skip to content

Commit

Permalink
Fix community-app test
Browse files Browse the repository at this point in the history
  • Loading branch information
ia3andy committed Jan 8, 2024
1 parent 9d6c066 commit 4ba0b4c
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import java.net.URL;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

@QuarkusTest
@WithPlaywright(verbose = true)
Expand Down Expand Up @@ -49,14 +50,16 @@ public void testGenerateDefault(TestInfo testInfo) throws Throwable {
CountDownLatch latch = new CountDownLatch(1);
page.onResponse(response -> {
// Check if the URL of the response matches the expected URL of the zip file
if (response.url().endsWith(".zip")) {
if(response.headers().get("content-type").equals("application/zip")) {
Assertions.assertEquals(200, response.status());
latch.countDown();
}
});

page.waitForSelector(LABEL_DOWNLOAD_THE_ZIP).click();
latch.await();
if (!latch.await(30, TimeUnit.SECONDS)) {
Assertions.fail("The expected .zip response did not arrive within 30 seconds");
}
}
}

Expand Down

0 comments on commit 4ba0b4c

Please sign in to comment.