diff --git a/openmetadata-ui/src/main/resources/ui/cypress.config.ts b/openmetadata-ui/src/main/resources/ui/cypress.config.ts index b5d5794ddb2..2ec11180abe 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress.config.ts +++ b/openmetadata-ui/src/main/resources/ui/cypress.config.ts @@ -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) { diff --git a/openmetadata-ui/src/main/resources/ui/cypress/common/common.js b/openmetadata-ui/src/main/resources/ui/cypress/common/common.js index 1ba9df4d067..01fc7b87d7c 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/common/common.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/common/common.js @@ -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') diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Features/RestoreEntity.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Features/RestoreEntity.spec.js index 22d10beadf6..edfbf5d27b5 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Features/RestoreEntity.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Features/RestoreEntity.spec.js @@ -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); diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/SearchIndexDetails.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/SearchIndexDetails.spec.js index 0b6043f08a5..ac9858c3633 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/SearchIndexDetails.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/SearchIndexDetails.spec.js @@ -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); + }); }); }); diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Service/redshiftWithDBT.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Service/redshiftWithDBT.spec.js index 56efc6a40c2..a0d57ae6063 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Service/redshiftWithDBT.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Service/redshiftWithDBT.spec.js @@ -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