1
1
import { FrameLocator , Page , expect , test } from '@playwright/test' ;
2
- import { awaitResponse , getMitoFrameWithTestCSV , checkColumnCellsHaveExpectedValues } from '../utils' ;
2
+ import { awaitResponse , getMitoFrameWithTestCSV , checkColumnCellsHaveExpectedValues , fillInput , updateSelectedValue } from '../utils' ;
3
3
4
4
const openColumnControlPanel = async ( mito : any , columnName : string ) => {
5
5
const columnHeader = await mito . locator ( '.endo-column-header-final-container' , { hasText : columnName } ) ;
@@ -8,15 +8,11 @@ const openColumnControlPanel = async (mito: any, columnName: string) => {
8
8
} ;
9
9
10
10
const changeDtypeInColumnControlPanel = async ( mito : FrameLocator , page : Page , dtype : string ) => {
11
- await mito . locator ( '.spacing-row' , { hasText : 'Dtype' } ) . locator ( '.select-text' ) . click ( ) ;
12
- await mito . locator ( '.mito-dropdown-item' , { hasText : dtype } ) . click ( ) ;
13
- await awaitResponse ( page ) ;
11
+ await updateSelectedValue ( mito , 'Dtype' , dtype ) ;
14
12
}
15
13
16
14
const changeNumTypeInColumnControlPanel = async ( mito : FrameLocator , page : Page , numType : string ) => {
17
- await mito . locator ( '.spacing-row' , { hasText : 'Num Type' } ) . locator ( '.select-text' ) . click ( ) ;
18
- await mito . locator ( '.mito-dropdown-item' , { hasText : numType } ) . click ( ) ;
19
- await awaitResponse ( page ) ;
15
+ await updateSelectedValue ( mito , 'Num Type' , numType ) ;
20
16
}
21
17
22
18
const checkValuesTabHasExpectedValues = async ( mito : FrameLocator , expectedValues : any [ ] ) => {
@@ -53,7 +49,7 @@ test.describe('Column Control Panel', () => {
53
49
54
50
await mito . getByText ( 'Add Filter' ) . click ( ) ;
55
51
await mito . getByText ( 'Add a Filter' ) . click ( ) ;
56
- await mito . locator ( '.spacing-row' , { hasText : 'Where' } ) . locator ( 'input' ) . fill ( '4' ) ;
52
+ await fillInput ( mito , 'Where' , '4' ) ;
57
53
await awaitResponse ( page ) ;
58
54
59
55
await checkColumnCellsHaveExpectedValues ( mito , 0 , [ '7' , '10' ] ) ;
@@ -66,7 +62,7 @@ test.describe('Column Control Panel', () => {
66
62
67
63
await mito . getByText ( 'Add Filter' ) . click ( ) ;
68
64
await mito . getByText ( 'Add a Group' ) . click ( ) ;
69
- await mito . locator ( '.spacing-row' , { hasText : 'Where' } ) . locator ( 'input' ) . fill ( '7' ) ;
65
+ await fillInput ( mito , 'Where' , '7' ) ;
70
66
await awaitResponse ( page ) ;
71
67
72
68
await checkColumnCellsHaveExpectedValues ( mito , 0 , [ '10' ] ) ;
0 commit comments