Project

pudi

0.0
No commit activity in last 3 years
No release in over 3 years
Get count of http request fired by a web app
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0

Runtime

 Project Readme

Pudi

Gives total number of https requests made at any given point. Ajax calls are also included.

Example Applications

  • To assert if a page/section is not reloading, as part of an action
beforeCount = getHttpRequestCount()
#<do some operations here>
afterCount = getHttpRequestCount()
beforeCount.should eq afterCount
  • To assert if a page/section is reloading, as part of an action
beforeCount = getHttpRequestCount()
#<do some operations here>
afterCount = getHttpRequestCount()
beforeCount.should < afterCount
#though we might need other assertions here

Usage

#Gemfile
gem 'pudi'

Cucumber

# In env.rb
require 'pudi'

firefox_profile = Selenium::WebDriver::Firefox::Profile.new
firefox_profile.add_extension File.join(Gem::Specification.find_by_name("pudi").gem_dir,"/lib/pudi/pudi.xpi")

Capybara.register_driver :selenium do |app|
  Capybara::Selenium::Driver.new(app, :browser => :firefox, :profile => firefox_profile)
end

ToDo

  1. Capture javascript errors
  2. Capture failed http requests