@ -30,15 +30,36 @@ require 'spec_helper'
describe 'boards onboarding tour' , js : true do
let ( :next_button ) { find ( '.enjoyhint_next_btn' ) }
let ( :user ) { FactoryBot . create :admin }
let ( :demo_project ) { FactoryBot . create :project , name : 'Demo project' , identifier : 'demo-project' , is_public : true , enabled_module_names : %w[ work_package_tracking wiki ] }
let ( :scrum_project ) { FactoryBot . create :project , name : 'Scrum project' , identifier : 'your-scrum-project' , is_public : true , enabled_module_names : %w[ work_package_tracking wiki ] }
let ( :user ) { FactoryBot . create :admin ,
member_in_project : demo_project ,
member_through_role : role }
let ( :permissions ) { % i [ show_board_views manage_board_views view_work_packages manage_public_queries ] }
let ( :role ) { FactoryBot . create ( :role , permissions : permissions ) }
let ( :demo_project ) do
FactoryBot . create :project ,
name : 'Demo project' ,
identifier : 'demo-project' ,
is_public : true ,
enabled_module_names : %w[ work_package_tracking wiki board_view ]
end
let ( :scrum_project ) do
FactoryBot . create :project ,
name : 'Scrum project' ,
identifier : 'your-scrum-project' ,
is_public : true ,
enabled_module_names : %w[ work_package_tracking wiki ]
end
let! ( :wp_1 ) { FactoryBot . create ( :work_package , project : demo_project ) }
let! ( :wp_2 ) { FactoryBot . create ( :work_package , project : scrum_project ) }
let! ( :board_view ) { FactoryBot . create :board_grid_with_query , project : demo_project , name : 'KANBAN' , query : query }
let ( :query ) { FactoryBot . create :query , user : user , project : demo_project }
before do
with_enterprise_token :board_view
login_as user
:: OrderedWorkPackage . create ( query : query , work_package : wp_1 , position : 0 )
allow ( Setting ) . to receive ( :demo_projects_available ) . and_return ( true )
allow ( Setting ) . to receive ( :boards_demo_data_available ) . and_return ( true )
end
@ -59,19 +80,22 @@ describe 'boards onboarding tour', js: true do
expect ( page ) . to have_text 'Manage your work within an intuitive Boards view.'
next_button . click
expect ( page ) . to have_text 'You can create multiple lists (columns) within one Board view, e.g. to create a KANBAN board.'
expect ( page )
. to have_text 'You can create multiple lists (columns) within one Board view, e.g. to create a KANBAN board.'
next_button . click
expect ( page ) . to have_text 'Click the + will add a new card to the list within a Board.'
next_button . click
expect ( page ) . to have_text 'Drag & Drop your cards within a list to re-order, or the another list. A double click will open the details view.'
expect ( page )
. to have_text 'Drag & Drop your cards within a list to re-order, or the another list. A double click will open the details view.'
step_through_onboarding_main_menu_tour
end
it " I don't see the board onboarding tour in the scrum project " do
# Set sessionStorage value so that the tour knows that it is in the scum tour
page . execute_script ( " window.sessionStorage.setItem('openProject-onboardingTour', 'startMainTourFromBacklogs'); " ) ;
# Set the tour parameter so that we can start on the wp page
visit " /projects/ #{ scrum_project . identifier } /work_packages?start_onboarding_tour=true "
@ -80,5 +104,3 @@ describe 'boards onboarding tour', js: true do
end
end
end