-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adding e2e tests for DataTable (#188)
Co-authored-by: UncleGedd <42304551+UncleGedd@users.noreply.github.com>
- Loading branch information
1 parent
2fe0c99
commit a7c6256
Showing
5 changed files
with
49 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2024-Present The UDS Authors | ||
|
||
import { expect, test } from '@playwright/test' | ||
|
||
test.describe('DataTable', async () => { | ||
test.beforeEach(async ({ page }) => { | ||
await page.goto('/workloads/pods') | ||
}) | ||
|
||
test('filters rows when we click the namespace link in a row', async ({ page }) => { | ||
await page.getByRole('button', { name: 'podinfo' }).click() | ||
|
||
expect(await page.getByTestId('table-header-results').textContent()).toBe('(showing 1 of 7)') | ||
|
||
await page.getByTestId('table-filter-namespace-select').selectOption({ label: 'All Namespaces' }) | ||
|
||
await page.getByRole('button', { name: 'kube-system' }).first().click() | ||
|
||
expect(await page.getByTestId('table-header-results').textContent()).toBe('(showing 3 of 7)') | ||
}) | ||
|
||
test('filters rows when we select the namespace from the drop down option', async ({ page }) => { | ||
await page.getByTestId('table-filter-namespace-select').selectOption({ label: 'podinfo' }) | ||
|
||
expect(await page.getByTestId('table-header-results').textContent()).toBe('(showing 1 of 7)') | ||
|
||
await page.getByTestId('table-filter-namespace-select').selectOption({ label: 'kube-system' }) | ||
|
||
expect(await page.getByTestId('table-header-results').textContent()).toBe('(showing 3 of 7)') | ||
}) | ||
}) |