Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor: fixed AUT failure of main branch #15170

Merged
merged 1 commit into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
* See the License for the specific language governing permissions and
* 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;
let isSuccessStatus = false;

export const checkDataInsightSuccessStatus = (
count = 1,
Expand All @@ -38,10 +40,29 @@ export const checkDataInsightSuccessStatus = (
if ($ingestionStatus.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');
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ export const editCreatedProperty = (propertyName) => {

cy.get('[data-testid="save"]').click();

cy.wait('@checkPatchForDescription', { timeout: 10000 });
cy.wait('@checkPatchForDescription', { timeout: 15000 });

cy.get('.ant-modal-wrap').should('not.exist');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
interceptURL,
verifyResponseStatusCode,
} from '../../common/common';
import { checkDataInsightSuccessStatus } from '../../common/DataInsightUtils';
import { verifyKpiChart } from '../../common/DataInsightUtils';
import { SidebarItem } from '../../constants/Entity.interface';
import { GlobalSettingOptions } from '../../constants/settings.constant';

Expand All @@ -39,8 +39,6 @@ const KPI_DATA = [
},
];

let isSuccessStatus = false;

const deleteKpiRequest = () => {
cy.get('[data-menu-id*="kpi"]').click();
cy.wait('@getKpi').then(({ response }) => {
Expand Down Expand Up @@ -141,7 +139,7 @@ describe('Data Insight feature', () => {
cy.get('[data-testid="run-now-button"]').click();
verifyResponseStatusCode('@triggerPipeline', 200);
cy.reload();
isSuccessStatus = checkDataInsightSuccessStatus();
verifyKpiChart();
});

it('Verifying Data assets tab', () => {
Expand All @@ -151,9 +149,6 @@ describe('Data Insight feature', () => {
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');
}
cy.get('#entity-summary-chart').scrollIntoView().should('be.visible');
cy.get('#PercentageOfEntitiesWithDescriptionByType-graph')
.scrollIntoView()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('Data Insight settings page should work properly', () => {
).click();
verifyResponseStatusCode('@getDataInsightDetails', 200);
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('[data-testid="hour-options"]').click();
cy.get('[title="01"]').click();
Expand Down Expand Up @@ -82,8 +82,8 @@ describe('Data Insight settings page should work properly', () => {
).click();
cy.get('[data-testid="install-application"]').click();
cy.get('[data-testid="save-button"]').click();
cy.get('#cronType').click();
cy.get('[title="Day"]').click();
cy.get('[data-testid="cron-type"]').click();
cy.get('.rc-virtual-list [title="Day"]').click();
cy.get('[data-testid="cron-type"]').should('contain', 'Day');
cy.get('[data-testid="deploy-button"]').click();
verifyResponseStatusCode('@installApplication', 201);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ const verifyEntities = ({ url }) => {
tables.forEach((table) => {
cy.get(
`[data-testid="table-data-card_${table.databaseSchema}.${table.name}"]`
).should('be.exist');
)
.scrollIntoView()
.should('be.exist');
});
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('Search Index Application', () => {
interceptURL('PATCH', '/api/v1/apps/*', 'updateApplication');
visitSearchApplicationPage();
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('[data-testid="hour-options"]').click();
cy.get('[title="01"]').click();
Expand Down Expand Up @@ -86,8 +86,8 @@ describe('Search Index Application', () => {
cy.get('[data-testid="install-application"]').click();
cy.get('[data-testid="save-button"]').scrollIntoView().click();
cy.get('[data-testid="submit-btn"]').scrollIntoView().click();
cy.get('#cronType').click();
cy.get('[title="Day"]').click();
cy.get('[data-testid="cron-type"]').click();
cy.get('.rc-virtual-list [title="Day"]').click();
cy.get('[data-testid="cron-type"]').should('contain', 'Day');
cy.get('[data-testid="deploy-button"]').click();
verifyResponseStatusCode('@installApplication', 201);
Expand Down
Loading