Sha256: 7658290c251e30005bbba0fff1a9d7a6fa69759a91c7087cd45806519ea386e8

Contents?: true

Size: 756 Bytes

Versions: 22

Compression:

Stored size: 756 Bytes

Contents

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'ruby-jmeter'

module RubyJmeter
  class ExtendedDSL < DSL
    def test_method_here
      puts "here be dragons"
    end
  end
end

# Define your page objects
class HomePage
  def initialize(dsl)
    @dsl = dsl
  end

  def test_method_unreachable
    puts "I can never be reached from ExtendedDSL"
  end

  def visit
    get name: 'home', url: '/' do
      test_method_here
    end
  end

  private

  def method_missing method, *args, &block
    @dsl.__send__ method, *args, &block
  end
end

test do
  threads count: 1 do
    # then re-use your page objects in your test plan
    home = HomePage.new(self)
    home.visit
  end
end.run(path: '/usr/share/jmeter/bin/', gui: true)

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
ruby-jmeter-3.1.08 examples/real_page_objects.rb
ruby-jmeter-3.1.07 examples/real_page_objects.rb
ruby-jmeter-3.1.06 examples/real_page_objects.rb
ruby-jmeter-3.1.05 examples/real_page_objects.rb
ruby-jmeter-3.1.04 examples/real_page_objects.rb
ruby-jmeter-3.1.03 examples/real_page_objects.rb
ruby-jmeter-3.1.02 examples/real_page_objects.rb
ruby-jmeter-3.1.01 examples/real_page_objects.rb
ruby-jmeter-3.0.13 examples/real_page_objects.rb
ruby-jmeter-3.0.12 examples/real_page_objects.rb
ruby-jmeter-3.0.11 examples/real_page_objects.rb
ruby-jmeter-3.0.10 examples/real_page_objects.rb
ruby-jmeter-3.0.9 examples/real_page_objects.rb
ruby-jmeter-3.0.8 examples/real_page_objects.rb
ruby-jmeter-3.0.7 examples/real_page_objects.rb
ruby-jmeter-3.0.6 examples/real_page_objects.rb
ruby-jmeter-3.0.5 examples/real_page_objects.rb
ruby-jmeter-3.0.4 examples/real_page_objects.rb
ruby-jmeter-3.0.3 examples/real_page_objects.rb
ruby-jmeter-3.0.2 examples/real_page_objects.rb