mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-10-19 04:41:02 +00:00
OSS changes for adding automator cypress tests (#16611)
This commit is contained in:
parent
1d4e3e0825
commit
dc31717b16
@ -16,6 +16,7 @@ import {
|
|||||||
DASHBOARD_SERVICE_DETAILS,
|
DASHBOARD_SERVICE_DETAILS,
|
||||||
DATABASE_DETAILS,
|
DATABASE_DETAILS,
|
||||||
DATABASE_SERVICE_DETAILS,
|
DATABASE_SERVICE_DETAILS,
|
||||||
|
ES_RESERVED_CHARACTERS,
|
||||||
MESSAGING_SERVICE_DETAILS,
|
MESSAGING_SERVICE_DETAILS,
|
||||||
ML_MODEL_SERVICE_DETAILS,
|
ML_MODEL_SERVICE_DETAILS,
|
||||||
PIPELINE_SERVICE_DETAILS,
|
PIPELINE_SERVICE_DETAILS,
|
||||||
@ -476,3 +477,16 @@ export const getUserCreationDetails = () => {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const escapeESReservedCharacters = (text?: string) => {
|
||||||
|
const reUnescapedHtml = /[\\[\]#+=&|><!(){}^"~*?:/-]/g;
|
||||||
|
const reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
|
||||||
|
|
||||||
|
const getReplacedChar = (char: string) => {
|
||||||
|
return ES_RESERVED_CHARACTERS[char] ?? char;
|
||||||
|
};
|
||||||
|
|
||||||
|
return text && reHasUnescapedHtml.test(text)
|
||||||
|
? text.replace(reUnescapedHtml, getReplacedChar)
|
||||||
|
: text ?? '';
|
||||||
|
};
|
||||||
|
@ -64,7 +64,11 @@ export const validateOwnerAndTeamCounts = () => {
|
|||||||
cy.clickOutside();
|
cy.clickOutside();
|
||||||
};
|
};
|
||||||
|
|
||||||
export const addOwner = (ownerName: string, dataTestId?: string) => {
|
export const addOwner = (
|
||||||
|
ownerName: string,
|
||||||
|
dataTestId?: string,
|
||||||
|
verifyPatchResponse = true
|
||||||
|
) => {
|
||||||
interceptURL('GET', '/api/v1/users?*isBot=false*', 'getUsers');
|
interceptURL('GET', '/api/v1/users?*isBot=false*', 'getUsers');
|
||||||
cy.get('[data-testid="edit-owner"]').click();
|
cy.get('[data-testid="edit-owner"]').click();
|
||||||
|
|
||||||
@ -84,7 +88,10 @@ export const addOwner = (ownerName: string, dataTestId?: string) => {
|
|||||||
interceptURL('PATCH', `/api/v1/**`, 'patchOwner');
|
interceptURL('PATCH', `/api/v1/**`, 'patchOwner');
|
||||||
|
|
||||||
cy.get(`.ant-popover [title="${ownerName}"]`).click();
|
cy.get(`.ant-popover [title="${ownerName}"]`).click();
|
||||||
verifyResponseStatusCode('@patchOwner', 200);
|
|
||||||
|
if (verifyPatchResponse) {
|
||||||
|
verifyResponseStatusCode('@patchOwner', 200);
|
||||||
|
}
|
||||||
|
|
||||||
cy.get(`[data-testid=${dataTestId ?? 'owner-link'}]`).should(
|
cy.get(`[data-testid=${dataTestId ?? 'owner-link'}]`).should(
|
||||||
'contain',
|
'contain',
|
||||||
|
@ -483,3 +483,29 @@ export const DOMAIN_QUICK_FILTERS_DETAILS = {
|
|||||||
experts: [],
|
experts: [],
|
||||||
style: {},
|
style: {},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const ES_RESERVED_CHARACTERS: Record<string, string> = {
|
||||||
|
'+': '\\+',
|
||||||
|
'-': '\\-',
|
||||||
|
'=': '\\=',
|
||||||
|
'&': '\\&',
|
||||||
|
'&&': '\\&&',
|
||||||
|
'||': '\\||',
|
||||||
|
'>': '\\>',
|
||||||
|
'<': '\\<',
|
||||||
|
'!': '\\!',
|
||||||
|
'(': '\\(',
|
||||||
|
')': '\\)',
|
||||||
|
'{': '\\{',
|
||||||
|
'}': '\\}',
|
||||||
|
'[': '\\[',
|
||||||
|
']': '\\]',
|
||||||
|
'^': '\\^',
|
||||||
|
'"': '\\"',
|
||||||
|
'~': '\\~',
|
||||||
|
'*': '\\*',
|
||||||
|
'?': '\\?',
|
||||||
|
':': '\\:',
|
||||||
|
'\\': '\\\\',
|
||||||
|
'/': '\\/',
|
||||||
|
};
|
||||||
|
@ -54,7 +54,7 @@ export interface AddIngestionProps {
|
|||||||
export type ScheduleIntervalProps = {
|
export type ScheduleIntervalProps = {
|
||||||
onChange: (newScheduleInterval: string) => void;
|
onChange: (newScheduleInterval: string) => void;
|
||||||
status: LoadingState;
|
status: LoadingState;
|
||||||
scheduleInterval: string;
|
scheduleInterval?: string;
|
||||||
includePeriodOptions?: string[];
|
includePeriodOptions?: string[];
|
||||||
submitButtonLabel: string;
|
submitButtonLabel: string;
|
||||||
children?: ReactNode;
|
children?: ReactNode;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user