From 18727e9b7911845f6820c14c360564a7ca85e905 Mon Sep 17 00:00:00 2001 From: Johannes Maron Date: Thu, 18 Dec 2025 01:34:32 +0100 Subject: [PATCH 1/3] Use selenium deb package in CI --- .github/workflows/ci.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1f17381a..36576eca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -95,13 +95,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - - name: Install Chrome - run: sudo apt-get install -y google-chrome-stable - name: Install Selenium run: | - mkdir bin - curl -O https://chromedriver.storage.googleapis.com/`curl -s https://chromedriver.storage.googleapis.com/LATEST_RELEASE`/chromedriver_linux64.zip - unzip chromedriver_linux64.zip -d bin + wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb + sudo dpkg -i google-chrome-stable_current_amd64.deb || sudo apt-get -f install -y - uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} From 9e1524d82528519d7b61636f15c891dc28e57167 Mon Sep 17 00:00:00 2001 From: Johannes Maron Date: Thu, 18 Dec 2025 10:46:42 +0100 Subject: [PATCH 2/3] Fix flaky test --- tests/test_forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_forms.py b/tests/test_forms.py index a2b87522..58eb400d 100644 --- a/tests/test_forms.py +++ b/tests/test_forms.py @@ -53,7 +53,7 @@ def test_lang_attr(self): # Regression test for #163 widget = Select2Widget() - assert widget.i18n_name == "en" + assert widget.i18n_name == translation.get_language() with translation.override("de"): assert widget.i18n_name == "de" From a4a531c4ff12f48ac70430ad46ecf06f537168df Mon Sep 17 00:00:00 2001 From: Johannes Maron Date: Thu, 18 Dec 2025 11:14:02 +0100 Subject: [PATCH 3/3] Fix flaky tests --- .github/workflows/ci.yml | 2 +- tests/conftest.py | 2 +- tests/test_forms.py | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 36576eca..f01a32ba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -97,7 +97,7 @@ jobs: - uses: actions/checkout@v6 - name: Install Selenium run: | - wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb + curl -LsSfO https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb sudo dpkg -i google-chrome-stable_current_amd64.deb || sudo apt-get -f install -y - uses: actions/setup-python@v6 with: diff --git a/tests/conftest.py b/tests/conftest.py index 60bbe399..dd6ca21a 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -28,7 +28,7 @@ def random_name(n): @pytest.fixture(scope="session") def driver(): chrome_options = webdriver.ChromeOptions() - chrome_options.headless = True + chrome_options.add_argument("--headless=new") try: b = webdriver.Chrome(options=chrome_options) except WebDriverException as e: diff --git a/tests/test_forms.py b/tests/test_forms.py index 58eb400d..081f1ff6 100644 --- a/tests/test_forms.py +++ b/tests/test_forms.py @@ -53,7 +53,8 @@ def test_lang_attr(self): # Regression test for #163 widget = Select2Widget() - assert widget.i18n_name == translation.get_language() + with translation.override("en"): + assert widget.i18n_name == "en" with translation.override("de"): assert widget.i18n_name == "de"