@ -251,6 +251,7 @@ describe 'Projects index page',
scenario 'it keeps applying filters and order' do
load_and_open_filters admin
SeleniumHubWaiter . wait
projects_page . set_filter ( 'name_and_identifier' ,
'Name or identifier' ,
'doesn\'t contain' ,
@ -259,43 +260,48 @@ describe 'Projects index page',
click_on 'Apply'
# Sorts ASC by name
SeleniumHubWaiter . wait
click_on 'Sort by "Name"'
# Results should be filtered and ordered ASC by name
expect ( page ) . to have_text ( development_project . name )
expect ( page ) . to_not have_text ( project . name ) # as it filtered away
expect ( page ) . to have_no _text ( project . name ) # as it filtered away
expect ( page ) . to have_text ( 'Next' ) # as the result set is larger than 1
expect ( page ) . to_not have_text ( public_project . name ) # as it is on the second page
expect ( page ) . to have_no _text ( public_project . name ) # as it is on the second page
# Changing the page size to 5 and back to 1 should not change the filters (which we test later on the second page)
SeleniumHubWaiter . wait
find ( '.pagination--options .pagination--item' , text : '5' ) . click # click page size '5'
SeleniumHubWaiter . wait
find ( '.pagination--options .pagination--item' , text : '1' ) . click # return back to page size '1'
SeleniumHubWaiter . wait
click_on '2' # Go to pagination page 2
# On page 2 you should see the second page of the filtered set ordered ASC by name
expect ( page ) . to have_text ( public_project . name )
expect ( page ) . to_not have_text ( project . name ) # Filtered away
expect ( page ) . to_not have_text ( 'Next' ) # Filters kept active, so there is no third page.
expect ( page ) . to_not have_text ( development_project . name ) # That one should be on page 1
expect ( page ) . to have_no _text ( project . name ) # Filtered away
expect ( page ) . to have_no _text ( 'Next' ) # Filters kept active, so there is no third page.
expect ( page ) . to have_no _text ( development_project . name ) # That one should be on page 1
# Sorts DESC by name
SeleniumHubWaiter . wait
click_on 'Ascending sorted by "Name"'
# On page 2 the same filters should still be intact but the order should be DESC on name
expect ( page ) . to have_text ( development_project . name )
expect ( page ) . to_not have_text ( project . name ) # Filtered away
expect ( page ) . to_not have_text ( 'Next' ) # Filters kept active, so there is no third page.
expect ( page ) . to_not have_text ( public_project . name ) # That one should be on page 1
expect ( page ) . to have_no _text ( project . name ) # Filtered away
expect ( page ) . to have_no _text ( 'Next' ) # Filters kept active, so there is no third page.
expect ( page ) . to have_no _text ( public_project . name ) # That one should be on page 1
# Sending the filter form again what implies to compose the request freshly
SeleniumHubWaiter . wait
click_on 'Apply'
# We should see page 1, resetting pagination, as it is a new filter, but keeping the DESC order on the project
# name
expect ( page ) . to have_text ( public_project . name )
expect ( page ) . to_not have_text ( development_project . name ) # as it is on the second page
expect ( page ) . to_not have_text ( project . name ) # as it filtered away
expect ( page ) . to have_no _text ( development_project . name ) # as it is on the second page
expect ( page ) . to have_no _text ( project . name ) # as it filtered away
expect ( page ) . to have_text ( 'Next' ) # as the result set is larger than 1
end
end
@ -305,6 +311,7 @@ describe 'Projects index page',
load_and_open_filters admin
# Filter on model attribute 'name'
SeleniumHubWaiter . wait
projects_page . set_filter ( 'name_and_identifier' ,
'Name or identifier' ,
'doesn\'t contain' ,
@ -314,9 +321,10 @@ describe 'Projects index page',
expect ( page ) . to have_text ( development_project . name )
expect ( page ) . to have_text ( public_project . name )
expect ( page ) . to_not have_text ( project . name )
expect ( page ) . to have_no _text ( project . name )
# Filter on model attribute 'identifier'
SeleniumHubWaiter . wait
remove_filter ( 'name_and_identifier' )
projects_page . set_filter ( 'name_and_identifier' ,
@ -327,8 +335,8 @@ describe 'Projects index page',
click_on 'Apply'
expect ( page ) . to have_text ( project . name )
expect ( page ) . to_not have_text ( development_project . name )
expect ( page ) . to_not have_text ( public_project . name )
expect ( page ) . to have_no _text ( development_project . name )
expect ( page ) . to have_no _text ( public_project . name )
end
feature 'Active or archived' do
@ -356,6 +364,7 @@ describe 'Projects index page',
expect ( page ) . to have_text ( 'Development project' )
expect ( page ) . to have_text ( 'Public project' )
SeleniumHubWaiter . wait
projects_page . click_menu_item_of ( 'Archive' , parent_project )
projects_page . accept_alert_dialog!
@ -375,6 +384,7 @@ describe 'Projects index page',
load_and_open_filters admin
SeleniumHubWaiter . wait
projects_page . filter_by_active ( 'no' )
expect ( page ) . to have_text ( " ARCHIVED #{ parent_project . name } " )
@ -389,6 +399,7 @@ describe 'Projects index page',
expect ( menu ) . to_not have_text ( 'Settings' )
expect ( menu ) . to_not have_text ( 'New subproject' )
SeleniumHubWaiter . wait
click_link ( 'Unarchive' )
end
@ -401,6 +412,7 @@ describe 'Projects index page',
load_and_open_filters admin
SeleniumHubWaiter . wait
projects_page . filter_by_active ( 'yes' )
expect ( page ) . to have_text ( parent_project . name )
@ -435,16 +447,19 @@ describe 'Projects index page',
login_as ( admin )
projects_page . visit!
SeleniumHubWaiter . wait
click_link ( 'Sort by "Status"' )
expect_project_at_place ( green_project , 1 )
expect ( page ) . to have_text ( '(1 - 8/8)' )
SeleniumHubWaiter . wait
click_link ( 'Ascending sorted by "Status"' )
expect_project_at_place ( green_project , 8 )
expect ( page ) . to have_text ( '(1 - 8/8)' )
SeleniumHubWaiter . wait
projects_page . open_filters
projects_page . set_filter ( 'project_status_code' ,
@ -458,6 +473,7 @@ describe 'Projects index page',
expect ( page ) . to_not have_text ( gray_project . name )
expect ( page ) . to_not have_text ( no_status_project . name )
SeleniumHubWaiter . wait
projects_page . set_filter ( 'project_status_code' ,
'Project status' ,
'all' ,
@ -469,6 +485,7 @@ describe 'Projects index page',
expect ( page ) . to_not have_text ( gray_project . name )
expect ( page ) . to_not have_text ( no_status_project . name )
SeleniumHubWaiter . wait
projects_page . set_filter ( 'project_status_code' ,
'Project status' ,
'none' ,
@ -540,6 +557,7 @@ describe 'Projects index page',
allow_enterprise_edition
project_created_on_today
load_and_open_filters admin
SeleniumHubWaiter . wait
end
scenario 'selecting operator' do
@ -555,6 +573,7 @@ describe 'Projects index page',
expect ( page ) . to_not have_text ( project_created_on_fixed_date . name )
# created on 'this week' shows projects that were created within the last seven days
SeleniumHubWaiter . wait
remove_filter ( 'created_at' )
projects_page . set_filter ( 'created_at' ,
@ -568,6 +587,7 @@ describe 'Projects index page',
expect ( page ) . to_not have_text ( project_created_on_fixed_date . name )
# created on 'on' shows projects that were created within the last seven days
SeleniumHubWaiter . wait
remove_filter ( 'created_at' )
projects_page . set_filter ( 'created_at' ,
@ -582,6 +602,7 @@ describe 'Projects index page',
expect ( page ) . to_not have_text ( project_created_on_this_week . name )
# created on 'less than days ago'
SeleniumHubWaiter . wait
remove_filter ( 'created_at' )
projects_page . set_filter ( 'created_at' ,
@ -595,6 +616,7 @@ describe 'Projects index page',
expect ( page ) . to_not have_text ( project_created_on_fixed_date . name )
# created on 'more than days ago'
SeleniumHubWaiter . wait
remove_filter ( 'created_at' )
projects_page . set_filter ( 'created_at' ,
@ -608,6 +630,7 @@ describe 'Projects index page',
expect ( page ) . to_not have_text ( project_created_on_today . name )
# created on 'between'
SeleniumHubWaiter . wait
remove_filter ( 'created_at' )
projects_page . set_filter ( 'created_at' ,
@ -621,6 +644,7 @@ describe 'Projects index page',
expect ( page ) . to_not have_text ( project_created_on_today . name )
# Latest activity at 'today'. This spot check would fail if the data does not get collected from multiple tables
SeleniumHubWaiter . wait
remove_filter ( 'created_at' )
projects_page . set_filter ( 'latest_activity_at' ,
@ -633,6 +657,7 @@ describe 'Projects index page',
expect ( page ) . to_not have_text ( project_created_on_fixed_date . name )
# CF List
SeleniumHubWaiter . wait
remove_filter ( 'latest_activity_at' )
projects_page . set_filter ( " cf_ #{ list_custom_field . id } " ,
@ -650,11 +675,13 @@ describe 'Projects index page',
within ( cf_filter ) do
# Initial filter is a 'single select'
expect ( cf_filter . find ( :select , 'value' ) ) . not_to be_multiple
SeleniumHubWaiter . wait
click_on 'Toggle multiselect'
# switching to multiselect keeps the current selection
expect ( cf_filter . find ( :select , 'value' ) ) . to be_multiple
expect ( cf_filter ) . to have_select ( 'value' , selected : list_custom_field . possible_values [ 2 ] . value )
SeleniumHubWaiter . wait
select list_custom_field . possible_values [ 3 ] . value , from : 'value'
end
@ -670,6 +697,7 @@ describe 'Projects index page',
list_custom_field . possible_values [ 3 ] . value ] )
# switching to single select keeps the first selection
SeleniumHubWaiter . wait
select list_custom_field . possible_values [ 1 ] . value , from : 'value'
unselect list_custom_field . possible_values [ 2 ] . value , from : 'value'
@ -688,6 +716,7 @@ describe 'Projects index page',
end
# CF date filter work (at least for one operator)
SeleniumHubWaiter . wait
remove_filter ( " cf_ #{ list_custom_field . id } " )
projects_page . set_filter ( " cf_ #{ date_custom_field . id } " ,
@ -695,10 +724,11 @@ describe 'Projects index page',
'on' ,
[ '2011-11-11' ] )
SeleniumHubWaiter . wait
click_on 'Apply'
expect ( page ) . to have_text ( project_created_on_today . name )
expect ( page ) . to_not have_text ( project_created_on_fixed_date . name )
expect ( page ) . to have_no _text ( project_created_on_fixed_date . name )
end
pending " NOT WORKING YET: Date vs. DateTime issue: Selecting same date for from and to value shows projects of that date "
@ -862,6 +892,7 @@ describe 'Projects index page',
child_project_z ,
public_project )
SeleniumHubWaiter . wait
click_link ( 'Name' )
# Projects ordered by name asc
@ -872,6 +903,7 @@ describe 'Projects index page',
public_project ,
child_project_z )
SeleniumHubWaiter . wait
click_link ( 'Name' )
# Projects ordered by name desc
@ -882,6 +914,7 @@ describe 'Projects index page',
development_project ,
child_project_a )
SeleniumHubWaiter . wait
click_link ( integer_custom_field . name )
# Projects ordered by cf asc first then project name desc
@ -892,6 +925,7 @@ describe 'Projects index page',
child_project_m ,
child_project_a )
SeleniumHubWaiter . wait
click_link ( 'Sort by "Project hierarchy"' )
# again ordered by name asc on each hierarchical level