-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(score-card): Read scoring json from annotation config (#201)
Alternative way to dynamically set location of JSON file through the annotations field of catalog-info.yaml. To achieve this, configuration of scorecard/jsonDataUrl in app-config.yaml is optional but github.com/project-slug and scorecard/jsonDataUrl annotations are required within the catalog-info.yaml file. --------- Co-authored-by: Scott Guymer <[email protected]>
- Loading branch information
1 parent
772af92
commit 35c2578
Showing
22 changed files
with
1,706 additions
and
225 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@oriflame/backstage-plugin-score-card': minor | ||
--- | ||
|
||
Alternative way to dynamically set location of JSON file through the annotations field of catalog-info.yaml. To achieve this, configuration of scorecard/jsonDataUrl alongside github.com/project-slug annotations is required within the catalog-info.yaml file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"jest.jestCommandLine": "node_modules/.bin/jest --config node_modules/@backstage/cli/config/jest.js", | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
* Copyright 2022 Oriflame (Based on https://github.com/RoadieHQ/roadie-backstage-plugins source copyrighted by Larder Software Limited) | ||
* | ||
* 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. | ||
*/ | ||
import { test, expect } from '@playwright/test'; | ||
import { failOnBrowserErrors } from '@backstage/e2e-test-utils/playwright'; | ||
|
||
failOnBrowserErrors(); | ||
|
||
test('Entity Score board: displays the score board based on sample data', async ({ | ||
page, | ||
}) => { | ||
page.on('load', p => { | ||
p.evaluate(() => | ||
window.localStorage.setItem( | ||
'@backstage/core:SignInPage:provider', | ||
'guest', | ||
), | ||
); | ||
}); | ||
|
||
await page.goto( | ||
'/catalog/default/component/sample-service-entity-source/score', | ||
); | ||
|
||
await expect(page.getByText('Scoring')).toBeVisible(); | ||
await expect(page.getByText('Total score: Yellow')).toBeVisible(); | ||
|
||
await expect( | ||
page.getByRole('cell', { name: 'Area: Code Green' }), | ||
).toBeVisible(); | ||
await expect( | ||
page.getByRole('cell', { name: 'Area: Documentation Red' }), | ||
).toBeVisible(); | ||
await expect( | ||
page.getByRole('cell', { name: 'Area: Operations Yellow' }), | ||
).toBeVisible(); | ||
await expect( | ||
page.getByRole('cell', { name: 'Area: Quality Red' }), | ||
).toBeVisible(); | ||
|
||
await page | ||
.getByRole('cell', { name: 'Area: Code Green' }) | ||
.getByRole('button') | ||
.click(); | ||
await expect(page.getByText('hints: Gitflow: 100%')).toBeVisible(); | ||
|
||
const gitflowLinkHref = await page | ||
.getByRole('link', { name: 'GitFlow' }) | ||
.getAttribute('href'); | ||
|
||
expect(gitflowLinkHref).toEqual('https://link-to-wiki/2157'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.