Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
f2d92f4
Scheduler: migrate the timezones e2e tests to Playwright (#36071)
ajivanyandev Nov 9, 2026
8b48e48
Scheduler: migrate the viewOffset e2e tests to Playwright (#36196)
ajivanyandev Nov 9, 2026
7375f3e
Scheduler: migrate the common e2e tests to Playwright (#36212)
ajivanyandev Nov 11, 2026
3a3939a
Scheduler: wait out the long renders in the many-cells Playwright test
ajivanyandev Nov 16, 2026
f347b39
Playwright: render the Material themes with their bundled Roboto
ajivanyandev Nov 16, 2026
347aed9
Playwright: retry a failed test once on CI
ajivanyandev Nov 16, 2026
e84166e
PivotGrid: re-record the material T1210807 etalon with the bundled Ro…
ajivanyandev Nov 16, 2026
ef1c410
Playwright: shorten the comments of the flaky-test fixes
ajivanyandev Nov 16, 2026
dea1e2b
Scheduler: adapt the Playwright tests to 26_1
ajivanyandev Nov 17, 2026
8d2d427
Scheduler: drop the etalons that 26_1 renders differently from main
ajivanyandev Nov 17, 2026
2c9a83c
Scheduler: record the 26_1 etalons
ajivanyandev Nov 17, 2026
db109a5
Scheduler: re-shoot the later 26_1 etalons in the multi-screenshot tests
ajivanyandev Nov 17, 2026
eb1e11e
Scheduler: record the rest of the 26_1 etalons
ajivanyandev Nov 17, 2026
283fb4c
Scheduler: re-shoot the last 26_1 etalons of the drag and resize tests
ajivanyandev Nov 17, 2026
57a8df5
TestCafe: skip the quarantine run when no test is quarantined
ajivanyandev Nov 17, 2026
ce9234d
Merge branch '26_1' into e2e/scheduler-playwright-26_1
ajivanyandev Nov 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
3 changes: 2 additions & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,9 @@
/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/** @DevExpress/devextreme-scheduler
/packages/devextreme/testing/tests/*/scheduler.* @DevExpress/devextreme-scheduler
/packages/testcafe-models/scheduler/** @DevExpress/devextreme-scheduler
/e2e/testcafe-devextreme/tests/scheduler/** @DevExpress/devextreme-scheduler
/e2e/testcafe-devextreme/tests/accessibility/scheduler/** @DevExpress/devextreme-scheduler
/e2e/playwright/models/scheduler/** @DevExpress/devextreme-scheduler
/e2e/playwright/tests/scheduler/** @DevExpress/devextreme-scheduler

/packages/devextreme-scss/scss/widgets/*/scheduler/** @DevExpress/devextreme-scheduler
/packages/devextreme-scss/scss/widgets/*/recurrenceEditor/** @DevExpress/devextreme-scheduler
Expand Down
40 changes: 38 additions & 2 deletions .github/workflows/playwright_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ jobs:
fail-fast: false
matrix: ${{ fromJson(needs.determine-playwright-matrix.outputs.matrix) }}
runs-on: devextreme-shr2
timeout-minutes: 10
timeout-minutes: 15

steps:
- name: Get sources
Expand Down Expand Up @@ -278,13 +278,39 @@ jobs:
if-no-files-found: ignore

- name: Upload test traces and screenshot diffs
if: ${{ failure() }}
if: ${{ always() }}
uses: actions/upload-artifact@v7
with:
name: playwright-traces-${{ env.JOB_NAME }}
path: ${{ github.workspace }}/e2e/playwright/artifacts/test-results
if-no-files-found: ignore

- name: Collect new etalons
if: ${{ always() }}
run: |
mkdir -p "$RUNNER_TEMP/new-etalons"
git ls-files --others --exclude-standard -z -- 'e2e/playwright/tests/**/etalons/*.png' \
| xargs -0 -r cp --parents -t "$RUNNER_TEMP/new-etalons"

- name: Upload new etalons
if: ${{ always() }}
uses: actions/upload-artifact@v7
with:
name: playwright-etalons-${{ env.JOB_NAME }}
path: ${{ runner.temp }}/new-etalons
if-no-files-found: ignore

# A retry passes against the etalon its first attempt wrote, so new etalons fail the job here.
- name: Fail on new etalons
if: ${{ always() }}
run: |
new_etalons=$(git ls-files --others --exclude-standard -- 'e2e/playwright/tests/**/etalons/*.png')
if [ -n "$new_etalons" ]; then
echo "::error::The tests wrote etalons that are not in the repository. They are in the playwright-etalons artifact:"
echo "$new_etalons"
exit 1
fi

merge-artifacts:
runs-on: ubuntu-latest
timeout-minutes: 6
Expand All @@ -307,6 +333,7 @@ jobs:
const artifactGroups = {
blobs: /^playwright-blob-/,
traces: /^playwright-traces-/,
etalons: /^playwright-etalons-/,
};

for (const [outputName, pattern] of Object.entries(artifactGroups)) {
Expand Down Expand Up @@ -369,3 +396,12 @@ jobs:
pattern: playwright-traces-*
separate-directories: true
delete-merged: true

- name: Merge new etalons
if: steps.mergeable-artifacts.outputs.etalons == 'true'
uses: actions/upload-artifact/merge@v7
continue-on-error: true
with:
name: playwright-etalons
pattern: playwright-etalons-*
delete-merged: true
81 changes: 67 additions & 14 deletions .github/workflows/testcafe_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,29 @@ jobs:
outputs:
should-run: ${{ steps.check.outputs.should-run }}
styles-changed: ${{ steps.changes.outputs.styles }}
has-quarantined-tests: ${{ steps.quarantined-tests.outputs.has-tests }}
steps:
- uses: actions/checkout@v6
- name: Check RUN_TESTS flag
id: check
run: echo "should-run=${{ env.RUN_TESTS }}" >> $GITHUB_OUTPUT

- name: Check quarantined tests
id: quarantined-tests
working-directory: ./e2e/testcafe-devextreme
run: |
listed=0
[ -f quarantine.json ] && listed=$(jq '.tests | length' quarantine.json)
# Matches the meta key: test.meta({ unstable: true }) or test.meta('unstable', true).
marked=$(grep -rlE --include='*.ts' --include='*.js' "unstable['\"]?[[:space:]]*[:,]" tests helpers || true)
echo "Tests in quarantine.json: $listed"
echo "Files with unstable tests: ${marked:-(none)}"
if [ "$listed" -gt 0 ] || [ -n "$marked" ]; then
echo "has-tests=true" >> $GITHUB_OUTPUT
else
echo "has-tests=false" >> $GITHUB_OUTPUT
fi

- uses: dorny/paths-filter@v4
id: changes
with:
Expand Down Expand Up @@ -245,15 +262,7 @@ jobs:
{ "componentFolder": "dataGrid", "name": "dataGrid (4/4)", "indices": "4/4", "cache": true, "concurrency": 5 },

{ "componentFolder": "editors", "name": "editors" },
{ "componentFolder": "navigation", "name": "navigation", "concurrency": 6 },

{ "componentFolder": "scheduler/common", "name": "scheduler / common (1/3)", "indices": "1/3", "concurrency": 6 },
{ "componentFolder": "scheduler/common", "name": "scheduler / common (2/3)", "indices": "2/3", "concurrency": 6 },
{ "componentFolder": "scheduler/common", "name": "scheduler / common (3/3)", "indices": "3/3", "concurrency": 6 },
{ "componentFolder": "scheduler/viewOffset", "name": "scheduler / viewOffset (1/2)", "indices": "1/2", "concurrency": 4 },
{ "componentFolder": "scheduler/viewOffset", "name": "scheduler / viewOffset (2/2)", "indices": "2/2", "concurrency": 4 },
{ "componentFolder": "scheduler/timezones", "name": "scheduler / timezones (Europe/Berlin)", "timezone": "Europe/Berlin" },
{ "componentFolder": "scheduler/timezones", "name": "scheduler / timezones (America/Los_Angeles)", "timezone": "America/Los_Angeles" }
{ "componentFolder": "navigation", "name": "navigation", "concurrency": 6 }
]
JSON
)
Expand Down Expand Up @@ -409,13 +418,51 @@ jobs:
path: ${{ github.workspace }}/e2e/testcafe-devextreme/artifacts/failedtests/**/*
if-no-files-found: ignore

testcafe-quarantine:
name: quarantine
check-quarantine:
name: Check if quarantine should run
needs: [check-should-run, build, testcafe]
if: |
!cancelled() &&
needs.check-should-run.outputs.should-run == 'true' &&
needs.build.result == 'success'
runs-on: ubuntu-latest
timeout-minutes: 3
outputs:
should-run: ${{ steps.check.outputs.should-run }}

steps:
- name: Check flaky test reports and quarantined tests
id: check
uses: actions/github-script@v9
env:
HAS_QUARANTINED_TESTS: ${{ needs.check-should-run.outputs.has-quarantined-tests }}
with:
script: |
const artifacts = await github.paginate(github.rest.actions.listWorkflowRunArtifacts, {
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.runId,
per_page: 100,
});

// Same pattern as the "Download flaky test reports" step of the quarantine job.
const flakyReports = artifacts
.map((artifact) => artifact.name)
.filter((name) => name.startsWith('flaky-report'));
const hasQuarantinedTests = process.env.HAS_QUARANTINED_TESTS !== 'false';

core.info(`Flaky test reports: ${flakyReports.length ? flakyReports.join(', ') : '(none)'}`);
core.info(`Quarantined tests: ${hasQuarantinedTests ? 'yes' : 'none'}`);
core.setOutput('should-run', flakyReports.length > 0 || hasQuarantinedTests ? 'true' : 'false');

testcafe-quarantine:
name: quarantine
needs: [check-should-run, build, testcafe, check-quarantine]
if: |
!cancelled() &&
needs.check-should-run.outputs.should-run == 'true' &&
needs.build.result == 'success' &&
needs.check-quarantine.outputs.should-run != 'false'
runs-on: devextreme-shr2
timeout-minutes: 10

Expand Down Expand Up @@ -564,9 +611,15 @@ jobs:
echo "============================================================"
echo " [QUARANTINED] Run of all quarantined tests (quarantine.json)"
echo "============================================================"
run_tests --onlyQuarantined true
quarantined_failed=$last_failed
meta_failed_names=$(jq -r '.tests[]' "$result")
if [ "${{ needs.check-should-run.outputs.has-quarantined-tests }}" = "false" ]; then
echo "No quarantined tests."
quarantined_failed=0
meta_failed_names=""
else
run_tests --onlyQuarantined true
quarantined_failed=$last_failed
meta_failed_names=$(jq -r '.tests[]' "$result")
fi

echo ""
echo "============================================================"
Expand Down
20 changes: 20 additions & 0 deletions e2e/playwright/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,21 @@ test together with its etalon. The two sets must never cover the same case at on
left behind gets updated by whoever touches the component next and starts asserting a render
nobody checks.

### Etalons from CI

Without a container, CI records the etalons. A test whose etalon does not exist fails, and
Playwright writes what it rendered in the etalon's place; the workflow collects those files at
their repository paths into the `playwright-etalons` artifact:

```bash
gh run download <run-id> -n playwright-etalons -D ci-etalons
cp -R ci-etalons/. ../.. # from e2e/playwright: the paths start at the repository root
```

Look through them before committing — a new etalon is only as right as the render it captured. On
the host, run such tests with `--ignore-snapshots`: a host run writes missing etalons too, and a
macOS or Windows render must not end up among them.

## Themes

A test runs in the default theme unless it says otherwise. The jobs that run the whole suite in
Expand Down Expand Up @@ -116,6 +131,11 @@ The trace holds every action with the DOM before and after it, the network and t
failed screenshot comparison uploads its `-expected`, `-actual` and `-diff` images alongside, so a
failure that only happens on CI can be diagnosed without reproducing it.

On CI a failed test runs once more, in a new browser. A test that passes then does not fail the
job: the log lists it under "flaky", and the traces artifact keeps its failed run. A test that
wrote a missing etalon is the exception: its retry passes against that file, so the job fails on
the new etalon instead.

## Writing a test

```ts
Expand Down
13 changes: 12 additions & 1 deletion e2e/playwright/fixtures.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { test as base } from '@playwright/test';
import { expect, test as base } from '@playwright/test';
import { DEFAULT_BROWSER_SIZE, DEFAULT_THEME } from './helpers/const';
import { changeTheme, openTestPage, resetPageState } from './helpers/testPageUtils';

const GOOGLE_FONTS = /^https:\/\/fonts\.googleapis\.com\//;

export interface TestOptions {
theme: string;
browserSize: [number, number];
Expand All @@ -16,13 +18,22 @@ export const test = base.extend<TestOptions>({

page: async ({ page, theme, browserSize }, use) => {
const [width, height] = browserSize;
// TestCafe failed a test on an uncaught error in the page; some tests assert nothing else.
const pageErrors: string[] = [];

page.on('pageerror', (error) => pageErrors.push(error.stack ?? error.message));

// Material themes fall back to their bundled Roboto instead of whatever Google Fonts serves.
await page.context().route(GOOGLE_FONTS, (route) => route.fulfill({ contentType: 'text/css' }));

await page.setViewportSize({ width, height });
await openTestPage(page);
await changeTheme(page, theme);
await resetPageState(page);

await use(page);

expect(pageErrors, 'uncaught errors in the page').toEqual([]);
},
});

Expand Down
37 changes: 37 additions & 0 deletions e2e/playwright/helpers/callbackTestHelper.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import type { Page } from '@playwright/test';

type WindowCallbackExtended = Window
& typeof globalThis
& {
clientTesting?: {
data: Record<string, any>;
addCallbackResult: <T>(key: string, result: T) => void;
};
};

const initClientTesting = async (page: Page, keyArray: string[]): Promise<void> => page.evaluate(
(keys) => {
const extendedWindow = window as WindowCallbackExtended;

extendedWindow.clientTesting = {
data: Object.fromEntries(keys.map((key) => [key, []])),
addCallbackResult: (key: string, result: any) => {
extendedWindow.clientTesting!.data[key].push(result);
},
};
},
keyArray,
);

const getClientResults = async <T>(page: Page, key: string): Promise<T[]> => page.evaluate(
(name) => (window as WindowCallbackExtended).clientTesting!.data[name],
key,
);

const CallbackTestHelper = {
initClientTesting,
getClientResults,
};

export type { WindowCallbackExtended };
export { CallbackTestHelper };
23 changes: 11 additions & 12 deletions e2e/playwright/helpers/createWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,27 @@ import type { Page } from '@playwright/test';
import type { WidgetName, WidgetOptions } from '../models/types';
import { DEFAULT_SELECTOR } from './const';

export interface CreateWidgetOptions {
disableFxAnimation: boolean;
export interface CreateWidgetOptions<TArg = undefined> {
disableFxAnimation?: boolean;
arg?: TArg;
}

const DEFAULT_OPTIONS: CreateWidgetOptions = {
disableFxAnimation: true,
};
type WidgetConfig<TWidgetName> = TWidgetName extends keyof WidgetOptions
? WidgetOptions[TWidgetName]
: object;

export const createWidget = async <TWidgetName extends WidgetName>(
export const createWidget = async <TWidgetName extends WidgetName, TArg = undefined>(
page: Page,
widgetName: TWidgetName,
widgetOptions: TWidgetName extends keyof WidgetOptions
? WidgetOptions[TWidgetName]
| (() => WidgetOptions[TWidgetName] | Promise<WidgetOptions[TWidgetName]>)
: unknown,
widgetOptions: WidgetConfig<TWidgetName>
| ((arg: TArg) => WidgetConfig<TWidgetName> | Promise<WidgetConfig<TWidgetName>>),
selector: string = DEFAULT_SELECTOR,
{ disableFxAnimation } = DEFAULT_OPTIONS,
{ disableFxAnimation = true, arg }: CreateWidgetOptions<TArg> = {},
): Promise<void> => {
// Handlers cannot pass through the "page.evaluate" arguments, so a configuration with them
// arrives as a factory that Playwright runs in the page.
const options = typeof widgetOptions === 'function'
? await page.evaluateHandle(widgetOptions as () => unknown)
? await page.evaluateHandle(widgetOptions as (value: any) => unknown, arg)
: widgetOptions;

await page.evaluate(({
Expand Down
14 changes: 13 additions & 1 deletion e2e/playwright/helpers/domUtils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Page } from '@playwright/test';
import type { Locator, Page } from '@playwright/test';

const STYLESHEET_RULES_ID = 'stylesheetRules';

Expand Down Expand Up @@ -121,3 +121,15 @@ export const removeStylesheetRulesFromPage = async (page: Page): Promise<void> =
(stylesheetId) => { document.getElementById(stylesheetId)?.remove(); },
STYLESHEET_RULES_ID,
);

export const getStyleAttribute = async (
locator: Locator,
): Promise<string | null> => locator.getAttribute('style');

export const hasHorizontalScroll = async (
locator: Locator,
): Promise<boolean> => locator.evaluate((element) => element.scrollWidth > element.clientWidth);

export const getDocumentScrollTop = async (
page: Page,
): Promise<number> => page.evaluate(() => document.documentElement.scrollTop);
Loading
Loading