-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(Templates): Template Filters e2e test (#6442)
added tests for template filters
- Loading branch information
1 parent
16fc422
commit 4b1a79e
Showing
1 changed file
with
69 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import { expect, test } from '@playwright/test'; | ||
import { GoToMockTemplatesGallery } from './utils/GoToTemplate'; | ||
|
||
test.describe( | ||
'Template Filters Tests', | ||
{ | ||
tag: '@mock', | ||
}, | ||
() => { | ||
test('Search through names should show valid template cards', async ({ page }) => { | ||
await page.goto('/templates'); | ||
|
||
await GoToMockTemplatesGallery(page); | ||
|
||
await page.getByPlaceholder('Search').fill('Mock'); | ||
|
||
await expect(page.getByText('[Mock] Basic Workflow Only')).toBeVisible(); | ||
await expect(page.getByText('[Mock] Simple Accelerator')).toBeVisible(); | ||
await expect(page.getByText('[Mock] Simple Connection')).toBeVisible(); | ||
|
||
await page.getByPlaceholder('Search').fill('Basic Workflow Only'); | ||
|
||
await expect(page.getByText('[Mock] Basic Workflow Only')).toBeVisible(); | ||
await expect(page.getByText('[Mock] Simple Accelerator')).not.toBeVisible(); | ||
await expect(page.getByText('[Mock] Simple Connection')).not.toBeVisible(); | ||
|
||
expect(true).toBeTruthy(); | ||
}); | ||
|
||
test('Search through tags should show valid template cards', async ({ page }) => { | ||
await page.goto('/templates'); | ||
|
||
await GoToMockTemplatesGallery(page); | ||
|
||
await page.getByPlaceholder('Search').fill('Mock'); | ||
|
||
await expect(page.getByText('[Mock] Basic Workflow Only')).toBeVisible(); | ||
await expect(page.getByText('[Mock] Simple Accelerator')).toBeVisible(); | ||
await expect(page.getByText('[Mock] Simple Connection')).toBeVisible(); | ||
|
||
await page.getByPlaceholder('Search').fill('try catch'); | ||
|
||
await expect(page.getByText('[Mock] Basic Workflow Only')).toBeVisible(); | ||
await expect(page.getByText('[Mock] Simple Accelerator')).not.toBeVisible(); | ||
await expect(page.getByText('[Mock] Simple Connection')).not.toBeVisible(); | ||
|
||
await page.getByPlaceholder('Search').fill('Simple-Connection-Parameter'); | ||
|
||
await expect(page.getByText('[Mock] Basic Workflow Only')).not.toBeVisible(); | ||
await expect(page.getByText('[Mock] Simple Accelerator')).not.toBeVisible(); | ||
await expect(page.getByText('[Mock] Simple Connection')).toBeVisible(); | ||
}); | ||
|
||
test('Only all and Workflows tabs should show blank workflow card', async ({ page }) => { | ||
await page.goto('/templates'); | ||
|
||
await GoToMockTemplatesGallery(page); | ||
|
||
await page.getByRole('tab', { name: 'All' }).click(); | ||
await expect(page.getByText('Blank workflow', { exact: true })).toBeVisible(); | ||
|
||
await page.getByRole('tab', { name: 'Workflows' }).click(); | ||
await expect(page.getByText('Blank workflow', { exact: true })).toBeVisible(); | ||
|
||
await page.getByRole('tab', { name: 'Accelerators' }).click(); | ||
await expect(page.getByText('Blank workflow', { exact: true })).not.toBeVisible(); | ||
}); | ||
} | ||
); |