Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: testing #3128

Draft
wants to merge 58 commits into
base: 24_1
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
e0ce746
test setting env var
AlexanderMoiseev Jan 26, 2024
846fb4c
move theme var to matrix settings
AlexanderMoiseev Jan 26, 2024
27a8aea
fix matrix value
AlexanderMoiseev Jan 29, 2024
7cefdb9
redundant quotes. removed
AlexanderMoiseev Jan 29, 2024
af9625b
add material theme to matrix
AlexanderMoiseev Jan 29, 2024
a78ef89
test name changed
AlexanderMoiseev Jan 29, 2024
fed3fa9
change theme
AlexanderMoiseev Jan 29, 2024
0b61991
hooks initialized
AlexanderMoiseev Jan 29, 2024
8cb2585
fix
AlexanderMoiseev Jan 29, 2024
384ddf9
run tests for material
AlexanderMoiseev Jan 29, 2024
8d03528
testing
AlexanderMoiseev Jan 30, 2024
24559b7
pass t
AlexanderMoiseev Jan 30, 2024
5cdf782
change theme url at runtime
AlexanderMoiseev Jan 31, 2024
2a93f71
temporarily change timeout for testing
AlexanderMoiseev Jan 31, 2024
d810b01
temp settings for testing
AlexanderMoiseev Jan 31, 2024
9baa4b8
test runner context passing
AlexanderMoiseev Jan 31, 2024
6883438
t
AlexanderMoiseev Jan 31, 2024
efafa78
temp comment watchdog
AlexanderMoiseev Jan 31, 2024
c525915
add dependencies to client function
AlexanderMoiseev Jan 31, 2024
ed41c0e
fix set context for t
AlexanderMoiseev Jan 31, 2024
f9fe2e8
theme changed
AlexanderMoiseev Jan 31, 2024
5304530
theme name added to tests
AlexanderMoiseev Jan 31, 2024
7f43de8
add theme to demo test name
AlexanderMoiseev Jan 31, 2024
f0e6b5d
new file
AlexanderMoiseev Jan 31, 2024
91f312f
rename files
AlexanderMoiseev Jan 31, 2024
d5007e2
add logs
AlexanderMoiseev Jan 31, 2024
e4adbe5
rb changes
AlexanderMoiseev Jan 31, 2024
a2643d6
add light shots
AlexanderMoiseev Jan 31, 2024
6cbb8db
test
AlexanderMoiseev Jan 31, 2024
311a632
add light
AlexanderMoiseev Jan 31, 2024
337fca7
new screenshots
AlexanderMoiseev Feb 1, 2024
74a46e4
add screenshots
AlexanderMoiseev Feb 1, 2024
847889e
test name fixed
AlexanderMoiseev Feb 1, 2024
6c7884a
screens updated
AlexanderMoiseev Feb 1, 2024
d9908a2
add to
AlexanderMoiseev Feb 1, 2024
5760915
Merge branch '24_1' into 24_1_add_themes_test
AlexanderMoiseev Feb 1, 2024
07f91ed
enable quarantine and update masks screenshot names
AlexanderMoiseev Feb 1, 2024
b4eafa9
hardcode theme value for testing
AlexanderMoiseev Feb 1, 2024
15e34d0
run tests
AlexanderMoiseev Feb 1, 2024
727981c
update material screenshots
AlexanderMoiseev Feb 1, 2024
90684ce
update baselines
AlexanderMoiseev Feb 1, 2024
0486182
remove timeout
AlexanderMoiseev Feb 1, 2024
bf63f73
swith test theme
AlexanderMoiseev Feb 1, 2024
70bb09a
change theme
AlexanderMoiseev Feb 1, 2024
8d28040
add configuration for frameworks y,l
AlexanderMoiseev Feb 1, 2024
8041602
force tests
AlexanderMoiseev Feb 1, 2024
0e68e5c
try updating theme manager
AlexanderMoiseev Feb 2, 2024
8065585
test
AlexanderMoiseev Feb 2, 2024
757bc34
clear logs
AlexanderMoiseev Feb 2, 2024
60c717b
test run scripts
AlexanderMoiseev Feb 2, 2024
568f9ef
test
AlexanderMoiseev Feb 2, 2024
68dc5c1
test
AlexanderMoiseev Feb 2, 2024
d4938f2
test
AlexanderMoiseev Feb 2, 2024
702b9b7
test
AlexanderMoiseev Feb 2, 2024
0b248fc
test
AlexanderMoiseev Feb 2, 2024
ad8158b
clear code
AlexanderMoiseev Feb 2, 2024
f224125
logs added
AlexanderMoiseev Feb 2, 2024
2fcd0d2
test
AlexanderMoiseev Feb 2, 2024
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
4 changes: 3 additions & 1 deletion .github/workflows/visual_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,13 @@ jobs:
fail-fast: false
matrix:
STRATEGY: [screenshots, accessibility]
THEME: ['material.blue.light']
CONSTEL: [jquery(1/4), jquery(2/4), jquery(3/4), jquery(4/4)]
env:
ACCESSIBILITY_TESTCAFE_REPORT_PATH: "accessibility_testcafe_report"

runs-on: ubuntu-latest
name: ${{ matrix.CONSTEL }}-${{ matrix.STRATEGY }}
name: ${{ matrix.CONSTEL }}-${{ matrix.STRATEGY }}-${{ matrix.THEME }}
timeout-minutes: 30

steps:
Expand Down Expand Up @@ -162,6 +163,7 @@ jobs:
CONCURRENCY: 4
TCQUARANTINE: true
CONSTEL: ${{ matrix.CONSTEL }}
THEME: ${{ matrix.THEME }}
# DISABLE_DEMO_TEST_SETTINGS: all # Uncomment to ignore all the visualtestrc.json settings
# DISABLE_DEMO_TEST_SETTINGS: ignore # Uncomment to ignore the `ignore` field
# DISABLE_DEMO_TEST_SETTINGS: comparison-options # Uncomment to ignore the `comparison-options` field
Expand Down
55 changes: 53 additions & 2 deletions utils/visual-tests/testcafe-runner.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import createTestCafe from 'testcafe';
import fs from 'fs';

const changeTheme = async(themeName) => createTestCafe.ClientFunction(() => new Promise((resolve) => {
// eslint-disable-next-line no-undef
window.DevExpress.ui.themes.ready(resolve);
// eslint-disable-next-line no-undef
window.DevExpress.ui.themes.current(themeName);
}),
{ dependencies: { themeName } })();

function reporter() {
return {
noColors: false,
Expand Down Expand Up @@ -208,17 +216,60 @@
const runner = tester.createRunner();
const concurrency = (process.env.CONCURRENCY && (+process.env.CONCURRENCY)) || 1;

const reporters = [reporter]
const reporters = [reporter];

console.log('current process.env.THEME', process.env.THEME);

if (process.env.STRATEGY === 'accessibility') {
reporters.push(accessibilityTestCafeReporter);
}

const runOptions = { quarantineMode: !!process.env.TCQUARANTINE ? { successThreshold: 1, attemptLimit: 5 } : false };

runOptions.hooks = {
test: {
after: async() => {

console.log('calling after test');

const result = await new Promise((resolve) => {
resolve('test after resolved');
});

console.log(result);
}
},
};

console.log('change theme');

if(process.env.THEME) {
const currentTheme = process.env.THEME;
runOptions.hooks.test.before = async() => {

await t.eval(() => {
console.log('start before test');
const urlSegments = location.href.split('/');

const newUrl = urlSegments.slice(0, -1).join('/');
const newLocation = `${newUrl}/dx.greenmist.css`;

console.log('newLocation', newLocation);

location.replace(newLocation);
Fixed Show fixed Hide fixed
location.reload();
console.log('end before test');
});

};
}
console.log('theme changed');

const failedCount = await runner
.reporter(reporters)
.browsers(process.env.BROWSERS || 'chrome:headless --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')
.concurrency(concurrency || 1)
.run({ quarantineMode: !!process.env.TCQUARANTINE ? { successThreshold: 1, attemptLimit: 5 } : false });
.run(runOptions);

await tester.close();
process.exit(failedCount);
Expand Down
Loading