Module: Appom::Helpers::VisualHelpers

Defined in:
lib/appom/helpers.rb

Overview

Phase 2 Visual testing helpers

Instance Method Summary collapse

Instance Method Details

#screenshot_with_highlight(element_name, filename: nil) ⇒ Object

Take screenshot with element highlighted



281
282
283
284
# File 'lib/appom/helpers.rb', line 281

def screenshot_with_highlight(element_name, filename: nil) # rubocop:disable Lint/UnusedMethodArgument
  element = send(element_name)
  Visual.test_helpers.highlight_element(element)
end

#visual_regression_test(test_name, options = {}) ⇒ Object

Visual regression test for current page



287
288
289
# File 'lib/appom/helpers.rb', line 287

def visual_regression_test(test_name, options = {})
  Visual.regression_test(test_name, options)
end

#wait_for_visual_stability(element_name = nil) ⇒ Object

Wait for visual stability before continuing



292
293
294
295
# File 'lib/appom/helpers.rb', line 292

def wait_for_visual_stability(element_name = nil, **)
  element = element_name ? send(element_name) : nil
  Visual.test_helpers.wait_for_visual_stability(element: element, **)
end