From 826bd3b6ebe5b423b69d61c2d7945712ae2ccb61 Mon Sep 17 00:00:00 2001 From: Dominika Zemanovicova Date: Tue, 24 Mar 2026 16:48:07 +0100 Subject: [PATCH] Update BASE_URL to RHDH_BASE_URL Signed-off-by: Dominika Zemanovicova --- docs/changelog.md | 8 +++++++- package.json | 2 +- src/playwright/helpers/api-helper.ts | 12 ++++++------ src/playwright/helpers/common.ts | 2 +- src/playwright/pages/catalog.ts | 6 ++++-- 5 files changed, 19 insertions(+), 11 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index 9499339..ebd947c 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -2,7 +2,13 @@ All notable changes to this project will be documented in this file. -## [1.1.18] - Current +## [1.1.19] - Current + +### Fixed + +- Updated occurrences of `BASE_URL` to `RHDH_BASE_URL` + +## [1.1.18] ### Added diff --git a/package.json b/package.json index 42dda34..46a9e23 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@red-hat-developer-hub/e2e-test-utils", - "version": "1.1.18", + "version": "1.1.19", "description": "Test utilities for RHDH E2E tests", "license": "Apache-2.0", "repository": { diff --git a/src/playwright/helpers/api-helper.ts b/src/playwright/helpers/api-helper.ts index e2ee3a8..66dba80 100644 --- a/src/playwright/helpers/api-helper.ts +++ b/src/playwright/helpers/api-helper.ts @@ -339,7 +339,7 @@ export class APIHelper { * @returns The UID string if found, otherwise undefined. */ static async getEntityUidByName(name: string): Promise { - const baseUrl = process.env.BASE_URL; + const baseUrl = process.env.RHDH_BASE_URL; const url = `${baseUrl}/api/catalog/entities/by-name/template/default/${name}`; const context = await request.newContext(); const response = await context.get(url); @@ -357,7 +357,7 @@ export class APIHelper { * @returns The status code of the delete operation. */ static async deleteLocationByUid(uid: string): Promise { - const baseUrl = process.env.BASE_URL; + const baseUrl = process.env.RHDH_BASE_URL; const url = `${baseUrl}/api/catalog/locations/${uid}`; const context = await request.newContext(); const response = await context.delete(url); @@ -375,7 +375,7 @@ export class APIHelper { name: string, namespace: string = "default", ): Promise { - const baseUrl = process.env.BASE_URL; + const baseUrl = process.env.RHDH_BASE_URL; const url = `${baseUrl}/api/catalog/locations/by-entity/template/${namespace}/${name}`; const context = await request.newContext(); const response = await context.get(url); @@ -396,7 +396,7 @@ export class APIHelper { * @returns The status code of the delete operation. */ static async deleteEntityLocationById(id: string): Promise { - const baseUrl = process.env.BASE_URL; + const baseUrl = process.env.RHDH_BASE_URL; const url = `${baseUrl}/api/catalog/locations/${id}`; const context = await request.newContext(); const response = await context.delete(url); @@ -410,7 +410,7 @@ export class APIHelper { * @returns The status code of the registration operation. */ static async registerLocation(target: string): Promise { - const baseUrl = process.env.BASE_URL; + const baseUrl = process.env.RHDH_BASE_URL; const url = `${baseUrl}/api/catalog/locations`; const context = await request.newContext(); const response = await context.post(url, { @@ -434,7 +434,7 @@ export class APIHelper { static async getLocationIdByTarget( target: string, ): Promise { - const baseUrl = process.env.BASE_URL; + const baseUrl = process.env.RHDH_BASE_URL; const url = `${baseUrl}/api/catalog/locations`; const context = await request.newContext(); const response = await context.get(url); diff --git a/src/playwright/helpers/common.ts b/src/playwright/helpers/common.ts index 292cce7..4706627 100644 --- a/src/playwright/helpers/common.ts +++ b/src/playwright/helpers/common.ts @@ -360,7 +360,7 @@ export class LoginHelper { await popup.waitForLoadState("domcontentloaded"); - if (popup.url().startsWith(process.env.BASE_URL as string)) { + if (popup.url().startsWith(process.env.RHDH_BASE_URL as string)) { // an active microsoft session is already logged in and the popup will automatically close return "Already logged in"; } else { diff --git a/src/playwright/pages/catalog.ts b/src/playwright/pages/catalog.ts index a130f97..63d9887 100644 --- a/src/playwright/pages/catalog.ts +++ b/src/playwright/pages/catalog.ts @@ -1,7 +1,7 @@ import type { Locator, Page } from "@playwright/test"; import { UIhelper } from "../helpers/ui-helper.js"; -//${BASE_URL}/catalog page +//${RHDH_BASE_URL}/catalog page export class CatalogPage { private page: Page; private uiHelper: UIhelper; @@ -36,7 +36,9 @@ export class CatalogPage { async search(s: string) { await this.searchField.clear(); const searchResponse = this.page.waitForResponse( - new RegExp(`${process.env.BASE_URL}/api/catalog/entities/by-query/*`), + new RegExp( + `${process.env.RHDH_BASE_URL}/api/catalog/entities/by-query/*`, + ), ); await this.searchField.fill(s); await searchResponse;