Skip to content

Commit 1a4cf84

Browse files
install fonts
1 parent d8e71bf commit 1a4cf84

187 files changed

Lines changed: 95 additions & 240 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/demos_visual_tests.yml

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -557,13 +557,25 @@ jobs:
557557
python -m http.server 8082 &
558558
python -m http.server 8083 &
559559
560+
- name: Set Chrome flags
561+
id: chrome-flags
562+
run: |
563+
BASE_FLAGS="chrome:headless --window-size=1200,800 --disable-gpu --no-sandbox --disable-dev-shm-usage --disable-partial-raster --disable-skia-runtime-opts --run-all-compositor-stages-before-draw --disable-new-content-rendering-timeout --disable-threaded-animation --disable-threaded-scrolling --disable-checker-imaging --disable-image-animation-resync --use-gl=\"swiftshader\" --disable-features=PaintHolding --js-flags=--random-seed=2147483647"
564+
565+
# For Material theme, enable better font rendering to avoid instability
566+
if [[ "${{ matrix.THEME }}" != *"material"* ]]; then
567+
BASE_FLAGS="$BASE_FLAGS --font-render-hinting=none --disable-font-subpixel-positioning"
568+
fi
569+
570+
echo "flags=$BASE_FLAGS" >> $GITHUB_OUTPUT
571+
560572
- name: Run TestCafe tests
561573
shell: bash
562574
working-directory: apps/demos
563575
env:
564576
STRATEGY: ${{ matrix.STRATEGY }}
565577
CHANGEDFILEINFOSPATH: changed-files.json
566-
BROWSERS: chrome:headless --disable-gpu --no-sandbox --disable-dev-shm-usage --disable-partial-raster --disable-skia-runtime-opts --run-all-compositor-stages-before-draw --disable-new-content-rendering-timeout --disable-threaded-animation --disable-threaded-scrolling --disable-checker-imaging --disable-image-animation-resync --use-gl="swiftshader" --disable-features=PaintHolding --js-flags=--random-seed=2147483647 --font-render-hinting=none --disable-font-subpixel-positioning
578+
BROWSERS: ${{ steps.chrome-flags.outputs.flags }}
567579
#DEBUG: hammerhead:*,testcafe:*
568580
CONCURRENCY: 4
569581
TCQUARANTINE: true
@@ -685,11 +697,23 @@ jobs:
685697
python -m http.server 8082 &
686698
python -m http.server 8083 &
687699
700+
- name: Set Chrome flags
701+
id: chrome-flags
702+
run: |
703+
BASE_FLAGS="chrome:headless --window-size=1200,800 --disable-gpu --no-sandbox --disable-dev-shm-usage --disable-partial-raster --disable-skia-runtime-opts --run-all-compositor-stages-before-draw --disable-new-content-rendering-timeout --disable-threaded-animation --disable-threaded-scrolling --disable-checker-imaging --disable-image-animation-resync --use-gl=\"swiftshader\" --disable-features=PaintHolding --js-flags=--random-seed=2147483647"
704+
705+
# For Material theme, enable better font rendering to avoid instability
706+
if [[ "${{ matrix.THEME }}" != *"material"* ]]; then
707+
BASE_FLAGS="$BASE_FLAGS --font-render-hinting=none --disable-font-subpixel-positioning"
708+
fi
709+
710+
echo "flags=$BASE_FLAGS" >> $GITHUB_OUTPUT
711+
688712
- name: Run TestCafe tests
689713
shell: bash
690714
working-directory: apps/demos
691715
env:
692-
BROWSERS: chrome:headless --window-size=1200,800 --disable-gpu --no-sandbox --disable-dev-shm-usage --disable-partial-raster --disable-skia-runtime-opts --run-all-compositor-stages-before-draw --disable-new-content-rendering-timeout --disable-threaded-animation --disable-threaded-scrolling --disable-checker-imaging --disable-image-animation-resync --use-gl="swiftshader" --disable-features=PaintHolding --js-flags=--random-seed=2147483647 --font-render-hinting=none --disable-font-subpixel-positioning
716+
BROWSERS: ${{ steps.chrome-flags.outputs.flags }}
693717
# DEBUG: hammerhead:*,testcafe:*
694718
CONCURRENCY: 4
695719
TCQUARANTINE: true
@@ -809,12 +833,24 @@ jobs:
809833
python -m http.server 8082 &
810834
python -m http.server 8083 &
811835
836+
- name: Set Chrome flags
837+
id: chrome-flags
838+
run: |
839+
BASE_FLAGS="chrome:headless --window-size=1200,800 --disable-gpu --no-sandbox --disable-dev-shm-usage --disable-partial-raster --disable-skia-runtime-opts --run-all-compositor-stages-before-draw --disable-new-content-rendering-timeout --disable-threaded-animation --disable-threaded-scrolling --disable-checker-imaging --disable-image-animation-resync --use-gl=\"swiftshader\" --disable-features=PaintHolding --js-flags=--random-seed=2147483647"
840+
841+
# For Material theme, enable better font rendering to avoid instability
842+
if [[ "${{ matrix.THEME }}" != *"material"* ]]; then
843+
BASE_FLAGS="$BASE_FLAGS --font-render-hinting=none --disable-font-subpixel-positioning"
844+
fi
845+
846+
echo "flags=$BASE_FLAGS" >> $GITHUB_OUTPUT
847+
812848
- name: Run TestCafe tests
813849
shell: bash
814850
working-directory: apps/demos
815851
env:
816852
CHANGEDFILEINFOSPATH: changed-files.json
817-
BROWSERS: chrome:headless --window-size=1200,800 --disable-gpu --no-sandbox --disable-dev-shm-usage --disable-partial-raster --disable-skia-runtime-opts --run-all-compositor-stages-before-draw --disable-new-content-rendering-timeout --disable-threaded-animation --disable-threaded-scrolling --disable-checker-imaging --disable-image-animation-resync --use-gl="swiftshader" --disable-features=PaintHolding --js-flags=--random-seed=2147483647 --font-render-hinting=none --disable-font-subpixel-positioning
853+
BROWSERS: ${{ steps.chrome-flags.outputs.flags }}
818854
# DEBUG: hammerhead:*,testcafe:*
819855
CONCURRENCY: 1
820856
TCQUARANTINE: true

apps/demos/testing/common.test.ts

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { glob } from 'glob';
22
import { join } from 'path';
33
import { existsSync } from 'fs';
4-
import { compareScreenshot } from 'devextreme-screenshot-comparer';
4+
import { createScreenshotsComparer } from 'devextreme-screenshot-comparer';
55
import { axeCheck, createReport } from '@testcafe-community/axe';
66
import {
77
getPortByIndex,
@@ -180,23 +180,25 @@ Object.values(FRAMEWORKS).forEach((approach) => {
180180
} else {
181181
const testTheme = process.env.THEME;
182182

183-
let comparisonResult;
183+
const consoleMessages = await t.getBrowserConsoleMessages();
184+
const errors = [...consoleMessages.error, ...consoleMessages.warn]
185+
.filter((e) => !knownWarnings.some((kw) => e.startsWith(kw)));
186+
await t.expect(errors).eql([]);
187+
188+
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
189+
184190
if (isGitHubDemos) {
185-
comparisonResult = await compareScreenshot(t, `${testName}${getThemePostfix(testTheme)}.png`, undefined, comparisonOptions && {
191+
await takeScreenshot(`${testName}${getThemePostfix(testTheme)}.png`, undefined, comparisonOptions && {
186192
...comparisonOptions,
187193
looksSameComparisonOptions: { antialiasingTolerance: 10 },
188194
});
189195
} else {
190-
comparisonResult = await compareScreenshot(t, `${testName}${getThemePostfix(testTheme)}.png`, undefined, comparisonOptions);
196+
await takeScreenshot(`${testName}${getThemePostfix(testTheme)}.png`, undefined, comparisonOptions);
191197
}
192198

193-
const consoleMessages = await t.getBrowserConsoleMessages();
194-
195-
const errors = [...consoleMessages.error, ...consoleMessages.warn]
196-
.filter((e) => !knownWarnings.some((kw) => e.startsWith(kw)));
197-
198-
await t.expect(errors).eql([]);
199-
await t.expect(comparisonResult).ok('INVALID_SCREENSHOT');
199+
await t
200+
.expect(compareResults.isValid())
201+
.ok(compareResults.errorMessages());
200202
}
201203
});
202204
});
-701 Bytes
-951 Bytes
-668 Bytes
-1.16 KB
-948 Bytes
-109 Bytes
20 Bytes
2 Bytes

0 commit comments

Comments
 (0)