Skip to content
Open
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* Copyright Red Hat, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

export const AGGREGATED_CARDS_METRIC_IDS = {
jiraMetricId: 'jira.open_issues',
githubMetricId: 'github.open_prs',
githubOpenPrsKpi: 'openPrsKpi',
jiraOpenIssuesKpi: 'openIssuesKpi',
openPrsWeightedKpi: 'openPrsWeightedKpi',
} as const;

/** Must match `title` in App.tsx homepage widget config (Add widget picker). */
export const AGGREGATED_CARDS_WIDGET_TITLES = {
jiraMetricId: 'Scorecard: With deprecated metricId property (Jira)',
githubMetricId: 'Scorecard: With default aggregation config (GitHub)',
githubOpenPrsKpi: 'Scorecard: GitHub open PRs',
jiraOpenIssuesKpi: 'Scorecard: Jira open blocking tickets',
openPrsWeightedKpi: 'Scorecard: GitHub open PRs (weighted health)',
} as const;

export const AGGREGATED_CARDS_METADATA = {
deprecatedMetricId: {
id: AGGREGATED_CARDS_METRIC_IDS.jiraMetricId,
title: 'Scorecard: With deprecated metricId property (Jira)',
metricId: 'jira.open_issues',
},
defaultAggregation: {
id: AGGREGATED_CARDS_METRIC_IDS.githubMetricId,
title: 'Scorecard: With default aggregation config (GitHub)',
metricId: 'github.open_prs',
},
jiraOpenIssuesKpi: {
id: AGGREGATED_CARDS_METRIC_IDS.jiraOpenIssuesKpi,
title: 'Scorecard: Jira open blocking tickets',
metricId: 'jira.open_issues',
},
githubOpenPrsKpi: {
id: AGGREGATED_CARDS_METRIC_IDS.githubOpenPrsKpi,
title: 'Scorecard: GitHub open PRs',
metricId: 'github.open_prs',
},
openPrsWeightedKpi: {
id: AGGREGATED_CARDS_METRIC_IDS.openPrsWeightedKpi,
title: 'Scorecard: GitHub open PRs (weighted health)',
metricId: 'github.open_prs',
},
} as const;

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import { Locator, Page, expect } from '@playwright/test';
import { AGGREGATED_CARDS_WIDGET_TITLES } from '../constants/homepageWidgetTitles';
import { AGGREGATED_CARDS_WIDGET_TITLES } from '../constants/aggregations';
import {
ScorecardMessages,
getEntityCount,
Expand Down Expand Up @@ -63,9 +63,7 @@ export class HomePage {
cardPattern = /Scorecard:\s*GitHub open PRs|ScorecardGithubHomepage/i;
} else if (cardName === 'Scorecard: Jira open blocking') {
cardPattern = /Scorecard:\s*Jira open blocking|ScorecardJiraHomepage/i;
} else if (
cardName === AGGREGATED_CARDS_WIDGET_TITLES.withOpenPrsWeightedKpi
) {
} else if (cardName === AGGREGATED_CARDS_WIDGET_TITLES.openPrsWeightedKpi) {
cardPattern =
/Scorecard:\s*GitHub open PRs \(weighted health\)|ScorecardOpenPrsWeightedKpi/i;
} else {
Expand Down
Loading
Loading