Skip to content

Commit 7b38043

Browse files
openshift-cherrypick-robotchristoph-jerolimovkim-tsao
authored
chore: re-re-enable scorecard e2e tests (#4224)
Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com> Co-authored-by: Christoph Jerolimov <jerolimov+git@redhat.com> Co-authored-by: Kim Tsao <84398375+kim-tsao@users.noreply.github.com>
1 parent f9af97b commit 7b38043

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

e2e-tests/playwright/e2e/plugins/scorecard/scorecard.spec.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,15 @@ test.describe.serial("Scorecard Plugin Tests", () => {
4646
importPage = new ComponentImportPage(page);
4747
scorecardPage = new ScorecardPage(page);
4848
await new Common(page).loginAsKeycloakUser();
49+
50+
// Import the component here instead of the first tests so that they can re-run.
51+
// It would be great if this would detect if the component is already imported.
52+
await catalog.go();
53+
await importPage.startComponentImport();
54+
await importPage.analyzeComponent(
55+
"https://github.com/rhdh-pai-qe/backstage-catalog/blob/main/catalog-info.yaml",
56+
);
57+
await importPage.viewImportedComponent();
4958
});
5059

5160
test.afterAll(async () => {
@@ -56,11 +65,7 @@ test.describe.serial("Scorecard Plugin Tests", () => {
5665
await mockScorecardResponse(page, CUSTOM_SCORECARD_RESPONSE);
5766

5867
await catalog.go();
59-
await importPage.startComponentImport();
60-
await importPage.analyzeComponent(
61-
"https://github.com/rhdh-pai-qe/backstage-catalog/blob/main/catalog-info.yaml",
62-
);
63-
await importPage.viewImportedComponent();
68+
await catalog.goToByName("rhdh-app");
6469
await scorecardPage.openTab();
6570

6671
await scorecardPage.verifyScorecardValues({

e2e-tests/playwright/support/page-objects/scorecard/component-import-page.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ export class ComponentImportPage {
4040

4141
async viewImportedComponent() {
4242
await this.uiHelper.clickButton("View Component");
43-
await this.uiHelper.verifyText("Overview");
43+
// After a component is imported, wait for the Overview tab to be visible
44+
// This could take sometime more time depending on the environment performance.
45+
// We saw API calls taking round about 10 seconds in some cases on our CI.
46+
const tabLocator = this.page.getByRole("tab", { name: "Overview" });
47+
await tabLocator.waitFor({ state: "visible", timeout: 20000 });
4448
}
4549
}

0 commit comments

Comments
 (0)