Skip to content

Commit

Permalink
Upgrade Firefox from 123.x to 129.x
Browse files Browse the repository at this point in the history
  • Loading branch information
basil committed Jul 31, 2024
1 parent b456c5f commit 40ccbb7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ public class FallbackConfig extends AbstractModule {

public static final String DOM_MAX_SCRIPT_RUN_TIME = "dom.max_script_run_time";
public static final String DOM_MAX_CHROME_SCRIPT_RUN_TIME = "dom.max_chrome_script_run_time";
public static final String DOM_DISABLE_BEFOREUNLOAD = "dom.disable_beforeunload";
public static final int PAGE_LOAD_TIMEOUT = 30;
public static final int IMPLICIT_WAIT_TIMEOUT = 1;

Expand Down Expand Up @@ -180,7 +179,7 @@ private FirefoxOptions buildFirefoxOptions(TestName testName) throws IOException
// Config screen with many plugins can cause FF to complain JS takes too long to complete - set longer timeout
firefoxOptions.addPreference(DOM_MAX_SCRIPT_RUN_TIME, (int)getElasticTime().seconds(600));
firefoxOptions.addPreference(DOM_MAX_CHROME_SCRIPT_RUN_TIME, (int)getElasticTime().seconds(600));
firefoxOptions.addPreference(DOM_DISABLE_BEFOREUNLOAD, false);
firefoxOptions.enableBiDi();
if (HarRecorder.isCaptureHarEnabled()) {
firefoxOptions.setProxy(createSeleniumProxy(testName.get()));
}
Expand Down
6 changes: 4 additions & 2 deletions src/main/resources/ath-container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,18 @@ RUN apt-get update \
&& rm -rf /var/lib/apt/lists/*

# Install a fixed firefox version that is known to work with the current selenium version, copied from https://support.mozilla.org/en-US/kb/install-firefox-linux
ARG FIREFOX_VERSION=123.0.1
ARG FIREFOX_VERSION=129.0
RUN install -m 0755 -d /etc/apt/keyrings \
&& curl -fsSL https://packages.mozilla.org/apt/repo-signing-key.gpg -o /etc/apt/keyrings/packages.mozilla.org.asc \
&& printf 'deb [signed-by=/etc/apt/keyrings/packages.mozilla.org.asc] https://packages.mozilla.org/apt mozilla main\n' > /etc/apt/sources.list.d/mozilla.list \
&& printf 'Package: *\nPin: origin packages.mozilla.org\nPin-Priority: 1000\n' > /etc/apt/preferences.d/mozilla \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install --no-install-recommends -y \
firefox="${FIREFOX_VERSION}*" \
firefox-nightly="${FIREFOX_VERSION}*" \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# TODO https://bugzilla.mozilla.org/show_bug.cgi?id=1824220
ENV FIREFOX_BIN=/usr/bin/firefox-nightly

# Docker installation according to https://docs.docker.com/engine/install/ubuntu/
ARG DOCKER_BUILDX_VERSION=0.16.1
Expand Down
3 changes: 2 additions & 1 deletion src/test/java/core/FormValidationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.jenkinsci.test.acceptance.po.JenkinsConfig;
import org.jenkinsci.test.acceptance.po.ListView;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;

public class FormValidationTest extends AbstractJUnitTest {
Expand Down Expand Up @@ -72,7 +73,7 @@ private void jsValidation() {
}

private void navigateAway() {
jenkins.runThenConfirmAlert(() -> jenkins.open());
jenkins.runThenConfirmAlert(() -> driver.findElement(By.xpath("//ol[@id=\"breadcrumbs\"]/li[1]/a")).click());
sleep(1000); // Needed for some reason
}
}

0 comments on commit 40ccbb7

Please sign in to comment.