Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions e2e-tests/playwright/e2e/plugins/scorecard/scorecard.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ test.describe.serial("Scorecard Plugin Tests", () => {
importPage = new ComponentImportPage(page);
scorecardPage = new ScorecardPage(page);
await new Common(page).loginAsKeycloakUser();

// Import the component here instead of the first tests so that they can re-run.
// It would be great if this would detect if the component is already imported.
await catalog.go();
await importPage.startComponentImport();
await importPage.analyzeComponent(
"https://github.com/rhdh-pai-qe/backstage-catalog/blob/main/catalog-info.yaml",
);
await importPage.viewImportedComponent();
});

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

await catalog.go();
await importPage.startComponentImport();
await importPage.analyzeComponent(
"https://github.com/rhdh-pai-qe/backstage-catalog/blob/main/catalog-info.yaml",
);
await importPage.viewImportedComponent();
await catalog.goToByName("rhdh-app");
await scorecardPage.openTab();

await scorecardPage.verifyScorecardValues({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ export class ComponentImportPage {

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