Skip to content

Commit

Permalink
Merge pull request #2255 from epam/feat/fix_issues_related_to_e2e
Browse files Browse the repository at this point in the history
Improve e2e framework
  • Loading branch information
siarheiyelin authored May 16, 2024
2 parents 72d1bf0 + 61a5ee8 commit 7156d4b
Show file tree
Hide file tree
Showing 1,034 changed files with 335 additions and 688 deletions.
109 changes: 17 additions & 92 deletions app/src/docs/TabButton.doc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ import * as electric from '@epam/electric';
import {
DocBuilder,
DocPreviewBuilder,
TComponentPreview,
TDocConfig,
TDocContext,
TPreviewCellSize,
TPreviewCellSize, TPreviewMatrix,
TSkin,
} from '@epam/uui-docs';
import { BaseDocsBlock, DocExample, EditableDocContent } from '../common';
Expand Down Expand Up @@ -38,105 +37,31 @@ export class TabButtonDoc extends BaseDocsBlock {
href: 'https://google.com',
icon: 'action-account-fill.svg',
};
const cellSize: TPreviewCellSize = '190-70';
const baseMatrix: TComponentPreview<uui.TabButtonProps>['matrix'] = {
const w190_h70: TPreviewCellSize = '190-70';
const w165_h55: TPreviewCellSize = '165-55';
type TMatrixLocal = TPreviewMatrix<uui.TabButtonProps>;
const statesMatrix: TMatrixLocal = {
size: { values: ['36'] },
isLinkActive: { values: [false, true] },
isDisabled: { values: [false, true] },
};
const baseMatrix: TMatrixLocal = {
href: { values: [TEST_DATA.href] },
caption: { values: [TEST_DATA.caption] },
isLinkActive: { values: [true] },
count: { values: [undefined, TEST_DATA.count] },
withNotify: { values: [true, false] },
icon: { examples: [undefined, TEST_DATA.icon] },
iconPosition: { examples: '*', condition: (props) => !!props.icon },
size: { examples: '*' },
onClear: { examples: [undefined, TEST_DATA.callback] },
isDisabled: { values: [false] },
};

docPreview.add({
id: TTabButtonPreview['Active'],
matrix: {
isLinkActive: { values: [true] },
isDisabled: { values: [false] },
isDropdown: { values: [false] },
...baseMatrix,
onClear: { examples: [undefined, TEST_DATA.callback] },
},
cellSize,
});
docPreview.add({
id: TTabButtonPreview['Active Disabled'],
matrix: {
isLinkActive: { values: [true] },
isDisabled: { values: [true] },
isDropdown: { values: [false] },
...baseMatrix,
},
cellSize,
});
docPreview.add({
id: TTabButtonPreview['Active Dropdown'],
matrix: {
isLinkActive: { values: [true] },
isDisabled: { values: [false] },
isDropdown: { values: [true] },
isOpen: { values: [false] },
...baseMatrix,
onClear: { examples: [undefined, TEST_DATA.callback] },
},
cellSize,
});
docPreview.add({
id: TTabButtonPreview['Active Dropdown Disabled'],
matrix: {
isLinkActive: { values: [true] },
isDisabled: { values: [true] },
isDropdown: { values: [true] },
isOpen: { values: [false] },
...baseMatrix,
},
cellSize,
});
docPreview.add({
id: TTabButtonPreview['Inactive'],
matrix: {
isLinkActive: { values: [false] },
isDisabled: { values: [false] },
isDropdown: { values: [false] },
...baseMatrix,
onClear: { examples: [undefined, TEST_DATA.callback] },
},
cellSize,
});
docPreview.add({
id: TTabButtonPreview['Inactive Disabled'],
matrix: {
isLinkActive: { values: [false] },
isDisabled: { values: [true] },
isDropdown: { values: [false] },
...baseMatrix,
},
cellSize,
});
docPreview.add({
id: TTabButtonPreview['Inactive Dropdown'],
matrix: {
isLinkActive: { values: [false] },
isDisabled: { values: [false] },
isDropdown: { values: [true] },
isOpen: { values: [false] },
...baseMatrix,
onClear: { examples: [undefined, TEST_DATA.callback] },
},
cellSize,
});
docPreview.add({
id: TTabButtonPreview['Inactive Dropdown Disabled'],
matrix: {
isLinkActive: { values: [false] },
isDisabled: { values: [true] },
isDropdown: { values: [true] },
isOpen: { values: [false] },
...baseMatrix,
},
cellSize,
});
docPreview.add(TTabButtonPreview['Basic'], { ...baseMatrix }, w190_h70);
docPreview.add(TTabButtonPreview['Basic States'], { ...baseMatrix, ...statesMatrix }, w165_h55);
docPreview.add(TTabButtonPreview['Basic Dropdown'], { ...baseMatrix, isDropdown: { values: [true] } }, w190_h70);
docPreview.add(TTabButtonPreview['Basic Dropdown States'], { ...baseMatrix, isDropdown: { values: [true] }, ...statesMatrix }, w165_h55);
},
};

Expand Down
20 changes: 12 additions & 8 deletions app/src/docs/TextInput.doc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ export class TextInputDoc extends BaseDocsBlock {
placeholder: 'Test placeholder',
};
type TMatrixLocal = TPreviewMatrix<uui.TextInputProps>;
const statesBaseMatrix: TMatrixLocal = {
size: { values: ['30'] },
isInvalid: { values: [false, true] },
isDisabled: { values: [false, true], condition: (props) => !props.isInvalid },
isReadonly: { values: [false, true], condition: (props) => !props.isInvalid && !props.isDisabled },
};
const baseMatrix: TMatrixLocal = {
size: { examples: '*' },
icon: { examples: [undefined, TEST_DATA.icon] },
Expand All @@ -48,16 +54,14 @@ export class TextInputDoc extends BaseDocsBlock {
onCancel: { examples: ['callback'] },
value: { values: [undefined, TEST_DATA.value] },
};
const cellSize: TPreviewCellSize = '180-80';
const w180_h80: TPreviewCellSize = '180-80';
const w180_h50: TPreviewCellSize = '180-50';
const formBaseMatrix: TMatrixLocal = { mode: { examples: ['form'] }, ...baseMatrix };
docPreview.add(TTextInputPreview['Form'], formBaseMatrix, cellSize);
docPreview.add(TTextInputPreview['Form Invalid'], { ...formBaseMatrix, isInvalid: { values: [true] } }, cellSize);
docPreview.add(TTextInputPreview['Form Disabled'], { ...formBaseMatrix, isDisabled: { values: [true] } }, cellSize);
docPreview.add(TTextInputPreview['Form ReadOnly'], { ...formBaseMatrix, isReadonly: { values: [true] } }, cellSize);
docPreview.add(TTextInputPreview['Form'], formBaseMatrix, w180_h80);
docPreview.add(TTextInputPreview['Form States'], { ...formBaseMatrix, ...statesBaseMatrix }, w180_h50);
const inlineBaseMatrix: TMatrixLocal = { mode: { examples: ['inline'] }, ...baseMatrix };
docPreview.add(TTextInputPreview['Inline'], inlineBaseMatrix, cellSize);
docPreview.add(TTextInputPreview['Inline Disabled'], { ...inlineBaseMatrix, isDisabled: { values: [true] } }, cellSize);
docPreview.add(TTextInputPreview['Inline ReadOnly'], { ...inlineBaseMatrix, isReadonly: { values: [true] } }, cellSize);
docPreview.add(TTextInputPreview['Inline'], inlineBaseMatrix, w180_h80);
docPreview.add(TTextInputPreview['Inline States'], { ...inlineBaseMatrix, ...statesBaseMatrix }, w180_h50);
},
};

Expand Down
109 changes: 17 additions & 92 deletions app/src/docs/VerticalTabButton.doc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ import { BaseDocsBlock, DocExample, EditableDocContent } from '../common';
import {
DocBuilder,
DocPreviewBuilder,
TComponentPreview,
TDocConfig,
TDocContext,
TPreviewCellSize,
TPreviewCellSize, TPreviewMatrix,
TSkin,
} from '@epam/uui-docs';
import { TVerticalTabButtonPreview } from './_types/previewIds';
Expand Down Expand Up @@ -38,105 +37,31 @@ export class VerticalTabButtonDoc extends BaseDocsBlock {
href: 'https://google.com',
icon: 'action-account-fill.svg',
};
const cellSize: TPreviewCellSize = '190-70';
const baseMatrix: TComponentPreview<uui.TabButtonProps>['matrix'] = {
const w190_h70: TPreviewCellSize = '190-70';
const w165_h55: TPreviewCellSize = '165-55';
type TMatrixLocal = TPreviewMatrix<uui.TabButtonProps>;
const statesMatrix: TMatrixLocal = {
size: { values: ['36'] },
isLinkActive: { values: [false, true] },
isDisabled: { values: [false, true] },
};
const baseMatrix: TMatrixLocal = {
href: { values: [TEST_DATA.href] },
caption: { values: [TEST_DATA.caption] },
isLinkActive: { values: [true] },
count: { values: [undefined, TEST_DATA.count] },
withNotify: { values: [true, false] },
icon: { examples: [undefined, TEST_DATA.icon] },
iconPosition: { examples: '*', condition: (props) => !!props.icon },
size: { examples: '*' },
onClear: { examples: [undefined, TEST_DATA.callback] },
isDisabled: { values: [false] },
};

docPreview.add({
id: TVerticalTabButtonPreview['Active'],
matrix: {
isLinkActive: { values: [true] },
isDisabled: { values: [false] },
isDropdown: { values: [false] },
...baseMatrix,
onClear: { examples: [undefined, TEST_DATA.callback] },
},
cellSize,
});
docPreview.add({
id: TVerticalTabButtonPreview['Active Disabled'],
matrix: {
isLinkActive: { values: [true] },
isDisabled: { values: [true] },
isDropdown: { values: [false] },
...baseMatrix,
},
cellSize,
});
docPreview.add({
id: TVerticalTabButtonPreview['Active Dropdown'],
matrix: {
isLinkActive: { values: [true] },
isDisabled: { values: [false] },
isDropdown: { values: [true] },
isOpen: { values: [false] },
...baseMatrix,
onClear: { examples: [undefined, TEST_DATA.callback] },
},
cellSize,
});
docPreview.add({
id: TVerticalTabButtonPreview['Active Dropdown Disabled'],
matrix: {
isLinkActive: { values: [true] },
isDisabled: { values: [true] },
isDropdown: { values: [true] },
isOpen: { values: [false] },
...baseMatrix,
},
cellSize,
});
docPreview.add({
id: TVerticalTabButtonPreview['Inactive'],
matrix: {
isLinkActive: { values: [false] },
isDisabled: { values: [false] },
isDropdown: { values: [false] },
...baseMatrix,
onClear: { examples: [undefined, TEST_DATA.callback] },
},
cellSize,
});
docPreview.add({
id: TVerticalTabButtonPreview['Inactive Disabled'],
matrix: {
isLinkActive: { values: [false] },
isDisabled: { values: [true] },
isDropdown: { values: [false] },
...baseMatrix,
},
cellSize,
});
docPreview.add({
id: TVerticalTabButtonPreview['Inactive Dropdown'],
matrix: {
isLinkActive: { values: [false] },
isDisabled: { values: [false] },
isDropdown: { values: [true] },
isOpen: { values: [false] },
...baseMatrix,
onClear: { examples: [undefined, TEST_DATA.callback] },
},
cellSize,
});
docPreview.add({
id: TVerticalTabButtonPreview['Inactive Dropdown Disabled'],
matrix: {
isLinkActive: { values: [false] },
isDisabled: { values: [true] },
isDropdown: { values: [true] },
isOpen: { values: [false] },
...baseMatrix,
},
cellSize,
});
docPreview.add(TVerticalTabButtonPreview['Basic'], { ...baseMatrix }, w190_h70);
docPreview.add(TVerticalTabButtonPreview['Basic States'], { ...baseMatrix, ...statesMatrix }, w165_h55);
docPreview.add(TVerticalTabButtonPreview['Basic Dropdown'], { ...baseMatrix, isDropdown: { values: [true] } }, w190_h70);
docPreview.add(TVerticalTabButtonPreview['Basic Dropdown States'], { ...baseMatrix, isDropdown: { values: [true] }, ...statesMatrix }, w165_h55);
},
};

Expand Down
Loading

0 comments on commit 7156d4b

Please sign in to comment.