0

I have a cucumber project that uses Cheezy Page Objects.

Everything is working fine but as I was already with too many page object classes I decided to move them from the /pages folder to some subfolders (/pages/homepage, /pages/checkout_page).

The problem is that now the steps don't recognize the classes (I get the error Homepage not found). I'm sure this is a simple question, but how can I make this work?

Thanks

Also, I have this on the env.rb

  Dir[$PROJECT_ROOT + '/pages/*.rb'].each {|file| require file }
Justin Ko
  • 46,526
  • 5
  • 91
  • 101
Tiago
  • 673
  • 1
  • 8
  • 24

1 Answers1

0

Ok,

I found the solution here: Ruby: Iterate thought all .rb (including subfolders) files in the folder

I needed to change

Dir[$PROJECT_ROOT + '/pages/*.rb'].each {|file| require file }

to

Dir[$PROJECT_ROOT + '/pages/**/*.rb'].each {|file| require file }

Thaks anyway :)

Community
  • 1
  • 1
Tiago
  • 673
  • 1
  • 8
  • 24