Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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.
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.
970 changes: 970 additions & 0 deletions e2e/testcafe-devextreme/tests/cardView/selection/functional.ts

Large diffs are not rendered by default.

355 changes: 355 additions & 0 deletions e2e/testcafe-devextreme/tests/cardView/selection/visual.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,355 @@
import CardView from 'devextreme-testcafe-models/cardView';
import { createScreenshotsComparer } from 'devextreme-screenshot-comparer';
import { ClientFunction } from 'testcafe';
import url from '../../../helpers/getPageUrl';
import { createWidget } from '../../../helpers/createWidget';
import { testScreenshot } from '../../../helpers/themeUtils';

fixture`Selection.Visual`
.page(url(__dirname, '../../container.html'));

const CARD_VIEW_SELECTOR = '#container';

test('Single mode', async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
const cardView = new CardView(CARD_VIEW_SELECTOR);

await testScreenshot(t, takeScreenshot, 'card-view_single_selection.png', { element: cardView.element });

await t
.expect(compareResults.isValid())
.ok(compareResults.errorMessages());
}).before(async () => createWidget('dxCardView', {
dataSource: [
{
id: 0, title: 'header1', A: 'A_0', B: 'B_0', C: 'C_0',
},
{
id: 1, title: 'header2', A: 'A_1', B: 'B_1', C: 'C_1',
},
{
id: 2, title: 'header3', A: 'A_2', B: 'B_2', C: 'C_2',
},
{
id: 3, title: 'header4', A: 'A_3', B: 'B_3', C: 'C_3',
},
{
id: 4, title: 'header5', A: 'A_4', B: 'B_4', C: 'C_4',
},
],
cardHeader: {
captionExpr: () => 'title',
},
columns: ['A', 'B', 'C'],
keyExpr: 'id',
height: 700,
selectedCardKeys: [0],
selection: {
mode: 'single',
},
}));

test('Multiple mode with Select All/Deselect All and showCheckBoxesMode = \'none\'', async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
const cardView = new CardView(CARD_VIEW_SELECTOR);

await testScreenshot(t, takeScreenshot, 'card-view_miltiple_selection_with_showCheckBoxesMode_=_none.png', { element: cardView.element });

await t
.expect(compareResults.isValid())
.ok(compareResults.errorMessages());
}).before(async () => createWidget('dxCardView', {
dataSource: [
{
id: 0, title: 'header1', A: 'A_0', B: 'B_0', C: 'C_0',
},
{
id: 1, title: 'header2', A: 'A_1', B: 'B_1', C: 'C_1',
},
{
id: 2, title: 'header3', A: 'A_2', B: 'B_2', C: 'C_2',
},
{
id: 3, title: 'header4', A: 'A_3', B: 'B_3', C: 'C_3',
},
{
id: 4, title: 'header5', A: 'A_4', B: 'B_4', C: 'C_4',
},
],
cardHeader: {
captionExpr: () => 'title',
},
columns: ['A', 'B', 'C'],
keyExpr: 'id',
height: 700,
selection: {
mode: 'multiple',
showCheckBoxesMode: 'none',
allowSelectAll: true,
},
}));

test('Multiple mode with Select All/Deselect All and showCheckBoxesMode = \'always\'', async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
const cardView = new CardView(CARD_VIEW_SELECTOR);

await testScreenshot(t, takeScreenshot, 'card-view_miltiple_selection_with_showCheckBoxesMode_=_always.png', { element: cardView.element });

await t
.expect(compareResults.isValid())
.ok(compareResults.errorMessages());
}).before(async () => createWidget('dxCardView', {
dataSource: [
{
id: 0, title: 'header1', A: 'A_0', B: 'B_0', C: 'C_0',
},
{
id: 1, title: 'header2', A: 'A_1', B: 'B_1', C: 'C_1',
},
{
id: 2, title: 'header3', A: 'A_2', B: 'B_2', C: 'C_2',
},
{
id: 3, title: 'header4', A: 'A_3', B: 'B_3', C: 'C_3',
},
{
id: 4, title: 'header5', A: 'A_4', B: 'B_4', C: 'C_4',
},
],
cardHeader: {
captionExpr: () => 'title',
},
columns: ['A', 'B', 'C'],
keyExpr: 'id',
height: 700,
selection: {
mode: 'multiple',
showCheckBoxesMode: 'always',
allowSelectAll: true,
},
}));

test('Multiple mode with Select All/Deselect All and showCheckBoxesMode = \'onClick\'', async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
const cardView = new CardView(CARD_VIEW_SELECTOR);
const firstSelectCheckboxItemContent = cardView
.getCard(0)
.getToolbarItemContent(0);

await testScreenshot(t, takeScreenshot, 'card-view_miltiple_selection_with_showCheckBoxesMode_=_onClick_1.png', { element: cardView.element });

await t.hover(firstSelectCheckboxItemContent);

await testScreenshot(t, takeScreenshot, 'card-view_miltiple_selection_with_showCheckBoxesMode_=_onClick_2.png', { element: cardView.element });

await t.hover(cardView.element);

await testScreenshot(t, takeScreenshot, 'card-view_miltiple_selection_with_showCheckBoxesMode_=_onClick_3.png', { element: cardView.element });

await t
.expect(compareResults.isValid())
.ok(compareResults.errorMessages());
}).before(async () => createWidget('dxCardView', {
dataSource: [
{
id: 0, title: 'header1', A: 'A_0', B: 'B_0', C: 'C_0',
},
{
id: 1, title: 'header2', A: 'A_1', B: 'B_1', C: 'C_1',
},
{
id: 2, title: 'header3', A: 'A_2', B: 'B_2', C: 'C_2',
},
{
id: 3, title: 'header4', A: 'A_3', B: 'B_3', C: 'C_3',
},
{
id: 4, title: 'header5', A: 'A_4', B: 'B_4', C: 'C_4',
},
],
cardHeader: {
captionExpr: () => 'title',
},
columns: ['A', 'B', 'C'],
keyExpr: 'id',
height: 700,
selection: {
mode: 'multiple',
showCheckBoxesMode: 'onClick',
allowSelectAll: true,
},
}));

test('Multiple mode with a selected card and showCheckBoxesMode = \'onClick\'', async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
const cardView = new CardView(CARD_VIEW_SELECTOR);

await testScreenshot(t, takeScreenshot, 'card-view_checkbox_visibility_with_showCheckBoxesMode_=_onClick.png', { element: cardView.element });

await t
.expect(compareResults.isValid())
.ok(compareResults.errorMessages());
}).before(async () => createWidget('dxCardView', {
dataSource: [
{
id: 0, title: 'header1', A: 'A_0', B: 'B_0', C: 'C_0',
},
{
id: 1, title: 'header2', A: 'A_1', B: 'B_1', C: 'C_1',
},
{
id: 2, title: 'header3', A: 'A_2', B: 'B_2', C: 'C_2',
},
{
id: 3, title: 'header4', A: 'A_3', B: 'B_3', C: 'C_3',
},
{
id: 4, title: 'header5', A: 'A_4', B: 'B_4', C: 'C_4',
},
],
cardHeader: {
captionExpr: () => 'title',
},
columns: ['A', 'B', 'C'],
selectedCardKeys: [0],
keyExpr: 'id',
height: 700,
selection: {
mode: 'multiple',
showCheckBoxesMode: 'onClick',
allowSelectAll: true,
},
}));

test('Multiple mode with selected cards and showCheckBoxesMode = \'onClick\'', async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
const cardView = new CardView(CARD_VIEW_SELECTOR);

await testScreenshot(t, takeScreenshot, 'card-view_checkboxes_visibility_with_showCheckBoxesMode_=_onClick.png', { element: cardView.element });

await t
.expect(compareResults.isValid())
.ok(compareResults.errorMessages());
}).before(async () => createWidget('dxCardView', {
dataSource: [
{
id: 0, title: 'header1', A: 'A_0', B: 'B_0', C: 'C_0',
},
{
id: 1, title: 'header2', A: 'A_1', B: 'B_1', C: 'C_1',
},
{
id: 2, title: 'header3', A: 'A_2', B: 'B_2', C: 'C_2',
},
{
id: 3, title: 'header4', A: 'A_3', B: 'B_3', C: 'C_3',
},
{
id: 4, title: 'header5', A: 'A_4', B: 'B_4', C: 'C_4',
},
],
cardHeader: {
captionExpr: () => 'title',
},
columns: ['A', 'B', 'C'],
selectedCardKeys: [0, 1],
keyExpr: 'id',
height: 700,
selection: {
mode: 'multiple',
showCheckBoxesMode: 'onClick',
allowSelectAll: true,
},
}));

test('Multiple mode with Select All/Deselect All and showCheckBoxesMode = \'onLongTap\'', async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
const cardView = new CardView(CARD_VIEW_SELECTOR);
const firstCard = cardView.getCard(0);

await testScreenshot(t, takeScreenshot, 'card-view_miltiple_selection_with_showCheckBoxesMode_=_onLongTap_1.png', { element: cardView.element });

await ClientFunction((card) => {
$(card()).trigger('dxhold');
})(firstCard.element);

await testScreenshot(t, takeScreenshot, 'card-view_miltiple_selection_with_showCheckBoxesMode_=_onLongTap_2.png', { element: cardView.element });

await ClientFunction((card) => {
$(card()).trigger('dxhold');
})(firstCard.element);

await testScreenshot(t, takeScreenshot, 'card-view_miltiple_selection_with_showCheckBoxesMode_=_onLongTap_3.png', { element: cardView.element });

await t
.expect(compareResults.isValid())
.ok(compareResults.errorMessages());
}).before(async () => createWidget('dxCardView', {
dataSource: [
{
id: 0, title: 'header1', A: 'A_0', B: 'B_0', C: 'C_0',
},
{
id: 1, title: 'header2', A: 'A_1', B: 'B_1', C: 'C_1',
},
{
id: 2, title: 'header3', A: 'A_2', B: 'B_2', C: 'C_2',
},
{
id: 3, title: 'header4', A: 'A_3', B: 'B_3', C: 'C_3',
},
{
id: 4, title: 'header5', A: 'A_4', B: 'B_4', C: 'C_4',
},
],
cardHeader: {
captionExpr: () => 'title',
},
columns: ['A', 'B', 'C'],
keyExpr: 'id',
height: 700,
selection: {
mode: 'multiple',
showCheckBoxesMode: 'onLongTap',
allowSelectAll: true,
},
}));

test('Multiple mode without Select All/Deselect All', async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
const cardView = new CardView(CARD_VIEW_SELECTOR);

await testScreenshot(t, takeScreenshot, 'card-view_miltiple_selection_without_select-all.png', { element: cardView.element });

await t
.expect(compareResults.isValid())
.ok(compareResults.errorMessages());
}).before(async () => createWidget('dxCardView', {
dataSource: [
{
id: 0, title: 'header1', A: 'A_0', B: 'B_0', C: 'C_0',
},
{
id: 1, title: 'header2', A: 'A_1', B: 'B_1', C: 'C_1',
},
{
id: 2, title: 'header3', A: 'A_2', B: 'B_2', C: 'C_2',
},
{
id: 3, title: 'header4', A: 'A_3', B: 'B_3', C: 'C_3',
},
{
id: 4, title: 'header5', A: 'A_4', B: 'B_4', C: 'C_4',
},
],
cardHeader: {
captionExpr: () => 'title',
},
columns: ['A', 'B', 'C'],
keyExpr: 'id',
height: 700,
selection: {
mode: 'multiple',
allowSelectAll: false,
},
}));
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,9 @@
border: $cardview-card-border-size solid $cardview-card-border-color;
border-radius: $cardview-card-border-radius;
background-color: $cardview-card-background-color;
overflow: hidden;
}

.dx-cardview-card-selection {
background-color: $cardview-card-selection-background-color;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ $cardview-card-border-size: null !default;
$cardview-card-min-width: null !default;
$cardview-card-border-radius: null !default;
$cardview-card-background-color: null !default;
$cardview-card-selection-background-color: null !default;
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,27 @@
}
}
}

.dx-cardview-select-checkboxes-hidden .dx-cardview-card:not(.dx-cardview-card-selection) .dx-cardview-select-checkbox {
.dx-checkbox {
display: none;
}

.dx-toolbar-item-content::before {
content: '';
width: 20px;
height: 20px;
display: inline-block;
pointer-events: none;
}

.dx-toolbar-item-content:hover {
&::before {
display: none;
}

.dx-checkbox {
display: inline-block;
}
}
}
Loading
Loading