pyrite 0.5.5 → 0.5.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/pyrite.rb +7 -0
  2. data/lib/pyrite/dsl.rb +10 -6
  3. metadata +3 -3
@@ -6,6 +6,13 @@ DatabaseCleaner.strategy = :truncation
6
6
  require 'pyrite/pyrite_test'
7
7
 
8
8
  module Pyrite
9
+ # set the default JS framework for the AUT
10
+ # e.g `Pyrite.js_framework = :jquery`
11
+ # can be set in pyrite_helper.rb
12
+ # Makes `wait_for :ajax` use the correct JS lib.
13
+ # Defaults to jQuery.
14
+ mattr_accessor :js_framework
15
+ @@js_framework = :jquery
9
16
 
10
17
  # The ip address the RC is running on
11
18
  mattr_accessor :rc_host
@@ -36,7 +36,7 @@ module Pyrite
36
36
  browser.click("link=#{text}")
37
37
  end
38
38
 
39
- # Press a button based on its text
39
+ # Press an submit (not button) input based on its text
40
40
  def press(text)
41
41
  browser.click("css=input[type=submit][value='#{text}']")
42
42
  end
@@ -56,12 +56,16 @@ module Pyrite
56
56
  browser.select("css=#{element}", option)
57
57
  end
58
58
 
59
- # Wait for a specific element or the page to load
59
+ # Wait for a specific element, the page to load
60
+ # or an AJAX request to return
60
61
  def wait_for(element)
61
- if element == :page_load
62
- browser.wait_for_page_to_load :page
63
- else
64
- browser.wait_for :element => "#{element}"
62
+ case element
63
+ when :page_load
64
+ browser.wait_for_page_to_load :page
65
+ when :ajax
66
+ browser.wait_for(:wait_for => :ajax, :javascript_framework => Pyrite.js_framework)
67
+ else
68
+ browser.wait_for :element => "css=#{element}"
65
69
  end
66
70
  end
67
71
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 5
8
- - 5
9
- version: 0.5.5
8
+ - 6
9
+ version: 0.5.6
10
10
  platform: ruby
11
11
  authors:
12
12
  - Adam Rogers
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-04-27 00:00:00 +01:00
18
+ date: 2010-05-10 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency