@@ -15,6 +15,7 @@ import {
1515 compareNodes ,
1616 getEventListener ,
1717} from "@finos/perspective-test" ;
18+
1819import { expect , test } from "@playwright/test" ;
1920
2021let runTests = ( title : string , beforeEachAndLocalTests : ( ) => void ) => {
@@ -24,14 +25,17 @@ let runTests = (title: string, beforeEachAndLocalTests: () => void) => {
2425 test ( "Clicking edit button toggles sidebar" , async ( { page } ) => {
2526 let view = new PspViewer ( page ) ;
2627 await view . openSettingsPanel ( ) ;
27- let editBtn = view . dataGrid . regularTable . editBtnRow . first ( ) ;
28+ let editBtn = view . dataGrid . regularTable . editBtnRow
29+ . locator ( "th.psp-menu-enabled span" )
30+ . first ( ) ;
2831 await editBtn . click ( ) ;
2932 await view . columnSettingsSidebar . container . waitFor ( ) ;
3033 await editBtn . click ( ) ;
3134 await view . columnSettingsSidebar . container . waitFor ( {
3235 state : "hidden" ,
3336 } ) ;
3437 } ) ;
38+
3539 test ( "Toggling a column in the sidebar highlights in the plugin" , async ( {
3640 page,
3741 } ) => {
@@ -140,7 +144,6 @@ let runTests = (title: string, beforeEachAndLocalTests: () => void) => {
140144 expect ( name ) . toBeTruthy ( ) ;
141145 let td = await table . getFirstCellByColumnName ( name ) ;
142146 await td . waitFor ( ) ;
143- page . evaluate ( ( name ) => console . log ( name ) , name ) ;
144147
145148 // text style
146149 await view . columnSettingsSidebar . openTab ( "style" ) ;
@@ -149,18 +152,15 @@ let runTests = (title: string, beforeEachAndLocalTests: () => void) => {
149152 . locator ( "input[type=checkbox]:not(:disabled)" )
150153 . first ( ) ;
151154 let tdStyle = await td . evaluate ( ( node ) => {
152- console . log ( node . innerHTML , node . style . cssText ) ;
153155 return node . style . cssText ;
154156 } ) ;
155157 let listener = await getEventListener (
156158 page ,
157159 "perspective-column-style-change"
158160 ) ;
159- await checkbox . waitFor ( ) ;
160- await checkbox . click ( { timeout : 100 } ) ;
161+ await checkbox . click ( ) ;
161162 expect ( await listener ( ) ) . toBe ( true ) ;
162163 let newStyle = await td . evaluate ( ( node ) => {
163- console . log ( node . innerHTML , node . style . cssText ) ;
164164 return node . style . cssText ;
165165 } ) ;
166166 expect ( tdStyle ) . not . toBe ( newStyle ) ;
@@ -173,7 +173,7 @@ let runTests = (title: string, beforeEachAndLocalTests: () => void) => {
173173 let table = view . dataGrid . regularTable ;
174174
175175 let col = await view . getOrCreateColumnByType ( "string" ) ;
176- await col . editBtn . click ( { timeout : 100 } ) ;
176+ await col . editBtn . click ( ) ;
177177 let name = await col . name . innerText ( ) ;
178178 expect ( name ) . toBeTruthy ( ) ;
179179 let td = await table . getFirstCellByColumnName ( name ) ;
0 commit comments