Skip to content

Commit 24fa239

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 4ac34bb commit 24fa239

4 files changed

Lines changed: 27 additions & 21 deletions

File tree

playwright/e2e/column-datetime.spec.ts

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

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

99
const columnTitle = 'date and time'
1010
const tableTitle = 'Test datetime'
@@ -32,9 +32,10 @@ test.describe('Test column ' + columnTitle, () => {
3232
await expect(page.locator('.custom-table table tr td div').filter({ hasText: '5:15' }).first()).toBeVisible()
3333

3434
// delete row
35-
await page.locator('.NcTable tr td button').first().click()
36-
await page.locator('button').filter({ hasText: 'Delete' }).click()
37-
await page.locator('button').filter({ hasText: /I really/ }).click({ force: true })
35+
await openRowActionMenu(page, page.locator('[data-cy="customTableRow"]').first())
36+
await page.locator('[data-cy="deleteRowBtn"]').click()
37+
await page.locator('[data-cy="confirmDialog"]').getByRole('button', { name: 'Confirm' }).click()
38+
await expect(page.locator('[data-cy="customTableRow"]')).toHaveCount(0, { timeout: 10000 })
3839

3940
await removeColumn(page, columnTitle)
4041
})

playwright/e2e/column-datetimeDate.spec.ts

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

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

99
const columnTitle = 'date'
1010
const tableTitle = 'Test datetimeDate'
@@ -29,9 +29,10 @@ test.describe('Test column ' + columnTitle, () => {
2929
await expect(page.locator('.custom-table table tr td div').filter({ hasText: '2023' }).first()).toBeVisible()
3030

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

3637
await removeColumn(page, columnTitle)
3738
})

playwright/e2e/column-datetimeTime.spec.ts

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

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

99
const columnTitle = 'time'
1010
const tableTitle = 'Test datetimeTime'
@@ -27,9 +27,10 @@ test.describe('Test column ' + columnTitle, () => {
2727
await expect(page.locator('.custom-table table tr td div').filter({ hasText: '5:15' }).first()).toBeVisible()
2828

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

3435
await removeColumn(page, columnTitle)
3536
})

playwright/e2e/column-selection-multi.spec.ts

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

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

99
const columnTitle = 'multi selection'
1010
const tableTitle = 'Test number column'
@@ -42,15 +42,17 @@ test.describe('Test column ' + columnTitle, () => {
4242
await expect(page.locator('.custom-table table tr td .cell-multi-selection').filter({ hasText: 'third option' }).first()).toBeVisible()
4343

4444
// delete first row
45-
await page.locator('.NcTable tr td button').first().click()
46-
await page.locator('button').filter({ hasText: 'Delete' }).click()
47-
await page.locator('button').filter({ hasText: /I really/ }).click({ force: true })
45+
await openRowActionMenu(page, page.locator('[data-cy="customTableRow"]').first())
46+
await page.locator('[data-cy="deleteRowBtn"]').click()
47+
await page.locator('[data-cy="confirmDialog"]').getByRole('button', { name: 'Confirm' }).click()
48+
await expect(page.locator('[data-cy="customTableRow"]')).toHaveCount(1, { timeout: 10000 })
4849

4950
await expect(page.locator('.custom-table table tr td .cell-multi-selection', { hasText: 'first option' })).toBeHidden()
5051
await expect(page.locator('.custom-table table tr td .cell-multi-selection', { hasText: 'second option' })).toBeHidden()
5152

5253
// edit second row (which is now first row)
53-
await page.locator('.NcTable tr td button').first().click()
54+
await openRowActionMenu(page, page.locator('[data-cy="customTableRow"]').first())
55+
await page.locator('[data-cy="editRowBtn"]').click()
5456
await page.locator('.modal__content .slot input').first().click()
5557
await page.locator('ul.vs__dropdown-menu li span[title="first option"]').first().click()
5658
await page.locator('.modal__content .title').first().click()
@@ -60,9 +62,10 @@ test.describe('Test column ' + columnTitle, () => {
6062
await expect(page.locator('.custom-table table tr td .cell-multi-selection').filter({ hasText: 'third option' }).first()).toBeVisible()
6163

6264
// delete first row
63-
await page.locator('.NcTable tr td button').first().click()
64-
await page.locator('button').filter({ hasText: 'Delete' }).click()
65-
await page.locator('button').filter({ hasText: /I really/ }).click({ force: true })
65+
await openRowActionMenu(page, page.locator('[data-cy="customTableRow"]').first())
66+
await page.locator('[data-cy="deleteRowBtn"]').click()
67+
await page.locator('[data-cy="confirmDialog"]').getByRole('button', { name: 'Confirm' }).click()
68+
await expect(page.locator('[data-cy="customTableRow"]')).toHaveCount(0, { timeout: 10000 })
6669

6770
await removeColumn(page, columnTitle)
6871
})
@@ -79,6 +82,6 @@ test.describe('Test column ' + columnTitle, () => {
7982
await page.locator('button').filter({ hasText: 'Save' }).click()
8083

8184
await expect(page.locator('.custom-table table tr td .cell-multi-selection').first()).toBeVisible()
82-
await expect(page.locator('.NcTable tr td button').first()).toBeVisible()
85+
await expect(page.locator('[data-cy="customTableRow"]').first()).toBeVisible()
8386
})
8487
})

0 commit comments

Comments
 (0)