Sha256: b64d191053cc46dade3c0d71f53694c4b9fccebede98f83c082e51400712d4d4

Contents?: true

Size: 621 Bytes

Versions: 6

Compression:

Stored size: 621 Bytes

Contents

module Capybara
  module Angular
    module DSL
      include Capybara::DSL

      Capybara::Session::DSL_METHODS.each do |method|
        define_method(method) do |*args, &block|
          page.send(method, *args, &block)
        end
      end

      def page
        wait_until_angular_ready unless @ignoring_angular
        Capybara.current_session
      end

      def wait_until_angular_ready
        Waiter.new(Capybara.current_session).wait_until_ready
      end

      def ignoring_angular
        @ignoring_angular = true
        yield
      ensure
        @ignoring_angular = false
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
capybara-angular-0.2.6 lib/capybara/angular/dsl.rb
capybara-angular-0.2.5 lib/capybara/angular/dsl.rb
capybara-angular-0.2.4 lib/capybara/angular/dsl.rb
capybara-angular-0.2.3 lib/capybara/angular/dsl.rb
capybara-angular-0.2.2 lib/capybara/angular/dsl.rb
capybara-angular-0.1.2 lib/capybara/angular/dsl.rb