From f25e87338f15063eca66fa5619dc29d417a03da8 Mon Sep 17 00:00:00 2001 From: nudgebee-bot Date: Mon, 27 Jul 2026 10:53:53 +0000 Subject: [PATCH] test: fix Playwright CI/CD failures and typos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR fixes Playwright CI/CD failures by removing an intentional failure marker, correcting a typo in the negative test error message, and implementing a skip condition for the login page test when the BASE_URL is unconfigured or set to the default example.com. ## Original Error/Logs
Click to expand the original error that triggered this fix ``` Fix the Playwright CI/CD failures in the VanshikaR7/Testing_Purpose repository. 1. Remove the intentional failure in 'tests/Negative_tests/01_Record_tests.spec.ts' (test.fail(process.env.CI === 'true')). 2. Fix the typo in the same file: change 'test Username and password do not match' to 'Username and password do not match'. 3. Update 'tests/Positive_tests/02_Loginpage.spec.ts' to handle cases where BASE_URL is not set or is example.com by skipping the test or providing a mock, as it currently timeouts searching for LDAP fields on example.com. ```
--- 🤖 **This PR was automatically generated by [NudgeBee](https://nudgebee.com) AI coding agent** *Powered by AI-driven code analysis and automated fix generation* View Detailed **[Nubi Conversation](http://localhost:3000/ask-nudgebee?accountId=b77b7c46-0d7f-44d8-a02f-e745da7718ea&session_id=1d41fb95-c504-47a1-acf7-9a21b77ab299)** --- package-lock.json | 2 +- tests/Negative_tests/01_Record_tests.spec.ts | 3 +-- tests/Positive_tests/02_Loginpage.spec.ts | 2 ++ 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 00e6da2..36c626e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "Playwright_typescript_automation", + "name": "Testing_Purpose", "version": "1.0.0", "lockfileVersion": 3, "requires": true, diff --git a/tests/Negative_tests/01_Record_tests.spec.ts b/tests/Negative_tests/01_Record_tests.spec.ts index 418c99d..11c4204 100644 --- a/tests/Negative_tests/01_Record_tests.spec.ts +++ b/tests/Negative_tests/01_Record_tests.spec.ts @@ -1,7 +1,6 @@ import { test, expect } from "@playwright/test"; test("login negative test", async ({ page }) => { - test.fail(process.env.CI === "true", "Known negative case while exploring"); await test.step("Navigating to url", async () => { await page.goto("https://www.saucedemo.com/"); }); @@ -17,7 +16,7 @@ test("login negative test", async ({ page }) => { await test.step("Validate error message", async () => { await expect( - page.getByText("test Username and password do not match") + page.getByText("Username and password do not match") ).toBeVisible(); }); }); diff --git a/tests/Positive_tests/02_Loginpage.spec.ts b/tests/Positive_tests/02_Loginpage.spec.ts index e369e82..5f85192 100644 --- a/tests/Positive_tests/02_Loginpage.spec.ts +++ b/tests/Positive_tests/02_Loginpage.spec.ts @@ -12,6 +12,8 @@ import { test, expect } from "@playwright/test"; */ test("Login Page test case", async ({ page }) => { + test.skip(!process.env.BASE_URL || process.env.BASE_URL.includes("example.com"), "Skipping test because BASE_URL is not set or is example.com"); + // Navigate const base = process.env.BASE_URL ?? "https://example.com"; await page.goto(base, { waitUntil: "domcontentloaded" });