Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
Help us understand the problem. What is going on with this article?

Capybara中に確認したいこと

More than 3 years have passed since last update.

Capybara(Poltergeist)のテスト中にpryしていろいろ中身を確認したいです。そのメモです。

pry
# headerを確認
Capybara.current_session.driver.headers
=> {"User-Agent"=>"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36"}

# selectの中身を確認
page.find_all('#select_time option').map{|m| m.text}
=> ["ご希望の時間帯をお選びください", "【1】10:00 ~ 19:00"]

# 画面サイズを確認したいのですが....これだと上手く取得できない....
Capybara.current_session.driver.client.window_size
=> [1024, 768]

分からない...window_size

pryで止める前に

Capybara.current_session.driver.resize(1000, 2000)

と設定しているのに、なんで、=> [1024, 768]と出力されてしまうのでしょうか。見ている項目が間違っているのでしょうか。。。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away