mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-01 21:23:10 +00:00
cypress: fixed flaky cypress of main branch (#10996)
* fixed failing cypress on main * updating cypress config to test * updating ingestion check * revert changes related cypress.config * added api wait for service details page API
This commit is contained in:
parent
673573a512
commit
d30e2d89d6
@ -74,18 +74,12 @@ export const handleIngestionRetry = (
|
|||||||
// ingestions page
|
// ingestions page
|
||||||
let retryCount = count;
|
let retryCount = count;
|
||||||
const testIngestionsTab = () => {
|
const testIngestionsTab = () => {
|
||||||
cy.get('[data-testid="Ingestions"]').should('exist').and('be.visible');
|
|
||||||
cy.get('[data-testid="Ingestions"] >> [data-testid="filter-count"]').should(
|
|
||||||
'have.text',
|
|
||||||
rowIndex
|
|
||||||
);
|
|
||||||
// click on the tab only for the first time
|
// click on the tab only for the first time
|
||||||
if (retryCount === 0) {
|
if (retryCount === 0) {
|
||||||
// Wait for pipeline status to be loaded
|
cy.get('[data-testid="Ingestions"]').should('exist').and('be.visible');
|
||||||
if (ingestionType === 'metadata') {
|
cy.get(
|
||||||
verifyResponseStatusCode('@ingestionPipelines', 200);
|
'[data-testid="Ingestions"] >> [data-testid="filter-count"]'
|
||||||
}
|
).should('have.text', rowIndex);
|
||||||
|
|
||||||
cy.get('[data-testid="Ingestions"]').click();
|
cy.get('[data-testid="Ingestions"]').click();
|
||||||
|
|
||||||
if (ingestionType === 'metadata') {
|
if (ingestionType === 'metadata') {
|
||||||
@ -112,15 +106,9 @@ export const handleIngestionRetry = (
|
|||||||
|
|
||||||
retryCount++;
|
retryCount++;
|
||||||
|
|
||||||
if (ingestionType === 'metadata') {
|
cy.get(`[data-row-key*="${ingestionType}"]`)
|
||||||
cy.get(`[data-row-key*="${ingestionType}"]`)
|
.find('[data-testid="pipeline-status"]')
|
||||||
.find('[data-testid="pipeline-status"]')
|
.as('checkRun');
|
||||||
.as('checkRun');
|
|
||||||
} else {
|
|
||||||
cy.get(`[data-row-key*="${ingestionType}"]`)
|
|
||||||
.find('[data-testid="pipeline-status"]')
|
|
||||||
.as('checkRun');
|
|
||||||
}
|
|
||||||
// the latest run should be success
|
// the latest run should be success
|
||||||
cy.get('@checkRun').then(($ingestionStatus) => {
|
cy.get('@checkRun').then(($ingestionStatus) => {
|
||||||
if (
|
if (
|
||||||
@ -290,9 +278,17 @@ export const testServiceCreationAndIngestion = (
|
|||||||
cy.clock();
|
cy.clock();
|
||||||
cy.wait(10000);
|
cy.wait(10000);
|
||||||
|
|
||||||
cy.get('[data-testid="view-service-button"]').should('be.visible');
|
interceptURL(
|
||||||
cy.get('[data-testid="view-service-button"]').click();
|
'GET',
|
||||||
|
'/api/v1/services/ingestionPipelines?*',
|
||||||
|
'ingestionPipelines'
|
||||||
|
);
|
||||||
|
interceptURL('GET', '/api/v1/services/*/name/*', 'serviceDetails');
|
||||||
|
|
||||||
|
cy.get('[data-testid="view-service-button"]').should('be.visible').click();
|
||||||
verifyResponseStatusCode('@getIngestionPipelineStatus', 200);
|
verifyResponseStatusCode('@getIngestionPipelineStatus', 200);
|
||||||
|
verifyResponseStatusCode('@ingestionPipelines', 200);
|
||||||
|
verifyResponseStatusCode('@serviceDetails', 200);
|
||||||
handleIngestionRetry(type, testIngestionButton);
|
handleIngestionRetry(type, testIngestionButton);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -115,22 +115,36 @@ describe('Postgres Ingestion', () => {
|
|||||||
.click();
|
.click();
|
||||||
|
|
||||||
verifyResponseStatusCode('@getServices', 200);
|
verifyResponseStatusCode('@getServices', 200);
|
||||||
cy.intercept('/api/v1/services/ingestionPipelines?*').as('ingestionData');
|
interceptURL(
|
||||||
|
'GET',
|
||||||
|
'/api/v1/services/ingestionPipelines?*',
|
||||||
|
'ingestionData'
|
||||||
|
);
|
||||||
interceptURL(
|
interceptURL(
|
||||||
'GET',
|
'GET',
|
||||||
'/api/v1/system/config/pipeline-service-client',
|
'/api/v1/system/config/pipeline-service-client',
|
||||||
'airflow'
|
'airflow'
|
||||||
);
|
);
|
||||||
|
interceptURL(
|
||||||
|
'GET',
|
||||||
|
'/api/v1/permissions/ingestionPipeline/name/*',
|
||||||
|
'ingestionPermissions'
|
||||||
|
);
|
||||||
|
interceptURL('GET', '/api/v1/services/*/name/*', 'serviceDetails');
|
||||||
cy.get(`[data-testid="service-name-${serviceName}"]`)
|
cy.get(`[data-testid="service-name-${serviceName}"]`)
|
||||||
.should('exist')
|
.should('exist')
|
||||||
.click();
|
.click();
|
||||||
cy.get('[data-testid="tabs"]').should('exist');
|
verifyResponseStatusCode('@ingestionData', 200, {
|
||||||
cy.wait('@ingestionData');
|
responseTimeout: 50000,
|
||||||
|
});
|
||||||
|
verifyResponseStatusCode('@serviceDetails', 200);
|
||||||
verifyResponseStatusCode('@airflow', 200);
|
verifyResponseStatusCode('@airflow', 200);
|
||||||
|
cy.get('[data-testid="tabs"]').should('exist');
|
||||||
cy.get('[data-testid="Ingestions"]')
|
cy.get('[data-testid="Ingestions"]')
|
||||||
.scrollIntoView()
|
.scrollIntoView()
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
|
verifyResponseStatusCode('@ingestionPermissions', 200);
|
||||||
cy.get('[data-testid="ingestion-details-container"]').should('exist');
|
cy.get('[data-testid="ingestion-details-container"]').should('exist');
|
||||||
cy.get('[data-testid="add-new-ingestion-button"]')
|
cy.get('[data-testid="add-new-ingestion-button"]')
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
|
@ -109,22 +109,37 @@ describe('RedShift Ingestion', () => {
|
|||||||
.click();
|
.click();
|
||||||
|
|
||||||
verifyResponseStatusCode('@getServices', 200);
|
verifyResponseStatusCode('@getServices', 200);
|
||||||
cy.intercept('/api/v1/services/ingestionPipelines?*').as('ingestionData');
|
interceptURL(
|
||||||
|
'GET',
|
||||||
|
'/api/v1/services/ingestionPipelines?*',
|
||||||
|
'ingestionData'
|
||||||
|
);
|
||||||
interceptURL(
|
interceptURL(
|
||||||
'GET',
|
'GET',
|
||||||
'/api/v1/system/config/pipeline-service-client',
|
'/api/v1/system/config/pipeline-service-client',
|
||||||
'airflow'
|
'airflow'
|
||||||
);
|
);
|
||||||
|
interceptURL(
|
||||||
|
'GET',
|
||||||
|
'/api/v1/permissions/ingestionPipeline/name/*',
|
||||||
|
'ingestionPermissions'
|
||||||
|
);
|
||||||
|
interceptURL('GET', '/api/v1/services/*/name/*', 'serviceDetails');
|
||||||
cy.get(`[data-testid="service-name-${REDSHIFT.serviceName}"]`)
|
cy.get(`[data-testid="service-name-${REDSHIFT.serviceName}"]`)
|
||||||
.should('exist')
|
.should('exist')
|
||||||
.click();
|
.click();
|
||||||
cy.get('[data-testid="tabs"]').should('exist');
|
|
||||||
cy.wait('@ingestionData');
|
verifyResponseStatusCode('@ingestionData', 200, {
|
||||||
|
responseTimeout: 50000,
|
||||||
|
});
|
||||||
|
verifyResponseStatusCode('@serviceDetails', 200);
|
||||||
verifyResponseStatusCode('@airflow', 200);
|
verifyResponseStatusCode('@airflow', 200);
|
||||||
|
cy.get('[data-testid="tabs"]').should('exist');
|
||||||
cy.get('[data-testid="Ingestions"]')
|
cy.get('[data-testid="Ingestions"]')
|
||||||
.scrollIntoView()
|
.scrollIntoView()
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
|
verifyResponseStatusCode('@ingestionPermissions', 200);
|
||||||
cy.get('[data-testid="ingestion-details-container"]').should('exist');
|
cy.get('[data-testid="ingestion-details-container"]').should('exist');
|
||||||
cy.get('[data-testid="add-new-ingestion-button"]')
|
cy.get('[data-testid="add-new-ingestion-button"]')
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
|
@ -38,7 +38,7 @@ describe('Add nested teams and test TeamsSelectable', () => {
|
|||||||
cy.login();
|
cy.login();
|
||||||
|
|
||||||
cy.get('[data-testid="appbar-item-settings"]').should('be.visible').click();
|
cy.get('[data-testid="appbar-item-settings"]').should('be.visible').click();
|
||||||
interceptURL('GET', '/api/v1/teams/name/Organization?*', 'getOrganization');
|
interceptURL('GET', '/api/v1/teams/name/*', 'getOrganization');
|
||||||
interceptURL('GET', '/api/v1/users*', 'getTeams');
|
interceptURL('GET', '/api/v1/users*', 'getTeams');
|
||||||
interceptURL('GET', '/api/v1/permissions/team/*', 'getPermissions');
|
interceptURL('GET', '/api/v1/permissions/team/*', 'getPermissions');
|
||||||
// Clicking on teams
|
// Clicking on teams
|
||||||
@ -64,6 +64,8 @@ describe('Add nested teams and test TeamsSelectable', () => {
|
|||||||
verifyResponseStatusCode('@getCreatedTeam', 200);
|
verifyResponseStatusCode('@getCreatedTeam', 200);
|
||||||
// asserting the added values
|
// asserting the added values
|
||||||
cy.get('table').find('.ant-table-row').contains(teamName).click();
|
cy.get('table').find('.ant-table-row').contains(teamName).click();
|
||||||
|
verifyResponseStatusCode('@getOrganization', 200);
|
||||||
|
verifyResponseStatusCode('@getPermissions', 200);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user