From a23f0ce3ac04d83a8a2e0bc1fa9a7a81d93e802a Mon Sep 17 00:00:00 2001 From: Eric Enns <492127+ericenns@users.noreply.github.com> Date: Wed, 5 Jun 2024 14:46:52 -0500 Subject: [PATCH] chore: fix some flaky group samples tests --- test/system/groups/samples_test.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/system/groups/samples_test.rb b/test/system/groups/samples_test.rb index f1b3ea348e..808fcbd2ff 100644 --- a/test/system/groups/samples_test.rb +++ b/test/system/groups/samples_test.rb @@ -119,6 +119,7 @@ def retrieve_puids test 'can sort the list of samples' do visit group_samples_url(@group) + assert_text 'Displaying 1-20 items of 26 total' # Because PUIDs are not always generated the same, issues regarding order have occurred when hard testing # the expected ordering of samples based on PUID. To resolve this, we will gather the first 4 PUIDs and ensure # they are ordered as expected against one another. @@ -169,6 +170,7 @@ def retrieve_puids test 'can filter by name and then sort the list of samples' do visit group_samples_url(@group) + assert_text 'Displaying 1-20 items of 26 total' within '#group_samples_list' do assert_selector 'table tbody tr', count: 20 within first('table tbody tr td') do @@ -207,6 +209,7 @@ def retrieve_puids test 'can filter by puid and then sort the list of samples' do visit group_samples_url(@group) + assert_text 'Displaying 1-20 items of 26 total' within '#group_samples_list' do assert_selector 'table tbody tr', count: 20 within first('table tbody tr td') do @@ -328,6 +331,7 @@ def retrieve_puids test 'can sort samples by metadata column' do visit group_samples_url(@group) + assert_text 'Displaying 1-20 items of 26 total' assert_selector 'label', text: I18n.t('groups.samples.index.search.metadata'), count: 1 assert_selector 'table thead tr th', count: 6 find('label', text: I18n.t('groups.samples.index.search.metadata')).click @@ -368,6 +372,7 @@ def retrieve_puids test 'filtering samples by list of sample puids' do visit group_samples_url(@group) + assert_text 'Displaying 1-20 items of 26 total' within 'tbody#group-samples-table-body' do assert_selector 'tr', count: 20 assert_selector 'tr td', text: @sample1.puid @@ -405,6 +410,7 @@ def retrieve_puids test 'selecting / deselecting all samples' do visit group_samples_url(@group) + assert_text 'Displaying 1-20 items of 26 total' within 'tbody' do assert_selector 'input[name="sample_ids[]"]', count: 20 assert_selector 'input[name="sample_ids[]"]:checked', count: 0