░▒▓████████████████████████████████▓▒░ ░▒▓█ ▓▒░ ░▒▓█ ~ S W A M P ~ ▓▒░ ░▒▓█ ▓▒░ ░▒▓████████████████████████████████▓▒░
pplmvsvm
LOCATION:
/var/www/canvas/vendor/bundle/ruby/3.1.0/gems/headless-2.3.1/spec
☗ ROOT
↻ REFRESH
✎ CARVE FLESH
EDITING: integration_spec.rb
require 'headless' require 'selenium-webdriver' describe 'Integration test' do let!(:headless) { Headless.new } before { headless.start } after { headless.destroy_sync } it 'should use xvfb' do work_with_browser end it 'should record screenshots' do headless.take_screenshot("test.jpg") expect(File.exist?("test.jpg")).to eq true end it 'should record video with ffmpeg' do headless.video.start_capture work_with_browser headless.video.stop_and_save("test.mov") expect(File.exist?("test.mov")).to eq true end it 'should raise an error when trying to create the same display' do expect { FileUtils.mv("/tmp/.X#{headless.display}-lock", "/tmp/headless-test-tmp") Headless.new(display: headless.display, reuse: false) }.to raise_error(Headless::Exception, /troubleshooting guide/) FileUtils.mv("/tmp/headless-test-tmp", "/tmp/.X#{headless.display}-lock") end private def work_with_browser driver = Selenium::WebDriver.for :firefox driver.navigate.to 'http://google.com' expect(driver.title).to match(/Google/) driver.close end end
CANCEL
Name
Type
Size
Modified
Actions
↩ ..
DIR
—
—
📄 headless_spec.rb
RB
8.9 KB
2023-09-24 03:47
EDIT
📄 integration_spec.rb
RB
1.1 KB
2023-09-24 03:47
EDIT
📄 video_recorder_spec.rb
RB
4.2 KB
2023-09-24 03:47
EDIT