1
0
mirror of synced 2026-08-04 06:26:55 +00:00

fix(test): make shouldReportNewWindowDownloads pass in Firefox (#82)

This commit is contained in:
Yury Semikhatsky
2020-12-02 12:54:30 -08:00
committed by GitHub
parent 507e72c2cf
commit 0def0377aa
@@ -335,13 +335,8 @@ public class TestDownload extends TestBase {
return isChromium() && isHeadful();
}
static boolean isChromiumHeadfulOrFirefox() {
// TODO: figure out why download is not received in Firefox.
return isChromiumHeadful() || isFirefox();
}
@Test
@DisabledIf(value="isChromiumHeadfulOrFirefox", disabledReason="fixme")
@DisabledIf(value="isChromiumHeadful", disabledReason="fixme")
void shouldReportNewWindowDownloads() throws IOException {
// TODO: - the test fails in headful Chromium as the popup page gets closed along
// with the session before download completed event arrives.
@@ -349,7 +344,7 @@ public class TestDownload extends TestBase {
Page page = browser.newPage(new Browser.NewPageOptions().withAcceptDownloads(true));
page.setContent("<a target=_blank href='" + server.PREFIX + "/download'>download</a>");
Deferred<Event<Page.EventType>> downloadEvent = page.waitForEvent(DOWNLOAD);
page.click("a", new Page.ClickOptions().withModifiers(ALT));
page.click("a");
Download download = (Download) downloadEvent.get().data();
Path path = download.path();
assertTrue(Files.exists(path));