Class: Playwright::Video

Inherits:
Object
  • Object
show all
Defined in:
lib/playwright/video.rb

Instance Method Summary collapse

Constructor Details

#initialize(page) ⇒ Video

Returns a new instance of Video.



3
4
5
6
7
8
9
10
11
# File 'lib/playwright/video.rb', line 3

def initialize(page)
  @page = page
  @artifact = Concurrent::Promises.resolvable_future
  if @page.closed?
    on_page_closed
  else
    page.once('close', -> { on_page_closed })
  end
end

Instance Method Details

#deleteObject



36
37
38
39
40
# File 'lib/playwright/video.rb', line 36

def delete
  wait_for_artifact_and do |artifact|
    artifact.delete
  end
end

#pathObject



24
25
26
27
28
# File 'lib/playwright/video.rb', line 24

def path
  wait_for_artifact_and do |artifact|
    artifact.absolute_path
  end
end

#save_as(path) ⇒ Object



30
31
32
33
34
# File 'lib/playwright/video.rb', line 30

def save_as(path)
  wait_for_artifact_and do |artifact|
    artifact.save_as(path)
  end
end