How can I do the scenario below: (the purpose is to be able to run all selenium scripts I have or only run some scripts I want if I pass test files as arguments from terminal window with the below code and scenario:
if test files are passed in terminal window
then system will run below codes:
scripts = ENV[scripts].plit(',')
FileList[scripts].each { |file|
system("ruby #{file} > #{directory_name}/#{file}.out")}
if test files are NOT passed in terminal window (it means I want to run all scripts I have in my test suite), then system will run below codes:
FileList['test*.rb'].each { |file|
system("ruby #{file} > #{directory_name}/#{file}.out")}
If I understand correctly, can you just use an
ifstatement?