mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-12 08:52:38 +00:00
cypress: worked on flaky ui cypress (#12772)
This commit is contained in:
parent
73a8741619
commit
d0f9428333
@ -32,10 +32,13 @@ const reactOnFeed = (feedSelector, reaction) => {
|
|||||||
cy.get('[data-testid="add-reactions"]').click();
|
cy.get('[data-testid="add-reactions"]').click();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
cy.get('.ant-popover-inner-content')
|
||||||
cy.get(
|
.should('be.visible')
|
||||||
`#reaction-popover [data-testid="reaction-button"][title="${reaction}"]`
|
.then(() => {
|
||||||
).click();
|
cy.get(
|
||||||
|
`#reaction-popover [data-testid="reaction-button"][title="${reaction}"]`
|
||||||
|
).click();
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
describe('Activity feed', () => {
|
describe('Activity feed', () => {
|
||||||
@ -130,6 +133,31 @@ describe('Activity feed', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('Remove Emoji reaction from feed', () => {
|
||||||
|
// remove reaction for latest feed
|
||||||
|
[
|
||||||
|
'thumbsUp',
|
||||||
|
'thumbsDown',
|
||||||
|
'laugh',
|
||||||
|
'hooray',
|
||||||
|
'confused',
|
||||||
|
'heart',
|
||||||
|
'eyes',
|
||||||
|
'rocket',
|
||||||
|
].map((reaction) =>
|
||||||
|
reactOnFeed(
|
||||||
|
'[data-testid="activity-feed-widget"] [data-testid="message-container"]:first-child',
|
||||||
|
reaction
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
// Verify if reaction is working or not
|
||||||
|
cy.get('[data-testid="message-container"]')
|
||||||
|
.eq(1)
|
||||||
|
.find('[data-testid="feed-reaction-container"]')
|
||||||
|
.should('not.exist');
|
||||||
|
});
|
||||||
|
|
||||||
it('User should be able to reply to feed', () => {
|
it('User should be able to reply to feed', () => {
|
||||||
interceptURL('GET', '/api/v1/feed/*', 'fetchFeed');
|
interceptURL('GET', '/api/v1/feed/*', 'fetchFeed');
|
||||||
cy.get(
|
cy.get(
|
||||||
@ -162,7 +190,7 @@ describe('Activity feed', () => {
|
|||||||
'[data-testid="editor-wrapper"] [contenteditable="true"].ql-editor'
|
'[data-testid="editor-wrapper"] [contenteditable="true"].ql-editor'
|
||||||
).as('editor');
|
).as('editor');
|
||||||
cy.get('@editor').click();
|
cy.get('@editor').click();
|
||||||
cy.get('@editor').type('Cypress has replied here. Thanks! @aa');
|
cy.get('@editor').type('Cypress has replied here. Thanks! @aaron_johnson0');
|
||||||
|
|
||||||
verifyResponseStatusCode('@suggestUser', 200);
|
verifyResponseStatusCode('@suggestUser', 200);
|
||||||
cy.get('[data-value="@aaron_johnson0"]').click();
|
cy.get('[data-value="@aaron_johnson0"]').click();
|
||||||
@ -197,6 +225,11 @@ describe('Activity feed', () => {
|
|||||||
|
|
||||||
it('Mention should work for the feed reply', () => {
|
it('Mention should work for the feed reply', () => {
|
||||||
interceptURL('GET', '/api/v1/feed/*', 'fetchFeed');
|
interceptURL('GET', '/api/v1/feed/*', 'fetchFeed');
|
||||||
|
interceptURL(
|
||||||
|
'GET',
|
||||||
|
'/api/v1/feed?filterType=MENTIONS&userId=*',
|
||||||
|
'mentionsFeed'
|
||||||
|
);
|
||||||
cy.get(
|
cy.get(
|
||||||
'[data-testid="activity-feed-widget"] [data-testid="message-container"]:first-child'
|
'[data-testid="activity-feed-widget"] [data-testid="message-container"]:first-child'
|
||||||
).within(() => {
|
).within(() => {
|
||||||
@ -222,7 +255,6 @@ describe('Activity feed', () => {
|
|||||||
).as('editor');
|
).as('editor');
|
||||||
cy.get('@editor').click();
|
cy.get('@editor').click();
|
||||||
cy.get('@editor').type('Can you resolve this thread for me? @admin');
|
cy.get('@editor').type('Can you resolve this thread for me? @admin');
|
||||||
// verifyResponseStatusCode('@suggestUser', 200);
|
|
||||||
cy.get('[data-value="@admin"]').click();
|
cy.get('[data-value="@admin"]').click();
|
||||||
|
|
||||||
cy.get('[data-testid="send-button"]')
|
cy.get('[data-testid="send-button"]')
|
||||||
@ -244,7 +276,7 @@ describe('Activity feed', () => {
|
|||||||
cy.get('[data-testid="activity-feed-widget"]')
|
cy.get('[data-testid="activity-feed-widget"]')
|
||||||
.contains('@Mentions')
|
.contains('@Mentions')
|
||||||
.click();
|
.click();
|
||||||
|
verifyResponseStatusCode('@mentionsFeed', 200);
|
||||||
// Verify mentioned thread should be there int he mentioned tab
|
// Verify mentioned thread should be there int he mentioned tab
|
||||||
cy.get(
|
cy.get(
|
||||||
'[data-testid="message-container"] > .activity-feed-card [data-testid="viewer-container"]'
|
'[data-testid="message-container"] > .activity-feed-card [data-testid="viewer-container"]'
|
||||||
|
|||||||
@ -81,12 +81,13 @@ const addRemoveOwner = (isGlossaryPage) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const addRemoveTier = () => {
|
const addRemoveTier = () => {
|
||||||
|
interceptURL('GET', '/api/v1/tags?parent=Tier&limit=10', 'fetchTier');
|
||||||
cy.get('[data-testid="edit-tier"]').click();
|
cy.get('[data-testid="edit-tier"]').click();
|
||||||
|
verifyResponseStatusCode('@fetchTier', 200);
|
||||||
cy.get('[data-testid="radio-btn-Tier1"]').click({ waitForAnimations: true });
|
cy.get('[data-testid="radio-btn-Tier1"]').click({ waitForAnimations: true });
|
||||||
|
verifyResponseStatusCode('@patchOwner', 200);
|
||||||
cy.get('[data-testid="radio-btn-Tier1"]').should('be.checked');
|
cy.get('[data-testid="radio-btn-Tier1"]').should('be.checked');
|
||||||
|
|
||||||
verifyResponseStatusCode('@patchOwner', 200);
|
|
||||||
cy.clickOutside();
|
cy.clickOutside();
|
||||||
cy.get('[data-testid="Tier"]').should('contain', TIER);
|
cy.get('[data-testid="Tier"]').should('contain', TIER);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user