Skip to content

Commit

Permalink
Debug log when not successful product list
Browse files Browse the repository at this point in the history
  • Loading branch information
srbarrios committed Feb 9, 2025
1 parent 31b84c7 commit 698ed4c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions testsuite/features/step_definitions/navigation_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -804,10 +804,16 @@
end

Then(/^I should only see success signs in the product list$/) do
raise ScriptError, 'No product synchronized' if page.has_no_xpath?('//*[contains(@class, \'fa-check-circle\')]')
raise ScriptError, 'At least one product is not fully synchronized' if page.has_xpath?('//*[contains(@class, \'fa-spinner\')]')
raise ScriptError, 'Warning detected' if page.has_xpath?('//*[contains(@class, \'fa-exclamation-triangle\')]')
raise ScriptError, 'Error detected' if page.has_xpath?('//*[contains(@class, \'fa-exclamation-circle\')]')
begin
raise ScriptError, 'No product synchronized' if page.has_no_xpath?('//*[contains(@class, \'fa-check-circle\')]')
raise ScriptError, 'At least one product is not fully synchronized' if page.has_xpath?('//*[contains(@class, \'fa-spinner\')]')
raise ScriptError, 'Warning detected' if page.has_xpath?('//*[contains(@class, \'fa-exclamation-triangle\')]')
raise ScriptError, 'Error detected' if page.has_xpath?('//*[contains(@class, \'fa-exclamation-circle\')]')
rescue ScriptError
log 'Check below the list of products for more details:'
get_target('server').run('echo -e "admin\nadmin\n" | mgr-sync list channels', verbose: true, check_errors: false, buffer_size: 1_000_000)
raise
end
end

Then(/^I select the "([^"]*)" repo$/) do |repo|
Expand Down
2 changes: 1 addition & 1 deletion testsuite/features/step_definitions/setup_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@
step %(I should see a "#{target_channel}" text)

xpath = "//label[contains(text(), '#{target_channel}')]"
channel_checkbox_id = find(:xpath, xpath)['for']
channel_checkbox_id = find(:xpath, xpath, match: :first)['for']

raise ScriptError, "Field #{channel_checkbox_id} is checked" if has_checked_field?(channel_checkbox_id)

Expand Down

0 comments on commit 698ed4c

Please sign in to comment.