Skip to content

Commit 7df902a

Browse files
v-tarasevich-blitz-brainchriscollins3456deepgarg760
authored
fix(cypress/summaryTab): split test into separated files (#15194)
Co-authored-by: Chris Collins <chriscollins3456@gmail.com> Co-authored-by: Deepak Garg <deepak.garg@datahub.com>
1 parent f1c95c7 commit 7df902a

File tree

6 files changed

+211
-230
lines changed

6 files changed

+211
-230
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import * as utils from "./utils";
2+
3+
const TEST_DOMAIN_NAME = "Testing";
4+
const TEST_TAG_NAME = "Cypress";
5+
const TEST_TERM_NAME = "CypressTerm";
6+
const TEST_ASSET_NAME = "Baz Dashboard"; // Used in the assets module
7+
8+
describe("summary tab - data product", () => {
9+
beforeEach(() => {
10+
utils.setThemeV2AndSummaryTabFlags(true);
11+
cy.login();
12+
cy.goToDataProduct("urn:li:dataProduct:testing");
13+
utils.goToSummaryTab();
14+
});
15+
16+
it("data product - header section", () => {
17+
utils.testPropertiesSection([
18+
{ name: "Created", type: "CREATED" },
19+
{ name: "Owners", type: "OWNERS" },
20+
{ name: "Domain", type: "DOMAIN", value: TEST_DOMAIN_NAME },
21+
{ name: "Tags", type: "TAGS", value: TEST_TAG_NAME },
22+
{ name: "Glossary Terms", type: "GLOSSARY_TERMS", value: TEST_TERM_NAME },
23+
]);
24+
});
25+
26+
it("data product - description section", () => {
27+
utils.testAboutSection();
28+
});
29+
30+
it("data product - modules section", () => {
31+
const defaultModules = [
32+
{
33+
type: "assets",
34+
name: "Assets",
35+
value: TEST_ASSET_NAME,
36+
},
37+
];
38+
39+
utils.testTemplateSection(defaultModules);
40+
});
41+
});
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import * as utils from "./utils";
2+
3+
const TEST_USER_DISPLAY_NAME = "jdoe";
4+
const TEST_ASSET_NAME = "Baz Dashboard";
5+
const TEST_DOMAIN_URN = "urn:li:domain:testing";
6+
const TEST_SUBDOMAIN_NAME = "Subdomain";
7+
const TEST_DATA_PRODUCT_NAME = "Testing";
8+
9+
describe("summary tab - domain", () => {
10+
beforeEach(() => {
11+
utils.setThemeV2AndSummaryTabFlags(true);
12+
cy.login();
13+
utils.openDomainByUrn(TEST_DOMAIN_URN);
14+
utils.goToSummaryTab();
15+
});
16+
17+
it("domain - header section", () => {
18+
utils.testPropertiesSection([
19+
{ name: "Created", type: "CREATED" },
20+
{ name: "Owners", type: "OWNERS", value: TEST_USER_DISPLAY_NAME },
21+
]);
22+
});
23+
24+
it("domain - description section", () => {
25+
utils.testAboutSection();
26+
});
27+
28+
it("domain - modules section", () => {
29+
const defaultModules = [
30+
{
31+
type: "assets",
32+
name: "Assets",
33+
value: TEST_ASSET_NAME,
34+
},
35+
{
36+
type: "hierarchy",
37+
// FYI: Domains module has different type in add module menu
38+
addType: "child-hierarchy",
39+
name: "Domains",
40+
value: TEST_SUBDOMAIN_NAME,
41+
},
42+
{
43+
type: "data-products",
44+
name: "Data Products",
45+
value: TEST_DATA_PRODUCT_NAME,
46+
},
47+
];
48+
49+
utils.testTemplateSection(defaultModules);
50+
});
51+
});
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import * as utils from "./utils";
2+
3+
const TEST_USER_DISPLAY_NAME = "jdoe";
4+
const TEST_GLOSSARY_NODE_URN = "urn:li:glossaryNode:CypressNode";
5+
const TEST_GLOSSARY_TERM_NAME = "CypressTerm";
6+
7+
describe("summary tab - glossary node", () => {
8+
beforeEach(() => {
9+
utils.setThemeV2AndSummaryTabFlags(true);
10+
cy.login();
11+
cy.goToGlossaryNode(TEST_GLOSSARY_NODE_URN);
12+
utils.goToSummaryTab();
13+
});
14+
15+
it("glossary node - header section", () => {
16+
utils.testPropertiesSection([
17+
{ name: "Created", type: "CREATED" },
18+
{ name: "Owners", type: "OWNERS", value: TEST_USER_DISPLAY_NAME },
19+
]);
20+
});
21+
22+
it("glossary node - description section", () => {
23+
utils.testAboutSection();
24+
});
25+
26+
it("glossary node - modules section", () => {
27+
const defaultModules = [
28+
{
29+
type: "hierarchy",
30+
// FYI: Contents module has different type in add module menu
31+
addType: "child-hierarchy",
32+
name: "Contents",
33+
value: TEST_GLOSSARY_TERM_NAME,
34+
},
35+
];
36+
37+
utils.testTemplateSection(defaultModules);
38+
});
39+
});
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import * as utils from "./utils";
2+
3+
const TEST_USER_DISPLAY_NAME = "John Doe";
4+
const TEST_GLOSSARY_TERM_URN = "urn:li:glossaryTerm:CypressNode.CypressTerm";
5+
const TEST_DOMAIN_NAME = "Testing";
6+
const TEST_RELATED_TERM_NAME = "RelatedCypressTerm";
7+
8+
describe("summary tab - glossary term", () => {
9+
beforeEach(() => {
10+
utils.setThemeV2AndSummaryTabFlags(true);
11+
cy.login();
12+
cy.goToGlossaryTerm(TEST_GLOSSARY_TERM_URN);
13+
utils.goToSummaryTab();
14+
});
15+
16+
it("glossary term - header section", () => {
17+
utils.testPropertiesSection([
18+
{ name: "Created", type: "CREATED" },
19+
{ name: "Owners", type: "OWNERS", value: TEST_USER_DISPLAY_NAME },
20+
{ name: "Domain", type: "DOMAIN", value: TEST_DOMAIN_NAME },
21+
]);
22+
});
23+
24+
it("glossary term - description section", () => {
25+
utils.testAboutSection();
26+
});
27+
28+
it("glossary term - modules section", () => {
29+
const defaultModules = [
30+
{
31+
type: "assets",
32+
name: "Assets",
33+
value: TEST_DOMAIN_NAME,
34+
},
35+
{
36+
type: "related-terms",
37+
name: "Related Terms",
38+
value: TEST_RELATED_TERM_NAME,
39+
},
40+
];
41+
42+
utils.testTemplateSection(defaultModules);
43+
});
44+
});

0 commit comments

Comments
 (0)