Skip to content

Commit

Permalink
e2e: Test dispaying of node connection status
Browse files Browse the repository at this point in the history
  • Loading branch information
m-janos committed Feb 16, 2021
1 parent ab0123c commit 63dfb1e
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
29 changes: 29 additions & 0 deletions e2e-test/cypress/integration/nodes_spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
describe("Nodes Page", function() {
const organization = "KfW";
const firstNode = {
accessType: "admin",
connectionStatus: "Connection"
};

beforeEach(function() {
cy.login();
cy.visit(`/nodes`);
});

it("Show nodes table", function() {
cy.get("[data-test=nodes-table]").should("be.visible");
});

it("Show node connection status", function() {
cy.get("#tableTitle").should("be.visible");
cy.get("[data-test=nodes-table] table tbody tr").should("have.length.above", 0);
cy.get("[data-test=nodes-table] table tbody tr")
.eq(0)
.then($node => {
expect($node.find("th")).to.contains.text(organization);
const nodeCount = parseInt($node.find("td").eq(0).text().trim(), 10);
expect(nodeCount).to.be.greaterThan(0);
expect($node.find("td").eq(1)).to.contains.text(`${firstNode.accessType} (${firstNode.connectionStatus})`);
});
});
});
2 changes: 1 addition & 1 deletion frontend/src/pages/Nodes/NodeVoting.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ const NodeVoting = ({ nodes, approveNewNodeForExistingOrganization, allowedInten
);

return (
<div className={classes.container}>
<div className={classes.container} data-test="node-voting">
<Card className={classes.card}>
<CardHeader title={strings.nodesDashboard.new_organization} />
{isDataLoading ? (
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/Nodes/NodesTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const groupBy = nodes => {
const NodesTable = ({ nodes, classes }) => {
const groupedNodes = groupBy(nodes);
return (
<Paper className={classes.paper}>
<Paper className={classes.paper} data-test="nodes-table">
<div className={classes.title}>
<Typography variant="h6" color="primary" id="tableTitle">
{strings.nodesDashboard.network}
Expand Down

0 comments on commit 63dfb1e

Please sign in to comment.