title: Is Ruby compatible with strict Page Object Pattern?
body: <p>I have built various Test Automation frameworks using the Page Object Pattern with Java (<a href="https://code.google.com/p/selenium/wiki/PageObjects">https://code.google.com/p/selenium/wiki/PageObjects</a>).  </p>
  
  <p>Two of the big benefits I have found are:</p>
  
  <p>1) You can see what methods are available when you have an instance of a page (e.g. typing <code>homepage.</code> will show me all the actions/methods you can call from the homepage)</p>
  
  <p>2) Because navigation methods (e.g. <code>goToHomepage()</code>) return an instance of the subsequent page (e.g. homepage), you can navigate through your tests simply by writing the code and seeing where it takes you. </p>
  
  <p>e.g. </p>
  
  <pre><code>WelcomePage welcomePage = loginPage.loginWithValidUser(validUser);
  PaymentsPage paymentsPage = welcomePage.goToPaymentsPage();
  </code></pre>
  
  <p>These benefits work perfectly with Java since the type of object (or page in this case) is known by the IDE.</p>
  
  <p>However, with Ruby, the object type is not fixed at any point and is often ambiguous to the IDE. Therefore, I cannot see how you can realise these benefits on an automation suite built using Ruby (e.g. by using Cucumber).</p>
  
  <p>Can anyone show me how you would use Ruby with the Page Object Pattern to gain these benefits?</p>