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 cukes with specs

ulfertsc3053690e79d
diff --git a/modules/backlogs/features/export_card_configurations.feature b/modules/backlogs/features/export_card_configurations.feature
deleted file mode 100644
index 4cf2a469e69..00000000000
--- a/modules/backlogs/features/export_card_configurations.feature
+++ /dev/null
@@ -1,83 +0,0 @@
-#-- copyright
-# OpenProject is an open source project management software.
-# Copyright (C) 2012-2020 the OpenProject GmbH
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License version 3.
-#
-# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
-# Copyright (C) 2006-2017 Jean-Philippe Lang
-# Copyright (C) 2010-2013 the ChiliProject Team
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# See docs/COPYRIGHT.rdoc for more details.
-#++
-
-Feature: Export sprint stories as PDF on the Backlogs view
- As a team member
- I want to export stories as a PDF on the scrum backlogs view
- So that I do not loose context while filling in details
-
- Background:
- Given there is 1 project with:
- | name | ecookbook |
- And I am working in project "ecookbook"
- And the project uses the following modules:
- | backlogs |
- And the following types are configured to track stories:
- | Story |
- | Epic |
- | Bug |
- And the type "Task" is configured to track tasks
- And the project uses the following types:
- | Story |
- | Bug |
- | Task |
- And there is 1 user with:
- | login | mathias |
- And there is a role "team member"
- And the role "team member" may have the following rights:
- | view_master_backlog |
- | view_work_packages |
- | edit_work_packages |
- | add_work_packages |
- | manage_subtasks |
- And the user "mathias" is a "team member"
- And the project has the following sprints:
- | name | start_date | effective_date |
- | Sprint 001 | 2010-01-01 | 2010-01-31 |
- And there are the following issue status:
- | name | is_closed | is_default |
- | New | false | true |
- | In Progress | false | false |
- | Resolved | false | false |
- | Closed | true | false |
- | Rejected | true | false |
- And the type "Story" has the default workflow for the role "team member"
- And there is a default issuepriority
- And the project has the following stories in the following sprints:
- | subject | sprint | story_points |
- | Story A | Sprint 001 | 10 |
- | Story B | Sprint 001 | 20 |
- And I am already logged in as "mathias"
-
- @javascript
- Scenario: Export sprint stories as a PDF using the default configuration
- Given there is the single default export card configuration
- And I am on the master backlog
- When I open the "Sprint 001" backlogs menu
- And I follow "Export" of the "Sprint 001" backlogs menu
- Then the PDF download dialog should be displayed
diff --git a/modules/backlogs/features/product_owner.feature b/modules/backlogs/features/product_owner.feature
deleted file mode 100644
index 43adaacd465..00000000000
--- a/modules/backlogs/features/product_owner.feature
+++ /dev/null
@@ -1,119 +0,0 @@
-#-- copyright
-# OpenProject is an open source project management software.
-# Copyright (C) 2012-2020 the OpenProject GmbH
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License version 3.
-#
-# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
-# Copyright (C) 2006-2017 Jean-Philippe Lang
-# Copyright (C) 2010-2013 the ChiliProject Team
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# See docs/COPYRIGHT.rdoc for more details.
-#++
-
-Feature: Product Owner
- As a product owner
- I want to manage story details and story priority
- So that they get done according to my requirements
-
- Background:
- Given the following types are configured to track stories:
- | Story |
- | Epic |
- And the type "Task" is configured to track tasks
- And there are the following issue status:
- | name | is_closed | is_default |
- | New | false | true |
- | Closed | true | false |
-
- And there is a role "product owner"
- And the role "product owner" may have the following rights:
- | view_master_backlog |
- | view_work_packages |
- | add_work_packages |
- | edit_work_packages |
- | manage_subtasks |
- | assign_versions |
-
- And the type "Story" has the default workflow for the role "product owner"
- And the type "Epic" has the default workflow for the role "product owner"
- And the type "Task" has the default workflow for the role "product owner"
-
- And there is 1 project with:
- | name | ecookbook |
- And I am working in project "ecookbook"
- And there is a default issuepriority
- And the project uses the following modules:
- | backlogs |
- And the project uses the following types:
- | Story |
- | Epic |
- | Task |
-
- And there is 1 user with:
- | login | mathias |
- And the user "mathias" is a "product owner"
-
- And the project has the following sprints:
- | name | start_date | effective_date |
- | Sprint 001 | 2010-01-01 | 2010-01-31 |
- | Sprint 002 | 2010-02-01 | 2010-02-28 |
- | Sprint 003 | 2010-03-01 | 2010-03-31 |
- | Sprint 004 | 2010-03-01 | 2010-03-31 |
- And the project has the following product owner backlogs:
- | Product Backlog |
- | Wishlist |
- And the project has the following stories in the following product owner backlogs:
- | subject | backlog |
- | Story 1 | Product Backlog |
- | Story 2 | Product Backlog |
- | Story 3 | Product Backlog |
- | Story 4 | Product Backlog |
- And the project has the following stories in the following sprints:
- | subject | sprint |
- | Story A | Sprint 001 |
- | Story B | Sprint 001 |
- And I am already logged in as "mathias"
-
- @javascript
- Scenario: Move a story to the top
- Given I am on the master backlog
- When I move the 3rd story to the 1st position
- Then the 1st story in the "Product Backlog" should be "Story 3"
-
- @javascript
- Scenario: Move a story to the bottom
- Given I am on the master backlog
- When I move the 2nd story to the last position
- Then the 4th story in the "Product Backlog" should be "Story 2"
-
- @javascript
- Scenario: Move a story down
- Given I am on the master backlog
- When I move the 2nd story to the 3rd position
- Then the 2nd story in the "Product Backlog" should be "Story 3"
- And the 3rd story in the "Product Backlog" should be "Story 2"
- And the 4th story in the "Product Backlog" should be "Story 4"
-
- @javascript
- Scenario: Move a story up
- Given I am on the master backlog
- When I move the 4th story to the 2nd position
- Then the 2nd story in the "Product Backlog" should be "Story 4"
- And the 3rd story in the "Product Backlog" should be "Story 2"
- And the 4th story in the "Product Backlog" should be "Story 3"
diff --git a/modules/backlogs/features/scrum_master.feature b/modules/backlogs/features/scrum_master.feature
index 5ff987ea5d8..848c9445e2c 100644
--- a/modules/backlogs/features/scrum_master.feature
+++ b/modules/backlogs/features/scrum_master.feature
@@ -150,14 +150,6 @@ Feature: Scrum Master
And Story 1 should be in the 2nd position of the sprint named Sprint 001
And Story 2 should be in the 1st position of the sprint named Sprint 002
- @javascript
- Scenario: Move a story down in a sprint
- Given I am on the master backlog
- When I move the story named Story A below Story B
- Then the request should complete successfully
- And Story A should be in the 2nd position of the sprint named Sprint 001
- And Story B should be the higher item of Story A
-
@javascript
Scenario: View tasks that have subtasks
Given I am on the taskboard for "Sprint 005"
@@ -170,14 +162,6 @@ Feature: Scrum Master
And I should not see "Subfeature"
And I should not see "Subsubtask"
- @javascript
- Scenario: Move stories around in the backlog that have a parent ticket
- Given I am on the master backlog
- When I move the story named Story D below Story E
- Then the request should complete successfully
- And Story D should be in the 2nd position of the sprint named Sprint 005
- And Story E should be the higher item of Story D
-
@javascript
Scenario: Move a task with subtasks around in the taskboard
Given I am on the taskboard for "Sprint 005"
diff --git a/modules/backlogs/features/shared_versions.feature b/modules/backlogs/features/shared_versions.feature
index 00068521073..2244daa209e 100644
--- a/modules/backlogs/features/shared_versions.feature
+++ b/modules/backlogs/features/shared_versions.feature
@@ -75,16 +75,3 @@ Feature: Shared Versions
Scenario: Inherited Sprints are displayed
Given I am on the master backlog
Then I should see "ParentSprint" within "#sprint_backlogs_container .backlog:first-child .sprint .name"
-
- # TODO: Add to stories_in_backlog spec
- @javascript
- Scenario: Only stories of current project are displayed
- Given the project "parent" has the following stories in the following sprints:
- | subject | backlog |
- | ParentStory | ParentSprint |
- And the project "child" has the following stories in the following sprints:
- | subject | backlog |
- | ChildStory | ParentSprint |
- And I am on the master backlog
- Then I should see "ChildStory" within ".backlog .story .subject"
- And I should not see "ParentStory" within ".backlog .story .subject"
diff --git a/modules/backlogs/spec/features/stories_in_backlog_spec.rb b/modules/backlogs/spec/features/stories_in_backlog_spec.rb
index 0c7668bba09..978fc457615 100644
--- a/modules/backlogs/spec/features/stories_in_backlog_spec.rb
+++ b/modules/backlogs/spec/features/stories_in_backlog_spec.rb
@@ -113,6 +113,30 @@ describe 'Stories in backlog',
project: project,
version_settings_attributes: [{ project: project, display: VersionSetting::DISPLAY_RIGHT }])
end
+ let!(:other_project) do
+ FactoryBot.create(:project).tap do |p|
+ FactoryBot.create(:member,
+ principal: current_user,
+ project: p,
+ roles: [role])
+ end
+ end
+ let!(:sprint_story_in_other_project) do
+ FactoryBot.create(:work_package,
+ project: other_project,
+ type: story,
+ status: default_status,
+ version: sprint,
+ story_points: 10)
+
+ end
+ let!(:export_card_configurations) do
+ ExportCardConfiguration.create!(name: 'Default',
+ per_page: 1,
+ page_size: 'A4',
+ orientation: 'landscape',
+ rows: "group1:\n has_border: false\n rows:\n row1:\n height: 50\n priority: 1\n columns:\n id:\n has_label: false")
+ end
let(:backlogs_page) { Pages::Backlogs.new(project) }
before do
@@ -143,6 +167,9 @@ describe 'Stories in backlog',
backlogs_page
.expect_story_not_in_sprint(sprint_story1_task, sprint)
+ backlogs_page
+ .expect_story_not_in_sprint(sprint_story_in_other_project, sprint)
+
backlogs_page
.expect_stories_in_order(sprint, sprint_story1, sprint_story2)
@@ -151,10 +178,12 @@ describe 'Stories in backlog',
.expect_velocity(sprint_story1, 30)
# Creating a story
+ backlogs_page
+ .click_in_backlog_menu(sprint, 'New Story')
- backlogs_page.click_in_backlog_menu(sprint, 'New Story')
- backlogs_page.edit_new_story(subject: 'New story',
- story_points: 10)
+ backlogs_page
+ .edit_new_story(subject: 'New story',
+ story_points: 10)
new_story = WorkPackage.find_by(subject: 'New story')
@@ -162,8 +191,8 @@ describe 'Stories in backlog',
.expect_story_in_sprint(new_story, sprint)
# All positions will be unique in the sprint
- expect(Story.where(version: sprint, type: story).pluck(:position))
- .to match_array([1,2,3])
+ expect(Story.where(version: sprint, type: story, project: project).pluck(:position))
+ .to match_array([1, 2, 3])
backlogs_page
.expect_stories_in_order(sprint, new_story, sprint_story1, sprint_story2)
@@ -172,7 +201,6 @@ describe 'Stories in backlog',
backlogs_page
.expect_velocity(sprint_story1, 40)
-
# Editing in a sprint
backlogs_page
@@ -192,6 +220,32 @@ describe 'Stories in backlog',
backlogs_page
.expect_velocity(sprint_story1, 45)
+ # Moving stories within the sprint via drag and drop
+
+ # Moving to top
+ backlogs_page
+ .drag_in_sprint(sprint_story1, new_story)
+
+ sleep(0.5)
+
+ backlogs_page
+ .expect_stories_in_order(sprint, sprint_story1, new_story, sprint_story2)
+
+ expect(Story.where(version: sprint, type: story, project: project).pluck(:position))
+ .to match_array([1, 2, 3])
+
+ # Moving to bottom
+ backlogs_page
+ .drag_in_sprint(sprint_story1, sprint_story2, before: false)
+
+ sleep(0.5)
+
+ backlogs_page
+ .expect_stories_in_order(sprint, new_story, sprint_story2, sprint_story1)
+
+ expect(Story.where(version: sprint, type: story, project: project).pluck(:position))
+ .to match_array([1, 2, 3])
+
# Editing in the backlog
backlogs_page
@@ -231,6 +285,11 @@ describe 'Stories in backlog',
.expect_status_options(backlog_story1,
[other_status])
+ # The pdf export is reachable via the menu
+ backlogs_page
+ .click_in_backlog_menu(sprint, 'Export')
+ # Will download something that is currently not speced
+
# One can switch to the work package page by clicking on the id
# Clicking on it will open the wp in another tab which seems to trip up selenium.
backlogs_page
diff --git a/modules/backlogs/spec/support/pages/backlogs.rb b/modules/backlogs/spec/support/pages/backlogs.rb
index d74a54eda1b..79d9b597614 100644
--- a/modules/backlogs/spec/support/pages/backlogs.rb
+++ b/modules/backlogs/spec/support/pages/backlogs.rb
@@ -104,6 +104,27 @@ module Pages
end
end
+ def drag_in_sprint(moved, target, before: true)
+ moved_element = find(story_selector(moved))
+ target_element = find(story_selector(target))
+
+ 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, 0, before ? +10 : +20)
+ .release
+ .perform
+ end
+
def expect_story_in_sprint(story, sprint)
within_backlog(sprint) do
expect(page)
@@ -150,8 +171,10 @@ module Pages
end
def expect_velocity(backlog, velocity)
- expect(page)
- .to have_selector("#backlog_#{backlog.id} .velocity", text: velocity.to_s)
+ within("#backlog_#{backlog.id} .velocity") do
+ expect(page)
+ .to have_content(velocity.to_s)
+ end
end
def expect_stories_in_order(backlog, *stories)