Cypress: Updated condition for service page (#8822)

* Cypress: Updated condition for service page

* added wait for skeleton load

* condition fixed at retry of ingetion
This commit is contained in:
Shailesh Parmar 2022-11-17 11:03:59 +05:30 committed by GitHub
parent 8c67e0f627
commit e74ec6f7e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 56 additions and 49 deletions

View File

@ -74,28 +74,33 @@ export const handleIngestionRetry = (
}
};
const checkSuccessState = () => {
testIngestionsTab();
retryCount++;
// the latest run should be success
cy.get(`.ant-table-tbody > :nth-child(${rowIndex}) > :nth-child(4)`).then(
($ingestionStatus) => {
if (
($ingestionStatus.text() === 'Running' ||
$ingestionStatus.text() === 'Queued' || $ingestionStatus.text() === '--') &&
retryCount <= RETRY_TIMES
) {
// retry after waiting for 20 seconds
cy.wait(20000);
cy.reload();
checkSuccessState();
} else {
cy.get(`.ant-table-tbody > :nth-child(${rowIndex}) > :nth-child(4)`).should(
'have.text',
'Success'
);
}
}
);
testIngestionsTab();
retryCount++;
cy.get('body').then(($body) => {
if ($body.find('.ant-skeleton-input').length) {
cy.wait(1000);
}
});
// the latest run should be success
cy.get(`.ant-table-tbody > :nth-child(${rowIndex}) > :nth-child(4)`).then(
($ingestionStatus) => {
if (
$ingestionStatus.text() !== 'Success' &&
retryCount <= RETRY_TIMES
) {
// retry after waiting for 20 seconds
cy.wait(20000);
cy.reload();
checkSuccessState();
} else {
cy.get(
`.ant-table-tbody > :nth-child(${rowIndex}) > :nth-child(4)`
).should('have.text', 'Success');
}
}
);
};
checkSuccessState();
@ -889,7 +894,6 @@ export const addTeam = (TEAM_DETAILS) => {
export const retryIngestionRun = () => {
let retryCount = 0;
const testIngestionsTab = () => {
cy.get('[data-testid="Ingestions"]').should('be.visible');
cy.get('[data-testid="Ingestions"] >> [data-testid="filter-count"]').should(
@ -903,28 +907,31 @@ export const retryIngestionRun = () => {
};
const checkSuccessState = () => {
testIngestionsTab();
retryCount++;
// the latest run should be success
cy.get('[data-testid="pipeline-status"]').then(
($ingestionStatus) => {
if (
($ingestionStatus.text() === 'Running' ||
$ingestionStatus.text() === 'Queued' || $ingestionStatus.text() === '--') &&
retryCount <= RETRY_TIMES
) {
// retry after waiting for 20 seconds
cy.wait(20000);
cy.reload();
checkSuccessState();
} else {
cy.get('[data-testid="pipeline-status"]').should(
'have.text',
'Success'
);
}
}
);
testIngestionsTab();
retryCount++;
cy.get('body').then(($body) => {
if ($body.find('.ant-skeleton-input').length) {
cy.wait(1000);
}
});
// the latest run should be success
cy.get('[data-testid="pipeline-status"]').then(($ingestionStatus) => {
if (
$ingestionStatus.text() !== 'Success' &&
retryCount <= RETRY_TIMES
) {
// retry after waiting for 20 seconds
cy.wait(20000);
cy.reload();
checkSuccessState();
} else {
cy.get('[data-testid="pipeline-status"]').should(
'have.text',
'Success'
);
}
});
};
checkSuccessState();

View File

@ -75,8 +75,8 @@ describe('Data Quality and Profiler should work properly', () => {
serviceName
);
});
// Todo:- profiler is not retrying to get latest status in CLI
it.skip('Add Profiler ingestion', () => {
it('Add Profiler ingestion', () => {
login(LOGIN.username, LOGIN.password);
cy.goToHomePage();
goToProfilerTab();
@ -125,8 +125,8 @@ describe('Data Quality and Profiler should work properly', () => {
handleIngestionRetry('database', true, 0, 'profiler');
});
// Todo:- skipping for now as it flaky failure, need to check for cause of failure
it.skip('Check if profiler is ingested properly or not', () => {
it('Check if profiler is ingested properly or not', () => {
login(LOGIN.username, LOGIN.password);
cy.goToHomePage();
goToProfilerTab();