mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-28 10:56:02 +00:00
cypress: fixed AUT failure of main branch (#15820)
This commit is contained in:
parent
3613bc64fd
commit
eec5a72fa6
@ -23,6 +23,7 @@ import {
|
|||||||
} from '../../common/EntityUtils';
|
} from '../../common/EntityUtils';
|
||||||
import { visitEntityDetailsPage } from '../../common/Utils/Entity';
|
import { visitEntityDetailsPage } from '../../common/Utils/Entity';
|
||||||
import { getToken } from '../../common/Utils/LocalStorage';
|
import { getToken } from '../../common/Utils/LocalStorage';
|
||||||
|
import { generateRandomUser } from '../../common/Utils/Owner';
|
||||||
import { EntityType } from '../../constants/Entity.interface';
|
import { EntityType } from '../../constants/Entity.interface';
|
||||||
import {
|
import {
|
||||||
DATABASE_SERVICE,
|
DATABASE_SERVICE,
|
||||||
@ -39,6 +40,8 @@ const queryTable = {
|
|||||||
};
|
};
|
||||||
const table1 = generateRandomTable();
|
const table1 = generateRandomTable();
|
||||||
const table2 = generateRandomTable();
|
const table2 = generateRandomTable();
|
||||||
|
const user = generateRandomUser();
|
||||||
|
let userId = '';
|
||||||
|
|
||||||
const DATA = {
|
const DATA = {
|
||||||
...queryTable,
|
...queryTable,
|
||||||
@ -64,6 +67,7 @@ const queryFilters = ({
|
|||||||
cy.get(`[data-testid="search-dropdown-${key}"]`).click();
|
cy.get(`[data-testid="search-dropdown-${key}"]`).click();
|
||||||
cy.get('[data-testid="search-input"]').type(filter);
|
cy.get('[data-testid="search-input"]').type(filter);
|
||||||
verifyResponseStatusCode(apiKey, 200);
|
verifyResponseStatusCode(apiKey, 200);
|
||||||
|
cy.get(`[data-testid="search-dropdown-${key}"]`).trigger('mouseout');
|
||||||
cy.get(`[data-testid="drop-down-menu"] [title="${filter}"]`).click();
|
cy.get(`[data-testid="drop-down-menu"] [title="${filter}"]`).click();
|
||||||
cy.get('[data-testid="update-btn"]').click();
|
cy.get('[data-testid="update-btn"]').click();
|
||||||
verifyResponseStatusCode('@fetchQuery', 200);
|
verifyResponseStatusCode('@fetchQuery', 200);
|
||||||
@ -82,6 +86,16 @@ describe('Query Entity', { tags: 'DataAssets' }, () => {
|
|||||||
});
|
});
|
||||||
// get Table by name and create query in the table
|
// get Table by name and create query in the table
|
||||||
createQueryByTableName(token, table1);
|
createQueryByTableName(token, table1);
|
||||||
|
|
||||||
|
// Create a new user
|
||||||
|
cy.request({
|
||||||
|
method: 'POST',
|
||||||
|
url: `/api/v1/users/signup`,
|
||||||
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
|
body: user,
|
||||||
|
}).then((response) => {
|
||||||
|
userId = response.body.id;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -95,6 +109,13 @@ describe('Query Entity', { tags: 'DataAssets' }, () => {
|
|||||||
serviceFqn: DATABASE_SERVICE.service.name,
|
serviceFqn: DATABASE_SERVICE.service.name,
|
||||||
serviceType: SERVICE_CATEGORIES.DATABASE_SERVICES,
|
serviceType: SERVICE_CATEGORIES.DATABASE_SERVICES,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Delete created user
|
||||||
|
cy.request({
|
||||||
|
method: 'DELETE',
|
||||||
|
url: `/api/v1/users/${userId}?hardDelete=true&recursive=false`,
|
||||||
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -207,7 +228,7 @@ describe('Query Entity', { tags: 'DataAssets' }, () => {
|
|||||||
cy.get('[data-testid="table_queries"]').click();
|
cy.get('[data-testid="table_queries"]').click();
|
||||||
verifyResponseStatusCode('@fetchQuery', 200);
|
verifyResponseStatusCode('@fetchQuery', 200);
|
||||||
queryFilters({
|
queryFilters({
|
||||||
filter: 'Aaron Singh',
|
filter: `${user.firstName}${user.lastName}`,
|
||||||
apiKey: '@searchOwner',
|
apiKey: '@searchOwner',
|
||||||
key: 'Owner',
|
key: 'Owner',
|
||||||
});
|
});
|
||||||
|
@ -76,7 +76,7 @@ const addKpi = (data) => {
|
|||||||
cy.get(`.ant-select-dropdown [title="${data.metricType}"]`).click();
|
cy.get(`.ant-select-dropdown [title="${data.metricType}"]`).click();
|
||||||
cy.get('[data-testid="metric-percentage-input"] [role="spinbutton"]')
|
cy.get('[data-testid="metric-percentage-input"] [role="spinbutton"]')
|
||||||
.scrollIntoView()
|
.scrollIntoView()
|
||||||
.type(100);
|
.type('100');
|
||||||
cy.get('[data-testid="start-date"]').click().type(`${startDate}{enter}`);
|
cy.get('[data-testid="start-date"]').click().type(`${startDate}{enter}`);
|
||||||
cy.get('[data-testid="end-date"]').click().type(`${endDate}{enter}`);
|
cy.get('[data-testid="end-date"]').click().type(`${endDate}{enter}`);
|
||||||
cy.get(descriptionBox).scrollIntoView().type('cypress test');
|
cy.get(descriptionBox).scrollIntoView().type('cypress test');
|
||||||
@ -139,6 +139,10 @@ describe('Data Insight feature', { tags: 'Observability' }, () => {
|
|||||||
verifyResponseStatusCode('@deploy', 200);
|
verifyResponseStatusCode('@deploy', 200);
|
||||||
cy.reload();
|
cy.reload();
|
||||||
verifyResponseStatusCode('@dataInsightsApplication', 200);
|
verifyResponseStatusCode('@dataInsightsApplication', 200);
|
||||||
|
|
||||||
|
// Adding a manual wait to allow some time between deploying the pipeline and triggering it
|
||||||
|
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
||||||
|
cy.wait(1000);
|
||||||
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();
|
||||||
@ -219,7 +223,7 @@ describe('Data Insight feature', { tags: 'Observability' }, () => {
|
|||||||
cy.get('[data-testid="metric-percentage-input"] [role="spinbutton"]')
|
cy.get('[data-testid="metric-percentage-input"] [role="spinbutton"]')
|
||||||
.scrollIntoView()
|
.scrollIntoView()
|
||||||
.clear()
|
.clear()
|
||||||
.type(50);
|
.type('50');
|
||||||
cy.get('[data-testid="submit-btn"]').scrollIntoView().click();
|
cy.get('[data-testid="submit-btn"]').scrollIntoView().click();
|
||||||
verifyResponseStatusCode('@updateKpi', 200);
|
verifyResponseStatusCode('@updateKpi', 200);
|
||||||
});
|
});
|
||||||
|
@ -121,6 +121,10 @@ describe(
|
|||||||
verifyResponseStatusCode('@deploy', 200);
|
verifyResponseStatusCode('@deploy', 200);
|
||||||
cy.reload();
|
cy.reload();
|
||||||
verifyResponseStatusCode('@getDataInsightDetails', 200);
|
verifyResponseStatusCode('@getDataInsightDetails', 200);
|
||||||
|
|
||||||
|
// Adding a manual wait to allow some time between deploying the pipeline and triggering it
|
||||||
|
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
||||||
|
cy.wait(1000);
|
||||||
cy.get('[data-testid="run-now-button"]').click();
|
cy.get('[data-testid="run-now-button"]').click();
|
||||||
verifyResponseStatusCode('@triggerPipeline', 200);
|
verifyResponseStatusCode('@triggerPipeline', 200);
|
||||||
|
|
||||||
|
@ -910,7 +910,6 @@ describe(
|
|||||||
verifyResponseStatusCode('@systemProfiler', 200);
|
verifyResponseStatusCode('@systemProfiler', 200);
|
||||||
cy.get('[data-testid="profiler-setting-btn"]').click();
|
cy.get('[data-testid="profiler-setting-btn"]').click();
|
||||||
cy.get('.ant-modal-body').should('be.visible');
|
cy.get('.ant-modal-body').should('be.visible');
|
||||||
verifyResponseStatusCode('@tableProfilerConfig', 200);
|
|
||||||
cy.get('[data-testid="slider-input"]')
|
cy.get('[data-testid="slider-input"]')
|
||||||
.clear()
|
.clear()
|
||||||
.type(profilerSetting.profileSample);
|
.type(profilerSetting.profileSample);
|
||||||
@ -975,7 +974,8 @@ describe(
|
|||||||
cy.get('[data-testid="profiler"]').click();
|
cy.get('[data-testid="profiler"]').click();
|
||||||
// verify profiler setting details
|
// verify profiler setting details
|
||||||
cy.get('[data-testid="profiler-setting-btn"]').click();
|
cy.get('[data-testid="profiler-setting-btn"]').click();
|
||||||
verifyResponseStatusCode('@tableProfilerConfig', 200);
|
// need extra time to load API response
|
||||||
|
verifyResponseStatusCode('@tableProfilerConfig', 200, { timeout: 10000 });
|
||||||
|
|
||||||
cy.get('[data-testid="slider-input"]').should(
|
cy.get('[data-testid="slider-input"]').should(
|
||||||
'have.value',
|
'have.value',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user