vatsrahul1001 commented on code in PR #59744:
URL: https://github.com/apache/airflow/pull/59744#discussion_r2664694797


##########
airflow-core/src/airflow/ui/tests/e2e/specs/dags-list.spec.ts:
##########
@@ -75,7 +75,7 @@ test.describe("Dag Details Tab", () => {
   let dagsPage: DagsPage;
 
   const testDagId = testConfig.testDag.id;
-
+ 

Review Comment:
   Unrelated whitespace change here



##########
airflow-core/src/airflow/ui/tests/e2e/pages/DagsPage.ts:
##########
@@ -100,6 +100,27 @@ export class DagsPage extends BasePage {
     await this.navigateTo(DagsPage.getDagDetailUrl(dagName));
   }
 
+  /**
+ * Open the Code tab on a DAG detail page
+ */
+  public async openCodeTab(): Promise<void> {
+    const codeTab = this.page
+      .getByRole("tab", { name: "Code" });
+
+    await codeTab.waitFor({ state: "visible", timeout: 10_000 });
+    await codeTab.click();
+  }
+
+  /**
+   * Get the DAG code text displayed in the Code tab
+   */
+  public async getDagCodeText(): Promise<string | null> {
+    const codeBlock = this.page.locator("pre").first();

Review Comment:
   This looks fragile. Check if the Code tab component has a data-testid. If 
not, consider adding one to the UI.



##########
airflow-core/src/airflow/ui/tests/e2e/specs/dag-code-tab.spec.ts:
##########
@@ -0,0 +1,40 @@
+/*!
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+  import { test, expect } from "@playwright/test";
+  import { DagsPage } from "tests/e2e/pages/DagsPage";
+
+  test.describe("Dag Code Tab", () => {
+    let dagsPage: DagsPage;
+    const testDagId = "example_simplest_dag";

Review Comment:
   Get example dag from config instead
   
   ```
   import { testConfig } from "playwright.config";
   const testDagId = testConfig.testDag.id;
   ```



##########
airflow-core/src/airflow/ui/tests/e2e/pages/DagsPage.ts:
##########
@@ -100,6 +100,27 @@ export class DagsPage extends BasePage {
     await this.navigateTo(DagsPage.getDagDetailUrl(dagName));
   }
 
+  /**
+ * Open the Code tab on a DAG detail page
+ */
+  public async openCodeTab(): Promise<void> {

Review Comment:
   You can do url navigation which can be more reliable 
   
   ```
   public async openCodeTab(dagId: string): Promise<void> {
     await this.page.goto(`/dags/${dagId}/code`);
     await this.page.waitForLoadState("networkidle");
   }
   ```



##########
airflow-core/src/airflow/ui/tests/e2e/specs/dag-code-tab.spec.ts:
##########
@@ -0,0 +1,40 @@
+/*!
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+  import { test, expect } from "@playwright/test";
+  import { DagsPage } from "tests/e2e/pages/DagsPage";
+
+  test.describe("Dag Code Tab", () => {
+    let dagsPage: DagsPage;
+    const testDagId = "example_simplest_dag";
+
+    test.beforeEach(async ({ page }) => {
+      dagsPage = new DagsPage(page);
+    });
+
+    test("should display Dag code", async () => {

Review Comment:
   Rename to `verify Dag code displays`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to