Skip to content

Commit e1e9d4b

Browse files
chore: re-re-enable scorecard e2e tests (#3928)
Signed-off-by: Christoph Jerolimov <[email protected]>
1 parent 0537699 commit e1e9d4b

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

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

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import {
2727
INVALID_THRESHOLD_RESPONSE,
2828
} from "../../../utils/scorecard-response-utils";
2929

30-
test.describe.skip("Scorecard Plugin Tests", () => {
30+
test.describe.serial("Scorecard Plugin Tests", () => {
3131
let context;
3232
let page;
3333
let catalog: Catalog;
@@ -46,6 +46,15 @@ test.describe.skip("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.skip("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)