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

View File

@ -75,8 +75,8 @@ describe('Data Quality and Profiler should work properly', () => {
serviceName 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); login(LOGIN.username, LOGIN.password);
cy.goToHomePage(); cy.goToHomePage();
goToProfilerTab(); goToProfilerTab();
@ -125,8 +125,8 @@ describe('Data Quality and Profiler should work properly', () => {
handleIngestionRetry('database', true, 0, 'profiler'); 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); login(LOGIN.username, LOGIN.password);
cy.goToHomePage(); cy.goToHomePage();
goToProfilerTab(); goToProfilerTab();