mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-02 11:39:12 +00:00
cypress: fix AUT failure part 3 (#13833)
This commit is contained in:
parent
d117a2c8ac
commit
3564eea9d6
@ -24,6 +24,7 @@ export default defineConfig({
|
||||
numTestsKeptInMemory: 0,
|
||||
experimentalMemoryManagement: true,
|
||||
e2e: {
|
||||
experimentalStudio: true,
|
||||
// We've imported your old cypress plugins here.
|
||||
// You may want to clean this up later by importing these.
|
||||
setupNodeEvents(on, config) {
|
||||
|
||||
@ -1182,7 +1182,7 @@ export const updateDescriptionForIngestedTables = (
|
||||
retryIngestionRun();
|
||||
|
||||
// Navigate to table name
|
||||
visitEntityDetailsPage({ term: tableName, serviceName, entity });
|
||||
visitEntityDetailsPage({ term: tableName, serviceName, entity, entityFqn });
|
||||
cy.get('[data-testid="markdown-parser"]')
|
||||
.first()
|
||||
.invoke('text')
|
||||
|
||||
@ -19,14 +19,9 @@ import {
|
||||
} from '../../common/common';
|
||||
import { createEntityTable, hardDeleteService } from '../../common/entityUtils';
|
||||
import { DELETE_TERM, MYDATA_SUMMARY_OPTIONS } from '../../constants/constants';
|
||||
import {
|
||||
DATABASE_SERVICE,
|
||||
TABLE_DETAILS,
|
||||
} from '../../constants/entityConstant';
|
||||
import { DATABASE_SERVICE } from '../../constants/entityConstant';
|
||||
import { SERVICE_CATEGORIES } from '../../constants/service.constants';
|
||||
|
||||
const tableDetails = TABLE_DETAILS;
|
||||
|
||||
const ENTITY_TABLE = {
|
||||
term: DATABASE_SERVICE.tables.name,
|
||||
displayName: DATABASE_SERVICE.tables.name,
|
||||
@ -143,11 +138,7 @@ describe('Restore entity functionality should work properly', () => {
|
||||
.contains(ENTITY_TABLE.displayName)
|
||||
.click();
|
||||
|
||||
cy.get('[data-testid="entity-header-display-name"]')
|
||||
.contains(ENTITY_TABLE.displayName)
|
||||
.click();
|
||||
|
||||
cy.get('[data-testid="deleted-badge"]').should('exist');
|
||||
cy.get('[data-testid="deleted-badge"]').should('be.visible');
|
||||
|
||||
cy.get('[data-testid="breadcrumb"]')
|
||||
.scrollIntoView()
|
||||
@ -160,7 +151,7 @@ describe('Restore entity functionality should work properly', () => {
|
||||
'queryDeletedTables'
|
||||
);
|
||||
|
||||
cy.get('[data-testid="show-deleted"]').click();
|
||||
cy.get('[data-testid="show-deleted"]').click({ waitForAnimations: true });
|
||||
|
||||
verifyResponseStatusCode('@queryDeletedTables', 200);
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ import {
|
||||
verifyResponseStatusCode,
|
||||
visitEntityDetailsPage,
|
||||
} from '../../common/common';
|
||||
import { BASE_URL } from '../../constants/constants';
|
||||
import { BASE_URL, uuid } from '../../constants/constants';
|
||||
import {
|
||||
SEARCH_INDEX_DETAILS_FOR_ANNOUNCEMENT,
|
||||
SEARCH_INDEX_DETAILS_FOR_DETAILS_PAGE_TEST,
|
||||
@ -43,6 +43,32 @@ import {
|
||||
USER_NAME,
|
||||
} from '../../constants/SearchIndexDetails.constants';
|
||||
|
||||
const policy = {
|
||||
name: `cy-data-steward-policy-${uuid()}`,
|
||||
rules: [
|
||||
{
|
||||
name: 'DataStewardPolicy-EditRule',
|
||||
resources: ['All'],
|
||||
operations: [
|
||||
'EditDescription',
|
||||
'EditDisplayName',
|
||||
'EditOwner',
|
||||
'EditLineage',
|
||||
'EditTags',
|
||||
'ViewAll',
|
||||
],
|
||||
effect: 'allow',
|
||||
},
|
||||
],
|
||||
};
|
||||
let policyId = '';
|
||||
|
||||
const role = {
|
||||
name: `cy-data-steward-role-${uuid()}`,
|
||||
policies: [policy.name],
|
||||
};
|
||||
let roleId = '';
|
||||
|
||||
const performCommonOperations = () => {
|
||||
// Add and remove tier flow should work properly
|
||||
addTier(TIER, 'searchIndexes');
|
||||
@ -131,6 +157,29 @@ describe('Prerequisite for search index details page test', () => {
|
||||
response.body.fullyQualifiedName;
|
||||
});
|
||||
|
||||
// Create Data Steward Policy
|
||||
cy.request({
|
||||
method: 'POST',
|
||||
url: `/api/v1/policies`,
|
||||
headers: { Authorization: `Bearer ${token}` },
|
||||
body: policy,
|
||||
}).then((response) => {
|
||||
policyId = response.body.id;
|
||||
|
||||
expect(response.status).to.eq(201);
|
||||
|
||||
cy.request({
|
||||
method: 'POST',
|
||||
url: `/api/v1/roles`,
|
||||
headers: { Authorization: `Bearer ${token}` },
|
||||
body: role,
|
||||
}).then((response) => {
|
||||
roleId = response.body.id;
|
||||
|
||||
expect(response.status).to.eq(201);
|
||||
});
|
||||
});
|
||||
|
||||
// Create a new user
|
||||
cy.request({
|
||||
method: 'POST',
|
||||
@ -210,7 +259,7 @@ describe('Prerequisite for data steward role tests', () => {
|
||||
|
||||
cy.get('[data-testid="inline-edit-container"] #select-role').click();
|
||||
|
||||
cy.get('[title="Data Steward"]').click();
|
||||
cy.get(`[title=${role.name}]`).click();
|
||||
|
||||
cy.clickOutside();
|
||||
|
||||
@ -404,7 +453,7 @@ describe('Cleanup', () => {
|
||||
cy.login();
|
||||
});
|
||||
|
||||
it('Delete search index and user', () => {
|
||||
it('Delete user, role and policy', () => {
|
||||
const token = localStorage.getItem('oidcIdToken');
|
||||
|
||||
// Delete created user
|
||||
@ -415,5 +464,23 @@ describe('Cleanup', () => {
|
||||
}).then((response) => {
|
||||
expect(response.status).to.eq(200);
|
||||
});
|
||||
|
||||
// Delete policy
|
||||
cy.request({
|
||||
method: 'DELETE',
|
||||
url: `/api/v1/policies/${policyId}?hardDelete=true&recursive=false`,
|
||||
headers: { Authorization: `Bearer ${token}` },
|
||||
}).then((response) => {
|
||||
expect(response.status).to.eq(200);
|
||||
});
|
||||
|
||||
// Delete role
|
||||
cy.request({
|
||||
method: 'DELETE',
|
||||
url: `/api/v1/roles/${roleId}?hardDelete=true&recursive=false`,
|
||||
headers: { Authorization: `Bearer ${token}` },
|
||||
}).then((response) => {
|
||||
expect(response.status).to.eq(200);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@ -32,6 +32,10 @@ import {
|
||||
} from '../../constants/constants';
|
||||
import { REDSHIFT } from '../../constants/service.constants';
|
||||
|
||||
const dbtEntityFqn = `${REDSHIFT.serviceName}.${Cypress.env(
|
||||
'redshiftDatabase'
|
||||
)}.dbt_jaffle.${REDSHIFT.DBTTable}`;
|
||||
|
||||
describe('RedShift Ingestion', () => {
|
||||
beforeEach(() => {
|
||||
cy.login();
|
||||
@ -248,6 +252,7 @@ describe('RedShift Ingestion', () => {
|
||||
term: REDSHIFT.DBTTable,
|
||||
serviceName: REDSHIFT.serviceName,
|
||||
entity: 'tables',
|
||||
entityFqn: dbtEntityFqn,
|
||||
});
|
||||
|
||||
// Verify tags
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user