mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-01 05:03:10 +00:00
add cypress for search index app (#16104)
This commit is contained in:
parent
e2de16bbaa
commit
71293e9fbd
@ -25,6 +25,19 @@ const visitSearchApplicationPage = () => {
|
|||||||
verifyResponseStatusCode('@getSearchIndexingApplication', 200);
|
verifyResponseStatusCode('@getSearchIndexingApplication', 200);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const verifyLastExecutionRun = (interceptedUrlLabel: string) => {
|
||||||
|
cy.wait(`@${interceptedUrlLabel}`).then((interception) => {
|
||||||
|
expect(interception.response.statusCode).to.eq(200);
|
||||||
|
|
||||||
|
// Validate the last execution run response
|
||||||
|
const responseData = interception.response.body;
|
||||||
|
if (responseData.data.length > 0) {
|
||||||
|
expect(responseData.data).to.have.length(1);
|
||||||
|
expect(responseData.data[0].status).to.equal('success');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
describe('Search Index Application', { tags: 'Settings' }, () => {
|
describe('Search Index Application', { tags: 'Settings' }, () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.login();
|
cy.login();
|
||||||
@ -36,6 +49,16 @@ describe('Search Index Application', { tags: 'Settings' }, () => {
|
|||||||
verifyResponseStatusCode('@getApplications', 200);
|
verifyResponseStatusCode('@getApplications', 200);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('Verify last execution run', () => {
|
||||||
|
interceptURL(
|
||||||
|
'GET',
|
||||||
|
'/api/v1/apps/name/SearchIndexingApplication/status?offset=0&limit=1',
|
||||||
|
'lastExecutionRun'
|
||||||
|
);
|
||||||
|
visitSearchApplicationPage();
|
||||||
|
verifyLastExecutionRun('lastExecutionRun');
|
||||||
|
});
|
||||||
|
|
||||||
it('Edit application', () => {
|
it('Edit application', () => {
|
||||||
interceptURL('PATCH', '/api/v1/apps/*', 'updateApplication');
|
interceptURL('PATCH', '/api/v1/apps/*', 'updateApplication');
|
||||||
visitSearchApplicationPage();
|
visitSearchApplicationPage();
|
||||||
@ -118,5 +141,16 @@ describe('Search Index Application', { tags: 'Settings' }, () => {
|
|||||||
verifyResponseStatusCode('@getSearchIndexingApplication', 200);
|
verifyResponseStatusCode('@getSearchIndexingApplication', 200);
|
||||||
cy.get('[data-testid="run-now-button"]').click();
|
cy.get('[data-testid="run-now-button"]').click();
|
||||||
verifyResponseStatusCode('@triggerPipeline', 200);
|
verifyResponseStatusCode('@triggerPipeline', 200);
|
||||||
|
|
||||||
|
cy.wait(120000); // waiting for 2 minutes before we check if reindex was success
|
||||||
|
|
||||||
|
interceptURL(
|
||||||
|
'GET',
|
||||||
|
'/api/v1/apps/name/SearchIndexingApplication/status?offset=0&limit=1',
|
||||||
|
'lastExecutionRun'
|
||||||
|
);
|
||||||
|
|
||||||
|
cy.reload();
|
||||||
|
verifyLastExecutionRun('lastExecutionRun');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user