mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-26 09:55:52 +00:00
Fixed: Custom property failing cypress test (#8460)
* Custom property cypress * testing out entity topic name * Fixed Custom property topic search issue * removed import of deleted file
This commit is contained in:
parent
e7a4a7a3e5
commit
e68f35ec85
@ -683,8 +683,7 @@ export const addCustomPropertiesForEntity = (
|
||||
entityType,
|
||||
customType,
|
||||
value,
|
||||
entityObj,
|
||||
entityName
|
||||
entityObj
|
||||
) => {
|
||||
const propertyName = `entity${entityType.name}test${uuid()}`;
|
||||
|
||||
@ -713,7 +712,7 @@ export const addCustomPropertiesForEntity = (
|
||||
//Checking the added property in Entity
|
||||
|
||||
visitEntityDetailsPage(
|
||||
entityName || entityObj.term,
|
||||
entityObj.term,
|
||||
entityObj.serviceName,
|
||||
entityObj.entity
|
||||
);
|
||||
|
@ -11,7 +11,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { addCustomPropertiesForEntity, deleteCreatedProperty, editCreatedProperty, interceptURL, login, verifyResponseStatusCode } from '../../common/common';
|
||||
import {
|
||||
addCustomPropertiesForEntity,
|
||||
deleteCreatedProperty,
|
||||
editCreatedProperty,
|
||||
interceptURL,
|
||||
login,
|
||||
verifyResponseStatusCode
|
||||
} from '../../common/common';
|
||||
import { ENTITIES, LOGIN } from '../../constants/constants';
|
||||
|
||||
describe('Custom Properties should work properly', () => {
|
||||
@ -33,8 +40,6 @@ describe('Custom Properties should work properly', () => {
|
||||
|
||||
Object.values(ENTITIES).forEach((entity) => {
|
||||
it(`Add Integer custom property for ${entity.name} Entities`, () => {
|
||||
cy.getSearchQueryName(entity.name).then((entityName) => {
|
||||
|
||||
interceptURL(
|
||||
'GET',
|
||||
`/api/v1/metadata/types/name/${entity.name}*`,
|
||||
@ -54,8 +59,7 @@ describe('Custom Properties should work properly', () => {
|
||||
entity,
|
||||
'integer',
|
||||
entity.integerValue,
|
||||
entity.entityObj,
|
||||
entityName
|
||||
entity.entityObj
|
||||
);
|
||||
//Navigating back to custom properties page
|
||||
cy.get('[data-testid="appbar-item-settings"]')
|
||||
@ -72,8 +76,6 @@ describe('Custom Properties should work properly', () => {
|
||||
|
||||
deleteCreatedProperty(propertyName);
|
||||
});
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
Object.values(ENTITIES).forEach((entity) => {
|
||||
|
@ -16,7 +16,6 @@
|
||||
// Import commands.js using ES2015 syntax:
|
||||
import 'cypress-localstorage-commands';
|
||||
import './commands';
|
||||
import './get-search-query.command';
|
||||
|
||||
// Alternatively you can use CommonJS syntax:
|
||||
// require('./commands')
|
||||
|
@ -1,33 +0,0 @@
|
||||
/*
|
||||
* Copyright 2021 Collate
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
Cypress.Commands.add('getSearchQueryName', (entityName) => {
|
||||
cy.getLocalStorage("oidcIdToken").then((token) => {
|
||||
cy.request({
|
||||
method: 'GET',
|
||||
url: `/api/v1/search/query?q=*&from=0&size=10&sort_field=updatedAt&sort_order=desc&index=${entityName}_search_index`,
|
||||
headers: {
|
||||
Authorization: `Bearer ${token}`
|
||||
}
|
||||
|
||||
}).then((response) => {
|
||||
if (response && response.body && response.body.hits) {
|
||||
const entitySource = response.body.hits.hits[0]._source;
|
||||
const name = entitySource.name || entitySource.displayName;
|
||||
|
||||
return name;
|
||||
}
|
||||
})
|
||||
});
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user