mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-01 02:56:10 +00:00
cypress: worked on upgrade test part 2 (#12625)
* cypress: worked on upgrade test part 2 * fixed task utils * fixed entity announcement
This commit is contained in:
parent
e3b9ac7e3a
commit
4e48c4a542
@ -17,7 +17,8 @@ import {
|
|||||||
verifyResponseStatusCode,
|
verifyResponseStatusCode,
|
||||||
} from './common';
|
} from './common';
|
||||||
|
|
||||||
const assignee = 'admin';
|
const owner = 'admin';
|
||||||
|
const assignee = 'adam_rodriguez9';
|
||||||
const secondAssignee = 'aaron_johnson0';
|
const secondAssignee = 'aaron_johnson0';
|
||||||
|
|
||||||
export const verifyTaskDetails = (regexPattern) => {
|
export const verifyTaskDetails = (regexPattern) => {
|
||||||
@ -30,7 +31,7 @@ export const verifyTaskDetails = (regexPattern) => {
|
|||||||
expect(matches).to.not.be.null;
|
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');
|
cy.get(`[data-testid="assignee-${assignee}"]`).should('be.visible');
|
||||||
};
|
};
|
||||||
|
|||||||
@ -873,7 +873,7 @@ export const deleteCreatedProperty = (propertyName) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const updateOwner = () => {
|
export const updateOwner = () => {
|
||||||
cy.get('[data-testid="avatar"]').should('be.visible').click();
|
cy.get('[data-testid="avatar"]').click();
|
||||||
cy.get('[data-testid="user-name"]')
|
cy.get('[data-testid="user-name"]')
|
||||||
.should('exist')
|
.should('exist')
|
||||||
.invoke('text')
|
.invoke('text')
|
||||||
@ -881,10 +881,12 @@ export const updateOwner = () => {
|
|||||||
cy.get('[data-testid="hiden-layer"]').should('exist').click();
|
cy.get('[data-testid="hiden-layer"]').should('exist').click();
|
||||||
interceptURL('GET', '/api/v1/users?limit=15', 'getUsers');
|
interceptURL('GET', '/api/v1/users?limit=15', 'getUsers');
|
||||||
// Clicking on edit owner button
|
// 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('.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"]')
|
cy.get('[data-testid="selectable-list"]')
|
||||||
.eq(1)
|
.eq(1)
|
||||||
.find(`[title="${text.trim()}"]`)
|
.find(`[title="${text.trim()}"]`)
|
||||||
|
|||||||
@ -14,6 +14,7 @@
|
|||||||
import {
|
import {
|
||||||
interceptURL,
|
interceptURL,
|
||||||
login,
|
login,
|
||||||
|
uuid,
|
||||||
verifyResponseStatusCode,
|
verifyResponseStatusCode,
|
||||||
visitEntityDetailsPage,
|
visitEntityDetailsPage,
|
||||||
} from '../../common/common';
|
} from '../../common/common';
|
||||||
@ -29,7 +30,7 @@ import { NAVBAR_DETAILS } from '../../constants/redirections.constants';
|
|||||||
const CREDENTIALS = {
|
const CREDENTIALS = {
|
||||||
firstName: 'Test_Data_Consumer',
|
firstName: 'Test_Data_Consumer',
|
||||||
lastName: 'User_Data_consumer',
|
lastName: 'User_Data_consumer',
|
||||||
email: 'test_dataconsumer@openmetadata.org',
|
email: `test_dataconsumer${uuid()}@openmetadata.org`,
|
||||||
password: 'User@OMD123',
|
password: 'User@OMD123',
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -249,8 +250,6 @@ describe('DataConsumer Edit policy should work properly', () => {
|
|||||||
}
|
}
|
||||||
cy.get('body').click();
|
cy.get('body').click();
|
||||||
|
|
||||||
cy.get('[data-testid="no-data-placeholder"]').should('be.visible');
|
|
||||||
|
|
||||||
cy.clickOnLogo();
|
cy.clickOnLogo();
|
||||||
|
|
||||||
// Check CRUD for Tags
|
// Check CRUD for Tags
|
||||||
@ -281,7 +280,6 @@ describe('DataConsumer Edit policy should work properly', () => {
|
|||||||
Object.values(PERMISSIONS).forEach((id) => {
|
Object.values(PERMISSIONS).forEach((id) => {
|
||||||
if (id.testid === '[data-menu-id*="metadata"]') {
|
if (id.testid === '[data-menu-id*="metadata"]') {
|
||||||
cy.get(id.testid).should('be.visible').click();
|
cy.get(id.testid).should('be.visible').click();
|
||||||
cy.get(`[data-testid="no-data-placeholder"]`).should('be.visible');
|
|
||||||
} else {
|
} else {
|
||||||
cy.get(id.testid).should('not.be.exist');
|
cy.get(id.testid).should('not.be.exist');
|
||||||
}
|
}
|
||||||
@ -291,6 +289,7 @@ describe('DataConsumer Edit policy should work properly', () => {
|
|||||||
|
|
||||||
describe('Cleanup', () => {
|
describe('Cleanup', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
Cypress.session.clearAllSavedSessions();
|
||||||
cy.login();
|
cy.login();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -149,14 +149,17 @@ describe('Entity Announcement', () => {
|
|||||||
|
|
||||||
verifyResponseStatusCode('@announcementFeed', 200);
|
verifyResponseStatusCode('@announcementFeed', 200);
|
||||||
cy.get('[data-testid="main-message"]').each(($message) => {
|
cy.get('[data-testid="main-message"]').each(($message) => {
|
||||||
cy.wrap($message).trigger('mouseover');
|
cy.wrap($message)
|
||||||
cy.get('[data-testid="delete-message"]').click();
|
.trigger('mouseover')
|
||||||
cy.get('.ant-modal-body').should(
|
.then(() => {
|
||||||
'contain',
|
cy.get('[data-testid="delete-message"]').click({ force: true });
|
||||||
'Are you sure you want to permanently delete this message?'
|
cy.get('.ant-modal-body').should(
|
||||||
);
|
'contain',
|
||||||
cy.get('[data-testid="save-button"]').click();
|
'Are you sure you want to permanently delete this message?'
|
||||||
verifyResponseStatusCode('@deleteFeed', 200);
|
);
|
||||||
|
cy.get('[data-testid="save-button"]').click();
|
||||||
|
verifyResponseStatusCode('@deleteFeed', 200);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -40,7 +40,7 @@ describe('Task flow should work', () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
const assignee = 'admin';
|
const assignee = 'adam_rodriguez9';
|
||||||
const tag = 'Personal';
|
const tag = 'Personal';
|
||||||
|
|
||||||
const createTagTask = (value) => {
|
const createTagTask = (value) => {
|
||||||
@ -48,7 +48,9 @@ describe('Task flow should work', () => {
|
|||||||
|
|
||||||
cy.get('#title').should(
|
cy.get('#title').should(
|
||||||
'have.value',
|
'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(
|
cy.get('[data-testid="select-assignee"] > .ant-select-selector').type(
|
||||||
@ -58,12 +60,17 @@ describe('Task flow should work', () => {
|
|||||||
verifyResponseStatusCode('@suggestApi', 200);
|
verifyResponseStatusCode('@suggestApi', 200);
|
||||||
|
|
||||||
cy.get(`[data-testid="assignee-option-${assignee}"]`)
|
cy.get(`[data-testid="assignee-option-${assignee}"]`)
|
||||||
.should('be.visible')
|
|
||||||
.trigger('mouseover')
|
.trigger('mouseover')
|
||||||
.trigger('click');
|
.trigger('click');
|
||||||
|
|
||||||
cy.clickOutside();
|
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);
|
cy.get('[data-testid="tag-selector"]').click().type(tag);
|
||||||
|
|
||||||
verifyResponseStatusCode('@suggestTag', 200);
|
verifyResponseStatusCode('@suggestTag', 200);
|
||||||
@ -76,7 +83,11 @@ describe('Task flow should work', () => {
|
|||||||
toastNotification('Task created successfully.');
|
toastNotification('Task created successfully.');
|
||||||
|
|
||||||
// verify the task details
|
// verify the task details
|
||||||
verifyTaskDetails(/#(\d+) RequestTagfortags/);
|
verifyTaskDetails(
|
||||||
|
value.tagCount > 0
|
||||||
|
? /#(\d+) UpdateTagfortags/
|
||||||
|
: /#(\d+) RequestTagfortags/
|
||||||
|
);
|
||||||
|
|
||||||
// edit task assignees
|
// edit task assignees
|
||||||
editAssignee();
|
editAssignee();
|
||||||
@ -89,10 +100,6 @@ describe('Task flow should work', () => {
|
|||||||
toastNotification('Task resolved successfully');
|
toastNotification('Task resolved successfully');
|
||||||
|
|
||||||
verifyResponseStatusCode('@entityFeed', 200);
|
verifyResponseStatusCode('@entityFeed', 200);
|
||||||
|
|
||||||
cy.get('.toastui-editor-contents > p').contains(
|
|
||||||
'Resolved the Task with Tag(s) - PersonalData.Personal'
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
it('Task flow for table description', () => {
|
it('Task flow for table description', () => {
|
||||||
@ -103,10 +110,16 @@ describe('Task flow should work', () => {
|
|||||||
|
|
||||||
cy.get('[data-testid="request-description"]').click();
|
cy.get('[data-testid="request-description"]').click();
|
||||||
|
|
||||||
verifyResponseStatusCode('@getEntityDetails', 200);
|
cy.wait('@getEntityDetails').then((res) => {
|
||||||
|
const entity = res.response.body;
|
||||||
|
|
||||||
// create description task
|
// create description task
|
||||||
createAndUpdateDescriptionTask(value);
|
|
||||||
|
createAndUpdateDescriptionTask({
|
||||||
|
...value,
|
||||||
|
term: entity.displayName ?? entity.name,
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Task flow for table tags', () => {
|
it('Task flow for table tags', () => {
|
||||||
@ -117,9 +130,28 @@ describe('Task flow should work', () => {
|
|||||||
|
|
||||||
cy.get('[data-testid="request-entity-tags"]').click();
|
cy.get('[data-testid="request-entity-tags"]').click();
|
||||||
|
|
||||||
verifyResponseStatusCode('@getEntityDetails', 200);
|
cy.wait('@getEntityDetails').then((res) => {
|
||||||
|
const entity = res.response.body;
|
||||||
|
|
||||||
// create tag task
|
// create tag task
|
||||||
createTagTask(value);
|
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();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -26,7 +26,7 @@ import {
|
|||||||
|
|
||||||
const updateddescription = 'This is updated description';
|
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 = {
|
const TEAM_DETAILS = {
|
||||||
name: teamName,
|
name: teamName,
|
||||||
updatedname: `${teamName}-updated`,
|
updatedname: `${teamName}-updated`,
|
||||||
@ -70,7 +70,7 @@ describe('Teams flow should work properly', () => {
|
|||||||
|
|
||||||
// asserting the added values
|
// asserting the added values
|
||||||
cy.get(`[data-row-key="${TEAM_DETAILS.name}"]`)
|
cy.get(`[data-row-key="${TEAM_DETAILS.name}"]`)
|
||||||
.should('exist')
|
.scrollIntoView()
|
||||||
.should('be.visible');
|
.should('be.visible');
|
||||||
cy.get(`[data-row-key="${TEAM_DETAILS.name}"]`).should(
|
cy.get(`[data-row-key="${TEAM_DETAILS.name}"]`).should(
|
||||||
'contain',
|
'contain',
|
||||||
@ -131,6 +131,9 @@ describe('Teams flow should work properly', () => {
|
|||||||
.scrollIntoView();
|
.scrollIntoView();
|
||||||
cy.get('[data-testid="add-new-user"]').click();
|
cy.get('[data-testid="add-new-user"]').click();
|
||||||
verifyResponseStatusCode('@getUsers', 200);
|
verifyResponseStatusCode('@getUsers', 200);
|
||||||
|
cy.get('[data-testid="selectable-list"] [data-testid="searchbar"]').type(
|
||||||
|
TEAM_DETAILS.username
|
||||||
|
);
|
||||||
cy.get('[data-testid="selectable-list"]')
|
cy.get('[data-testid="selectable-list"]')
|
||||||
.find(`[title="${TEAM_DETAILS.username}"]`)
|
.find(`[title="${TEAM_DETAILS.username}"]`)
|
||||||
.click();
|
.click();
|
||||||
|
|||||||
@ -75,8 +75,6 @@ describe('Users flow should work properly', () => {
|
|||||||
.type(searchBotText);
|
.type(searchBotText);
|
||||||
|
|
||||||
verifyResponseStatusCode('@searchUser', 200);
|
verifyResponseStatusCode('@searchUser', 200);
|
||||||
|
|
||||||
cy.get('[data-testid="search-error-placeholder"]').should('be.visible');
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user