test: fix playwright AUT for API collection, database and custom theme config (#17570)

This commit is contained in:
Sachin Chaurasiya 2024-08-23 21:15:01 +05:30 committed by GitHub
parent c76c27e1e9
commit 3605d3d9da
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 76 additions and 66 deletions

View File

@ -72,7 +72,7 @@ test.describe('Custom Theme Config Page', () => {
}
const updatedConfigResponsePromise = page.waitForResponse(
'api/v1/system/settings'
'/api/v1/system/settings'
);
// Click the save button
@ -90,7 +90,7 @@ test.describe('Custom Theme Config Page', () => {
);
const defaultConfigResponsePromise = page.waitForResponse(
'api/v1/system/settings'
'/api/v1/system/settings'
);
// Click the reset button

View File

@ -235,7 +235,8 @@ export class ApiCollectionClass extends EntityClass {
page: Page,
owner1: string[],
owner2: string[],
type: 'Teams' | 'Users' = 'Users'
type: 'Teams' | 'Users' = 'Users',
isEditPermission = true
): Promise<void> {
if (type === 'Teams') {
await addOwner({
@ -245,22 +246,24 @@ export class ApiCollectionClass extends EntityClass {
endpoint: this.endpoint,
dataTestId: 'data-assets-header',
});
await updateOwner({
page,
owner: owner2[0],
type,
endpoint: this.endpoint,
dataTestId: 'data-assets-header',
});
await this.verifyOwnerPropagation(page, owner2[0]);
if (isEditPermission) {
await updateOwner({
page,
owner: owner2[0],
type,
endpoint: this.endpoint,
dataTestId: 'data-assets-header',
});
await this.verifyOwnerPropagation(page, owner2[0]);
await removeOwner({
page,
endpoint: this.endpoint,
ownerName: owner2[0],
type,
dataTestId: 'data-assets-header',
});
await removeOwner({
page,
endpoint: this.endpoint,
ownerName: owner2[0],
type,
dataTestId: 'data-assets-header',
});
}
} else {
await addMultiOwner({
page,
@ -270,22 +273,24 @@ export class ApiCollectionClass extends EntityClass {
endpoint: this.endpoint,
type,
});
await addMultiOwner({
page,
ownerNames: owner2,
activatorBtnDataTestId: 'edit-owner',
resultTestId: 'data-assets-header',
endpoint: this.endpoint,
type,
});
await this.verifyOwnerPropagation(page, owner2[0]);
await removeOwner({
page,
endpoint: this.endpoint,
ownerName: owner2[0],
type,
dataTestId: 'data-assets-header',
});
if (isEditPermission) {
await addMultiOwner({
page,
ownerNames: owner2,
activatorBtnDataTestId: 'edit-owner',
resultTestId: 'data-assets-header',
endpoint: this.endpoint,
type,
});
await this.verifyOwnerPropagation(page, owner2[0]);
await removeOwner({
page,
endpoint: this.endpoint,
ownerName: owner2[0],
type,
dataTestId: 'data-assets-header',
});
}
}
}
}

View File

@ -253,7 +253,8 @@ export class DatabaseClass extends EntityClass {
page: Page,
owner1: string[],
owner2: string[],
type: 'Teams' | 'Users' = 'Users'
type: 'Teams' | 'Users' = 'Users',
isEditPermission = true
): Promise<void> {
if (type === 'Teams') {
await addOwner({
@ -263,22 +264,24 @@ export class DatabaseClass extends EntityClass {
endpoint: this.endpoint,
dataTestId: 'data-assets-header',
});
await updateOwner({
page,
owner: owner2[0],
type,
endpoint: this.endpoint,
dataTestId: 'data-assets-header',
});
await this.verifyOwnerPropagation(page, owner2[0]);
if (isEditPermission) {
await updateOwner({
page,
owner: owner2[0],
type,
endpoint: this.endpoint,
dataTestId: 'data-assets-header',
});
await this.verifyOwnerPropagation(page, owner2[0]);
await removeOwner({
page,
endpoint: this.endpoint,
ownerName: owner2[0],
type,
dataTestId: 'data-assets-header',
});
await removeOwner({
page,
endpoint: this.endpoint,
ownerName: owner2[0],
type,
dataTestId: 'data-assets-header',
});
}
} else {
await addMultiOwner({
page,
@ -288,22 +291,24 @@ export class DatabaseClass extends EntityClass {
endpoint: this.endpoint,
type,
});
await addMultiOwner({
page,
ownerNames: owner2,
activatorBtnDataTestId: 'edit-owner',
resultTestId: 'data-assets-header',
endpoint: this.endpoint,
type,
});
await this.verifyOwnerPropagation(page, owner2[0]);
await removeOwner({
page,
endpoint: this.endpoint,
ownerName: owner2[0],
type,
dataTestId: 'data-assets-header',
});
if (isEditPermission) {
await addMultiOwner({
page,
ownerNames: owner2,
activatorBtnDataTestId: 'edit-owner',
resultTestId: 'data-assets-header',
endpoint: this.endpoint,
type,
});
await this.verifyOwnerPropagation(page, owner2[0]);
await removeOwner({
page,
endpoint: this.endpoint,
ownerName: owner2[0],
type,
dataTestId: 'data-assets-header',
});
}
}
}