Skip to content

Commit

Permalink
Merge pull request #2229 from epam/feat/improve_e2e_framework
Browse files Browse the repository at this point in the history
Feat/improve e2e framework
  • Loading branch information
siarheiyelin authored May 7, 2024
2 parents a8aa6e8 + 092ee71 commit ff640ed
Show file tree
Hide file tree
Showing 225 changed files with 244 additions and 99 deletions.
10 changes: 5 additions & 5 deletions app/src/docs/TextInput.doc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ export class TextInputDoc extends BaseDocsBlock {
const cellSize: TPreviewCellSize = '180-80';
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 (read only)'], { ...formBaseMatrix, isReadonly: { values: [true] } }, 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);
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 (read only)'], { ...inlineBaseMatrix, isReadonly: { values: [true] } }, cellSize);
docPreview.add(TTextInputPreview['Inline Disabled'], { ...inlineBaseMatrix, isDisabled: { values: [true] } }, cellSize);
docPreview.add(TTextInputPreview['Inline ReadOnly'], { ...inlineBaseMatrix, isReadonly: { values: [true] } }, cellSize);
},
};

Expand Down
45 changes: 35 additions & 10 deletions app/src/docs/_types/previewIds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ export enum TCheckboxPreview {
}
export enum TTextInputPreview {
'Form'= 'Form',
'Form (invalid)'= 'Form (invalid)',
'Form (disabled)'= 'Form (disabled)',
'Form (read only)'= 'Form (read only)',
'Form Invalid'= 'Form Invalid',
'Form Disabled'= 'Form Disabled',
'Form ReadOnly'= 'Form ReadOnly',
'Inline'= 'Inline',
'Inline (disabled)'= 'Inline (disabled)',
'Inline (read only)'= 'Inline (read only)'
'Inline Disabled'= 'Inline Disabled',
'Inline ReadOnly'= 'Inline ReadOnly'
}
export enum TCountIndicatorPreview {
Colors = 'Colors',
Expand Down Expand Up @@ -117,6 +117,11 @@ export enum TPickerInputPreview {
'Form Multi HasValue Overflow Invalid'= 'Form Multi HasValue Overflow Invalid',
'Form Multi HasValue Overflow Disabled'= 'Form Multi HasValue Overflow Disabled',
'Form Multi HasValue Overflow ReadOnly'= 'Form Multi HasValue Overflow ReadOnly',
// Form > Opened > Dropdown
'Form Opened Dropdown List' = 'Form Opened Dropdown List',
'Form Opened Dropdown Multi List' = 'Form Opened Dropdown Multi List',
'Form Opened Dropdown Tree' = 'Form Opened Dropdown Tree',
'Form Opened Dropdown Multi Tree' = 'Form Opened Dropdown Multi Tree',
/** INLINE */
// Inline > Single
'Inline Single'= 'Inline Single',
Expand All @@ -142,9 +147,29 @@ export enum TPickerInputPreview {
'Inline Multi HasValue Overflow'= 'Inline Multi HasValue Overflow',
'Inline Multi HasValue Overflow Disabled'= 'Inline Multi HasValue Overflow Disabled',
'Inline Multi HasValue Overflow ReadOnly'= 'Inline Multi HasValue Overflow ReadOnly',
// Opened > Dropdown
'Opened Dropdown Form List' = 'Opened Dropdown Form List',
'Opened Dropdown Form Multi List' = 'Opened Dropdown Form Multi List',
'Opened Dropdown Form Tree' = 'Opened Dropdown Form Tree',
'Opened Dropdown Form Multi Tree' = 'Opened Dropdown Form Multi Tree'
/** CELL */
// Cell > Single
'Cell Single'= 'Cell Single',
'Cell Single Disabled'= 'Cell Single Disabled',
'Cell Single ReadOnly'= 'Cell Single ReadOnly',
// Cell > Single > HasValue
'Cell Single HasValue'= 'Cell Single HasValue',
'Cell Single HasValue Disabled'= 'Cell Single HasValue Disabled',
'Cell Single HasValue ReadOnly'= 'Cell Single HasValue ReadOnly',
// Cell > Multi
'Cell Multi'= 'Cell Multi',
'Cell Multi Disabled'= 'Cell Multi Disabled',
'Cell Multi ReadOnly'= 'Cell Multi ReadOnly',
// Cell > Multi > HasValue
'Cell Multi HasValue'= 'Cell Multi HasValue',
'Cell Multi HasValue Disabled'= 'Cell Multi HasValue Disabled',
'Cell Multi HasValue ReadOnly'= 'Cell Multi HasValue ReadOnly',
// Cell > Multi > HasValue > MultiLine
'Cell Multi HasValue MultiLine'= 'Cell Multi HasValue MultiLine',
'Cell Multi HasValue MultiLine Disabled'= 'Cell Multi HasValue MultiLine Disabled ',
'Cell Multi HasValue MultiLine ReadOnly'= 'Cell Multi HasValue MultiLine ReadOnly',
// Cell > Multi > HasValue > Overflow
'Cell Multi HasValue Overflow'= 'Cell Multi HasValue Overflow',
'Cell Multi HasValue Overflow Disabled'= 'Cell Multi HasValue Overflow Disabled',
'Cell Multi HasValue Overflow ReadOnly'= 'Cell Multi HasValue Overflow ReadOnly'
}
189 changes: 133 additions & 56 deletions app/src/docs/pickerInput/PickerInput.doc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,16 @@ export class PickerInputDoc extends BaseDocsBlock {
formMulti: 'Form Multi',
formMultiHasValue: 'Form Multi HasValue',
formOpened: 'Form Opened',
//
inlineSingle: 'Inline Single',
inlineSingleHasValue: 'Inline Single HasValue',
inlineMulti: 'Inline Multi',
inlineMultiHasValue: 'Inline Multi HasValue',
//
cellSingle: 'Cell Single',
cellSingleHasValue: 'Cell Single HasValue',
cellMulti: 'Cell Multi',
cellMultiHasValue: 'Cell Multi HasValue',
};

type TMatrixLocal = TPreviewMatrix<uui.PickerInputProps<any, any>>;
Expand Down Expand Up @@ -189,6 +195,66 @@ export class PickerInputDoc extends BaseDocsBlock {
docPreview.add(GROUPS.formMultiHasValue, TPickerInputPreview['Form Multi HasValue Overflow Disabled'], { ...formMultiHasValueOverflowBaseMatrix, isDisabled: { values: [true] } }, w210_h65);
docPreview.add(GROUPS.formMultiHasValue, TPickerInputPreview['Form Multi HasValue Overflow ReadOnly'], { ...formMultiHasValueOverflowBaseMatrix, isReadonly: { values: [true] } }, w210_h65);

/**
* Form Opened Dropdown
*/
const openedBaseMatrix: TMatrixLocal = {
mode: { values: ['form'] },
valueType: { values: ['id'] },
};
docPreview.add({
groupId: GROUPS.formOpened,
id: TPickerInputPreview['Form Opened Dropdown List'],
context: TDocContext.OpenedPickerInput,
cellSize: w400_h480,
matrix: {
...openedBaseMatrix,
getName: { values: [(i) => i.level] },
dataSource: { examples: [TEST_DATA.dsLanguageLevels] },
selectionMode: { values: ['single'] },
value: { values: [undefined, 1] },
},
});
docPreview.add({
groupId: GROUPS.formOpened,
id: TPickerInputPreview['Form Opened Dropdown Multi List'],
context: TDocContext.OpenedPickerInput,
cellSize: w400_h480,
matrix: {
...openedBaseMatrix,
getName: { values: [(i) => i.level] },
dataSource: { examples: [TEST_DATA.dsLanguageLevels] },
selectionMode: { values: ['multi'] },
value: { values: [undefined, [1]] },
},
});
docPreview.add({
groupId: GROUPS.formOpened,
id: TPickerInputPreview['Form Opened Dropdown Tree'],
context: TDocContext.OpenedPickerInput,
cellSize: w400_h480,
matrix: {
...openedBaseMatrix,
getName: { values: [(i) => i.name] },
dataSource: { values: [TEST_DATA.euLocationsDs] },
selectionMode: { values: ['single'] },
value: { values: [undefined, TEST_DATA.euLocationsLyon] },
},
});
docPreview.add({
groupId: GROUPS.formOpened,
id: TPickerInputPreview['Form Opened Dropdown Multi Tree'],
context: TDocContext.OpenedPickerInput,
cellSize: w400_h480,
matrix: {
...openedBaseMatrix,
getName: { values: [(i) => i.name] },
dataSource: { values: [TEST_DATA.euLocationsDs] },
selectionMode: { values: ['multi'] },
value: { values: [undefined, [TEST_DATA.euLocationsLyon]] },
},
});

/**
* 2.1 Inline Single
*/
Expand Down Expand Up @@ -261,64 +327,75 @@ export class PickerInputDoc extends BaseDocsBlock {
docPreview.add(GROUPS.inlineMultiHasValue, TPickerInputPreview['Inline Multi HasValue Overflow ReadOnly'], { ...inlineMultiHasValueOverflowBaseMatrix, isReadonly: { values: [true] } }, w210_h65);

/**
* Opened Dropdown
* 3.1 Cell Single
*/
const openedBaseMatrix: TMatrixLocal = {
mode: { values: ['form'] },
valueType: { values: ['id'] },
const cellSingleBaseMatrix: TMatrixLocal = {
mode: { values: ['cell'] },
selectionMode: { values: ['single'] },
value: { values: [undefined] },
isInvalid: { values: [false] },
isDisabled: { values: [false] },
isReadonly: { values: [false] },
...baseMatrix,
};
docPreview.add({
groupId: GROUPS.formOpened,
id: TPickerInputPreview['Opened Dropdown Form List'],
context: TDocContext.OpenedPickerInput,
cellSize: w400_h480,
matrix: {
...openedBaseMatrix,
getName: { values: [(i) => i.level] },
dataSource: { examples: [TEST_DATA.dsLanguageLevels] },
selectionMode: { values: ['single'] },
value: { values: [undefined, 1] },
},
});
docPreview.add({
groupId: GROUPS.formOpened,
id: TPickerInputPreview['Opened Dropdown Form Multi List'],
context: TDocContext.OpenedPickerInput,
cellSize: w400_h480,
matrix: {
...openedBaseMatrix,
getName: { values: [(i) => i.level] },
dataSource: { examples: [TEST_DATA.dsLanguageLevels] },
selectionMode: { values: ['multi'] },
value: { values: [undefined, [1]] },
},
});
docPreview.add({
groupId: GROUPS.formOpened,
id: TPickerInputPreview['Opened Dropdown Form Tree'],
context: TDocContext.OpenedPickerInput,
cellSize: w400_h480,
matrix: {
...openedBaseMatrix,
getName: { values: [(i) => i.name] },
dataSource: { values: [TEST_DATA.euLocationsDs] },
selectionMode: { values: ['single'] },
value: { values: [undefined, TEST_DATA.euLocationsLyon] },
},
});
docPreview.add({
groupId: GROUPS.formOpened,
id: TPickerInputPreview['Opened Dropdown Form Multi Tree'],
context: TDocContext.OpenedPickerInput,
cellSize: w400_h480,
matrix: {
...openedBaseMatrix,
getName: { values: [(i) => i.name] },
dataSource: { values: [TEST_DATA.euLocationsDs] },
selectionMode: { values: ['multi'] },
value: { values: [undefined, [TEST_DATA.euLocationsLyon]] },
},
});
docPreview.add(GROUPS.cellSingle, TPickerInputPreview['Cell Single'], cellSingleBaseMatrix, w130_h65);
docPreview.add(GROUPS.cellSingle, TPickerInputPreview['Cell Single Disabled'], { ...cellSingleBaseMatrix, isDisabled: { values: [true] } }, w130_h65);
docPreview.add(GROUPS.cellSingle, TPickerInputPreview['Cell Single ReadOnly'], { ...cellSingleBaseMatrix, isReadonly: { values: [true] } }, w130_h65);
/**
* 3.2 Cell Single HasValue
*/
const cellSingleHasValueBaseMatrix: TMatrixLocal = { ...cellSingleBaseMatrix, value: { values: [TEST_DATA.value] } };
docPreview.add(GROUPS.cellSingleHasValue, TPickerInputPreview['Cell Single HasValue'], cellSingleHasValueBaseMatrix, w130_h65);
docPreview.add(GROUPS.cellSingleHasValue, TPickerInputPreview['Cell Single HasValue Disabled'], { ...cellSingleHasValueBaseMatrix, isDisabled: { values: [true] } }, w130_h65);
docPreview.add(GROUPS.cellSingleHasValue, TPickerInputPreview['Cell Single HasValue ReadOnly'], { ...cellSingleHasValueBaseMatrix, isReadonly: { values: [true] } }, w130_h65);
/**
* 3.3 Cell Multi
*/
const cellMultiBaseMatrix: TMatrixLocal = {
mode: { values: ['cell'] },
selectionMode: { values: ['multi'] },
value: { values: [undefined] },
maxItems: { values: [10] },
isSingleLine: { values: [false, true] },
...baseMatrix,
};
docPreview.add(GROUPS.cellMulti, TPickerInputPreview['Cell Multi'], cellMultiBaseMatrix, w130_h100);
docPreview.add(GROUPS.cellMulti, TPickerInputPreview['Cell Multi Disabled'], { ...cellMultiBaseMatrix, isDisabled: { values: [true] } }, w130_h100);
docPreview.add(GROUPS.cellMulti, TPickerInputPreview['Cell Multi ReadOnly'], { ...cellMultiBaseMatrix, isReadonly: { values: [true] } }, w130_h100);
/**
* 3.4 Cell Multi HasValue
*/
const cellMultiHasValueBaseMatrix: TMatrixLocal = {
...cellMultiBaseMatrix,
isSingleLine: { values: [true] },
value: { values: [TEST_DATA.valueMulti2] },
};
docPreview.add(GROUPS.cellMultiHasValue, TPickerInputPreview['Cell Multi HasValue'], cellMultiHasValueBaseMatrix, w210_h65);
docPreview.add(GROUPS.cellMultiHasValue, TPickerInputPreview['Cell Multi HasValue Disabled'], { ...cellMultiHasValueBaseMatrix, isDisabled: { values: [true] } }, w210_h65);
docPreview.add(GROUPS.cellMultiHasValue, TPickerInputPreview['Cell Multi HasValue ReadOnly'], { ...cellMultiHasValueBaseMatrix, isReadonly: { values: [true] } }, w210_h65);
/**
* 3.5 Cell Multi HasValue MultiLine
*/
const cellMultiHasValueMultiLineBaseMatrix: TMatrixLocal = {
...cellMultiHasValueBaseMatrix,
isSingleLine: { values: [false] },
value: { values: [TEST_DATA.valueMulti5] },
};
docPreview.add(GROUPS.cellMultiHasValue, TPickerInputPreview['Cell Multi HasValue MultiLine'], cellMultiHasValueMultiLineBaseMatrix, w210_h240);
docPreview.add(GROUPS.cellMultiHasValue, TPickerInputPreview['Cell Multi HasValue MultiLine Disabled'], { ...cellMultiHasValueMultiLineBaseMatrix, isDisabled: { values: [true] }, value: { values: [TEST_DATA.valueMulti8] } }, w210_h160);
docPreview.add(GROUPS.cellMultiHasValue, TPickerInputPreview['Cell Multi HasValue MultiLine ReadOnly'], { ...cellMultiHasValueMultiLineBaseMatrix, isReadonly: { values: [true] }, value: { values: [TEST_DATA.valueMulti8] } }, w210_h160);
/**
* 3.6 Cell Multi HasValue Overflow
*/
const cellMultiHasValueOverflowBaseMatrix: TMatrixLocal = {
...cellMultiHasValueBaseMatrix,
isSingleLine: { values: [true] },
maxItems: { values: [1] },
value: { values: [TEST_DATA.valueMulti2] },
};
docPreview.add(GROUPS.cellMultiHasValue, TPickerInputPreview['Cell Multi HasValue Overflow'], cellMultiHasValueOverflowBaseMatrix, w210_h65);
docPreview.add(GROUPS.cellMultiHasValue, TPickerInputPreview['Cell Multi HasValue Overflow Disabled'], { ...cellMultiHasValueOverflowBaseMatrix, isDisabled: { values: [true] } }, w210_h65);
docPreview.add(GROUPS.cellMultiHasValue, TPickerInputPreview['Cell Multi HasValue Overflow ReadOnly'], { ...cellMultiHasValueOverflowBaseMatrix, isReadonly: { values: [true] } }, w210_h65);
},
};

Expand Down
6 changes: 5 additions & 1 deletion uui-e2e-tests/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ const { UUI_APP_BASE_URL, UUI_APP_BASE_URL_CI } = readEnvFile();
const timeout = isCi ? 20000 : 50000;
const maxFailures = isCi ? 10 : undefined;
const retries = isCi ? 1 : 0;
const workers = isCi ? 1 : undefined;
/**
* The fastest option (for both CI and Local) is to use default (undefined) amount of workers (which is 50% of CPU cores).
*/
const workers = isCi ? undefined : undefined;
const forbidOnly = isCi;
const trace = (isCi ? 'retry-with-trace' : 'retain-on-failure') as TraceMode;
const server = {
Expand Down Expand Up @@ -42,6 +45,7 @@ export default defineConfig({
['json', { outputFile: outputJsonFile }],
],
use: {
bypassCSP: true,
baseURL: server.baseUrl,
trace,
...SHARED_DEVICE_CFG.DEFAULT,
Expand Down
Loading

0 comments on commit ff640ed

Please sign in to comment.