Skip to content

Commit

Permalink
chore(e2e): reenable scaffolder-backend-module-http-request test (#1973)
Browse files Browse the repository at this point in the history
* chore(e2e): reenable scaffolder-backend-module-http-request test

* chore(e2e): remove waitForHeaderTitle as it is a duplicate of verifyHeading

* chore(e2e): add quay proxy to app-config
  • Loading branch information
PatAKnight authored Nov 22, 2024
1 parent 78d85d4 commit f4cbd9f
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 37 deletions.
6 changes: 6 additions & 0 deletions .ibm/pipelines/resources/config_map/app-config-rhdh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ proxy:
Authorization: '${ACR_SECRET}'
# Change to "false" in case of using self hosted artifactory instance with a self-signed certificate
secure: false
'/quay/api':
target: https://quay.io/
headers:
X-Requested-With: 'XMLHttpRequest'
changeOrigin: true
secure: true
catalog:
import:
entityFilename: catalog-info.yaml
Expand Down
62 changes: 29 additions & 33 deletions e2e-tests/playwright/e2e/plugins/http-request.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,35 @@ import { CatalogImport } from "../../support/pages/CatalogImport";
// Pre-req: Enable roadiehq-scaffolder-backend-module-http-request-dynamic plugin
// Pre-req: Enable janus-idp-backstage-plugin-quay plugin
//TODO Re-enable when roadiehq-scaffolder-backend-module-http-request-dynamic is included in the Helm image
test.describe.skip(
"Testing scaffolder-backend-module-http-request to invoke an external request",
() => {
let uiHelper: UIhelper;
let common: Common;
let catalogImport: CatalogImport;
const template =
"https://github.com/janus-qe/software-template/blob/main/test-http-request.yaml";
test.describe("Testing scaffolder-backend-module-http-request to invoke an external request", () => {
let uiHelper: UIhelper;
let common: Common;
let catalogImport: CatalogImport;
const template =
"https://github.com/janus-qe/software-template/blob/main/test-http-request.yaml";

test.beforeEach(async ({ page }) => {
uiHelper = new UIhelper(page);
common = new Common(page);
await common.loginAsGuest();
catalogImport = new CatalogImport(page);
});
test.beforeEach(async ({ page }) => {
uiHelper = new UIhelper(page);
common = new Common(page);
await common.loginAsGuest();
catalogImport = new CatalogImport(page);
});

test("Create a software template using http-request plugin", async () => {
await uiHelper.openSidebar("Create...");
await uiHelper.verifyHeading("Templates");
await uiHelper.waitForHeaderTitle();
await uiHelper.clickButton("Register Existing Component");
await catalogImport.registerExistingComponent(template);
test("Create a software template using http-request plugin", async () => {
await uiHelper.openSidebar("Create...");
await uiHelper.verifyHeading("Templates");
await uiHelper.clickButton("Register Existing Component");
await catalogImport.registerExistingComponent(template);

await uiHelper.openSidebar("Catalog");
await uiHelper.selectMuiBox("Kind", "Template");
await uiHelper.searchInputPlaceholder("Test");
await uiHelper.clickLink("Test HTTP Request");
await uiHelper.verifyHeading("Test HTTP Request");
await uiHelper.clickLink("Launch Template");
await uiHelper.verifyHeading("Software Templates");
await uiHelper.clickButton("Create");
//Checking for Http Status 200
await uiHelper.verifyText("200", false);
});
},
);
await uiHelper.openSidebar("Catalog");
await uiHelper.selectMuiBox("Kind", "Template");
await uiHelper.searchInputPlaceholder("Test");
await uiHelper.clickLink("Test HTTP Request");
await uiHelper.verifyHeading("Test HTTP Request");
await uiHelper.clickLink("Launch Template");
await uiHelper.verifyHeading("Software Templates");
await uiHelper.clickButton("Create");
//Checking for Http Status 200
await uiHelper.verifyText("200", false);
});
});
4 changes: 0 additions & 4 deletions e2e-tests/playwright/utils/UIhelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ export class UIhelper {
await this.page.keyboard.press("Tab");
}

async waitForHeaderTitle() {
await this.page.waitForSelector('h2[data-testid="header-title"]');
}

async clickButton(
label: string | RegExp,
options: { exact?: boolean; force?: boolean } = {
Expand Down

0 comments on commit f4cbd9f

Please sign in to comment.