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

Adding a component into parsys

Mikołaj Mański edited this page Jul 26, 2016 · 7 revisions

Adding a component into parsys

Since we have control of the parsys into which we want to insert our component, let's create our test scenario implementation now:

@Test
public void testAddingAndEditingSectionHeader() {
	SectionHeaderComponent sectionHeaderComponent = parsys.insertComponent(SectionHeaderComponent.class);

	//wait until page reloads after modifying the component
	assertTrue(summerBlockbusterHitsPage.isDisplayed());
	sectionHeaderComponent = parsys.getFirstComponentOfType(SectionHeaderComponent.class);

	assertThat(sectionHeaderComponent , CoreMatchers.notNullValue());
}

In the first line we are inserting the Section Header Component into our parsys. Class of this component has the following annotation:

@AemComponent(cssClassName = "section-header", group = "Geometrixx Media", name = "Section Header")

It provides information where the component is located in the sidekick so Bobcat can select appropriate component group and component itself to insert it.

Section Header component in the sidekick

The cssClassName property is helpful during component presence verification. This test case only inserts a component and checks whether it has been added to the page properly. The next step of this tutorial will be focuses on configuring a component using a configuration dialog window.

This is a part of AEM Authoring tutorial, please refer to other tutorial steps:

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