Have tests use new work package table rules

pull/3346/head^2
Oliver Günther 9 years ago
parent efe4845130
commit d684a2295a
  1. 4
      features/work_packages/index_move_columns.feature
  2. 2
      features/work_packages/index_sums.feature
  3. 2
      features/work_packages/work_packages_new.feature
  4. 20
      spec/features/accessibility/work_packages/work_package_query_spec.rb
  5. 8
      spec/features/work_packages/select_work_package_row_spec.rb

@ -70,11 +70,11 @@ Feature: Disabled done ratio on the work package index
And I choose "Columns" from the toolbar "settings" dropdown
And I select to see column "Author"
And I click "Apply"
Then I should see "Author" within ".workpackages-table"
Then I should see "Author" within ".work-package-table--container table"
@javascript
Scenario: Subject column should not be displayed when Subject is moved out of selected columns
When I go to the work packages index page of the project "project1"
And I choose "Columns" from the toolbar "settings" dropdown
And I select to not see column "Subject"
Then I should not see "Subject" within ".workpackages-table"
Then I should not see "Subject" within ".work-package-table--container table"

@ -70,7 +70,7 @@ Feature: Calculated sums on the work package index
# Adding this "should see" to prevent the columns menu from being opened
# before the information on available columns is returned from the server.
# If it is opened before the modal is empty.
And I should see "subject" within ".workpackages-table"
And I should see "subject" within ".work-package-table--container table"
And I choose "Columns" from the toolbar "settings" dropdown
And I select to see column "Estimated time"
And I click "Apply"

@ -68,4 +68,4 @@ Feature: Disabled done ratio on the work package index
Scenario: Total sums dialog should be displayed when the display sums checkbox is checked
When I go to the work packages index page of the project "project1"
And I choose "Display sums" from the toolbar "settings" dropdown
Then I should see "Sum for all work packages" within ".workpackages-table"
Then I should see "Sum for all work packages" within ".work-package-table--container table"

@ -63,7 +63,7 @@ describe 'Work package index accessibility', type: :feature do
end
describe 'Select all link' do
let(:link_selector) { 'table.workpackages-table th.checkbox a' }
let(:link_selector) { '.work-package-table--container th.checkbox a' }
before { visit_index_page }
@ -108,7 +108,7 @@ describe 'Work package index accessibility', type: :feature do
shared_examples_for 'sort column' do
it do
expect(page).to have_selector(column_header_selector)
expect(find(column_header_selector + ' span.sort-header')[:title]).to eq(sort_text)
expect(find(column_header_selector + ' span.generic-table--sort-header')[:title]).to eq(sort_text)
end
end
@ -158,7 +158,7 @@ describe 'Work package index accessibility', type: :feature do
describe 'id column' do
let(:link_caption) { 'ID' }
let(:column_header_selector) { 'table.workpackages-table th:nth-of-type(2)' }
let(:column_header_selector) { '.work-package-table--container th:nth-of-type(2)' }
let(:column_header_link_selector) { column_header_selector + ' a' }
it_behaves_like 'sortable column'
@ -169,7 +169,7 @@ describe 'Work package index accessibility', type: :feature do
# testing the same functionality.
# describe 'type column' do
# let(:link_caption) { 'Type' }
# let(:column_header_selector) { 'table.workpackages-table th:nth-of-type(3)' }
# let(:column_header_selector) { '.work-package-table--container th:nth-of-type(3)' }
# let(:column_header_link_selector) { column_header_selector + ' a' }
# it_behaves_like 'sortable column'
@ -177,7 +177,7 @@ describe 'Work package index accessibility', type: :feature do
describe 'status column' do
let(:link_caption) { 'Status' }
let(:column_header_selector) { 'table.workpackages-table th:nth-of-type(4)' }
let(:column_header_selector) { '.work-package-table--container th:nth-of-type(4)' }
let(:column_header_link_selector) { column_header_selector + ' a' }
it_behaves_like 'sortable column'
@ -185,7 +185,7 @@ describe 'Work package index accessibility', type: :feature do
describe 'priority column' do
let(:link_caption) { 'Priority' }
let(:column_header_selector) { 'table.workpackages-table th:nth-of-type(5)' }
let(:column_header_selector) { '.work-package-table--container th:nth-of-type(5)' }
let(:column_header_link_selector) { column_header_selector + ' a' }
it_behaves_like 'sortable column'
@ -193,7 +193,7 @@ describe 'Work package index accessibility', type: :feature do
describe 'subject column' do
let(:link_caption) { 'Subject' }
let(:column_header_selector) { 'table.workpackages-table th:nth-of-type(6)' }
let(:column_header_selector) { '.work-package-table--container th:nth-of-type(6)' }
let(:column_header_link_selector) { column_header_selector + ' a' }
it_behaves_like 'sortable column'
@ -201,7 +201,7 @@ describe 'Work package index accessibility', type: :feature do
describe 'assigned to column' do
let(:link_caption) { 'Assignee' }
let(:column_header_selector) { 'table.workpackages-table th:nth-of-type(7)' }
let(:column_header_selector) { '.work-package-table--container th:nth-of-type(7)' }
let(:column_header_link_selector) { column_header_selector + ' a' }
it_behaves_like 'sortable column'
@ -282,14 +282,14 @@ describe 'Work package index accessibility', type: :feature do
describe 'work package context menu', js: true do
it_behaves_like 'context menu' do
let(:target_link) { '#work-package-context-menu li.open a' }
let(:source_link) { '.workpackages-table tr.issue td.id a' }
let(:source_link) { '.work-package-table--container tr.issue td.id a' }
let(:keys) { [:shift, :alt, :f10] }
end
end
describe 'column header drop down menu', js: true do
it_behaves_like 'context menu' do
let(:source_link) { 'table.workpackages-table th:nth-of-type(2) a' }
let(:source_link) { '.work-package-table--container th:nth-of-type(2) a' }
let(:target_link) { '#column-context-menu .dropdown-menu li:first-of-type a' }
let(:keys) { :enter }
end

@ -60,7 +60,7 @@ describe 'Select work package row', type: :feature do
describe 'Work package row selection', js: true do
def select_work_package_row(number, mouse_button_behavior = :left)
element = find(".workpackages-table tr:nth-of-type(#{number}).issue td.id")
element = find(".work-package-table--container tr:nth-of-type(#{number}).issue td.id")
case mouse_button_behavior
when :double
element.double_click
@ -72,7 +72,7 @@ describe 'Select work package row', type: :feature do
end
def select_work_package_row_with_shift(number)
element = find(".workpackages-table tr:nth-of-type(#{number}).issue td.id")
element = find(".work-package-table--container tr:nth-of-type(#{number}).issue td.id")
page.driver.browser.action.key_down(:shift)
.click(element.native)
.key_up(:shift)
@ -80,7 +80,7 @@ describe 'Select work package row', type: :feature do
end
def select_work_package_row_with_ctrl(number)
element = find(".workpackages-table tr:nth-of-type(#{number}).issue td.id")
element = find(".work-package-table--container tr:nth-of-type(#{number}).issue td.id")
page.driver.browser.action.key_down(:control)
.click(element.native)
.key_up(:control)
@ -88,7 +88,7 @@ describe 'Select work package row', type: :feature do
end
def check_row_selection_state(row_index, state = true)
selector = ".workpackages-table tr:nth-of-type(#{row_index}).issue input[type=checkbox]:checked"
selector = ".work-package-table--container tr:nth-of-type(#{row_index}).issue input[type=checkbox]:checked"
expect(page).to (state ? have_selector(selector) : have_no_selector(selector))
end

Loading…
Cancel
Save