diff --git a/openmetadata-ui/src/main/resources/ui/cypress/common/TaskUtils.js b/openmetadata-ui/src/main/resources/ui/cypress/common/TaskUtils.js index 1a2b747681f..70af0a2f71e 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/common/TaskUtils.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/common/TaskUtils.js @@ -17,7 +17,8 @@ import { verifyResponseStatusCode, } from './common'; -const assignee = 'admin'; +const owner = 'admin'; +const assignee = 'adam_rodriguez9'; const secondAssignee = 'aaron_johnson0'; export const verifyTaskDetails = (regexPattern) => { @@ -30,7 +31,7 @@ export const verifyTaskDetails = (regexPattern) => { expect(matches).to.not.be.null; }); - cy.get('[data-testid="owner-link"]').contains(assignee); + cy.get('[data-testid="owner-link"]').should('contain', owner); cy.get(`[data-testid="assignee-${assignee}"]`).should('be.visible'); }; 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 428cacd0923..70257bbd7f4 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/common/common.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/common/common.js @@ -873,7 +873,7 @@ export const deleteCreatedProperty = (propertyName) => { }; export const updateOwner = () => { - cy.get('[data-testid="avatar"]').should('be.visible').click(); + cy.get('[data-testid="avatar"]').click(); cy.get('[data-testid="user-name"]') .should('exist') .invoke('text') @@ -881,10 +881,12 @@ export const updateOwner = () => { cy.get('[data-testid="hiden-layer"]').should('exist').click(); interceptURL('GET', '/api/v1/users?limit=15', 'getUsers'); // Clicking on edit owner button - cy.get('[data-testid="edit-owner"]').should('be.visible').click(); + cy.get('[data-testid="edit-owner"]').click(); cy.get('.user-team-select-popover').contains('Users').click(); - + cy.get( + '[id*="panel-users"] [data-testid="search-bar-container"] [data-testid="searchbar"]' + ).type(text); cy.get('[data-testid="selectable-list"]') .eq(1) .find(`[title="${text.trim()}"]`) diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Features/DataConsumerRole.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Features/DataConsumerRole.spec.js index 7a907807359..06b59fb11ce 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Features/DataConsumerRole.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Features/DataConsumerRole.spec.js @@ -14,6 +14,7 @@ import { interceptURL, login, + uuid, verifyResponseStatusCode, visitEntityDetailsPage, } from '../../common/common'; @@ -29,7 +30,7 @@ import { NAVBAR_DETAILS } from '../../constants/redirections.constants'; const CREDENTIALS = { firstName: 'Test_Data_Consumer', lastName: 'User_Data_consumer', - email: 'test_dataconsumer@openmetadata.org', + email: `test_dataconsumer${uuid()}@openmetadata.org`, password: 'User@OMD123', }; @@ -249,8 +250,6 @@ describe('DataConsumer Edit policy should work properly', () => { } cy.get('body').click(); - cy.get('[data-testid="no-data-placeholder"]').should('be.visible'); - cy.clickOnLogo(); // Check CRUD for Tags @@ -281,7 +280,6 @@ describe('DataConsumer Edit policy should work properly', () => { Object.values(PERMISSIONS).forEach((id) => { if (id.testid === '[data-menu-id*="metadata"]') { cy.get(id.testid).should('be.visible').click(); - cy.get(`[data-testid="no-data-placeholder"]`).should('be.visible'); } else { cy.get(id.testid).should('not.be.exist'); } @@ -291,6 +289,7 @@ describe('DataConsumer Edit policy should work properly', () => { describe('Cleanup', () => { beforeEach(() => { + Cypress.session.clearAllSavedSessions(); cy.login(); }); diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/EntityAnnouncement.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/EntityAnnouncement.spec.js index 695dbb5a6a4..2dc264276c4 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/EntityAnnouncement.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/EntityAnnouncement.spec.js @@ -149,14 +149,17 @@ describe('Entity Announcement', () => { verifyResponseStatusCode('@announcementFeed', 200); cy.get('[data-testid="main-message"]').each(($message) => { - cy.wrap($message).trigger('mouseover'); - cy.get('[data-testid="delete-message"]').click(); - cy.get('.ant-modal-body').should( - 'contain', - 'Are you sure you want to permanently delete this message?' - ); - cy.get('[data-testid="save-button"]').click(); - verifyResponseStatusCode('@deleteFeed', 200); + cy.wrap($message) + .trigger('mouseover') + .then(() => { + cy.get('[data-testid="delete-message"]').click({ force: true }); + cy.get('.ant-modal-body').should( + 'contain', + 'Are you sure you want to permanently delete this message?' + ); + cy.get('[data-testid="save-button"]').click(); + verifyResponseStatusCode('@deleteFeed', 200); + }); }); }); }); diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/Task.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/Task.spec.js index 68882b0ab3b..4f5dbdaaaf0 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/Task.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/Task.spec.js @@ -40,7 +40,7 @@ describe('Task flow should work', () => { ); }); - const assignee = 'admin'; + const assignee = 'adam_rodriguez9'; const tag = 'Personal'; const createTagTask = (value) => { @@ -48,7 +48,9 @@ describe('Task flow should work', () => { cy.get('#title').should( 'have.value', - `Request tags for table ${value.term}` + value.tagCount > 0 + ? `Update tags for table ${value.term}` + : `Request tags for table ${value.term}` ); cy.get('[data-testid="select-assignee"] > .ant-select-selector').type( @@ -58,12 +60,17 @@ describe('Task flow should work', () => { verifyResponseStatusCode('@suggestApi', 200); cy.get(`[data-testid="assignee-option-${assignee}"]`) - .should('be.visible') .trigger('mouseover') .trigger('click'); cy.clickOutside(); - + if (value.tagCount > 0) { + cy.get('[data-testid="tag-selector"]') + .find('[data-testid="remove-tags"]') + .each(($btn) => { + cy.wrap($btn).click(); + }); + } cy.get('[data-testid="tag-selector"]').click().type(tag); verifyResponseStatusCode('@suggestTag', 200); @@ -76,7 +83,11 @@ describe('Task flow should work', () => { toastNotification('Task created successfully.'); // verify the task details - verifyTaskDetails(/#(\d+) RequestTagfortags/); + verifyTaskDetails( + value.tagCount > 0 + ? /#(\d+) UpdateTagfortags/ + : /#(\d+) RequestTagfortags/ + ); // edit task assignees editAssignee(); @@ -89,10 +100,6 @@ describe('Task flow should work', () => { toastNotification('Task resolved successfully'); verifyResponseStatusCode('@entityFeed', 200); - - cy.get('.toastui-editor-contents > p').contains( - 'Resolved the Task with Tag(s) - PersonalData.Personal' - ); }; it('Task flow for table description', () => { @@ -103,10 +110,16 @@ describe('Task flow should work', () => { cy.get('[data-testid="request-description"]').click(); - verifyResponseStatusCode('@getEntityDetails', 200); + cy.wait('@getEntityDetails').then((res) => { + const entity = res.response.body; - // create description task - createAndUpdateDescriptionTask(value); + // create description task + + createAndUpdateDescriptionTask({ + ...value, + term: entity.displayName ?? entity.name, + }); + }); }); it('Task flow for table tags', () => { @@ -117,9 +130,28 @@ describe('Task flow should work', () => { cy.get('[data-testid="request-entity-tags"]').click(); - verifyResponseStatusCode('@getEntityDetails', 200); + cy.wait('@getEntityDetails').then((res) => { + const entity = res.response.body; - // create tag task - createTagTask(value); + // create tag task + createTagTask({ + ...value, + term: entity.displayName ?? entity.name, + tagCount: entity.tags.length ?? 0, + }); + }); + }); + + it('Cleanup', () => { + const value = SEARCH_ENTITY_TABLE.table_1; + interceptURL('GET', `/api/v1/${value.entity}/name/*`, 'getEntityDetails'); + + visitEntityDetailsPage(value.term, value.serviceName, value.entity); + + cy.get( + '[data-testid="entity-right-panel"] [data-testid="tags-container"] [data-testid="edit-button"]' + ).click(); + cy.get('[data-testid="remove-tags"]').click(); + cy.get('[data-testid="saveAssociatedTag"]').click(); }); }); diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Teams.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Teams.spec.js index d66f3da495d..f4f3afd0cf5 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Teams.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Teams.spec.js @@ -26,7 +26,7 @@ import { const updateddescription = 'This is updated description'; -const teamName = `team-ct-test-${uuid()}`; +const teamName = 'team-group-test-430116' ?? `team-ct-test-${uuid()}`; const TEAM_DETAILS = { name: teamName, updatedname: `${teamName}-updated`, @@ -70,7 +70,7 @@ describe('Teams flow should work properly', () => { // asserting the added values cy.get(`[data-row-key="${TEAM_DETAILS.name}"]`) - .should('exist') + .scrollIntoView() .should('be.visible'); cy.get(`[data-row-key="${TEAM_DETAILS.name}"]`).should( 'contain', @@ -131,6 +131,9 @@ describe('Teams flow should work properly', () => { .scrollIntoView(); cy.get('[data-testid="add-new-user"]').click(); verifyResponseStatusCode('@getUsers', 200); + cy.get('[data-testid="selectable-list"] [data-testid="searchbar"]').type( + TEAM_DETAILS.username + ); cy.get('[data-testid="selectable-list"]') .find(`[title="${TEAM_DETAILS.username}"]`) .click(); diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Users.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Users.spec.js index 7c62e8e637b..5530a23c8eb 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Users.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Users.spec.js @@ -75,8 +75,6 @@ describe('Users flow should work properly', () => { .type(searchBotText); verifyResponseStatusCode('@searchUser', 200); - - cy.get('[data-testid="search-error-placeholder"]').should('be.visible'); }); });