1515
1616// @ts -check
1717import { test , expect } from './fixture'
18- import { format } from 'date-fns'
1918
2019test . use ( {
2120 toolPath : '/tools/bucketexplorer' ,
@@ -185,7 +184,7 @@ test('upload and delete', async ({ page, utils }) => {
185184 await expect ( page . locator ( '[data-test="file-path"]' ) ) . toHaveText (
186185 '/ DEFAULT / tmp /' ,
187186 )
188- await utils . sleep ( 5000 ) // Ensure the table is rendered before getting the count
187+ await page . locator ( 'tbody> tr' ) . first ( ) . waitFor ( )
189188 let count = await page . locator ( 'tbody > tr' ) . count ( )
190189
191190 // Note that Promise.all prevents a race condition
@@ -264,7 +263,7 @@ test('navigate logs and tools bucket', async ({ page, utils }) => {
264263 )
265264 await expect ( page ) . toHaveURL ( / .* \/ t o o l s \/ b u c k e t e x p l o r e r \/ l o g s % 2 F D E F A U L T % 2 F / )
266265 // Ensure the log files have the correct dates
267- let date = format ( new Date ( ) , 'yyyyMMdd ' )
266+ let date = new Date ( ) . toISOString ( ) . split ( 'T' ) [ 0 ] . replace ( / - / g , '' )
268267 await page . getByRole ( 'cell' , { name : 'raw_logs' } ) . click ( )
269268 await page . getByRole ( 'cell' , { name : 'tlm' } ) . click ( )
270269 await page . getByRole ( 'cell' , { name : 'INST' , exact : true } ) . click ( )
@@ -335,7 +334,7 @@ test('auto refreshes to update files', async ({
335334 await page . locator ( '[data-test="upload-file-submit-btn"]' ) . click ( )
336335
337336 // The second tab shouldn't have refreshed yet, so the file shouldn't be there
338- await utils . sleep ( 5000 ) // Ensure the table is rendered before checking
337+ await page . locator ( 'tbody> tr' ) . first ( ) . waitFor ( )
339338 await expect (
340339 pageTwo . getByRole ( 'cell' , { name : 'package2.json' } ) ,
341340 ) . not . toBeVisible ( )
@@ -352,7 +351,7 @@ test('auto refreshes to update files', async ({
352351 await pageTwo . locator ( '.v-dialog' ) . press ( 'Escape' )
353352
354353 // Second tab should auto refresh in 1s and then the file should be there
355- await utils . sleep ( 5000 ) // Ensure the table is rendered before checking
354+ await page . locator ( 'tbody> tr' ) . first ( ) . waitFor ( )
356355 await expect (
357356 pageTwo . getByRole ( 'cell' , { name : 'package2.json' } ) ,
358357 ) . toBeVisible ( )
0 commit comments