-
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 drawer e2e tests (#164)
Co-authored-by: UncleGedd <42304551+UncleGedd@users.noreply.github.com>
- Loading branch information
1 parent
aed5b83
commit f19ca04
Showing
2 changed files
with
39 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2024-Present The UDS Authors | ||
|
||
import { expect, test } from '@playwright/test' | ||
|
||
test.describe('Drawer', async () => { | ||
test.beforeEach(async ({ page }) => { | ||
await page.goto('/workloads/pods') | ||
|
||
await page.getByRole('cell', { name: 'podinfo-' }).click() | ||
}) | ||
|
||
test.describe('is opened when clicking on a table row and', async () => { | ||
test('will display Metadata details', async ({ page }) => { | ||
const drawerEl = page.getByTestId('drawer') | ||
|
||
await expect(drawerEl).toBeVisible() | ||
await expect(drawerEl.getByText('Created')).toBeVisible() | ||
await expect(drawerEl.getByText('Name', { exact: true })).toBeVisible() | ||
await expect(drawerEl.getByText('Annotations')).toBeVisible() | ||
await expect(drawerEl.getByText('podinfo', { exact: true })).toBeVisible() | ||
}) | ||
|
||
test('will display YAML details', async ({ page }) => { | ||
const drawerEl = page.getByTestId('drawer') | ||
const labelName = await drawerEl.locator(':text("app.kubernetes.io/name:")').textContent() | ||
const podID = page.url().split('/').pop() | ||
|
||
await drawerEl.getByRole('button', { name: 'YAML' }).click() | ||
await expect(drawerEl.getByText('namespace:')).toBeVisible() | ||
|
||
// Ensure label:app matches pod info | ||
expect(labelName).toEqual(`app.kubernetes.io/name: podinfo`) | ||
// Ensure metadata:uid matches url pod:id | ||
await expect(drawerEl.locator(`:text("uid: ${podID}")`)).toBeVisible() | ||
}) | ||
}) | ||
}) |