Skip to content

Commit

Permalink
cypress: fixed flakiness and announcment cypress (#16579)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaileshParmar11 authored Jun 9, 2024
1 parent fe964e3 commit 1f9e87a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class ServiceBaseClass {

cy.get('[data-testid="view-service-button"]').click();
verifyResponseStatusCode('@serviceDetails', 200);
verifyResponseStatusCode('@ingestionPipelines', 200);
cy.wait('@ingestionPipelines');

this.handleIngestionRetry();
}
Expand Down Expand Up @@ -272,7 +272,7 @@ class ServiceBaseClass {
cy.get('[data-testid="ingestions"]').click();

if (ingestionType === 'metadata') {
verifyResponseStatusCode('@pipelineStatuses', 200, {
cy.wait('@pipelineStatuses', {
responseTimeout: 50000,
});
}
Expand All @@ -293,8 +293,8 @@ class ServiceBaseClass {
if (retryCount !== 0) {
cy.wait('@allPermissions').then(() => {
cy.wait('@serviceDetails').then(() => {
verifyResponseStatusCode('@ingestionPipelines', 200);
verifyResponseStatusCode('@pipelineStatuses', 200, {
cy.wait('@ingestionPipelines');
cy.wait('@pipelineStatuses', {
responseTimeout: 50000,
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ export const createAnnouncement = (announcement, entityName, updatedName) => {

cy.get('[data-testid="announcement-container"]')
.find(`a[href*="${encodeURIComponent(entityName)}"]`)
.filter(':visible')
.first()
.click();

cy.get('[data-testid="entity-header-display-name"]').should(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const verifyPipelineSuccessStatus = (time = 20000) => {
cy.reload();
verifyResponseStatusCode('@testSuite', 200);
cy.get('[id*="tab-pipeline"]').click();
verifyResponseStatusCode('@pipelineStatus', 200);
cy.wait('@pipelineStatus');
cy.get('[data-testid="pipeline-status"]').then(($el) => {
const text = $el.text();
if (text !== 'Success' && text !== 'Failed' && newTime > 500) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ export const editDisplayName = (editedUserName: string) => {
cy.get('[data-testid="displayName"]').type(editedUserName);
interceptURL('PATCH', '/api/v1/users/*', 'updateName');
cy.get('[data-testid="inline-save-btn"]').click();
cy.get('[data-testid="edit-displayName"]').scrollIntoView();
cy.get('[data-testid="user-name"]').should('contain', editedUserName);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,24 +69,6 @@ describe('Roles page should work properly', { tags: 'Settings' }, () => {
cy.url().should('eq', `${BASE_URL}/settings/access/roles`);
});

it('Default Role and Policies should be displayed', () => {
// Verifying the default roles and policies are present

Object.values(roles).forEach((role) => {
cy.get('[data-testid="role-name"]')
.should('contain', role)
.should('be.visible');
});

// Validate policy
cy.get('[data-testid="policy-link"]')
.should('contain', policies.dataConsumerPolicy)
.should('be.visible');
cy.get('[data-testid="policy-link"]')
.should('contain', policies.dataStewardPolicy)
.should('be.visible');
});

it('Add new role and check all tabs data', () => {
cy.get('[data-testid="add-role"]')
.contains('Add Role')
Expand Down

0 comments on commit 1f9e87a

Please sign in to comment.