mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-29 11:26:05 +00:00
cypress - verify owner propagation (#16385)
* verify owner propagation * fix reloading * change owner name
This commit is contained in:
parent
d5bf30ccd3
commit
3a842f58e3
@ -15,21 +15,38 @@ import { visitServiceDetailsPage } from '../../common/serviceUtils';
|
||||
import {
|
||||
createEntityTableViaREST,
|
||||
deleteEntityViaREST,
|
||||
visitEntityDetailsPage,
|
||||
} from '../../common/Utils/Entity';
|
||||
import { EntityType } from '../../constants/Entity.interface';
|
||||
import { DATABASE_SERVICE } from '../../constants/EntityConstant';
|
||||
import {
|
||||
DATABASE_SERVICE,
|
||||
DATABASE_SERVICE_DETAILS,
|
||||
} from '../../constants/EntityConstant';
|
||||
import { GlobalSettingOptions } from '../../constants/settings.constant';
|
||||
import { getToken } from '../Utils/LocalStorage';
|
||||
import {
|
||||
addOwner,
|
||||
removeOwner,
|
||||
updateOwner,
|
||||
validateOwnerAndTeamCounts,
|
||||
} from '../Utils/Owner';
|
||||
import EntityClass from './EntityClass';
|
||||
|
||||
class DatabaseClass extends EntityClass {
|
||||
databaseName: string;
|
||||
tableName: string;
|
||||
databaseSchemaName: string;
|
||||
|
||||
constructor() {
|
||||
const databaseName = `cypress-database-${Date.now()}`;
|
||||
const tableName = `cypress-table-${Date.now()}`;
|
||||
const databaseSchemaName = `cypress-database-schema-${Date.now()}`;
|
||||
|
||||
super(databaseName, DATABASE_SERVICE.database, EntityType.Database);
|
||||
|
||||
this.databaseName = databaseName;
|
||||
this.tableName = tableName;
|
||||
this.databaseSchemaName = databaseSchemaName;
|
||||
this.name = 'Database';
|
||||
}
|
||||
|
||||
@ -67,12 +84,47 @@ class DatabaseClass extends EntityClass {
|
||||
token,
|
||||
...DATABASE_SERVICE,
|
||||
database: { ...DATABASE_SERVICE.database, name: this.databaseName },
|
||||
tables: [],
|
||||
schema: undefined,
|
||||
tables: [
|
||||
{
|
||||
...DATABASE_SERVICE.entity,
|
||||
name: this.tableName,
|
||||
databaseSchema: `${DATABASE_SERVICE_DETAILS.name}.${this.databaseName}.${this.databaseSchemaName}`,
|
||||
},
|
||||
],
|
||||
schema: {
|
||||
name: this.databaseSchemaName,
|
||||
database: `${DATABASE_SERVICE_DETAILS.name}.${this.databaseName}`,
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Check owner is propogated to table entity and perform update and delete owner
|
||||
verifyOwnerPropogation(newOwnerName: string) {
|
||||
cy.goToHomePage();
|
||||
// Visit table entity details page
|
||||
visitEntityDetailsPage({
|
||||
term: this.tableName,
|
||||
serviceName: DATABASE_SERVICE.service.name,
|
||||
entity: EntityType.Table,
|
||||
});
|
||||
|
||||
updateOwner(newOwnerName);
|
||||
cy.reload();
|
||||
removeOwner(newOwnerName);
|
||||
// Visit Database page again
|
||||
this.visitEntity();
|
||||
}
|
||||
|
||||
override userOwnerFlow(ownerName: string, newOwnerName: string) {
|
||||
validateOwnerAndTeamCounts();
|
||||
addOwner(ownerName);
|
||||
// Verify Owner propogated to table entity
|
||||
this.verifyOwnerPropogation('Alex Pollard');
|
||||
updateOwner(newOwnerName);
|
||||
removeOwner(newOwnerName);
|
||||
}
|
||||
|
||||
// Cleanup
|
||||
override cleanup() {
|
||||
super.cleanup();
|
||||
|
Loading…
x
Reference in New Issue
Block a user