Skip to content

Commit 500c7bd

Browse files
committed
update numberbox screenshots, added font-family to tagbox
1 parent 31dbaa1 commit 500c7bd

8 files changed

+95
-101
lines changed

e2e/testcafe-devextreme/tests/editors/dateBox/common.ts

Lines changed: 34 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -15,65 +15,54 @@ const DATEBOX_CLASS = 'dx-datebox';
1515
const DROP_DOWN_EDITOR_ACTIVE_CLASS = 'dx-dropdowneditor-active';
1616
const FOCUSED_STATE_CLASS = 'dx-state-focused';
1717

18-
const stylingModes = ['outlined', 'underlined', 'filled'];
1918
const pickerTypes = ['calendar', 'list', 'native', 'rollers'];
20-
const labelModes = ['static', 'floating', 'hidden', 'outside'];
2119
const types = ['date', 'datetime', 'time'];
2220

2321
fixture.disablePageReloads`DateBox render`
2422
.page(url(__dirname, '../../container.html'));
2523

26-
stylingModes.forEach((stylingMode) => {
27-
labelModes.forEach((labelMode) => {
28-
test(`DateBox styles, stylingMode=${stylingMode}, labelMode=${labelMode}`, async (t) => {
29-
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
24+
test(`DateBox styles`, async (t) => {
25+
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
3026

31-
await testScreenshot(t, takeScreenshot, `Datebox stylingMode=${stylingMode}, labelMode=${labelMode}.png`, { shouldTestInCompact: true });
27+
await testScreenshot(t, takeScreenshot, `Datebox.png`, { shouldTestInCompact: true });
3228

33-
for (const state of [DROP_DOWN_EDITOR_ACTIVE_CLASS, FOCUSED_STATE_CLASS] as any[]) {
34-
for (const id of t.ctx.ids) {
35-
await setClassAttribute(Selector(`#${id}`), state);
36-
}
29+
for (const state of [DROP_DOWN_EDITOR_ACTIVE_CLASS, FOCUSED_STATE_CLASS] as any[]) {
30+
for (const id of t.ctx.ids) {
31+
await setClassAttribute(Selector(`#${id}`), state);
32+
}
3733

38-
await testScreenshot(t, takeScreenshot, `Datebox ${state.replaceAll('dx-', '').replaceAll('dropdowneditor-', '').replaceAll('state-', '')} stylingMode=${stylingMode}, labelMode=${labelMode}.png`, { shouldTestInCompact: true });
34+
await testScreenshot(t, takeScreenshot, `Datebox ${state.replaceAll('dx-', '').replaceAll('dropdowneditor-', '').replaceAll('state-', '')}.png`, { shouldTestInCompact: true });
3935

40-
for (const id of t.ctx.ids) {
41-
await removeClassAttribute(Selector(`#${id}`), state);
42-
}
43-
}
36+
for (const id of t.ctx.ids) {
37+
await removeClassAttribute(Selector(`#${id}`), state);
38+
}
39+
}
4440

45-
await t
46-
.expect(compareResults.isValid())
47-
.ok(compareResults.errorMessages());
48-
}).before(async (t) => {
49-
t.ctx.ids = [];
41+
await t
42+
.expect(compareResults.isValid())
43+
.ok(compareResults.errorMessages());
44+
}).before(async (t) => {
45+
t.ctx.ids = [];
5046

51-
await insertStylesheetRulesToPage(`.${DATEBOX_CLASS} { display: inline-block; margin: 5px; }`);
47+
await insertStylesheetRulesToPage(`.${DATEBOX_CLASS} { display: inline-block; margin: 5px; }`);
5248

53-
for (const rtlEnabled of [true, false]) {
54-
for (const type of types) {
55-
for (const pickerType of pickerTypes) {
56-
const id = `${`dx${new Guid()}`}`;
49+
for (const type of types) {
50+
for (const pickerType of pickerTypes) {
51+
const id = `${`dx${new Guid()}`}`;
5752

58-
t.ctx.ids.push(id);
59-
await appendElementTo('#container', 'div', id, { });
53+
t.ctx.ids.push(id);
54+
await appendElementTo('#container', 'div', id, { });
6055

61-
const options: any = {
62-
width: 220,
63-
label: 'label text',
64-
labelMode,
65-
stylingMode,
66-
showClearButton: true,
67-
pickerType,
68-
type,
69-
rtlEnabled,
70-
value: new Date(2021, 9, 17, 16, 34),
71-
};
56+
const options: any = {
57+
width: 220,
58+
label: 'label text',
59+
showClearButton: true,
60+
pickerType,
61+
type,
62+
value: new Date(2021, 9, 17, 16, 34),
63+
};
7264

73-
await createWidget('dxDateBox', options, `#${id}`);
74-
}
75-
}
76-
}
77-
});
78-
});
65+
await createWidget('dxDateBox', options, `#${id}`);
66+
}
67+
}
7968
});

e2e/testcafe-devextreme/tests/editors/dateBox/label.ts

Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -16,67 +16,67 @@ const stylingModes = ['outlined', 'underlined', 'filled'];
1616
fixture.disablePageReloads`DateBox_Label`
1717
.page(url(__dirname, '../../container.html'));
1818

19-
stylingModes.forEach((stylingMode) => {
20-
test(`Symbol parts in label should not be cropped with stylingMode=${stylingMode}`, async (t) => {
21-
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
19+
test('Symbol parts in label should not be cropped', async (t) => {
20+
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
2221

23-
await testScreenshot(t, takeScreenshot, `Datebox label symbols with stylingMode=${stylingMode}.png`, { element: '#container' });
22+
await testScreenshot(t, takeScreenshot, 'Datebox label symbols.png', { element: '#container' });
2423

25-
await t
26-
.expect(compareResults.isValid())
27-
.ok(compareResults.errorMessages());
28-
}).before(async () => {
29-
await appendElementTo('#container', 'div', 'dateBox');
30-
await setStyleAttribute(Selector('#container'), 'box-sizing: border-box; width: 300px; height: 400px; padding: 8px;');
24+
await t
25+
.expect(compareResults.isValid())
26+
.ok(compareResults.errorMessages());
27+
}).before(async () => {
28+
await appendElementTo('#container', 'div', 'dateBox');
29+
await setStyleAttribute(Selector('#container'), 'box-sizing: border-box; width: 300px; height: 400px; padding: 8px;');
3130

32-
return createWidget('dxDateBox', {
33-
label: 'qwerty QWERTY 1234567890',
31+
for (const stylingMode of stylingModes) {
32+
const id = `${`dx${new Guid()}`}`;
33+
34+
await appendElementTo('#container', 'div', id, { });
35+
36+
const options: any = {
37+
width: 220,
38+
label: 'label text',
3439
stylingMode,
35-
value: new Date(1900, 0, 1),
36-
}, '#dateBox');
37-
});
40+
showClearButton: true,
41+
value: new Date(2021, 9, 17, 16, 34),
42+
};
43+
44+
await createWidget('dxDateBox', options, `#${id}`);
45+
}
3846
});
3947

40-
[true, false].forEach((isValid) => {
41-
test(`DateBox with buttons container, isValid=${isValid}`, async (t) => {
42-
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
43-
44-
await insertStylesheetRulesToPage(`#container { display: flex; flex-wrap: wrap; } .${DATEBOX_CLASS} { width: 220px; margin: 2px; }`);
45-
46-
await testScreenshot(t, takeScreenshot, `DateBox render with buttons container, isValid=${isValid}.png`, { shouldTestInCompact: true });
47-
48-
await removeStylesheetRulesFromPage();
49-
50-
await t
51-
.expect(compareResults.isValid())
52-
.ok(compareResults.errorMessages());
53-
}).before(async () => {
54-
for (const stylingMode of stylingModes) {
55-
for (const buttons of [
56-
['clear'],
57-
['clear', 'dropDown'],
58-
[{ name: 'custom', location: 'after', options: { icon: 'home' } }, 'clear', 'dropDown'],
59-
['clear', { name: 'custom', location: 'after', options: { icon: 'home' } }, 'dropDown'],
60-
['clear', 'dropDown', { name: 'custom', location: 'after', options: { icon: 'home' } }],
61-
[{ name: 'custom', location: 'before', options: { icon: 'home' } }, 'clear', 'dropDown'],
62-
['clear', { name: 'custom', location: 'before', options: { icon: 'home' } }, 'dropDown'],
63-
['clear', 'dropDown', { name: 'custom', location: 'before', options: { icon: 'home' } }],
64-
]) {
65-
for (const rtlEnabled of [true, false]) {
66-
const id = `${`dx${new Guid()}`}`;
67-
68-
await appendElementTo('#container', 'div', id, { });
69-
70-
await createWidget('dxDateBox', {
71-
value: new Date(2021, 9, 17),
72-
stylingMode,
73-
rtlEnabled,
74-
buttons,
75-
showClearButton: true,
76-
isValid,
77-
}, `#${id}`);
78-
}
48+
test('DateBox with buttons container', async (t) => {
49+
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
50+
51+
await insertStylesheetRulesToPage(`#container { display: flex; flex-wrap: wrap; } .${DATEBOX_CLASS} { width: 220px; margin: 2px; }`);
52+
53+
await testScreenshot(t, takeScreenshot, 'DateBox render with buttons container.png', { shouldTestInCompact: true });
54+
55+
await removeStylesheetRulesFromPage();
56+
57+
await t
58+
.expect(compareResults.isValid())
59+
.ok(compareResults.errorMessages());
60+
}).before(async () => {
61+
for (const stylingMode of stylingModes) {
62+
for (const buttons of [
63+
['clear'],
64+
['clear', 'dropDown'],
65+
[{ name: 'custom', location: 'after', options: { icon: 'home' } }, 'clear', 'dropDown'],
66+
]) {
67+
for (const isValid of [true, false]) {
68+
const id = `${`dx${new Guid()}`}`;
69+
70+
await appendElementTo('#container', 'div', id, { });
71+
72+
await createWidget('dxDateBox', {
73+
value: new Date(2021, 9, 17),
74+
stylingMode,
75+
buttons,
76+
showClearButton: true,
77+
isValid,
78+
}, `#${id}`);
7979
}
8080
}
81-
});
81+
}
8282
});
17 Bytes
Loading
79 Bytes
Loading
12 Bytes
Loading
Loading
Loading

e2e/testcafe-devextreme/tests/editors/tagBox/label.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ import { Selector } from 'testcafe';
22
import { createScreenshotsComparer } from 'devextreme-screenshot-comparer';
33
import TagBox from 'devextreme-testcafe-models/tagBox';
44
import { safeSizeTest } from '../../../helpers/safeSizeTest';
5-
import { testScreenshot } from '../../../helpers/themeUtils';
5+
import { isMaterial, testScreenshot } from '../../../helpers/themeUtils';
66
import url from '../../../helpers/getPageUrl';
77
import { createWidget } from '../../../helpers/createWidget';
88
import {
99
appendElementTo,
1010
setStyleAttribute,
11+
insertStylesheetRulesToPage,
1112
} from '../../../helpers/domUtils';
1213

1314
const stylingModes = ['outlined', 'underlined', 'filled'];
@@ -37,6 +38,10 @@ stylingModes.forEach((stylingMode) => {
3738
stylingMode,
3839
};
3940

41+
if (isMaterial()) {
42+
await insertStylesheetRulesToPage('#container .dx-widget { font-family: sans-serif }');
43+
}
44+
4045
await appendElementTo('#container', 'div', 'tagBox1', { });
4146
await appendElementTo('#container', 'div', 'tagBox2', { });
4247

0 commit comments

Comments
 (0)