Skip to content

Commit

Permalink
test(*): fix test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Leopoldthecoder committed Aug 9, 2024
1 parent e5e2729 commit a410a47
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
1 change: 1 addition & 0 deletions tests/playwright/commands/fillEntityForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const fillEntityForm = async (params: Params) => {
handleModal,
} = params

await page.waitForTimeout(1000)
if (await page.locator('.kong-ui-entities-plugin-form').isVisible()) {
await expandAdvancedFields(page)
}
Expand Down
15 changes: 12 additions & 3 deletions tests/playwright/specs/plugins/01-Plugins.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ test.describe('plugins', () => {

await serviceListPage.goto()
await withNavigation(page, async () => await clickEntityListAction(page, 'view'))
const uuid = await page.locator('.copy-container').innerText()
const uuid = (await page
.locator('[data-testid="id-property-value"]')
.locator('.copy-container')
.innerText() ?? '').trim()

await switchDetailTab(page, 'plugins')

Expand Down Expand Up @@ -182,7 +185,10 @@ test.describe('plugins', () => {

await routeListPage.goto()
await withNavigation(page, async () => await clickEntityListAction(page, 'view'))
const uuid = await page.locator('.copy-container').innerText()
const uuid = (await page
.locator('[data-testid="id-property-value"]')
.locator('.copy-container')
.innerText() ?? '').trim()

await switchDetailTab(page, 'plugins')

Expand Down Expand Up @@ -215,7 +221,10 @@ test.describe('plugins', () => {
await consumerListPage.goto()

await withNavigation(page, async () => await clickEntityListAction(page, 'view'))
const uuid = await page.locator('.copy-container').innerText()
const uuid = (await page
.locator('[data-testid="id-property-value"]')
.locator('.copy-container')
.innerText() ?? '').trim()

await switchDetailTab(page, 'plugins')
await withNavigation(
Expand Down
5 changes: 4 additions & 1 deletion tests/playwright/specs/routes/02-RoutesPlugins.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ test.describe('routes plugins', () => {
test(`install a plugin for the route "${mockRouteName} from the plugins tab"`, async ({ page }) => {
await withNavigation(page, async () => await clickEntityListAction(page, 'view'))

const uuid = await page.locator('.copy-container').innerText()
const uuid = (await page
.locator('[data-testid="id-property-value"]')
.locator('.copy-container')
.innerText() ?? '').trim()

await switchDetailTab(page, 'plugins')

Expand Down

0 comments on commit a410a47

Please sign in to comment.