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"]`);
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 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 () => {
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
.getByTestId(
@ -180,7 +180,7 @@ test('Query Entity', async ({ page }) => {
await page.keyboard.type(`${queryData.queryUsedIn.table1}`);
await page.click('[data-testid="edit-query-used-in"]');
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 tableSearchResponse;

View File

@ -119,7 +119,7 @@ export const addOwner = async ({
await page.getByTestId(initiatorId).click();
if (type === 'Users') {
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 userListResponse;
@ -178,7 +178,7 @@ export const addOwnerWithoutValidation = async ({
await page.getByTestId(initiatorId).click();
if (type === 'Users') {
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 userListResponse;

View File

@ -94,7 +94,7 @@ export const fillOwnerDetails = async (page: Page, owners: string[]) => {
await page.waitForSelector('[data-testid="loader"]', { state: 'detached' });
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 userListResponse;
@ -390,16 +390,16 @@ export const fillGlossaryRowDetails = async (
.locator(RDG_ACTIVE_CELL_SELECTOR)
.press('ArrowRight', { delay: 100 });
await fillTextInputDetails(page, "#ccc")
await fillTextInputDetails(page, '#ccc');
await page
.locator(RDG_ACTIVE_CELL_SELECTOR)
.press('ArrowRight', { delay: 100 });
const base64Src =
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==';
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==';
await fillTextInputDetails(page, base64Src)
await fillTextInputDetails(page, base64Src);
await page
.locator(RDG_ACTIVE_CELL_SELECTOR)

View File

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

View File

@ -96,7 +96,7 @@ export const visitUserProfilePage = async (page: Page, userName: string) => {
}
);
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(
'[data-testid="user-list-v1-component"] [data-testid="loader"]',
@ -116,7 +116,7 @@ export const softDeleteUserProfilePage = async (
displayName: string
) => {
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 userResponse;