mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-12-16 10:08:08 +00:00
cypress: fixed aut failure part 7 (#16371)
* cypress: fixed aut failure part 7 * updated cypress * fixed failing cypress
This commit is contained in:
parent
89b1b090c7
commit
505690e523
@ -11,9 +11,10 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
import { SidebarItem } from '../constants/Entity.interface';
|
import { SidebarItem } from '../constants/Entity.interface';
|
||||||
import { interceptURL, RETRY_TIMES, verifyResponseStatusCode } from './common';
|
import { interceptURL, verifyResponseStatusCode } from './common';
|
||||||
|
|
||||||
const BASE_WAIT_TIME = 4000;
|
const BASE_WAIT_TIME = 4000;
|
||||||
|
const RETRY_TIMES = 3;
|
||||||
let isSuccessStatus = false;
|
let isSuccessStatus = false;
|
||||||
|
|
||||||
export const checkDataInsightSuccessStatus = (
|
export const checkDataInsightSuccessStatus = (
|
||||||
|
|||||||
@ -65,12 +65,12 @@ export const validateOwnerAndTeamCounts = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const addOwner = (ownerName: string, dataTestId?: string) => {
|
export const addOwner = (ownerName: string, dataTestId?: string) => {
|
||||||
|
interceptURL('GET', '/api/v1/users?*isBot=false*', 'getUsers');
|
||||||
cy.get('[data-testid="edit-owner"]').click();
|
cy.get('[data-testid="edit-owner"]').click();
|
||||||
|
|
||||||
cy.get("[data-testid='select-owner-tabs']").should('be.visible');
|
cy.get("[data-testid='select-owner-tabs']").should('be.visible');
|
||||||
cy.log('/api/v1/users?limit=*&isBot=false*');
|
|
||||||
cy.get('.ant-tabs [id*=tab-users]').click();
|
cy.get('.ant-tabs [id*=tab-users]').click();
|
||||||
|
verifyResponseStatusCode('@getUsers', 200);
|
||||||
interceptURL(
|
interceptURL(
|
||||||
'GET',
|
'GET',
|
||||||
`api/v1/search/query?q=*&index=user_search_index*`,
|
`api/v1/search/query?q=*&index=user_search_index*`,
|
||||||
@ -94,7 +94,6 @@ export const addOwner = (ownerName: string, dataTestId?: string) => {
|
|||||||
|
|
||||||
export const updateOwner = (ownerName: string, dataTestId?: string) => {
|
export const updateOwner = (ownerName: string, dataTestId?: string) => {
|
||||||
cy.get('[data-testid="edit-owner"]').click();
|
cy.get('[data-testid="edit-owner"]').click();
|
||||||
|
|
||||||
cy.get("[data-testid='select-owner-tabs']").should('be.visible');
|
cy.get("[data-testid='select-owner-tabs']").should('be.visible');
|
||||||
cy.log('/api/v1/users?limit=*&isBot=false*');
|
cy.log('/api/v1/users?limit=*&isBot=false*');
|
||||||
cy.get('.ant-tabs [id*=tab-users]').click();
|
cy.get('.ant-tabs [id*=tab-users]').click();
|
||||||
@ -129,11 +128,9 @@ export const removeOwner = (ownerName: string, dataTestId?: string) => {
|
|||||||
|
|
||||||
interceptURL('PATCH', `/api/v1/**`, 'patchOwner');
|
interceptURL('PATCH', `/api/v1/**`, 'patchOwner');
|
||||||
|
|
||||||
cy.get('[data-testid="select-owner-tabs"]').should('be.visible');
|
|
||||||
|
|
||||||
cy.get(
|
cy.get(
|
||||||
'[data-testid="select-owner-tabs"] [data-testid="remove-owner"]'
|
'[data-testid="select-owner-tabs"] [data-testid="remove-owner"]'
|
||||||
).scrollIntoView({ offset: { top: -100, left: 0 } });
|
).should('be.visible');
|
||||||
|
|
||||||
cy.get(
|
cy.get(
|
||||||
'[data-testid="select-owner-tabs"] [data-testid="remove-owner"]'
|
'[data-testid="select-owner-tabs"] [data-testid="remove-owner"]'
|
||||||
|
|||||||
@ -14,7 +14,6 @@ import {
|
|||||||
customFormatDateTime,
|
customFormatDateTime,
|
||||||
getEpochMillisForFutureDays,
|
getEpochMillisForFutureDays,
|
||||||
} from '../../../src/utils/date-time/DateTimeUtils';
|
} from '../../../src/utils/date-time/DateTimeUtils';
|
||||||
import { GlobalSettingOptions } from '../../constants/settings.constant';
|
|
||||||
import {
|
import {
|
||||||
descriptionBox,
|
descriptionBox,
|
||||||
interceptURL,
|
interceptURL,
|
||||||
@ -166,10 +165,6 @@ export const permanentDeleteUser = (username: string, displayName: string) => {
|
|||||||
|
|
||||||
cy.get('[data-testid="search-error-placeholder"]').should('be.exist');
|
cy.get('[data-testid="search-error-placeholder"]').should('be.exist');
|
||||||
};
|
};
|
||||||
export const visitUserListPage = () => {
|
|
||||||
interceptURL('GET', '/api/v1/users?*', 'getUsers');
|
|
||||||
cy.settingClick(GlobalSettingOptions.USERS);
|
|
||||||
};
|
|
||||||
|
|
||||||
export const generateToken = () => {
|
export const generateToken = () => {
|
||||||
cy.get('[data-testid="no-token"]').should('be.visible');
|
cy.get('[data-testid="no-token"]').should('be.visible');
|
||||||
@ -202,7 +197,7 @@ export const updateExpiration = (expiry: number | string) => {
|
|||||||
cy.get('[data-testid="token-expiry"]').click();
|
cy.get('[data-testid="token-expiry"]').click();
|
||||||
cy.contains(`${expiry} days`).click();
|
cy.contains(`${expiry} days`).click();
|
||||||
const expiryDate = customFormatDateTime(
|
const expiryDate = customFormatDateTime(
|
||||||
getEpochMillisForFutureDays(expiry),
|
getEpochMillisForFutureDays(expiry as number),
|
||||||
`ccc d'th' MMMM, yyyy`
|
`ccc d'th' MMMM, yyyy`
|
||||||
);
|
);
|
||||||
cy.get('[data-testid="save-edit"]').click();
|
cy.get('[data-testid="save-edit"]').click();
|
||||||
|
|||||||
@ -242,7 +242,7 @@ describe('Data Insight feature', { tags: 'Observability' }, () => {
|
|||||||
cy.sidebarClick(SidebarItem.DATA_INSIGHT);
|
cy.sidebarClick(SidebarItem.DATA_INSIGHT);
|
||||||
verifyResponseStatusCode('@dataInsightsChart', 200);
|
verifyResponseStatusCode('@dataInsightsChart', 200);
|
||||||
cy.get('[data-menu-id*="kpi"]').click();
|
cy.get('[data-menu-id*="kpi"]').click();
|
||||||
verifyResponseStatusCode('@dataInsightsChart', 200);
|
verifyResponseStatusCode('@getKpi', 200);
|
||||||
cy.get('[data-testid="kpi-card"]').should('be.visible');
|
cy.get('[data-testid="kpi-card"]').should('be.visible');
|
||||||
cy.get(
|
cy.get(
|
||||||
'[data-row-key="cypress-description-with-percentage-completed-description-fraction"]'
|
'[data-row-key="cypress-description-with-percentage-completed-description-fraction"]'
|
||||||
@ -283,7 +283,7 @@ describe('Data Insight feature', { tags: 'Observability' }, () => {
|
|||||||
cy.sidebarClick(SidebarItem.DATA_INSIGHT);
|
cy.sidebarClick(SidebarItem.DATA_INSIGHT);
|
||||||
verifyResponseStatusCode('@dataInsightsChart', 200);
|
verifyResponseStatusCode('@dataInsightsChart', 200);
|
||||||
cy.get('[data-menu-id*="kpi"]').click();
|
cy.get('[data-menu-id*="kpi"]').click();
|
||||||
verifyResponseStatusCode('@dataInsightsChart', 200);
|
verifyResponseStatusCode('@getKpi', 200);
|
||||||
KPI_DATA.map((data) => {
|
KPI_DATA.map((data) => {
|
||||||
cy.get(`[data-testid="delete-action-${data.displayName}"]`).click();
|
cy.get(`[data-testid="delete-action-${data.displayName}"]`).click();
|
||||||
cy.get('[data-testid="confirmation-text-input"]').type('DELETE');
|
cy.get('[data-testid="confirmation-text-input"]').type('DELETE');
|
||||||
|
|||||||
@ -415,7 +415,7 @@ describe(
|
|||||||
.scrollIntoView()
|
.scrollIntoView()
|
||||||
.should('be.visible');
|
.should('be.visible');
|
||||||
|
|
||||||
cy.get('[data-testid="version-button"]').click();
|
cy.get('[data-testid="version-button"]').scrollIntoView().click();
|
||||||
|
|
||||||
verifyResponseStatusCode('@getGlossaryTermParents', 200);
|
verifyResponseStatusCode('@getGlossaryTermParents', 200);
|
||||||
verifyResponseStatusCode('@getChildGlossaryTerms', 200);
|
verifyResponseStatusCode('@getChildGlossaryTerms', 200);
|
||||||
|
|||||||
@ -64,12 +64,10 @@ describe('Search Index Application', { tags: 'Settings' }, () => {
|
|||||||
visitSearchApplicationPage();
|
visitSearchApplicationPage();
|
||||||
cy.get('[data-testid="edit-button"]').click();
|
cy.get('[data-testid="edit-button"]').click();
|
||||||
cy.get('[data-testid="cron-type"]').click();
|
cy.get('[data-testid="cron-type"]').click();
|
||||||
cy.get('.rc-virtual-list [title="Day"]').click();
|
cy.get('.rc-virtual-list [title="None"]').click();
|
||||||
cy.get('[data-testid="hour-options"]').click();
|
|
||||||
cy.get('[title="01"]').click();
|
|
||||||
cy.get('.ant-modal-body [data-testid="deploy-button"]').click();
|
cy.get('.ant-modal-body [data-testid="deploy-button"]').click();
|
||||||
verifyResponseStatusCode('@updateApplication', 200);
|
verifyResponseStatusCode('@updateApplication', 200);
|
||||||
cy.get('[data-testid="cron-string"]').should('contain', 'At 01:00 AM');
|
cy.get('[data-testid="schedule-type"]').should('contain', 'None');
|
||||||
|
|
||||||
cy.get('[data-testid="configuration"]').click();
|
cy.get('[data-testid="configuration"]').click();
|
||||||
|
|
||||||
@ -114,8 +112,8 @@ describe('Search Index Application', { tags: 'Settings' }, () => {
|
|||||||
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('[data-testid="cron-type"]').click();
|
cy.get('[data-testid="cron-type"]').click();
|
||||||
cy.get('.rc-virtual-list [title="Day"]').click();
|
cy.get('.rc-virtual-list [title="None"]').click();
|
||||||
cy.get('[data-testid="cron-type"]').should('contain', 'Day');
|
cy.get('[data-testid="cron-type"]').should('contain', 'None');
|
||||||
cy.get('[data-testid="deploy-button"]').click();
|
cy.get('[data-testid="deploy-button"]').click();
|
||||||
verifyResponseStatusCode('@installApplication', 201);
|
verifyResponseStatusCode('@installApplication', 201);
|
||||||
verifyResponseStatusCode('@getApplications', 200);
|
verifyResponseStatusCode('@getApplications', 200);
|
||||||
|
|||||||
@ -34,7 +34,6 @@ import {
|
|||||||
revokeToken,
|
revokeToken,
|
||||||
updateDetails,
|
updateDetails,
|
||||||
updateExpiration,
|
updateExpiration,
|
||||||
visitUserListPage,
|
|
||||||
} from '../../common/Utils/Users';
|
} from '../../common/Utils/Users';
|
||||||
import {
|
import {
|
||||||
BASE_URL,
|
BASE_URL,
|
||||||
@ -46,8 +45,8 @@ import {
|
|||||||
import { EntityType, SidebarItem } from '../../constants/Entity.interface';
|
import { EntityType, SidebarItem } from '../../constants/Entity.interface';
|
||||||
import {
|
import {
|
||||||
GlobalSettingOptions,
|
GlobalSettingOptions,
|
||||||
SETTINGS_OPTIONS_PATH,
|
|
||||||
SETTING_CUSTOM_PROPERTIES_PATH,
|
SETTING_CUSTOM_PROPERTIES_PATH,
|
||||||
|
SETTINGS_OPTIONS_PATH,
|
||||||
} from '../../constants/settings.constant';
|
} from '../../constants/settings.constant';
|
||||||
|
|
||||||
const entity = new UsersTestClass();
|
const entity = new UsersTestClass();
|
||||||
@ -118,7 +117,7 @@ describe('User with different Roles', { tags: 'Settings' }, () => {
|
|||||||
|
|
||||||
it('Create Data Consumer User', () => {
|
it('Create Data Consumer User', () => {
|
||||||
cy.login();
|
cy.login();
|
||||||
visitUserListPage();
|
entity.visitUserListPage();
|
||||||
addUser({ ...user, role: DATA_CONSUMER_ROLE.name });
|
addUser({ ...user, role: DATA_CONSUMER_ROLE.name });
|
||||||
cy.logout();
|
cy.logout();
|
||||||
});
|
});
|
||||||
@ -145,7 +144,7 @@ describe('User with different Roles', { tags: 'Settings' }, () => {
|
|||||||
|
|
||||||
it(`Update token expiration`, () => {
|
it(`Update token expiration`, () => {
|
||||||
cy.login(user.email, user.newPassword);
|
cy.login(user.email, user.newPassword);
|
||||||
visitUserListPage();
|
entity.visitUserListPage();
|
||||||
Object.values(expirationTime).forEach((expiry) => {
|
Object.values(expirationTime).forEach((expiry) => {
|
||||||
updateExpiration(expiry);
|
updateExpiration(expiry);
|
||||||
});
|
});
|
||||||
@ -225,7 +224,7 @@ describe('User with different Roles', { tags: 'Settings' }, () => {
|
|||||||
it('Update Data Steward details', () => {
|
it('Update Data Steward details', () => {
|
||||||
// change role from consumer to steward
|
// change role from consumer to steward
|
||||||
cy.login();
|
cy.login();
|
||||||
visitUserListPage();
|
entity.visitUserListPage();
|
||||||
editRole(user.name, DATA_STEWARD_ROLE.name);
|
editRole(user.name, DATA_STEWARD_ROLE.name);
|
||||||
cy.logout();
|
cy.logout();
|
||||||
// login to steward user
|
// login to steward user
|
||||||
@ -243,7 +242,7 @@ describe('User with different Roles', { tags: 'Settings' }, () => {
|
|||||||
|
|
||||||
it('Token generation & revocation for Data Steward', () => {
|
it('Token generation & revocation for Data Steward', () => {
|
||||||
cy.login(user.email, user.newStewardPassword);
|
cy.login(user.email, user.newStewardPassword);
|
||||||
visitUserListPage();
|
entity.visitUserListPage();
|
||||||
cy.get('[data-testid="dropdown-profile"]').click({ force: true });
|
cy.get('[data-testid="dropdown-profile"]').click({ force: true });
|
||||||
cy.get('[data-testid="user-name"] > .ant-typography').click({
|
cy.get('[data-testid="user-name"] > .ant-typography').click({
|
||||||
force: true,
|
force: true,
|
||||||
@ -255,7 +254,7 @@ describe('User with different Roles', { tags: 'Settings' }, () => {
|
|||||||
|
|
||||||
it(`Update token expiration for Data Steward`, () => {
|
it(`Update token expiration for Data Steward`, () => {
|
||||||
cy.login(user.email, user.newStewardPassword);
|
cy.login(user.email, user.newStewardPassword);
|
||||||
visitUserListPage();
|
entity.visitUserListPage();
|
||||||
Object.values(expirationTime).forEach((expiry) => {
|
Object.values(expirationTime).forEach((expiry) => {
|
||||||
updateExpiration(expiry);
|
updateExpiration(expiry);
|
||||||
});
|
});
|
||||||
@ -307,19 +306,19 @@ describe('User with different Roles', { tags: 'Settings' }, () => {
|
|||||||
|
|
||||||
it('Admin Soft delete user', () => {
|
it('Admin Soft delete user', () => {
|
||||||
cy.login();
|
cy.login();
|
||||||
visitUserListPage();
|
entity.visitUserListPage();
|
||||||
entity.softDeleteUser(user.name, user.updatedDisplayName);
|
entity.softDeleteUser(user.name, user.updatedDisplayName);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Admin Restore soft deleted user', () => {
|
it('Admin Restore soft deleted user', () => {
|
||||||
cy.login();
|
cy.login();
|
||||||
visitUserListPage();
|
entity.visitUserListPage();
|
||||||
entity.restoreSoftDeletedUser(user.name, user.updatedDisplayName);
|
entity.restoreSoftDeletedUser(user.name, user.updatedDisplayName);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Admin Permanent Delete User', () => {
|
it('Admin Permanent Delete User', () => {
|
||||||
cy.login();
|
cy.login();
|
||||||
visitUserListPage();
|
entity.visitUserListPage();
|
||||||
entity.permanentDeleteUser(user.name, user.updatedDisplayName);
|
entity.permanentDeleteUser(user.name, user.updatedDisplayName);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -26,9 +26,9 @@ import {
|
|||||||
AppType,
|
AppType,
|
||||||
} from '../../../../generated/entity/applications/app';
|
} from '../../../../generated/entity/applications/app';
|
||||||
import { getIngestionPipelineByFqn } from '../../../../rest/ingestionPipelineAPI';
|
import { getIngestionPipelineByFqn } from '../../../../rest/ingestionPipelineAPI';
|
||||||
import Loader from '../../../common/Loader/Loader';
|
|
||||||
import { TestSuiteIngestionDataType } from '../../../DataQuality/AddDataQualityTest/AddDataQualityTest.interface';
|
import { TestSuiteIngestionDataType } from '../../../DataQuality/AddDataQualityTest/AddDataQualityTest.interface';
|
||||||
import TestSuiteScheduler from '../../../DataQuality/AddDataQualityTest/components/TestSuiteScheduler';
|
import TestSuiteScheduler from '../../../DataQuality/AddDataQualityTest/components/TestSuiteScheduler';
|
||||||
|
import Loader from '../../../common/Loader/Loader';
|
||||||
import AppRunsHistory from '../AppRunsHistory/AppRunsHistory.component';
|
import AppRunsHistory from '../AppRunsHistory/AppRunsHistory.component';
|
||||||
import { AppRunsHistoryRef } from '../AppRunsHistory/AppRunsHistory.interface';
|
import { AppRunsHistoryRef } from '../AppRunsHistory/AppRunsHistory.interface';
|
||||||
import { AppScheduleProps } from './AppScheduleProps.interface';
|
import { AppScheduleProps } from './AppScheduleProps.interface';
|
||||||
@ -155,7 +155,9 @@ const AppSchedule = ({
|
|||||||
<Typography.Text className="right-panel-label">
|
<Typography.Text className="right-panel-label">
|
||||||
{t('label.schedule-type')}
|
{t('label.schedule-type')}
|
||||||
</Typography.Text>
|
</Typography.Text>
|
||||||
<Typography.Text className="font-medium">
|
<Typography.Text
|
||||||
|
className="font-medium"
|
||||||
|
data-testid="schedule-type">
|
||||||
{(appData.appSchedule as AppScheduleClass).scheduleTimeline ??
|
{(appData.appSchedule as AppScheduleClass).scheduleTimeline ??
|
||||||
''}
|
''}
|
||||||
</Typography.Text>
|
</Typography.Text>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user