class Playwright::DSL::SceneDSL
Defines an actor in a stage. The block is only evaluated once when the method is called the first time.
class ExampleStage < Playwright::Stage actors do actor(:buyer) { User.first! } actor(:seller) { User.first! } end scenes do scene PurchaseProduct, from: :buyer, to: :seller end end
Constants
- SceneWithActors
Attributes
scenes[R]
Public Instance Methods
scene(klass, options)
click to toggle source
# File lib/playwright/dsl/scene_dsl.rb, line 37 def scene(klass, options) if klass.kind_of?(Class) accessor = klass.name.demodulize.underscore else accessor = klass.to_s klass = accessor.camelize.constantize end @scenes[accessor] = SceneWithActors.new(klass, options[:from], options[:to]) end