Skip to content

Commit e596b5b

Browse files
install fonts
1 parent d8e71bf commit e596b5b

188 files changed

Lines changed: 103 additions & 262 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/actions/run-qunit-tests/action.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ runs:
101101
env:
102102
CONSTEL: ${{ inputs.constel }}
103103
JQUERY: ${{ inputs.useJQuery }}
104-
MOBILE_UA: ${{ inputs.userAgent }}
105104
SHADOW_DOM: ${{ inputs.useShadowDom }}
106105
TZ: ${{ inputs.timezone }}
107106
NO_HEADLESS: ${{ inputs.headless == 'false' && 'true' || 'false' }}

.github/workflows/demos_visual_tests.yml

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,20 +550,44 @@ jobs:
550550
- name: DevExtreme - Build
551551
run: pnpx nx build devextreme
552552

553+
- name: Install Roboto font for Material theme
554+
run: |
555+
if [ ! -d "/usr/share/fonts/truetype/roboto" ]; then
556+
echo "Installing Roboto font..."
557+
sudo apt-get update -qq
558+
sudo apt-get install -y -qq fonts-roboto fonts-roboto-unhinted
559+
sudo fc-cache -f -v > /dev/null 2>&1
560+
echo "Roboto font installed"
561+
else
562+
echo "Roboto font already installed"
563+
fi
564+
553565
- name: Run Web Server
554566
run: |
555567
python -m http.server 8080 &
556568
python -m http.server 8081 &
557569
python -m http.server 8082 &
558570
python -m http.server 8083 &
559571
572+
- name: Set Chrome flags
573+
id: chrome-flags
574+
run: |
575+
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"
576+
577+
# For Material theme, enable better font rendering to avoid instability
578+
if [[ "${{ matrix.THEME }}" != *"material"* ]]; then
579+
BASE_FLAGS="$BASE_FLAGS --font-render-hinting=none --disable-font-subpixel-positioning"
580+
fi
581+
582+
echo "flags=$BASE_FLAGS" >> $GITHUB_OUTPUT
583+
560584
- name: Run TestCafe tests
561585
shell: bash
562586
working-directory: apps/demos
563587
env:
564588
STRATEGY: ${{ matrix.STRATEGY }}
565589
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
590+
BROWSERS: ${{ steps.chrome-flags.outputs.flags }}
567591
#DEBUG: hammerhead:*,testcafe:*
568592
CONCURRENCY: 4
569593
TCQUARANTINE: true
@@ -802,19 +826,43 @@ jobs:
802826
name: changed-demos
803827
path: apps/demos
804828

829+
- name: Install Roboto font for Material theme
830+
run: |
831+
if [ ! -d "/usr/share/fonts/truetype/roboto" ]; then
832+
echo "Installing Roboto font..."
833+
sudo apt-get update -qq
834+
sudo apt-get install -y -qq fonts-roboto fonts-roboto-unhinted
835+
sudo fc-cache -f -v > /dev/null 2>&1
836+
echo "Roboto font installed"
837+
else
838+
echo "Roboto font already installed"
839+
fi
840+
805841
- name: Run Web Server
806842
run: |
807843
python -m http.server 8080 &
808844
python -m http.server 8081 &
809845
python -m http.server 8082 &
810846
python -m http.server 8083 &
811847
848+
- name: Set Chrome flags
849+
id: chrome-flags
850+
run: |
851+
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"
852+
853+
# For Material theme, enable better font rendering to avoid instability
854+
if [[ "${{ matrix.THEME }}" != *"material"* ]]; then
855+
BASE_FLAGS="$BASE_FLAGS --font-render-hinting=none --disable-font-subpixel-positioning"
856+
fi
857+
858+
echo "flags=$BASE_FLAGS" >> $GITHUB_OUTPUT
859+
812860
- name: Run TestCafe tests
813861
shell: bash
814862
working-directory: apps/demos
815863
env:
816864
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
865+
BROWSERS: ${{ steps.chrome-flags.outputs.flags }}
818866
# DEBUG: hammerhead:*,testcafe:*
819867
CONCURRENCY: 1
820868
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

0 commit comments

Comments
 (0)