This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch v3-3-test
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/v3-3-test by this push:
     new 5b073e4fbca [v3-3-test] Fix Firefox and WebKit UI e2e runs failing at 
login (#73872) (#73879)
5b073e4fbca is described below

commit 5b073e4fbcafe91d652010430f708e37425d41e7
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Tue Sep 29 10:35:12 2026 +0200

    [v3-3-test] Fix Firefox and WebKit UI e2e runs failing at login (#73872) 
(#73879)
    
    * Fix Firefox and WebKit UI e2e runs failing at login
    
    The e2e global setup always logged in with the first configured
    Playwright project (Chromium), even when a run was narrowed to Firefox or
    WebKit. Only the selected browser is installed for such runs, both by
    breeze and, since the UI dependency caching change, by the CI workflow, so
    the setup could not launch Chromium and every test failed on a missing
    auth state file.
    
    Generated-by: Claude Opus 5
    
    * Guard against a Playwright config without projects in e2e setup
    (cherry picked from commit 3f60fa9e2c7d918be2230e39b802600ed5ebe42e)
    
    
    Generated-by: Claude Opus 5
    
    Co-authored-by: Jarek Potiuk <[email protected]>
---
 airflow-core/src/airflow/ui/tests/e2e/global-setup.ts      | 14 +++++++++++---
 dev/breeze/src/airflow_breeze/commands/testing_commands.py |  2 ++
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/airflow-core/src/airflow/ui/tests/e2e/global-setup.ts 
b/airflow-core/src/airflow/ui/tests/e2e/global-setup.ts
index 77313e49102..c8cd9d00b05 100644
--- a/airflow-core/src/airflow/ui/tests/e2e/global-setup.ts
+++ b/airflow-core/src/airflow/ui/tests/e2e/global-setup.ts
@@ -30,10 +30,18 @@ const browsers = { chromium, firefox, webkit };
  * Authenticate once before all tests and save state for reuse
  */
 async function globalSetup(config: FullConfig) {
-  const [firstProject] = config.projects as [FullConfig["projects"][number]];
-  const baseURL = firstProject.use.baseURL ?? testConfig.connection.baseUrl;
+  // `config.projects` lists every project even when `--project` narrows the 
run, and only the
+  // selected browser may be installed, so log in with the browser named in 
TEST_BROWSER.
+  const setupProject =
+    config.projects.find((project) => project.name === 
process.env.TEST_BROWSER) ?? config.projects[0];
+
+  if (setupProject === undefined) {
+    throw new Error("No Playwright projects are configured");
+  }
+
+  const baseURL = setupProject.use.baseURL ?? testConfig.connection.baseUrl;
   const { password, username } = testConfig.credentials;
-  const browserName = firstProject.name as keyof typeof browsers;
+  const browserName = setupProject.name as keyof typeof browsers;
   const browserType = browsers[browserName];
 
   const authDir = path.dirname(AUTH_FILE);
diff --git a/dev/breeze/src/airflow_breeze/commands/testing_commands.py 
b/dev/breeze/src/airflow_breeze/commands/testing_commands.py
index 60bbb727578..1d239403ab8 100644
--- a/dev/breeze/src/airflow_breeze/commands/testing_commands.py
+++ b/dev/breeze/src/airflow_breeze/commands/testing_commands.py
@@ -1623,6 +1623,8 @@ def ui_e2e_tests(
             "TEST_PASSWORD": test_admin_password,
             "TEST_DAG_ID": "example_bash_operator",
         }
+        if browser != "all":
+            env_vars["TEST_BROWSER"] = browser
 
         if force_reinstall_deps:
             clean_cmd = ["pnpm", "install", "--force"]

Reply via email to