Skip to content
This repository has been archived by the owner on Nov 23, 2021. It is now read-only.

Working with author pages

kkarolk edited this page Jul 22, 2016 · 2 revisions

Working with Author pages

AbstractPage class - opening page on author instance

Lets say AEM Author page that you want to test has following properties:

  • content url /content/geometrixx/en/products/square.html,
  • page title Square.

Then Page Object class for Square page will be as follows:

@PageObject
public class SquarePage extends AbstractPage {
 
   private static final String URL = "/content/geometrixx/en/products/square.html";
 
   private static final String PAGE_TITLE = "Square";
 
   @Override
   public String getContentPath() {
      return URL;
   }
 
   @Override
   public String getPageTitle() {
      return PAGE_TITLE;
   }
}

The AbstractPage class provides methods for opening page and verifying that loaded page has proper title.

Let's open Square page and verify that it was properly loaded.

@RunWith(TestRunner.class)
@Modules(GuiceModule.class)
public class SquarePageTest {

  @Inject
  private AemLogin aemLogin;

  @Inject
  private SquarePage squarePage;

  @Test
  public void openSquarePageTest() {
    aemLogin.authorLogin();
    squarePage.open();
    assertTrue(squarePage.isDisplayed());
  }
}

Following methods were implemented in AbstractPage class so you don't have to worry about them:

  • squarePage.open(); is opening page in the browser based on URL = "/content/geometrixx/en/products/square.html" provided in SquarePage class,
  • squarePage.isDisplayed() is verifying that page opened in the browser has proper title based on PAGE_TITLE = "Square" provided in SquarePage class.

Getting started with Bobcat

  1. Getting started

AEM Related Features

  1. Authoring tutorial - Classic
  1. AEM Classic Authoring Advanced usage
  1. Authoring tutorial - Touch UI
Clone this wiki locally