-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eb1242c
commit 879c6c9
Showing
14 changed files
with
701 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
220 changes: 220 additions & 0 deletions
220
openmetadata-ui/src/main/resources/ui/cypress/new-tests/Service.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,220 @@ | ||
/* | ||
* Copyright 2023 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. | ||
*/ | ||
|
||
import { uuid } from '../common/common'; | ||
import { | ||
createEntityViaREST, | ||
deleteEntityViaREST, | ||
} from '../common/Utils/Entity'; | ||
import DashboardServiceClass from './base/DashboardServiceClass'; | ||
import DatabaseServiceClass from './base/DatabaseServiceClass'; | ||
import { EntityType } from './base/EntityClass'; | ||
import MessagingServiceClass from './base/MessagingServiceClass'; | ||
import MlModelServiceClass from './base/MlModelServiceClass'; | ||
import PipelineServiceClass from './base/PipelineServiceClass'; | ||
import SearchServiceClass from './base/SearchServiceClass'; | ||
import StorageServiceClass from './base/StorageServiceClass'; | ||
|
||
const entities = [ | ||
new DatabaseServiceClass(), | ||
new MessagingServiceClass(), | ||
new DashboardServiceClass(), | ||
new PipelineServiceClass(), | ||
new MlModelServiceClass(), | ||
new StorageServiceClass(), | ||
new SearchServiceClass(), | ||
// TODO: add tests for metadata service tests | ||
// new MetadataServiceClass(), | ||
]; | ||
const domainDetails1 = { | ||
name: `cypress-domain-${uuid()}`, | ||
displayName: 'Cypress Domain', | ||
description: 'Cypress domain description', | ||
domainType: 'Aggregate', | ||
experts: [], | ||
style: {}, | ||
}; | ||
|
||
const domainDetails2 = { | ||
name: `cypress-domain-${uuid()}`, | ||
displayName: 'Cypress Domain 2', | ||
description: 'Cypress domain description', | ||
domainType: 'Aggregate', | ||
experts: [], | ||
style: {}, | ||
}; | ||
|
||
const OWNER1 = 'Aaron Johnson'; | ||
const OWNER2 = 'Cynthia Meyer'; | ||
|
||
const TEAM_OWNER_1 = 'Marketplace'; | ||
const TEAM_OWNER_2 = 'DevOps'; | ||
|
||
entities.forEach((entity) => { | ||
describe(`${entity.name} page`, () => { | ||
before(() => { | ||
cy.login(); | ||
entity.createEntity(); | ||
|
||
// Create domain | ||
cy.getAllLocalStorage().then((data) => { | ||
const token = Object.values(data)[0].oidcIdToken; | ||
|
||
createEntityViaREST({ | ||
token, | ||
body: domainDetails1, | ||
endPoint: EntityType.Domain, | ||
}); | ||
|
||
createEntityViaREST({ | ||
token, | ||
body: domainDetails2, | ||
endPoint: EntityType.Domain, | ||
}); | ||
}); | ||
}); | ||
|
||
after(() => { | ||
cy.login(); | ||
|
||
// Delete domain | ||
cy.getAllLocalStorage().then((data) => { | ||
const token = Object.values(data)[0].oidcIdToken; | ||
|
||
// Domain 1 to test | ||
deleteEntityViaREST({ | ||
token, | ||
entityName: domainDetails1.name, | ||
endPoint: EntityType.Domain, | ||
}); | ||
|
||
// Domain 2 to test | ||
deleteEntityViaREST({ | ||
token, | ||
entityName: domainDetails2.name, | ||
endPoint: EntityType.Domain, | ||
}); | ||
}); | ||
}); | ||
|
||
beforeEach(() => { | ||
cy.login(); | ||
entity.visitEntity(); | ||
}); | ||
|
||
it(`Assign domain`, () => { | ||
entity.assignDomain(domainDetails1.displayName); | ||
}); | ||
|
||
it(`Update domain`, () => { | ||
entity.updateDomain(domainDetails2.displayName); | ||
}); | ||
|
||
it(`Remove domain`, () => { | ||
entity.removeDomain(domainDetails2.displayName); | ||
}); | ||
|
||
it(`Assign user Owner`, () => { | ||
entity.assignOwner(OWNER1); | ||
}); | ||
|
||
it(`Update user Owner`, () => { | ||
entity.updateOwner(OWNER2); | ||
}); | ||
|
||
it(`Remove user Owner`, () => { | ||
entity.removeOwner(OWNER2); | ||
}); | ||
|
||
it(`Assign team as Owner`, () => { | ||
entity.assignTeamOwner(TEAM_OWNER_1); | ||
}); | ||
|
||
it(`Update team as Owner`, () => { | ||
entity.updateTeamOwner(TEAM_OWNER_2); | ||
}); | ||
|
||
it(`Remove team as Owner`, () => { | ||
entity.removeTeamOwner(TEAM_OWNER_2); | ||
}); | ||
|
||
it(`Assign tier`, () => { | ||
entity.assignTier('Tier1'); | ||
}); | ||
|
||
it(`Update tier`, () => { | ||
entity.updateTier('Tier5'); | ||
}); | ||
|
||
it(`Remove tier`, () => { | ||
entity.removeTier(); | ||
}); | ||
|
||
it(`Update description`, () => { | ||
entity.updateDescription(); | ||
}); | ||
|
||
it(`Assign tags`, () => { | ||
entity.assignTags(); | ||
}); | ||
|
||
it(`Update Tags`, () => { | ||
entity.updateTags(); | ||
}); | ||
|
||
it(`Remove Tags`, () => { | ||
entity.removeTags(); | ||
}); | ||
|
||
it(`Assign GlossaryTerm`, () => { | ||
entity.assignGlossary(); | ||
}); | ||
|
||
it(`Update GlossaryTerm`, () => { | ||
entity.updateGlossary(); | ||
}); | ||
|
||
it(`Remove GlossaryTerm`, () => { | ||
entity.removeGlossary(); | ||
}); | ||
|
||
it(`Update displayName`, () => { | ||
entity.renameEntity(); | ||
}); | ||
|
||
it(`Create annoucement`, () => { | ||
entity.createAnnouncement(); | ||
}); | ||
|
||
it(`Remove annoucement`, () => { | ||
entity.removeAnnouncement(); | ||
}); | ||
|
||
it(`Create inactive annoucement`, () => { | ||
entity.createInactiveAnnouncement(); | ||
}); | ||
|
||
it(`Remove inactive annoucement`, () => { | ||
entity.removeInactiveAnnouncement(); | ||
}); | ||
|
||
it(`Soft delete`, () => { | ||
entity.softDeleteEntity(); | ||
entity.restoreEntity(); | ||
}); | ||
|
||
it(`Hard delete`, () => { | ||
entity.hardDeleteEntity(); | ||
}); | ||
}); | ||
}); |
62 changes: 62 additions & 0 deletions
62
openmetadata-ui/src/main/resources/ui/cypress/new-tests/base/DashboardServiceClass.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* Copyright 2023 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. | ||
*/ | ||
|
||
import { createSingleLevelEntity } from '../../common/EntityUtils'; | ||
import { visitServiceDetailsPage } from '../../common/serviceUtils'; | ||
import { SERVICE_TYPE } from '../../constants/constants'; | ||
import { DASHBOARD_SERVICE } from '../../constants/EntityConstant'; | ||
import EntityClass, { EntityType } from './EntityClass'; | ||
|
||
class DashboardServiceClass extends EntityClass { | ||
dashboardName: string; | ||
|
||
constructor() { | ||
const dashboardName = `cypress-dashboard-service-${Date.now()}`; | ||
super(dashboardName, DASHBOARD_SERVICE.entity, EntityType.DashboardService); | ||
|
||
this.dashboardName = dashboardName; | ||
this.name = 'Dashboard Service'; | ||
} | ||
|
||
visitEntity() { | ||
visitServiceDetailsPage( | ||
{ | ||
name: this.dashboardName, | ||
type: SERVICE_TYPE.Dashboard, | ||
}, | ||
false | ||
); | ||
} | ||
|
||
// Creation | ||
|
||
createEntity() { | ||
// Handle creation here | ||
|
||
cy.getAllLocalStorage().then((data) => { | ||
const token = Object.values(data)[0].oidcIdToken as string; | ||
|
||
createSingleLevelEntity({ | ||
...DASHBOARD_SERVICE, | ||
service: { ...DASHBOARD_SERVICE.service, name: this.dashboardName }, | ||
entity: { | ||
...DASHBOARD_SERVICE.entity, | ||
service: this.dashboardName, | ||
}, | ||
token, | ||
}); | ||
}); | ||
} | ||
} | ||
|
||
export default DashboardServiceClass; |
69 changes: 69 additions & 0 deletions
69
openmetadata-ui/src/main/resources/ui/cypress/new-tests/base/DatabaseServiceClass.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
* Copyright 2023 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. | ||
*/ | ||
|
||
import { createEntityTable } from '../../common/EntityUtils'; | ||
import { visitServiceDetailsPage } from '../../common/serviceUtils'; | ||
import { SERVICE_TYPE } from '../../constants/constants'; | ||
import { DATABASE_SERVICE } from '../../constants/EntityConstant'; | ||
import EntityClass, { EntityType } from './EntityClass'; | ||
|
||
class DatabaseServiceClass extends EntityClass { | ||
databaseName: string; | ||
|
||
constructor() { | ||
const databaseName = `cypress-database-service-${Date.now()}`; | ||
super(databaseName, DATABASE_SERVICE.entity, EntityType.DatabaseService); | ||
|
||
this.databaseName = databaseName; | ||
this.name = 'Database Service'; | ||
} | ||
|
||
visitEntity() { | ||
visitServiceDetailsPage( | ||
{ | ||
name: this.databaseName, | ||
type: SERVICE_TYPE.Database, | ||
}, | ||
false | ||
); | ||
} | ||
|
||
// Creation | ||
|
||
createEntity() { | ||
// Handle creation here | ||
|
||
cy.getAllLocalStorage().then((data) => { | ||
const token = Object.values(data)[0].oidcIdToken as string; | ||
|
||
createEntityTable({ | ||
...DATABASE_SERVICE, | ||
service: { ...DATABASE_SERVICE.service, name: this.databaseName }, | ||
database: { ...DATABASE_SERVICE.database, service: this.databaseName }, | ||
schema: { | ||
...DATABASE_SERVICE.schema, | ||
database: `${this.databaseName}.${DATABASE_SERVICE.database.name}`, | ||
}, | ||
tables: [ | ||
{ | ||
...DATABASE_SERVICE.entity, | ||
databaseSchema: `${this.databaseName}.${DATABASE_SERVICE.database.name}.${DATABASE_SERVICE.schema.name}`, | ||
}, | ||
], | ||
token, | ||
}); | ||
}); | ||
} | ||
} | ||
|
||
export default DatabaseServiceClass; |
Oops, something went wrong.