fix tests

This commit is contained in:
Pranita 2025-09-26 04:38:17 +05:30
parent 2eef851724
commit 5620ce90fd
5 changed files with 16 additions and 17 deletions

View File

@ -66,7 +66,7 @@ test('Query Entity', async ({ page }) => {
); );
await page.click(`[data-testid="table_queries"]`); await page.click(`[data-testid="table_queries"]`);
const tableResponse = page.waitForResponse( const tableResponse = page.waitForResponse(
'/api/v1/search/query?q=**&from=0&size=*&index=table_search_index*' '/api/v1/search/query?q=&index=table_search_index&from=0&size=*'
); );
await queryResponse; await queryResponse;
await page.click(`[data-testid="add-query-btn"]`); await page.click(`[data-testid="add-query-btn"]`);
@ -110,7 +110,7 @@ test('Query Entity', async ({ page }) => {
await test.step('Update owner, description and tag', async () => { await test.step('Update owner, description and tag', async () => {
const ownerListResponse = page.waitForResponse( const ownerListResponse = page.waitForResponse(
'/api/v1/search/query?q=*isBot:false*index=user_search_index*' '/api/v1/search/query?q=&index=user_search_index&*'
); );
await page await page
.getByTestId( .getByTestId(
@ -180,7 +180,7 @@ test('Query Entity', async ({ page }) => {
await page.keyboard.type(`${queryData.queryUsedIn.table1}`); await page.keyboard.type(`${queryData.queryUsedIn.table1}`);
await page.click('[data-testid="edit-query-used-in"]'); await page.click('[data-testid="edit-query-used-in"]');
const tableSearchResponse = 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.keyboard.type(queryData.queryUsedIn.table2); await page.keyboard.type(queryData.queryUsedIn.table2);
await tableSearchResponse; await tableSearchResponse;

View File

@ -119,7 +119,7 @@ export const addOwner = async ({
await page.getByTestId(initiatorId).click(); await page.getByTestId(initiatorId).click();
if (type === 'Users') { if (type === 'Users') {
const userListResponse = page.waitForResponse( const userListResponse = page.waitForResponse(
'/api/v1/search/query?q=*isBot:false*index=user_search_index*' '/api/v1/search/query?q=&index=user_search_index&*'
); );
await page.getByRole('tab', { name: type }).click(); await page.getByRole('tab', { name: type }).click();
await userListResponse; await userListResponse;
@ -178,7 +178,7 @@ export const addOwnerWithoutValidation = async ({
await page.getByTestId(initiatorId).click(); await page.getByTestId(initiatorId).click();
if (type === 'Users') { if (type === 'Users') {
const userListResponse = page.waitForResponse( const userListResponse = page.waitForResponse(
'/api/v1/search/query?q=*isBot:false*index=user_search_index*' '/api/v1/search/query?q=&index=user_search_index&*'
); );
await page.getByRole('tab', { name: type }).click(); await page.getByRole('tab', { name: type }).click();
await userListResponse; await userListResponse;

View File

@ -94,7 +94,7 @@ export const fillOwnerDetails = async (page: Page, owners: string[]) => {
await page.waitForSelector('[data-testid="loader"]', { state: 'detached' }); await page.waitForSelector('[data-testid="loader"]', { state: 'detached' });
const userListResponse = page.waitForResponse( const userListResponse = page.waitForResponse(
'/api/v1/search/query?q=*isBot:false*index=user_search_index*' '/api/v1/search/query?q=&index=user_search_index&*'
); );
await page.getByRole('tab', { name: 'Users' }).click(); await page.getByRole('tab', { name: 'Users' }).click();
await userListResponse; await userListResponse;
@ -390,7 +390,7 @@ export const fillGlossaryRowDetails = async (
.locator(RDG_ACTIVE_CELL_SELECTOR) .locator(RDG_ACTIVE_CELL_SELECTOR)
.press('ArrowRight', { delay: 100 }); .press('ArrowRight', { delay: 100 });
await fillTextInputDetails(page, "#ccc") await fillTextInputDetails(page, '#ccc');
await page await page
.locator(RDG_ACTIVE_CELL_SELECTOR) .locator(RDG_ACTIVE_CELL_SELECTOR)
@ -399,7 +399,7 @@ export const fillGlossaryRowDetails = async (
const base64Src = const base64Src =
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg=='; 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==';
await fillTextInputDetails(page, base64Src) await fillTextInputDetails(page, base64Src);
await page await page
.locator(RDG_ACTIVE_CELL_SELECTOR) .locator(RDG_ACTIVE_CELL_SELECTOR)

View File

@ -11,18 +11,17 @@
* limitations under the License. * limitations under the License.
*/ */
import { expect, Page } from '@playwright/test'; import { expect, Page } from '@playwright/test';
import { escapeESReservedCharacters, getEncodedFqn } from './entity';
import { settingClick, SettingOptionsType } from './sidebar'; import { settingClick, SettingOptionsType } from './sidebar';
export const searchServiceFromSettingPage = async ( export const searchServiceFromSettingPage = async (
page: Page, page: Page,
service: string service: string
) => { ) => {
const serviceResponse = page.waitForResponse( const serviceResponse = page.waitForResponse((response) => {
`/api/v1/search/query?q=**${getEncodedFqn( const url = response.url();
escapeESReservedCharacters(service)
)}**` return url.includes('/api/v1/search/query') && url.includes(service);
); });
await page.fill('[data-testid="searchbar"]', service); await page.fill('[data-testid="searchbar"]', service);
await serviceResponse; await serviceResponse;

View File

@ -96,7 +96,7 @@ export const visitUserProfilePage = async (page: Page, userName: string) => {
} }
); );
const userResponse = page.waitForResponse( const userResponse = page.waitForResponse(
'/api/v1/search/query?q=**AND%20isAdmin:false%20isBot:false&from=0&size=*&index=*' '/api/v1/search/query?q=*&index=*&from=0&size=*'
); );
const loader = page.waitForSelector( const loader = page.waitForSelector(
'[data-testid="user-list-v1-component"] [data-testid="loader"]', '[data-testid="user-list-v1-component"] [data-testid="loader"]',
@ -116,7 +116,7 @@ export const softDeleteUserProfilePage = async (
displayName: string displayName: string
) => { ) => {
const userResponse = page.waitForResponse( const userResponse = page.waitForResponse(
'/api/v1/search/query?q=**&from=0&size=*&index=*' '/api/v1/search/query?q=*&index=*&from=0&size=*'
); );
await page.getByTestId('searchbar').fill(userName); await page.getByTestId('searchbar').fill(userName);
await userResponse; await userResponse;