Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

replace cuke with spec

ulferts012aa2d67b96
diff --git a/modules/backlogs/features/scrum_master.feature b/modules/backlogs/features/scrum_master.feature
index d1d3495433e..f8e5bc0ed1c 100644
--- a/modules/backlogs/features/scrum_master.feature
+++ b/modules/backlogs/features/scrum_master.feature
@@ -138,11 +138,3 @@ Feature: Scrum Master
When I update the sprint
Then the server should return an update error
- @javascript
- Scenario: Move a task with subtasks around in the taskboard
- Given I am on the taskboard for "Sprint 005"
- When I move the task named Task 10 below Task 11
- Then the request should complete successfully
- And Task 11 should be the higher task of Task 10
- And the story named Story D should have 1 task named Task 10
- And the story named Story D should have 1 task named Task 11
diff --git a/modules/backlogs/features/version_settings.feature b/modules/backlogs/features/version_settings.feature
index fecfb8f8c49..da4e36bc734 100644
--- a/modules/backlogs/features/version_settings.feature
+++ b/modules/backlogs/features/version_settings.feature
@@ -55,18 +55,6 @@ Feature: Version Settings
| Sprint 004 | 2010-03-01 | 2010-03-31 |
And I am already logged in as "padme"
- @javascript
- Scenario: One can select whether versions are displayed left or right (left is default) in the backlogs page
- When I go to the edit page of the version called "Sprint 001"
-
- Then the editable attributes of the version should be the following:
- | Column in backlog | left |
-
- When I select "right" from "Column in backlog"
- And I press "Save"
-
- Then I should be on the settings/versions page of the project called "ecookbook"
-
@javascript
Scenario: Inherited versions can also be configured to be displayed left, right or not at all
Given there is 1 project with:
diff --git a/modules/backlogs/spec/features/tasks_on_taskboard_spec.rb b/modules/backlogs/spec/features/tasks_on_taskboard_spec.rb
index 7547febe188..4af4020c55b 100644
--- a/modules/backlogs/spec/features/tasks_on_taskboard_spec.rb
+++ b/modules/backlogs/spec/features/tasks_on_taskboard_spec.rb
@@ -215,6 +215,33 @@ describe 'Tasks on taskboard',
expect(story1_task.subject)
.to eql "Updated task"
+ # Dragging a task within the same column (switching order)
+ taskboard_page
+ .drag_to_task(story1_task, added_task, :before)
+
+ taskboard_page
+ .expect_task_in_story_column(added_task, story1, 1)
+
+ taskboard_page
+ .expect_task_in_story_column(story1_task, story1, 1)
+
+ sleep(0.5)
+
+ expect(added_task.reload.higher_item.id)
+ .to eql story1_task.id
+
+ # Dragging a task to the next column (switching status)
+ taskboard_page
+ .drag_to_column(story1_task, story1, 2)
+
+ taskboard_page
+ .expect_task_in_story_column(story1_task, story1, 2)
+
+ sleep(0.5)
+
+ expect(story1_task.reload.status)
+ .to eql other_status
+
# There is a button to the burndown chart
expect(page)
.to have_selector("a[href='#{backlogs_project_sprint_burndown_chart_path(project, sprint)}']",
diff --git a/modules/backlogs/spec/support/pages/taskboard.rb b/modules/backlogs/spec/support/pages/taskboard.rb
index 4e637bd9e33..24e4583eb58 100644
--- a/modules/backlogs/spec/support/pages/taskboard.rb
+++ b/modules/backlogs/spec/support/pages/taskboard.rb
@@ -69,8 +69,8 @@ module Pages
expect(page).to have_no_selector('#work_package_')
end
- def update_task(story, attributes)
- find("#work_package_#{story.id}").click
+ def update_task(task, attributes)
+ find("#work_package_#{task.id}").click
change_attributes_in_modal(attributes)
@@ -79,6 +79,34 @@ module Pages
sleep(0.5)
end
+ def drag_to_task(dragged_task, target, before_or_after = :before)
+ moved_element = find("#work_package_#{dragged_task.id}")
+ target_element = find("#work_package_#{target.id}")
+
+ page
+ .driver
+ .browser
+ .action
+ .move_to(moved_element.native)
+ .click_and_hold(moved_element.native)
+ .perform
+
+ page
+ .driver
+ .browser
+ .action
+ .move_to(target_element.native, before_or_after == :before ? 0 : +50, +40)
+ .release
+ .perform
+ end
+
+ def drag_to_column(dragged_task, story, col_number)
+ moved_element = find("#work_package_#{dragged_task.id}")
+ target_element = find(".story_#{story.id} td:nth-of-type(#{col_number + 2})")
+
+ moved_element.drag_to(target_element)
+ end
+
def path
backlogs_project_sprint_taskboard_path(project, sprint)
end