Minor: fixed AUT failure of main branch (#15170)

This commit is contained in:
Shailesh Parmar 2024-02-14 12:20:16 +05:30 committed by GitHub
parent cdbcea11f6
commit cc2d30be84
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 36 additions and 18 deletions

View File

@ -10,9 +10,11 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import { RETRY_TIMES } from './common'; import { SidebarItem } from '../constants/Entity.interface';
import { interceptURL, RETRY_TIMES, verifyResponseStatusCode } from './common';
const BASE_WAIT_TIME = 4000; const BASE_WAIT_TIME = 4000;
let isSuccessStatus = false;
export const checkDataInsightSuccessStatus = ( export const checkDataInsightSuccessStatus = (
count = 1, count = 1,
@ -38,10 +40,29 @@ export const checkDataInsightSuccessStatus = (
if ($ingestionStatus.text() !== 'Success') { if ($ingestionStatus.text() !== 'Success') {
cy.get('@checkRun').should('have.text', 'Success'); cy.get('@checkRun').should('have.text', 'Success');
return true; isSuccessStatus = true;
} }
return false; isSuccessStatus = false;
} }
}); });
}; };
export const verifyKpiChart = () => {
interceptURL(
'GET',
'/api/v1/analytics/dataInsights/charts/aggregate?*',
'dataInsightsChart'
);
checkDataInsightSuccessStatus();
cy.sidebarClick(SidebarItem.DATA_INSIGHT);
verifyResponseStatusCode('@dataInsightsChart', 200);
cy.get('[data-testid="search-dropdown-Team"]').should('be.visible');
cy.get('[data-testid="search-dropdown-Tier"]').should('be.visible');
cy.get('[data-testid="summary-card"]').should('be.visible');
cy.get('[data-testid="kpi-card"]').should('be.visible');
if (isSuccessStatus) {
cy.get('#kpi-chart').scrollIntoView().should('be.visible');
}
};

View File

@ -625,7 +625,7 @@ export const editCreatedProperty = (propertyName) => {
cy.get('[data-testid="save"]').click(); cy.get('[data-testid="save"]').click();
cy.wait('@checkPatchForDescription', { timeout: 10000 }); cy.wait('@checkPatchForDescription', { timeout: 15000 });
cy.get('.ant-modal-wrap').should('not.exist'); cy.get('.ant-modal-wrap').should('not.exist');

View File

@ -22,7 +22,7 @@ import {
interceptURL, interceptURL,
verifyResponseStatusCode, verifyResponseStatusCode,
} from '../../common/common'; } from '../../common/common';
import { checkDataInsightSuccessStatus } from '../../common/DataInsightUtils'; import { verifyKpiChart } from '../../common/DataInsightUtils';
import { SidebarItem } from '../../constants/Entity.interface'; import { SidebarItem } from '../../constants/Entity.interface';
import { GlobalSettingOptions } from '../../constants/settings.constant'; import { GlobalSettingOptions } from '../../constants/settings.constant';
@ -39,8 +39,6 @@ const KPI_DATA = [
}, },
]; ];
let isSuccessStatus = false;
const deleteKpiRequest = () => { const deleteKpiRequest = () => {
cy.get('[data-menu-id*="kpi"]').click(); cy.get('[data-menu-id*="kpi"]').click();
cy.wait('@getKpi').then(({ response }) => { cy.wait('@getKpi').then(({ response }) => {
@ -141,7 +139,7 @@ describe('Data Insight feature', () => {
cy.get('[data-testid="run-now-button"]').click(); cy.get('[data-testid="run-now-button"]').click();
verifyResponseStatusCode('@triggerPipeline', 200); verifyResponseStatusCode('@triggerPipeline', 200);
cy.reload(); cy.reload();
isSuccessStatus = checkDataInsightSuccessStatus(); verifyKpiChart();
}); });
it('Verifying Data assets tab', () => { it('Verifying Data assets tab', () => {
@ -151,9 +149,6 @@ describe('Data Insight feature', () => {
cy.get('[data-testid="search-dropdown-Tier"]').should('be.visible'); cy.get('[data-testid="search-dropdown-Tier"]').should('be.visible');
cy.get('[data-testid="summary-card"]').should('be.visible'); cy.get('[data-testid="summary-card"]').should('be.visible');
cy.get('[data-testid="kpi-card"]').should('be.visible'); cy.get('[data-testid="kpi-card"]').should('be.visible');
if (isSuccessStatus) {
cy.get('#kpi-chart').scrollIntoView().should('be.visible');
}
cy.get('#entity-summary-chart').scrollIntoView().should('be.visible'); cy.get('#entity-summary-chart').scrollIntoView().should('be.visible');
cy.get('#PercentageOfEntitiesWithDescriptionByType-graph') cy.get('#PercentageOfEntitiesWithDescriptionByType-graph')
.scrollIntoView() .scrollIntoView()

View File

@ -37,7 +37,7 @@ describe('Data Insight settings page should work properly', () => {
).click(); ).click();
verifyResponseStatusCode('@getDataInsightDetails', 200); verifyResponseStatusCode('@getDataInsightDetails', 200);
cy.get('[data-testid="edit-button"]').click(); cy.get('[data-testid="edit-button"]').click();
cy.get('#cronType').click(); cy.get('[data-testid="cron-type"]').click();
cy.get('[title="Day"]').click(); cy.get('[title="Day"]').click();
cy.get('[data-testid="hour-options"]').click(); cy.get('[data-testid="hour-options"]').click();
cy.get('[title="01"]').click(); cy.get('[title="01"]').click();
@ -82,8 +82,8 @@ describe('Data Insight settings page should work properly', () => {
).click(); ).click();
cy.get('[data-testid="install-application"]').click(); cy.get('[data-testid="install-application"]').click();
cy.get('[data-testid="save-button"]').click(); cy.get('[data-testid="save-button"]').click();
cy.get('#cronType').click(); cy.get('[data-testid="cron-type"]').click();
cy.get('[title="Day"]').click(); cy.get('.rc-virtual-list [title="Day"]').click();
cy.get('[data-testid="cron-type"]').should('contain', 'Day'); cy.get('[data-testid="cron-type"]').should('contain', 'Day');
cy.get('[data-testid="deploy-button"]').click(); cy.get('[data-testid="deploy-button"]').click();
verifyResponseStatusCode('@installApplication', 201); verifyResponseStatusCode('@installApplication', 201);

View File

@ -119,7 +119,9 @@ const verifyEntities = ({ url }) => {
tables.forEach((table) => { tables.forEach((table) => {
cy.get( cy.get(
`[data-testid="table-data-card_${table.databaseSchema}.${table.name}"]` `[data-testid="table-data-card_${table.databaseSchema}.${table.name}"]`
).should('be.exist'); )
.scrollIntoView()
.should('be.exist');
}); });
}; };

View File

@ -40,7 +40,7 @@ describe('Search Index Application', () => {
interceptURL('PATCH', '/api/v1/apps/*', 'updateApplication'); interceptURL('PATCH', '/api/v1/apps/*', 'updateApplication');
visitSearchApplicationPage(); visitSearchApplicationPage();
cy.get('[data-testid="edit-button"]').click(); cy.get('[data-testid="edit-button"]').click();
cy.get('#cronType').click(); cy.get('[data-testid="cron-type"]').click();
cy.get('[title="Day"]').click(); cy.get('[title="Day"]').click();
cy.get('[data-testid="hour-options"]').click(); cy.get('[data-testid="hour-options"]').click();
cy.get('[title="01"]').click(); cy.get('[title="01"]').click();
@ -86,8 +86,8 @@ describe('Search Index Application', () => {
cy.get('[data-testid="install-application"]').click(); cy.get('[data-testid="install-application"]').click();
cy.get('[data-testid="save-button"]').scrollIntoView().click(); cy.get('[data-testid="save-button"]').scrollIntoView().click();
cy.get('[data-testid="submit-btn"]').scrollIntoView().click(); cy.get('[data-testid="submit-btn"]').scrollIntoView().click();
cy.get('#cronType').click(); cy.get('[data-testid="cron-type"]').click();
cy.get('[title="Day"]').click(); cy.get('.rc-virtual-list [title="Day"]').click();
cy.get('[data-testid="cron-type"]').should('contain', 'Day'); cy.get('[data-testid="cron-type"]').should('contain', 'Day');
cy.get('[data-testid="deploy-button"]').click(); cy.get('[data-testid="deploy-button"]').click();
verifyResponseStatusCode('@installApplication', 201); verifyResponseStatusCode('@installApplication', 201);