Skip to content

Commit 70baedb

Browse files
test: Update row action tests
AI-assistant: Claude Code v2.1.101 (Claude Sonnet 4.6) Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
1 parent 4f3c174 commit 70baedb

2 files changed

Lines changed: 12 additions & 10 deletions

File tree

playwright/e2e/column-number.spec.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
import { test, expect } from '../support/fixtures'
7-
import { createNumberColumn, createTable, loadTable, removeColumn } from '../support/commands'
7+
import { createNumberColumn, createTable, loadTable, openRowActionMenu, removeColumn } from '../support/commands'
88

99
const columnTitle = 'num1'
1010
const tableTitle = 'Test number column'
@@ -26,9 +26,10 @@ test.describe('Test column number', () => {
2626
await expect(page.locator('.custom-table table tr td div').filter({ hasText: '21.00' }).first()).toBeVisible()
2727

2828
// delete row
29-
await page.locator('.NcTable tr td button').first().click()
30-
await page.locator('button').filter({ hasText: 'Delete' }).click()
31-
await page.locator('button').filter({ hasText: /I really/ }).click({ force: true })
29+
await openRowActionMenu(page, page.locator('[data-cy="customTableRow"]').first())
30+
await page.locator('[data-cy="deleteRowBtn"]').click()
31+
await page.locator('[data-cy="confirmDialog"]').getByRole('button', { name: 'Confirm' }).click()
32+
await expect(page.locator('[data-cy="customTableRow"]')).toHaveCount(0, { timeout: 10000 })
3233

3334
// insert row with float value
3435
await page.locator('button').filter({ hasText: 'Create row' }).click()
@@ -38,9 +39,10 @@ test.describe('Test column number', () => {
3839
await expect(page.locator('.custom-table table tr td div').filter({ hasText: '21.30' }).first()).toBeVisible()
3940

4041
// delete row
41-
await page.locator('.NcTable tr td button').first().click()
42-
await page.locator('button').filter({ hasText: 'Delete' }).click()
43-
await page.locator('button').filter({ hasText: /I really/ }).click({ force: true })
42+
await openRowActionMenu(page, page.locator('[data-cy="customTableRow"]').first())
43+
await page.locator('[data-cy="deleteRowBtn"]').click()
44+
await page.locator('[data-cy="confirmDialog"]').getByRole('button', { name: 'Confirm' }).click()
45+
await expect(page.locator('[data-cy="customTableRow"]')).toHaveCount(0, { timeout: 10000 })
4446

4547
await removeColumn(page, columnTitle)
4648
})

playwright/e2e/view.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,14 +192,14 @@ test.describe('Interact with views', () => {
192192
await expect(page.locator('.icon-loading').first()).toBeHidden()
193193

194194
// Delete the first row
195+
const rowCountBefore = await page.locator('[data-cy="customTableRow"]').count()
195196
const firstRow = page.locator('[data-cy="customTableRow"]').first()
196197
await openRowActionMenu(page, firstRow)
197198
await page.locator('[data-cy="deleteRowBtn"]').click()
198199
await page.locator('[data-cy="confirmDialog"]').getByRole('button', { name: 'Confirm' }).click()
199200
await page.locator('[data-cy="confirmDialog"]').waitFor({ state: 'hidden', timeout: 10000 }).catch(() => {})
200201

201-
// Verify one row was deleted by checking the count decreased
202-
const count = await page.locator('[data-cy="customTableRow"]').count()
203-
expect(count).toBeLessThan(4)
202+
// Verify one row was deleted — toHaveCount retries until the DOM settles
203+
await expect(page.locator('[data-cy="customTableRow"]')).toHaveCount(rowCountBefore - 1, { timeout: 10000 })
204204
})
205205
})

0 commit comments

Comments
 (0)