Skip to content

Latest commit

 

History

History
85 lines (63 loc) · 1.5 KB

File metadata and controls

85 lines (63 loc) · 1.5 KB

CatalogApiHelper API

Static helper for RHDH catalog entity lookups via the REST API.

Import

import { CatalogApiHelper } from "@red-hat-developer-hub/e2e-test-utils/helpers";

Methods

entityExists()

static async entityExists(
  baseUrl: string,
  token: string,
  kind: string,
  name: string,
  namespace?: string,
): Promise<boolean>

Returns true if the entity exists. Returns false on HTTP 404. Rethrows other HTTP errors.

getEntity()

static async getEntity(
  baseUrl: string,
  token: string,
  kind: string,
  name: string,
  namespace?: string,
): Promise<unknown>

Fetches GET /api/catalog/entities/by-name/{kind}/{namespace}/{name}.

getEntityDescription()

static async getEntityDescription(
  baseUrl: string,
  token: string,
  kind: string,
  name: string,
  namespace?: string,
): Promise<string | undefined>

Returns metadata.description from the entity JSON.

getGroupEntity()

static async getGroupEntity(
  baseUrl: string,
  token: string,
  groupName: string,
): Promise<unknown>

getGroupMembers()

static async getGroupMembers(
  baseUrl: string,
  token: string,
  groupName: string,
): Promise<string[]>

dispose()

static async dispose(): Promise<void>

Disposes the internal Playwright APIRequestContext.

Related Pages