pyrite 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/pyrite/dsl.rb +9 -8
- metadata +3 -3
    
        data/lib/pyrite/dsl.rb
    CHANGED
    
    | @@ -38,7 +38,7 @@ module Pyrite | |
| 38 38 |  | 
| 39 39 | 
             
                # Press a button based on its text
         | 
| 40 40 | 
             
                def press(text)
         | 
| 41 | 
            -
                  browser.click("css=input[type=submit][value='#{text}']") | 
| 41 | 
            +
                  browser.click("css=input[type=submit][value='#{text}']")
         | 
| 42 42 | 
             
                end
         | 
| 43 43 |  | 
| 44 44 | 
             
                # Check a chek box or toggle a radio button
         | 
| @@ -66,8 +66,8 @@ module Pyrite | |
| 66 66 | 
             
                end
         | 
| 67 67 |  | 
| 68 68 | 
             
                # Wait for a frame with a give ID to finish loading
         | 
| 69 | 
            -
                def wait_for_frame(frame) | 
| 70 | 
            -
                  browser.wait_for_frame_to_load(frame,  | 
| 69 | 
            +
                def wait_for_frame(frame)
         | 
| 70 | 
            +
                  browser.wait_for_frame_to_load(frame, 10000)
         | 
| 71 71 | 
             
                end
         | 
| 72 72 |  | 
| 73 73 | 
             
                # Excecute commands within an iframe, then switch back to the parent frame
         | 
| @@ -76,9 +76,10 @@ module Pyrite | |
| 76 76 | 
             
                #      click "Submit"
         | 
| 77 77 | 
             
                #    end
         | 
| 78 78 | 
             
                def inside_iframe(frame)
         | 
| 79 | 
            -
                   | 
| 79 | 
            +
                  # massive hack but the only way to reliably wait
         | 
| 80 | 
            +
                  # for the frame
         | 
| 81 | 
            +
                  sleep 2
         | 
| 80 82 | 
             
                  browser.select_frame(frame)
         | 
| 81 | 
            -
                  wait_for_frame frame
         | 
| 82 83 | 
             
                  yield
         | 
| 83 84 | 
             
                  browser.select_frame("relative=parent")
         | 
| 84 85 | 
             
                end
         | 
| @@ -87,12 +88,12 @@ module Pyrite | |
| 87 88 | 
             
                # i.e.
         | 
| 88 89 | 
             
                #    follow 'delete'
         | 
| 89 90 | 
             
                #    get_confirmation
         | 
| 90 | 
            -
                #     | 
| 91 | 
            +
                #    assert_no_element "h2:contains('user1')"
         | 
| 91 92 | 
             
                def get_confirmation
         | 
| 92 93 | 
             
                  browser.get_confirmation
         | 
| 93 94 | 
             
                end
         | 
| 94 95 |  | 
| 95 | 
            -
                # drag an css selector to the center pixel of another, e.g. | 
| 96 | 
            +
                # drag an css selector to the center pixel of another, e.g.
         | 
| 96 97 | 
             
                #    `drag_and_drop(:from => "li#element_#{my_oject.id}", :to => "div#trash")
         | 
| 97 98 | 
             
                # ProTip: if you have a list of elements you wish to re-order, drag the top element down.
         | 
| 98 99 | 
             
                def drag_and_drop(opts={})
         | 
| @@ -106,7 +107,7 @@ module Pyrite | |
| 106 107 | 
             
                  browser.capture_entire_page_screenshot(image, '')
         | 
| 107 108 | 
             
                  puts `open #{image}`
         | 
| 108 109 | 
             
                end
         | 
| 109 | 
            -
             | 
| 110 | 
            +
             | 
| 110 111 | 
             
                # Write the HTML of a page to a file and open it.
         | 
| 111 112 | 
             
                # (probably only works on OS X)
         | 
| 112 113 | 
             
                def code_me
         | 
    
        metadata
    CHANGED
    
    | @@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version | |
| 5 5 | 
             
              segments: 
         | 
| 6 6 | 
             
              - 0
         | 
| 7 7 | 
             
              - 5
         | 
| 8 | 
            -
              -  | 
| 9 | 
            -
              version: 0.5. | 
| 8 | 
            +
              - 2
         | 
| 9 | 
            +
              version: 0.5.2
         | 
| 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- | 
| 18 | 
            +
            date: 2010-04-16 00:00:00 +01:00
         | 
| 19 19 | 
             
            default_executable: 
         | 
| 20 20 | 
             
            dependencies: 
         | 
| 21 21 | 
             
            - !ruby/object:Gem::Dependency 
         |