From a87d663597d1c38cefe1e38de2bbaf206f0c46cc Mon Sep 17 00:00:00 2001 From: Melissa Date: Fri, 28 Feb 2020 14:46:04 +0100 Subject: [PATCH] e2e-test: Fixed tests workflow-item & timestamp - After adding an image for a placeholder, the test couldn't find a button to click on anymore, so a force command solved the issue. - In timestamp_spec.js a div couldn't be found because it was nested, now the actual list is being forwarded. - Fixed project_analytics_spec.js --- .gitignore | 1 + .../cypress/integration/project_analytics_spec.js | 2 +- e2e-test/cypress/integration/timestamp_spec.js | 4 ++-- frontend/src/pages/Nodes/NodeVoting.js | 13 ++++++------- frontend/src/pages/Workflows/SubProjectDetails.js | 12 ++++++------ frontend/src/pages/Workflows/WorkflowList.js | 1 + 6 files changed, 17 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index 04569346a3..5d9e251e23 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ node_modules yarn-error.log .markdownlint.* *.code-workspace +e2e-test/debug.log diff --git a/e2e-test/cypress/integration/project_analytics_spec.js b/e2e-test/cypress/integration/project_analytics_spec.js index 2acfce0ebc..df72056f60 100644 --- a/e2e-test/cypress/integration/project_analytics_spec.js +++ b/e2e-test/cypress/integration/project_analytics_spec.js @@ -209,7 +209,7 @@ describe("Project Analytics", function() { // Open dialog cy.get("[data-test=details-analytics-button]") .should("be.visible") - .click(); + .click({ force: true }); cy.get("[data-test=select-currencies]") .should("be.visible") .click(); diff --git a/e2e-test/cypress/integration/timestamp_spec.js b/e2e-test/cypress/integration/timestamp_spec.js index cee24cb7e7..1d54351275 100644 --- a/e2e-test/cypress/integration/timestamp_spec.js +++ b/e2e-test/cypress/integration/timestamp_spec.js @@ -9,7 +9,6 @@ const standardBudget = [ describe("Timestamps", function() { before(function() { cy.login("mstein", "test"); - cy.visit(`/projects`); cy.createProject("p-timestamp", "project timestamp test", standardBudget); }); @@ -23,8 +22,9 @@ describe("Timestamps", function() { .last() .click(); cy.get("[data-test=assignee-selection]").click(); - cy.get("[data-test=assignee-list]") + cy.get("[data-test=assignee-selection]") .should("be.visible") + .get("[data-test=assignee-list]") .find("[value=thouse]") .click() .get("[data-test=confirmation-dialog-confirm]") diff --git a/frontend/src/pages/Nodes/NodeVoting.js b/frontend/src/pages/Nodes/NodeVoting.js index 28d7a1bb13..448625312c 100644 --- a/frontend/src/pages/Nodes/NodeVoting.js +++ b/frontend/src/pages/Nodes/NodeVoting.js @@ -1,16 +1,15 @@ -import React from "react"; - +import Button from "@material-ui/core/Button"; import Card from "@material-ui/core/Card"; -import CardHeader from "@material-ui/core/CardHeader"; import CardContent from "@material-ui/core/CardContent"; - -import Typography from "@material-ui/core/Typography"; +import CardHeader from "@material-ui/core/CardHeader"; +import Divider from "@material-ui/core/Divider"; import List from "@material-ui/core/List"; import ListItem from "@material-ui/core/ListItem"; import ListItemText from "@material-ui/core/ListItemText"; -import Divider from "@material-ui/core/Divider"; -import Button from "@material-ui/core/Button"; import { withStyles } from "@material-ui/core/styles"; +import Typography from "@material-ui/core/Typography"; +import React from "react"; + import strings from "../../localizeStrings"; import { canApproveNode } from "../../permissions"; import { NewOrganizationsEmptyState, ExistingNodesEmptyState } from "./NodesEmptyStates"; diff --git a/frontend/src/pages/Workflows/SubProjectDetails.js b/frontend/src/pages/Workflows/SubProjectDetails.js index c8ca59431f..9b51b173b6 100644 --- a/frontend/src/pages/Workflows/SubProjectDetails.js +++ b/frontend/src/pages/Workflows/SubProjectDetails.js @@ -1,29 +1,29 @@ import Avatar from "@material-ui/core/Avatar"; +import Button from "@material-ui/core/Button"; import Card from "@material-ui/core/Card"; import IconButton from "@material-ui/core/IconButton"; -import Button from "@material-ui/core/Button"; import List from "@material-ui/core/List"; import ListItem from "@material-ui/core/ListItem"; import ListItemText from "@material-ui/core/ListItemText"; -import Tooltip from "@material-ui/core/Tooltip"; -import Typography from "@material-ui/core/Typography"; -import AmountIcon from "@material-ui/icons/AccountBalance"; import Table from "@material-ui/core/Table"; import TableBody from "@material-ui/core/TableBody"; import TableCell from "@material-ui/core/TableCell"; import TableHead from "@material-ui/core/TableHead"; import TableRow from "@material-ui/core/TableRow"; +import Tooltip from "@material-ui/core/Tooltip"; +import Typography from "@material-ui/core/Typography"; +import AmountIcon from "@material-ui/icons/AccountBalance"; +import BarChartIcon from "@material-ui/icons/BarChart"; import DoneIcon from "@material-ui/icons/Check"; import DateIcon from "@material-ui/icons/DateRange"; import AssigneeIcon from "@material-ui/icons/Group"; -import BarChartIcon from "@material-ui/icons/BarChart"; import _isUndefined from "lodash/isUndefined"; import React from "react"; import { statusIconMapping, statusMapping, toAmountString, unixTsToString } from "../../helper.js"; import strings from "../../localizeStrings"; -import SubProjectAssigneeContainer from "./SubProjectAssigneeContainer"; import SubProjectAnalyticsDialog from "../Analytics/SubProjectAnalyticsDialog"; +import SubProjectAssigneeContainer from "./SubProjectAssigneeContainer"; import BudgetEmptyState from "../Common/BudgetEmptyState"; const styles = { diff --git a/frontend/src/pages/Workflows/WorkflowList.js b/frontend/src/pages/Workflows/WorkflowList.js index 4f0d9824d2..ba7c45a0ec 100644 --- a/frontend/src/pages/Workflows/WorkflowList.js +++ b/frontend/src/pages/Workflows/WorkflowList.js @@ -4,6 +4,7 @@ import EditIcon from "@material-ui/icons/Edit"; import _isEmpty from "lodash/isEmpty"; import React from "react"; import { SortableContainer } from "react-sortable-hoc"; + import { canReorderWorkflowItems } from "../../permissions.js"; import { RedactedWorkflowItem, WorkflowItem } from "./WorkflowItem";