Skip to content

Commit

Permalink
Playwright: fixed permission, dataQuality, & testCases spec for 1.5.5 (
Browse files Browse the repository at this point in the history
…#17884)

* Playwright: fixed permission, dataQuality, & testCases spec

* fixed testSuite wait issue
  • Loading branch information
ShaileshParmar11 authored Sep 18, 2024
1 parent e42a7d6 commit 55a0272
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,9 @@ test('Permissions', async ({ userPage, adminPage }) => {

await userPage.getByTestId('profiler').click();
const testCaseResponse = userPage.waitForResponse(
'/api/v1/dataQuality/testCases/search/list?fields=*'
(response) =>
response.url().includes('/api/v1/dataQuality/testCases/') &&
response.request().method() === 'GET'
);
await userPage
.getByTestId('profiler-tab-left-panel')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,8 @@ test('TestCase filters', async ({ page }) => {
// Test case filter by Tier

await page.click('#tier');
await page.fill('#tier', 'Tier2');
await page.waitForLoadState('domcontentloaded');
const getTestCaseByTier = page.waitForResponse(
'/api/v1/dataQuality/testCases/search/list?*tier=Tier.Tier2*'
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,13 @@ test('Table difference test case', async ({ page }) => {
await page.getByTestId('test-case-name').fill(testCase.name);
await page.getByTestId('test-type').click();
await page.getByTitle('Compare 2 tables for').click();
const tableListSearchResponse = page.waitForResponse(
`/api/v1/search/query?q=*index=table_search_index*`
);
await page.click('#tableTestForm_params_table2');
await tableListSearchResponse;
const tableSearchResponse = page.waitForResponse(
`/api/v1/search/query?q=*index=table_search_index*`
`/api/v1/search/query?q=*${testCase.table2}*index=table_search_index*`
);
await page.fill(`#tableTestForm_params_table2`, testCase.table2);
await tableSearchResponse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,13 @@ test('Logical TestSuite', async ({ page }) => {

await test.step('Add test case to logical test suite', async () => {
const testCaseResponse = page.waitForResponse(
'/api/v1/dataQuality/testCases?fields=*'
'/api/v1/search/query?q=*&index=test_case_search_index*'
);
await page.click('[data-testid="add-test-case-btn"]');
await testCaseResponse;

const getTestCase = page.waitForResponse(
'/api/v1/search/query?q=*&index=test_case_search_index*'
`/api/v1/search/query?q=*${testCaseName2}*&index=test_case_search_index*`
);
await page.fill('[data-testid="searchbar"]', testCaseName2);
await getTestCase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import {
INITIAL_PAGING_VALUE,
PAGE_SIZE,
PAGE_SIZE_BASE,
PAGE_SIZE_LARGE,
TIER_CATEGORY,
} from '../../../constants/constants';
import {
Expand Down Expand Up @@ -212,6 +213,7 @@ export const TestCases = ({ summaryPanel }: { summaryPanel: ReactNode }) => {
setIsOptionsLoading(true);
const { data } = await getTags({
parent: 'Tier',
limit: PAGE_SIZE_LARGE,
});

const options = data.map((hit) => {
Expand Down Expand Up @@ -582,6 +584,7 @@ export const TestCases = ({ summaryPanel }: { summaryPanel: ReactNode }) => {
name="tier">
<Select
allowClear
showSearch
data-testid="tier-select-filter"
options={tierOptions}
placeholder={t('label.tier')}
Expand Down

0 comments on commit 55a0272

Please sign in to comment.