How can I call lanes with parameters from within my lane?

H.WZ picture H.WZ · Nov 30, 2017 · Viewed 9.4k times · Source

I have a Fastfile,and I want to all lanes with parameters from within my lane .How can do this? Just like this:

lane :my_lane do
     other_lane paramter1_name:"1" parameter2:"2"
end

Answer

Artem  Demchenko picture Artem Demchenko · Nov 30, 2017

You should do it in this way:

lane :my_lane do
  other_lane(
    parameter1: '1', 
    parameter2: '2'
  )
end

Hope this helps!

So other lane should be

lane :other_lane do |values|
   parameter1  = values[:parameter1]
   parameter2  = values[:parameter2]
   puts parameter1
   puts parameter2
end