Consider the following case where page flow is configurable in AUT.

According to flow one page flow is Review Page -> Passenger Page – > Payment Page

Another possible flow is Review Page -> Payment Page.

Dynamic Linked Pages

Blow sample shows you the implementation for such case.


public class ReviewFlightPage extends WebDriverBaseTestPage<ReviewPage> implements PaymentLocators, PaymentsPageLauncher {

}

 
public class PassengerPage extends WebDriverBaseTestPage<ReviewFlightPage> implements PaymentLocators, PaymentsPageLauncher {

}

 
public class PaymentPage extends WebDriverBaseTestPage<PaymentsPageLauncher> implements PaymentLocators{

  protecte void initParent() {
  
    this.parent= (pageProps.getInt(review.next.flow) == 6)
    
    ? new ReviewFlightPage()
    
    : new PassengerPage();
  
  }

}