@ -17,10 +17,8 @@ export class ToolbarFieldsPage extends BasePage {
// todo: Click and toggle are similar method. Remove one of them
async toggle ( { title , isLocallySaved } : { title : string ; isLocallySaved? : boolean } ) {
await this . toolbar . clickFields ( ) ;
const toggleColumn = this . get ( )
. locator ( ` [data-testid="nc-fields-menu- ${ title } "] ` )
. locator ( 'input[type="checkbox"]' )
. click ( ) ;
const toggleColumn = ( ) = >
this . get ( ) . locator ( ` [data-testid="nc-fields-menu- ${ title } "] ` ) . locator ( 'input[type="checkbox"]' ) . click ( ) ;
await this . waitForResponse ( {
uiAction : toggleColumn ,
@ -43,7 +41,8 @@ export class ToolbarFieldsPage extends BasePage {
async click ( { title , isLocallySaved } : { title : string ; isLocallySaved? : boolean } ) {
await this . waitForResponse ( {
uiAction : this.get ( ) . locator ( ` [data-testid="nc-fields-menu- ${ title } "] ` ) . locator ( 'input[type="checkbox"]' ) . click ( ) ,
uiAction : ( ) = >
this . get ( ) . locator ( ` [data-testid="nc-fields-menu- ${ title } "] ` ) . locator ( 'input[type="checkbox"]' ) . click ( ) ,
requestUrlPathToMatch : isLocallySaved ? '/api/v1/db/public/' : '/api/v1/db/data/noco/' ,
httpMethodsToMatch : [ 'GET' ] ,
} ) ;
@ -53,7 +52,7 @@ export class ToolbarFieldsPage extends BasePage {
async hideAll ( { isLocallySaved } : { isLocallySaved? : boolean } = { } ) {
await this . toolbar . clickFields ( ) ;
await this . waitForResponse ( {
uiAction : this. get ( ) . locator ( ` button:has-text("Hide all") ` ) . click ( ) ,
uiAction : ( ) = > this . get ( ) . locator ( ` button:has-text("Hide all") ` ) . click ( ) ,
requestUrlPathToMatch : isLocallySaved ? '/api/v1/db/public/' : '/api/v1/db/data/noco/' ,
httpMethodsToMatch : [ 'GET' ] ,
} ) ;
@ -63,7 +62,7 @@ export class ToolbarFieldsPage extends BasePage {
async showAll ( { isLocallySaved } : { isLocallySaved? : boolean } = { } ) {
await this . toolbar . clickFields ( ) ;
await this . waitForResponse ( {
uiAction : this. get ( ) . locator ( ` button:has-text("Show all") ` ) . click ( ) ,
uiAction : ( ) = > this . get ( ) . locator ( ` button:has-text("Show all") ` ) . click ( ) ,
requestUrlPathToMatch : isLocallySaved ? '/api/v1/db/public/' : '/api/v1/db/data/noco/' ,
httpMethodsToMatch : [ 'GET' ] ,
} ) ;
@ -73,7 +72,7 @@ export class ToolbarFieldsPage extends BasePage {
async toggleShowSystemFields ( { isLocallySaved } : { isLocallySaved? : boolean } = { } ) {
await this . toolbar . clickFields ( ) ;
await this . waitForResponse ( {
uiAction : this. get ( ) . locator ( ` .nc-fields-show-system-fields ` ) . click ( ) ,
uiAction : ( ) = > this . get ( ) . locator ( ` .nc-fields-show-system-fields ` ) . click ( ) ,
requestUrlPathToMatch : isLocallySaved ? '/api/v1/db/public/' : '/api/v1/db/data/noco/' ,
httpMethodsToMatch : [ 'GET' ] ,
} ) ;