Skip to content

Commit

Permalink
test: Improve samples test scrolling and sorting interactions
Browse files Browse the repository at this point in the history
Enhance system test for samples table by adding explicit scrolling to last column and refactoring sorting assertions within table header context
  • Loading branch information
joshsadam committed Jan 31, 2025
1 parent 74b7671 commit 8073a23
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions test/system/groups/samples_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -487,15 +487,23 @@ def retrieve_puids
within('table thead tr') do
assert_selector 'th', count: 9
end
# Scroll to the last column
within 'div.overflow-auto.scrollbar' do |div|
div.scroll_to div.find('table thead th:nth-child(9)')
end

click_on 'metadatafield1'
assert_selector 'table thead th:nth-child(7) svg.icon-arrow_up'
within('table thead') do
click_on 'metadatafield1'
assert_selector 'th:nth-child(7) svg.icon-arrow_up'
end

assert_selector 'tbody tr:first-child th', text: @sample30.puid
assert_selector 'tbody tr:first-child td:nth-child(2)', text: @sample30.name

click_on 'metadatafield2'
assert_selector 'table thead th:nth-child(8) svg.icon-arrow_up'
within('table thead') do
click_link 'metadatafield2'
assert_selector 'th:nth-child(8) svg.icon-arrow_up'
end

assert_selector 'tbody tr:first-child th', text: @sample30.puid
assert_selector 'tbody tr:first-child td:nth-child(2)', text: @sample30.name
Expand Down

0 comments on commit 8073a23

Please sign in to comment.