Playwright: fixed permission, dataQuality, & testCases spec for 1.5.5 (#17884)

* Playwright: fixed permission, dataQuality, & testCases spec

* fixed testSuite wait issue
This commit is contained in:
Shailesh Parmar 2024-09-18 13:24:24 +05:30 committed by GitHub
parent e42a7d6e7c
commit 55a027203e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 16 additions and 5 deletions

View File

@ -251,7 +251,9 @@ test('Permissions', async ({ userPage, adminPage }) => {
await userPage.getByTestId('profiler').click(); await userPage.getByTestId('profiler').click();
const testCaseResponse = userPage.waitForResponse( 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 await userPage
.getByTestId('profiler-tab-left-panel') .getByTestId('profiler-tab-left-panel')

View File

@ -781,6 +781,8 @@ test('TestCase filters', async ({ page }) => {
// Test case filter by Tier // Test case filter by Tier
await page.click('#tier'); await page.click('#tier');
await page.fill('#tier', 'Tier2');
await page.waitForLoadState('domcontentloaded');
const getTestCaseByTier = page.waitForResponse( const getTestCaseByTier = page.waitForResponse(
'/api/v1/dataQuality/testCases/search/list?*tier=Tier.Tier2*' '/api/v1/dataQuality/testCases/search/list?*tier=Tier.Tier2*'
); );

View File

@ -54,10 +54,14 @@ test('Table difference test case', async ({ page }) => {
await page.getByTestId('test-case-name').fill(testCase.name); await page.getByTestId('test-case-name').fill(testCase.name);
await page.getByTestId('test-type').click(); await page.getByTestId('test-type').click();
await page.getByTitle('Compare 2 tables for').click(); await page.getByTitle('Compare 2 tables for').click();
await page.click('#tableTestForm_params_table2'); const tableListSearchResponse = page.waitForResponse(
const tableSearchResponse = page.waitForResponse(
`/api/v1/search/query?q=*index=table_search_index*` `/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=*${testCase.table2}*index=table_search_index*`
);
await page.fill(`#tableTestForm_params_table2`, testCase.table2); await page.fill(`#tableTestForm_params_table2`, testCase.table2);
await tableSearchResponse; await tableSearchResponse;
// The 'networkidle' parameter tells Playwright to wait until there are no network connections // The 'networkidle' parameter tells Playwright to wait until there are no network connections

View File

@ -127,13 +127,13 @@ test('Logical TestSuite', async ({ page }) => {
await test.step('Add test case to logical test suite', async () => { await test.step('Add test case to logical test suite', async () => {
const testCaseResponse = page.waitForResponse( 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 page.click('[data-testid="add-test-case-btn"]');
await testCaseResponse; await testCaseResponse;
const getTestCase = page.waitForResponse( 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 page.fill('[data-testid="searchbar"]', testCaseName2);
await getTestCase; await getTestCase;

View File

@ -49,6 +49,7 @@ import {
INITIAL_PAGING_VALUE, INITIAL_PAGING_VALUE,
PAGE_SIZE, PAGE_SIZE,
PAGE_SIZE_BASE, PAGE_SIZE_BASE,
PAGE_SIZE_LARGE,
TIER_CATEGORY, TIER_CATEGORY,
} from '../../../constants/constants'; } from '../../../constants/constants';
import { import {
@ -212,6 +213,7 @@ export const TestCases = ({ summaryPanel }: { summaryPanel: ReactNode }) => {
setIsOptionsLoading(true); setIsOptionsLoading(true);
const { data } = await getTags({ const { data } = await getTags({
parent: 'Tier', parent: 'Tier',
limit: PAGE_SIZE_LARGE,
}); });
const options = data.map((hit) => { const options = data.map((hit) => {
@ -582,6 +584,7 @@ export const TestCases = ({ summaryPanel }: { summaryPanel: ReactNode }) => {
name="tier"> name="tier">
<Select <Select
allowClear allowClear
showSearch
data-testid="tier-select-filter" data-testid="tier-select-filter"
options={tierOptions} options={tierOptions}
placeholder={t('label.tier')} placeholder={t('label.tier')}