fix tour.spec (#22800)

(cherry picked from commit b136282db7ff53c4ecdc5a525a5b5b85cfef694e)
This commit is contained in:
Pranita Fulsundar 2025-08-07 05:26:51 +05:30 committed by OpenMetadata Release Bot
parent 0d31300462
commit 0d35d56340
3 changed files with 6 additions and 2 deletions

View File

@ -14,6 +14,7 @@ import { expect, Page, test } from '@playwright/test';
import { UserClass } from '../../support/user/UserClass';
import { performAdminLogin } from '../../utils/admin';
import { redirectToHomePage } from '../../utils/common';
import { waitForAllLoadersToDisappear } from '../../utils/entity';
const user = new UserClass();
@ -132,6 +133,7 @@ test.describe('Tour should work properly', () => {
test('Tour should work from help section', async ({ page }) => {
await page.locator('[data-testid="help-icon"]').click();
await page.getByRole('link', { name: 'Tour', exact: true }).click();
await waitForAllLoadersToDisappear(page);
await page.waitForURL('**/tour');
await page.waitForSelector('#feedWidgetData');
@ -145,6 +147,7 @@ test.describe('Tour should work properly', () => {
.locator('.whats-new-alert-close')
.click();
await page.getByText('Take a product tour to get started!').click();
await waitForAllLoadersToDisappear(page);
await page.waitForURL('**/tour');
await page.waitForSelector('#feedWidgetData');
@ -154,6 +157,7 @@ test.describe('Tour should work properly', () => {
test('Tour should work from URL directly', async ({ page }) => {
await page.goto('/tour');
await waitForAllLoadersToDisappear(page);
await page.waitForURL('**/tour');
await page.waitForSelector('#feedWidgetData');

View File

@ -38,7 +38,7 @@ import {
import { searchAndClickOnOption } from './explore';
import { sidebarClick } from './sidebar';
const waitForAllLoadersToDisappear = async (page: Page) => {
export const waitForAllLoadersToDisappear = async (page: Page) => {
for (let attempt = 0; attempt < 3; attempt++) {
const allLoaders = page.locator('[data-testid="loader"]');
const count = await allLoaders.count();

View File

@ -41,7 +41,7 @@ const TourPage = () => {
updateIsTourOpen(true);
let attempts = 0;
const maxAttempts = 10;
const maxAttempts = 60;
const waitForElement = () => {
const el = document.querySelector('#feedWidgetData');