fix(test): aut failures for bot and persona profile (#23254)

* fix(test): aut failures for bot and persona profile

* fix personaDeleteionUserprofile

* fix data contract aut failure

* rever unwanted changes
This commit is contained in:
Chirag Madlani 2025-09-05 21:22:39 +05:30 committed by GitHub
parent a5f6e9d13b
commit b6f9ed4a5b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 22 additions and 20 deletions

View File

@ -108,12 +108,14 @@ test.describe('Ingestion Bot ', () => {
// Add assets to domain 1
await redirectToHomePage(page);
await sidebarClick(page, SidebarItem.DOMAIN);
await page.waitForLoadState('networkidle');
await selectDomain(page, domain1.data);
await addAssetsToDomain(page, domain1, domainAsset1);
// Add assets to domain 2
await redirectToHomePage(page);
await sidebarClick(page, SidebarItem.DOMAIN);
await page.waitForLoadState('networkidle');
await selectDomain(page, domain2.data);
await addAssetsToDomain(page, domain2, domainAsset2);
});

View File

@ -11,24 +11,16 @@
* limitations under the License.
*/
import { expect, test } from '@playwright/test';
import { expect } from '@playwright/test';
import { DELETE_TERM } from '../../constant/common';
import { GlobalSettingOptions } from '../../constant/settings';
import { UserClass } from '../../support/user/UserClass';
import {
createNewPage,
descriptionBox,
redirectToHomePage,
uuid,
} from '../../utils/common';
import { performAdminLogin } from '../../utils/admin';
import { descriptionBox, redirectToHomePage, uuid } from '../../utils/common';
import { validateFormNameFieldInput } from '../../utils/form';
import { setPersonaAsDefault } from '../../utils/persona';
import { settingClick } from '../../utils/sidebar';
// use the admin user to login
test.use({
storageState: 'playwright/.auth/admin.json',
});
import { test } from '../fixtures/pages';
const PERSONA_DETAILS = {
name: `test-persona-${uuid()}`,
@ -46,13 +38,13 @@ test.describe.serial('User profile works after persona deletion', () => {
const user = new UserClass();
test.beforeAll('Create user', async ({ browser }) => {
const { apiContext, afterAction } = await createNewPage(browser);
const { apiContext, afterAction } = await performAdminLogin(browser);
await user.create(apiContext);
await afterAction();
});
test.afterAll('Cleanup', async ({ browser }) => {
const { apiContext, afterAction } = await createNewPage(browser);
const { apiContext, afterAction } = await performAdminLogin(browser);
await user.delete(apiContext);
await afterAction();
});
@ -118,8 +110,11 @@ test.describe.serial('User profile works after persona deletion', () => {
// Step 2: Navigate directly to user profile and verify persona is shown
await test.step('Verify persona appears on user profile', async () => {
// Go directly to user profile URL
await page.goto(`http://localhost:8585/users/${user.responseData.name}`);
await page.goto(`/users/${user.responseData.name}`);
await page.waitForLoadState('networkidle');
await page.waitForSelector('[data-testid="loader"]', {
state: 'detached',
});
// Check if persona appears on the user profile
const personaCard = page.getByTestId('persona-details-card');
@ -187,9 +182,7 @@ test.describe.serial('User profile works after persona deletion', () => {
'Verify user profile still loads after persona deletion',
async () => {
// Go directly to user profile URL again
await page.goto(
`http://localhost:8585/users/${user.responseData.name}`
);
await page.goto(`/users/${user.responseData.name}`);
await page.waitForLoadState('networkidle');
// User profile should load without errors

View File

@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { expect, Page, test as base } from '@playwright/test';
import { test as base, expect, Page } from '@playwright/test';
import {
DATA_CONTRACT_DETAILS,
DATA_CONTRACT_SEMANTICS1,
@ -28,6 +28,7 @@ import { TagClass } from '../../support/tag/TagClass';
import { UserClass } from '../../support/user/UserClass';
import { performAdminLogin } from '../../utils/admin';
import { selectOption } from '../../utils/advancedSearch';
import { resetTokenFromBotPage } from '../../utils/bot';
import {
clickOutside,
redirectToHomePage,
@ -65,7 +66,7 @@ test.describe('Data Contracts', () => {
test.beforeAll('Setup pre-requests', async ({ browser }) => {
test.slow(true);
const { apiContext, afterAction } = await performAdminLogin(browser);
const { apiContext, afterAction, page } = await performAdminLogin(browser);
await table.create(apiContext);
await testClassification.create(apiContext);
await testTag.create(apiContext);
@ -101,6 +102,12 @@ test.describe('Data Contracts', () => {
},
],
});
if (!process.env.PLAYWRIGHT_IS_OSS) {
// Todo: Remove this patch once the issue is fixed #19140
await resetTokenFromBotPage(page, 'testsuite-bot');
}
await afterAction();
});