mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-10-18 12:18:35 +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,
|
||||
DATABASE_DETAILS,
|
||||
DATABASE_SERVICE_DETAILS,
|
||||
ES_RESERVED_CHARACTERS,
|
||||
MESSAGING_SERVICE_DETAILS,
|
||||
ML_MODEL_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();
|
||||
};
|
||||
|
||||
export const addOwner = (ownerName: string, dataTestId?: string) => {
|
||||
export const addOwner = (
|
||||
ownerName: string,
|
||||
dataTestId?: string,
|
||||
verifyPatchResponse = true
|
||||
) => {
|
||||
interceptURL('GET', '/api/v1/users?*isBot=false*', 'getUsers');
|
||||
cy.get('[data-testid="edit-owner"]').click();
|
||||
|
||||
@ -84,7 +88,10 @@ export const addOwner = (ownerName: string, dataTestId?: string) => {
|
||||
interceptURL('PATCH', `/api/v1/**`, 'patchOwner');
|
||||
|
||||
cy.get(`.ant-popover [title="${ownerName}"]`).click();
|
||||
verifyResponseStatusCode('@patchOwner', 200);
|
||||
|
||||
if (verifyPatchResponse) {
|
||||
verifyResponseStatusCode('@patchOwner', 200);
|
||||
}
|
||||
|
||||
cy.get(`[data-testid=${dataTestId ?? 'owner-link'}]`).should(
|
||||
'contain',
|
||||
|
@ -483,3 +483,29 @@ export const DOMAIN_QUICK_FILTERS_DETAILS = {
|
||||
experts: [],
|
||||
style: {},
|
||||
};
|
||||
|
||||
export const ES_RESERVED_CHARACTERS: Record<string, string> = {
|
||||
'+': '\\+',
|
||||
'-': '\\-',
|
||||
'=': '\\=',
|
||||
'&': '\\&',
|
||||
'&&': '\\&&',
|
||||
'||': '\\||',
|
||||
'>': '\\>',
|
||||
'<': '\\<',
|
||||
'!': '\\!',
|
||||
'(': '\\(',
|
||||
')': '\\)',
|
||||
'{': '\\{',
|
||||
'}': '\\}',
|
||||
'[': '\\[',
|
||||
']': '\\]',
|
||||
'^': '\\^',
|
||||
'"': '\\"',
|
||||
'~': '\\~',
|
||||
'*': '\\*',
|
||||
'?': '\\?',
|
||||
':': '\\:',
|
||||
'\\': '\\\\',
|
||||
'/': '\\/',
|
||||
};
|
||||
|
@ -54,7 +54,7 @@ export interface AddIngestionProps {
|
||||
export type ScheduleIntervalProps = {
|
||||
onChange: (newScheduleInterval: string) => void;
|
||||
status: LoadingState;
|
||||
scheduleInterval: string;
|
||||
scheduleInterval?: string;
|
||||
includePeriodOptions?: string[];
|
||||
submitButtonLabel: string;
|
||||
children?: ReactNode;
|
||||
|
Loading…
x
Reference in New Issue
Block a user