diff --git a/.github/workflows/continuous-integration-secure.yml b/.github/workflows/continuous-integration-secure.yml index 6a2aab05d6..4b96c5d59f 100644 --- a/.github/workflows/continuous-integration-secure.yml +++ b/.github/workflows/continuous-integration-secure.yml @@ -126,8 +126,10 @@ jobs: path: dist/screenshots/ run-id: ${{ github.event.workflow_run.id }} github-token: ${{ secrets.GH_ACTIONS_ARTIFACT_DOWNLOAD }} + + # TODO: Remove once meta file workflow has elaborated - name: Remove .keep file - run: rm dist/screenshots/.keep + run: rm dist/screenshots/.keep || true - name: Build visual-regression-app run: yarn build:visual-regression-app @@ -155,7 +157,7 @@ jobs: }); // If we have no screenshots, we do not need to create a check. - if (!readdirSync('dist/screenshots').length) { + if (readdirSync('dist/screenshots').length <= 1) { await createCheck(true); return 'empty'; } diff --git a/src/visual-regression-app/src/components/overview/overview.scss b/src/visual-regression-app/src/components/overview/overview.scss index 95240e4819..5ba7ad6ac5 100644 --- a/src/visual-regression-app/src/components/overview/overview.scss +++ b/src/visual-regression-app/src/components/overview/overview.scss @@ -7,3 +7,9 @@ gap: 1rem; flex-direction: column; } + +.app-compare-link { + @include sbb.mq($from: medium) { + margin-inline-start: auto; + } +} diff --git a/src/visual-regression-app/src/components/overview/overview.ts b/src/visual-regression-app/src/components/overview/overview.ts index 051dadb13f..0daa5bfbf2 100644 --- a/src/visual-regression-app/src/components/overview/overview.ts +++ b/src/visual-regression-app/src/components/overview/overview.ts @@ -1,12 +1,15 @@ import { LitElement, html, type TemplateResult, type CSSResultGroup, nothing } from 'lit'; import { customElement } from 'lit/decorators.js'; +// eslint-disable-next-line import-x/no-unresolved +import { meta } from 'virtual:meta'; import { screenshots } from '../../screenshots.js'; import style from './overview.scss?lit&inline'; import '@sbb-esta/lyne-elements/accordion.js'; -import '@sbb-esta/lyne-elements/button/secondary-button-link.js'; +import '@sbb-esta/lyne-elements/action-group.js'; +import '@sbb-esta/lyne-elements/button/button-link.js'; import '@sbb-esta/lyne-elements/card.js'; import '@sbb-esta/lyne-elements/container.js'; import '@sbb-esta/lyne-elements/expansion-panel.js'; @@ -28,14 +31,44 @@ export class Overview extends LitElement { Lyne visual regression comparison${screenshots.baselineOnly ? ' baseline' : nothing}
+ ${screenshots.stats} - ${screenshots.stats} - - ${!screenshots.baselineOnly ? `Start comparing` : `Check baselines`} - + ${meta.baselineGitSha + ? html`Baseline Commit + ${meta.baselineGitSha === 'N/A' + ? meta.baselineGitSha + : `#${meta.baselineGitSha.substring(0, 7)}`}` + : nothing} + ${meta.gitSha + ? html`Compare Commit + ${meta.gitSha === 'local' + ? meta.gitSha + : `#${meta.gitSha.substring(0, 7)}`}` + : nothing} + + ${!screenshots.baselineOnly ? `Start comparing` : `Check baselines`} + + ${screenshots.components.map( diff --git a/src/visual-regression-app/src/components/test-case/image-diff/fullscreen-diff/fullscreen-diff.ts b/src/visual-regression-app/src/components/test-case/image-diff/fullscreen-diff/fullscreen-diff.ts index 966a8d6e26..06a2d1152e 100644 --- a/src/visual-regression-app/src/components/test-case/image-diff/fullscreen-diff/fullscreen-diff.ts +++ b/src/visual-regression-app/src/components/test-case/image-diff/fullscreen-diff/fullscreen-diff.ts @@ -1,5 +1,7 @@ import { LitElement, html, type TemplateResult, type CSSResultGroup, nothing } from 'lit'; import { customElement, property } from 'lit/decorators.js'; +// eslint-disable-next-line import-x/no-unresolved +import { meta } from 'virtual:meta'; import type { ScreenshotFiles } from '../../../../interfaces.js'; @@ -47,7 +49,11 @@ export class FullscreenDiff extends LitElement { : nothing}
- +
`; } } diff --git a/src/visual-regression-app/src/components/test-case/image-diff/image-diff.ts b/src/visual-regression-app/src/components/test-case/image-diff/image-diff.ts index ae8d9b7389..1e3ea8c4c1 100644 --- a/src/visual-regression-app/src/components/test-case/image-diff/image-diff.ts +++ b/src/visual-regression-app/src/components/test-case/image-diff/image-diff.ts @@ -1,5 +1,7 @@ import { LitElement, html, type TemplateResult, type CSSResultGroup, nothing } from 'lit'; import { customElement, property, state } from 'lit/decorators.js'; +// eslint-disable-next-line import-x/no-unresolved +import { meta } from 'virtual:meta'; import type { ScreenshotFiles } from '../../../interfaces.js'; @@ -104,7 +106,7 @@ export class ImageDiff extends LitElement { > @@ -120,7 +122,11 @@ export class ImageDiff extends LitElement { class="app-image-button" ?hidden=${!this._showDiff || this.screenshotFiles.isNew} > - +