Skip to content

Commit ba63450

Browse files
fix(cypress): fix summary tab tests (#15267)
1 parent 84fe389 commit ba63450

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

datahub-web-react/src/app/entityV2/summary/properties/property/properties/OwnersProperty.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default function OwnersProperty(props: PropertyComponentProps) {
2222

2323
return (
2424
<HoverEntityTooltip entity={owner} showArrow={false}>
25-
<Link to={`${entityRegistry.getEntityUrl(owner.type, owner.urn)}`}>
25+
<Link to={`${entityRegistry.getEntityUrl(owner.type, owner.urn)}`} data-testid={`owner-${owner.urn}`}>
2626
<Avatar name={displayName} imageUrl={avatarUrl} size="sm" showInPill />
2727
</Link>
2828
</HoverEntityTooltip>

smoke-test/tests/cypress/cypress/e2e/summaryTab/domainSummary.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as utils from "./utils";
22

3-
const TEST_USER_DISPLAY_NAME = "jdoe";
3+
const TEST_USER_URN = "urn:li:corpuser:jdoe";
44
const TEST_ASSET_NAME = "Baz Dashboard";
55
const TEST_DOMAIN_URN = "urn:li:domain:testing";
66
const TEST_SUBDOMAIN_NAME = "Subdomain";
@@ -17,7 +17,7 @@ describe("summary tab - domain", () => {
1717
it("domain - header section", () => {
1818
utils.testPropertiesSection([
1919
{ name: "Created", type: "CREATED" },
20-
{ name: "Owners", type: "OWNERS", value: TEST_USER_DISPLAY_NAME },
20+
{ name: "Owners", type: "OWNERS", dataTestId: `owner-${TEST_USER_URN}` },
2121
]);
2222
});
2323

smoke-test/tests/cypress/cypress/e2e/summaryTab/glossaryNodeSummary.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as utils from "./utils";
22

3-
const TEST_USER_DISPLAY_NAME = "jdoe";
3+
const TEST_USER_URN = "urn:li:corpuser:jdoe";
44
const TEST_GLOSSARY_NODE_URN = "urn:li:glossaryNode:CypressNode";
55
const TEST_GLOSSARY_TERM_NAME = "CypressTerm";
66

@@ -15,7 +15,7 @@ describe("summary tab - glossary node", () => {
1515
it("glossary node - header section", () => {
1616
utils.testPropertiesSection([
1717
{ name: "Created", type: "CREATED" },
18-
{ name: "Owners", type: "OWNERS", value: TEST_USER_DISPLAY_NAME },
18+
{ name: "Owners", type: "OWNERS", dataTestId: `owner-${TEST_USER_URN}` },
1919
]);
2020
});
2121

smoke-test/tests/cypress/cypress/e2e/summaryTab/glossaryTermSummary.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as utils from "./utils";
22

3-
const TEST_USER_DISPLAY_NAME = "John Doe";
3+
const TEST_USER_URN = "urn:li:corpuser:jdoe";
44
const TEST_GLOSSARY_TERM_URN = "urn:li:glossaryTerm:CypressNode.CypressTerm";
55
const TEST_DOMAIN_NAME = "Testing";
66
const TEST_RELATED_TERM_NAME = "RelatedCypressTerm";
@@ -16,7 +16,7 @@ describe("summary tab - glossary term", () => {
1616
it("glossary term - header section", () => {
1717
utils.testPropertiesSection([
1818
{ name: "Created", type: "CREATED" },
19-
{ name: "Owners", type: "OWNERS", value: TEST_USER_DISPLAY_NAME },
19+
{ name: "Owners", type: "OWNERS", dataTestId: `owner-${TEST_USER_URN}` },
2020
{ name: "Domain", type: "DOMAIN", value: TEST_DOMAIN_NAME },
2121
]);
2222
});

smoke-test/tests/cypress/cypress/e2e/summaryTab/utils.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,9 @@ export function ensurePropertyExist(property) {
296296
expect(text).to.match(new RegExp(property.value, "i"));
297297
});
298298
}
299+
if (property.dataTestId !== undefined) {
300+
cy.getWithTestId(property.dataTestId).should("exist");
301+
}
299302
});
300303
}
301304

0 commit comments

Comments
 (0)