Skip to content

Commit

Permalink
chore: skip broken capybara test
Browse files Browse the repository at this point in the history
  • Loading branch information
route committed Feb 18, 2024
1 parent ef47a1d commit c8d0768
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ jobs:
with:
name: footprints
path: /tmp/cuprite/
overwrite: true
5 changes: 3 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ module TestSessions
#has_css? with spatial requirements accepts spatial options
#has_css? with spatial requirements supports spatial sugar
#fill_in should fill in a textarea in a reasonable time by default
#has_element? should be true if the given element is on the page
REGEXP

metadata[:skip] = true if metadata[:full_description].match(/#{regexes}/)
Expand Down Expand Up @@ -119,15 +120,15 @@ def save_exception_artifacts(browser, meta)
end

def save_exception_screenshot(browser, filename, line_number, timestamp)
screenshot_name = "screenshot-#{filename}-#{line_number}-#{timestamp}-#{rand(1000)}.png"
screenshot_name = "screenshot-#{filename}-#{line_number}-#{timestamp}.png"
screenshot_path = "/tmp/cuprite/#{screenshot_name}"
browser.screenshot(path: screenshot_path, full: true)
rescue StandardError => e
puts "#{e.class}: #{e.message}"
end

def save_exception_log(browser, filename, line_number, timestamp)
log_name = "logfile-#{filename}-#{line_number}-#{timestamp}-#{rand(1000)}.txt"
log_name = "logfile-#{filename}-#{line_number}-#{timestamp}.txt"
File.binwrite("/tmp/cuprite/#{log_name}", browser.options.logger.string)
rescue StandardError => e
puts "#{e.class}: #{e.message}"
Expand Down

0 comments on commit c8d0768

Please sign in to comment.