Skip to content

Commit

Permalink
update etalons
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeniyKiyashko committed Oct 11, 2024
1 parent 91e1fd4 commit 12ab8a2
Show file tree
Hide file tree
Showing 53 changed files with 106 additions and 74 deletions.
44 changes: 22 additions & 22 deletions .github/workflows/testcafe_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,25 +81,25 @@ jobs:
fail-fast: false
matrix:
ARGS: [
# { componentFolder: "accessibility", name: "accessibility (1/5)", indices: "1/5" },
# { componentFolder: "accessibility", name: "accessibility (2/5)", indices: "2/5" },
# { componentFolder: "accessibility", name: "accessibility (3/5)", indices: "3/5" },
# { componentFolder: "accessibility", name: "accessibility (4/5)", indices: "4/5" },
# { componentFolder: "accessibility", name: "accessibility (5/5)", indices: "5/5" },
# { componentFolder: "accessibility", name: "accessibility - material (1/7)", theme: "material.blue.light", indices: "1/7" },
# { componentFolder: "accessibility", name: "accessibility - material (2/7)", theme: "material.blue.light", indices: "2/7" },
# { componentFolder: "accessibility", name: "accessibility - material (3/7)", theme: "material.blue.light", indices: "3/7" },
# { componentFolder: "accessibility", name: "accessibility - material (4/7)", theme: "material.blue.light", indices: "4/7" },
# { componentFolder: "accessibility", name: "accessibility - material (5/7)", theme: "material.blue.light", indices: "5/7" },
# { componentFolder: "accessibility", name: "accessibility - material (6/7)", theme: "material.blue.light", indices: "6/7" },
# { componentFolder: "accessibility", name: "accessibility - material (7/7)", theme: "material.blue.light", indices: "7/7" },
# { componentFolder: "accessibility", name: "accessibility - fluent (1/7)", theme: "fluent.blue.light", indices: "1/7" },
# { componentFolder: "accessibility", name: "accessibility - fluent (2/7)", theme: "fluent.blue.light", indices: "2/7" },
# { componentFolder: "accessibility", name: "accessibility - fluent (3/7)", theme: "fluent.blue.light", indices: "3/7" },
# { componentFolder: "accessibility", name: "accessibility - fluent (4/7)", theme: "fluent.blue.light", indices: "4/7" },
# { componentFolder: "accessibility", name: "accessibility - fluent (5/7)", theme: "fluent.blue.light", indices: "5/7" },
# { componentFolder: "accessibility", name: "accessibility - fluent (6/7)", theme: "fluent.blue.light", indices: "6/7" },
# { componentFolder: "accessibility", name: "accessibility - fluent (7/7)", theme: "fluent.blue.light", indices: "7/7" },
{ componentFolder: "accessibility", name: "accessibility (1/5)", indices: "1/5" },
{ componentFolder: "accessibility", name: "accessibility (2/5)", indices: "2/5" },
{ componentFolder: "accessibility", name: "accessibility (3/5)", indices: "3/5" },
{ componentFolder: "accessibility", name: "accessibility (4/5)", indices: "4/5" },
{ componentFolder: "accessibility", name: "accessibility (5/5)", indices: "5/5" },
{ componentFolder: "accessibility", name: "accessibility - material (1/7)", theme: "material.blue.light", indices: "1/7" },
{ componentFolder: "accessibility", name: "accessibility - material (2/7)", theme: "material.blue.light", indices: "2/7" },
{ componentFolder: "accessibility", name: "accessibility - material (3/7)", theme: "material.blue.light", indices: "3/7" },
{ componentFolder: "accessibility", name: "accessibility - material (4/7)", theme: "material.blue.light", indices: "4/7" },
{ componentFolder: "accessibility", name: "accessibility - material (5/7)", theme: "material.blue.light", indices: "5/7" },
{ componentFolder: "accessibility", name: "accessibility - material (6/7)", theme: "material.blue.light", indices: "6/7" },
{ componentFolder: "accessibility", name: "accessibility - material (7/7)", theme: "material.blue.light", indices: "7/7" },
{ componentFolder: "accessibility", name: "accessibility - fluent (1/7)", theme: "fluent.blue.light", indices: "1/7" },
{ componentFolder: "accessibility", name: "accessibility - fluent (2/7)", theme: "fluent.blue.light", indices: "2/7" },
{ componentFolder: "accessibility", name: "accessibility - fluent (3/7)", theme: "fluent.blue.light", indices: "3/7" },
{ componentFolder: "accessibility", name: "accessibility - fluent (4/7)", theme: "fluent.blue.light", indices: "4/7" },
{ componentFolder: "accessibility", name: "accessibility - fluent (5/7)", theme: "fluent.blue.light", indices: "5/7" },
{ componentFolder: "accessibility", name: "accessibility - fluent (6/7)", theme: "fluent.blue.light", indices: "6/7" },
{ componentFolder: "accessibility", name: "accessibility - fluent (7/7)", theme: "fluent.blue.light", indices: "7/7" },
{ componentFolder: "common", name: "common" },
{ componentFolder: "common", name: "common - material", theme: 'material.blue.light' },
{ componentFolder: "common", name: "common - fluent", theme: 'fluent.blue.light' },
Expand Down Expand Up @@ -140,9 +140,9 @@ jobs:
{ componentFolder: "navigation", name: "navigation" },
{ componentFolder: "navigation", name: "navigation - material", theme: 'material.blue.light' },
{ componentFolder: "navigation", name: "navigation - fluent", theme: 'fluent.blue.light' },
# { componentFolder: "fileManager", name: "fileManager" },
# { componentFolder: "fileManager", name: "fileManager - material", theme: 'material.blue.light' },
# { componentFolder: "fileManager", name: "fileManager - fluent", theme: 'fluent.blue.light' },
{ componentFolder: "fileManager", name: "fileManager" },
{ componentFolder: "fileManager", name: "fileManager - material", theme: 'material.blue.light' },
{ componentFolder: "fileManager", name: "fileManager - fluent", theme: 'fluent.blue.light' },
# { componentFolder: "filterBuilder", name: "filterBuilder" },
# { componentFolder: "filterBuilder", name: "filterBuilder - material", theme: 'material.blue.light' },
# { componentFolder: "filterBuilder", name: "filterBuilder - fluent", theme: 'fluent.blue.light' },
Expand Down
4 changes: 2 additions & 2 deletions e2e/testcafe-devextreme/helpers/clearPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
const testCafe = require('testcafe');

module.exports = {
clearTestPage: async function() {
clearTestPage: async function(t) {
const shadowDom = process.env.shadowDom === 'true';

await testCafe.ClientFunction(() => {
Expand Down Expand Up @@ -46,6 +46,6 @@ module.exports = {
dependencies: {
shadowDom,
}
})();
}).with({ boundTestRun: t })();
}
};
36 changes: 20 additions & 16 deletions e2e/testcafe-devextreme/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,24 +113,28 @@ createTestCafe({
quarantineMode: { successThreshold: 1, attemptLimit: 5 },
};

if(args.componentFolder.trim() !== 'renovation') {
runOptions.hooks = {
test: {
before: async() => {
if(args.shadowDom) {
await addShadowRootTree();
}

if(args.theme) {
await changeTheme(args.theme);
}
},
after: async() => {
await testPageUtils.clearTestPage();
runOptions.hooks = {
test: {
before: async() => {
if(args.shadowDom) {
await addShadowRootTree();
}

if(args.theme) {
await changeTheme(args.theme);
}
},
};
}
after: async(t) => {
await testPageUtils.clearTestPage(t);

await createTestCafe.ClientFunction(() => {
document.body.style.minHeight = '100px';
}).with({ boundTestRun: t })();

await t.click(createTestCafe.Selector('body'), { offsetX: -1, offsetY: 1 });
}
},
};

if(args.browsers === 'chrome:docker') {
runOptions.disableScreenshots = true;
Expand Down
18 changes: 13 additions & 5 deletions e2e/testcafe-devextreme/tests/accessibility/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ import url from '../../helpers/getPageUrl';
import { testAccessibility, Configuration } from '../../helpers/accessibility/test';
import { Options } from '../../helpers/generateOptionMatrix';

fixture.disablePageReloads`Accessibility`
.page(url(__dirname, '../container.html'));
fixture`Accessibility`
.page(url(__dirname, '../container.html'))
// avoid `sj_evt is not defined` error
.skipJsErrors();

const markersData = [
{ location: '40.7825, -73.966111' },
Expand All @@ -18,21 +20,27 @@ const options: Options<Properties> = {
apiKey: [{
bing: 'Aq3LKP2BOmzWY47TZoT1YdieypN_rB6RY9FqBfx-MDCKjvvWBbT68R51xwbL-AqC',
}],
hint: [undefined, 'hint'],
controls: [true, false],
zoom: [undefined, 10],
markers: [markersData],
};

const a11yCheckConfig = {
// NOTE: color-contrast issues
rules: { 'color-contrast': { enabled: false } },
rules: {
'color-contrast': { enabled: false },
'aria-command-name': { enabled: false },
},
};

const created = async (t: TestController): Promise<void> => {
await t.wait(3000);
};

const configuration: Configuration = {
component: 'dxMap',
a11yCheckConfig,
options,
created,
};

testAccessibility(configuration);
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 26 additions & 15 deletions e2e/testcafe-devextreme/tests/editors/dateRangeBox/keyboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Selector } from 'testcafe';
import DateRangeBox from 'devextreme-testcafe-models/dateRangeBox';
import url from '../../../helpers/getPageUrl';
import { createWidget } from '../../../helpers/createWidget';
import { appendElementTo } from '../../../helpers/domUtils';
import { appendElementTo, insertStylesheetRulesToPage } from '../../../helpers/domUtils';

fixture.disablePageReloads`DateRangeBox keyboard navigation`
.page(url(__dirname, '../../container.html'));
Expand Down Expand Up @@ -1250,10 +1250,10 @@ test('DateRangeBox keyboard navigation via `shift+tab` key if applyValueMode is
});

test('DateRangeBox should not be closed by press shift+tab key on endDate input', async (t) => {
const dateRangeBox = new DateRangeBox('#container');
const dateRangeBox = new DateRangeBox('#dateRangeBox');

await t
.click(Selector('body'), { offsetX: -50 })
.click(Selector('#nextFocusableElement'))
.pressKey('shift+tab');

await t
Expand All @@ -1279,18 +1279,29 @@ test('DateRangeBox should not be closed by press shift+tab key on endDate input'
.eql(false)
.expect(dateRangeBox.isFocused)
.notOk();
}).before(async () => createWidget('dxDateRangeBox', {
value: ['2021/09/17', '2021/10/24'],
openOnFieldClick: true,
opened: true,
width: 500,
dropDownOptions: {
hideOnOutsideClick: false,
},
calendarOptions: {
focusStateEnabled: false,
},
}));
}).before(async () => {
await insertStylesheetRulesToPage('#container { display: flex; }');

await appendElementTo('#container', 'div', 'dateRangeBox');
await appendElementTo('#container', 'div', 'nextFocusableElement');

await createWidget('dxDateRangeBox', {
value: ['2021/09/17', '2021/10/24'],
openOnFieldClick: true,
opened: true,
width: 500,
dropDownOptions: {
hideOnOutsideClick: false,
},
calendarOptions: {
focusStateEnabled: false,
},
}, '#dateRangeBox');

await createWidget('dxButton', {
text: 'Next Focusable Element',
}, '#nextFocusableElement');
});

[
{ key: 'left', offsetInDays: -1 },
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions e2e/testcafe-devextreme/tests/editors/lookup/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ test('Popup should not be closed if lookup is placed at the page bottom (T101803
await t
.expect(await lookup.isOpened())
.ok();

await lookup.close();
}).before(async () => createWidget('dxLookup', {
items: [1, 2, 3],
usePopover: false,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions e2e/testcafe-devextreme/tests/navigation/menu/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ safeSizeTest('Menu delimiter appearance when orientation is horizontal', async (

await testScreenshot(t, takeScreenshot, 'Delimiter, horizontal menu, submenu less than root item.png');

await setAttribute('#container', 'style', 'padding-top: 450px;');
await setAttribute('#container', 'style', 'padding-top: 430px;');

await t
.click(menu.getItem(1))
Expand All @@ -117,15 +117,15 @@ safeSizeTest('Menu delimiter appearance when orientation is horizontal', async (

await testScreenshot(t, takeScreenshot, 'Delimiter, horizontal menu, submenu less than root item, bottom collision.png');

await setAttribute('#container', 'style', 'padding-left: 100px;');
await setAttribute('#container', 'style', 'padding-left: 80px;');

await t
.click(menu.getItem(3))
.pressKey('down');

await testScreenshot(t, takeScreenshot, 'Delimiter, horizontal menu, right collision.png');

await setAttribute('#container', 'style', 'padding-top: 450px; padding-left: 100px;');
await setAttribute('#container', 'style', 'padding-top: 430px; padding-left: 80px;');

await t
.click(menu.getItem(2))
Expand Down Expand Up @@ -187,14 +187,14 @@ safeSizeTest('Menu delimiter appearance when orientation is vertical', async (t)

await testScreenshot(t, takeScreenshot, 'Delimiter appearance, orientation is vertical, bottom collision.png');

await setAttribute('#container', 'style', 'padding-top: 0px; padding-left: 350px;');
await setAttribute('#container', 'style', 'padding-top: 0px; padding-left: 340px;');

await t
.click(menu.getItem(2));

await testScreenshot(t, takeScreenshot, 'Delimiter appearance, orientation is vertical, right collision.png');

await setAttribute('#container', 'style', 'padding-top: 400px; padding-left: 350px;');
await setAttribute('#container', 'style', 'padding-top: 400px; padding-left: 340px;');

await t
.click(menu.getItem(0))
Expand Down
3 changes: 0 additions & 3 deletions e2e/testcafe-devextreme/tests/navigation/splitter/common.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Selector } from 'testcafe';
import { createScreenshotsComparer } from 'devextreme-screenshot-comparer';
import Splitter from 'devextreme-testcafe-models/splitter';
import url from '../../../helpers/getPageUrl';
Expand Down Expand Up @@ -37,8 +36,6 @@ fixture.disablePageReloads`Splitter_common`
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
const splitter = new Splitter('#container');

await t.click(Selector('body'), { offsetX: -50 });

await testScreenshot(t, takeScreenshot, getScreenshotName('normal'), { element: '#container' });
await testScreenshot(t, takeScreenshot, getScreenshotName('normal'), { element: '#container', theme: darkTheme });

Expand Down
4 changes: 1 addition & 3 deletions e2e/testcafe-devextreme/tests/navigation/splitter/resize.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import Splitter from 'devextreme-testcafe-models/splitter';
import url from '../../../helpers/getPageUrl';
import { createWidget } from '../../../helpers/createWidget';
import { clearTestPage } from '../../../helpers/clearPage';
import { safeSizeTest } from '../../../helpers/safeSizeTest';

fixture.disablePageReloads`Splitter_integration`
.page(url(__dirname, '../../container.html'))
.afterEach(async () => clearTestPage());
.page(url(__dirname, '../../container.html'));

safeSizeTest('non resizable pane should not change its size during resize', async (t) => {
const splitter = new Splitter('#container');
Expand Down
10 changes: 10 additions & 0 deletions packages/testcafe-models/internal/dropDownList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,14 @@ export default abstract class DropDownList extends TextBox {
dependencies: { getInstance },
})();
}

close(): Promise<void> {
const { getInstance } = this;

return ClientFunction(() => {
(getInstance() as any).close();
}, {
dependencies: { getInstance },
})();
}
}
8 changes: 5 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 12ab8a2

Please sign in to comment.