Class: Applitools::Selenium::DomSnapshotScript
- Inherits:
-
Object
- Object
- Applitools::Selenium::DomSnapshotScript
- Defined in:
- lib/applitools/selenium/visual_grid/dom_snapshot_script.rb
Defined Under Namespace
Classes: DomSnapshotScript, RecursiveSnapshotter
Instance Attribute Summary collapse
-
#driver ⇒ Object
Returns the value of attribute driver.
Instance Method Summary collapse
- #create_dom_snapshot(dont_fetch_resources, urls_to_skip, cross_origin_rendering, use_cookies) ⇒ Object
-
#initialize(driver) ⇒ DomSnapshotScript
constructor
A new instance of DomSnapshotScript.
Constructor Details
#initialize(driver) ⇒ DomSnapshotScript
Returns a new instance of DomSnapshotScript.
12 13 14 |
# File 'lib/applitools/selenium/visual_grid/dom_snapshot_script.rb', line 12 def initialize(driver) self.driver = driver end |
Instance Attribute Details
#driver ⇒ Object
Returns the value of attribute driver.
10 11 12 |
# File 'lib/applitools/selenium/visual_grid/dom_snapshot_script.rb', line 10 def driver @driver end |
Instance Method Details
#create_dom_snapshot(dont_fetch_resources, urls_to_skip, cross_origin_rendering, use_cookies) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/applitools/selenium/visual_grid/dom_snapshot_script.rb', line 16 def create_dom_snapshot( dont_fetch_resources, urls_to_skip, cross_origin_rendering, ) serialize_resources = true compress_resources = false script = DomSnapshotScript.new(driver, urls_to_skip, dont_fetch_resources, serialize_resources, compress_resources) snapshotter = RecursiveSnapshotter.new(driver, script, cross_origin_rendering, ) begin snapshotter.create_cross_frames_dom_snapshots rescue StandardError => e Applitools::EyesLogger.error e.class.to_s Applitools::EyesLogger.error e. raise ::Applitools::EyesError.new 'Error while getting dom snapshot!' end end |