Commit 6b5a9c58 authored by 王志成's avatar 王志成
Browse files

打开网页使用width属性设置浏览器宽度

No related merge requests found
Showing with 3 additions and 0 deletions
+3 -0
......@@ -59,6 +59,9 @@ module Webshot
full = opts.fetch(:full, true)
selector = opts.fetch(:selector, nil)
allowed_status_codes = opts.fetch(:allowed_status_codes, [])
Capybara.page.driver.browser.resize(width, height)
# Check response code
status_code = page.driver.status_code.to_i
unless valid_status_code?(status_code, allowed_status_codes)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment