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

Sidekick

Mikołaj Mański edited this page Jul 18, 2016 · 6 revisions

Sidekick

Introduction

Bobcat provides classes that allows to perform actions on AEM Classic Sidekick.

Description

Sidekick Description

Main elements:

  • AemSidekick - page object that represents whole sidekick
  • SidekickActions - helper class for performing operations (included in AemSideKick)
  • SidekickTab - enum for tabs on sidekick (marked by red color)
  • ModeIcon - enum for choosing different sidekick modes (marked by blue color)
  • PageOperation - enum for choosing different page operations (marked by black color)
  • SidekickSection - enum for opening different sections if they are available on tab (marked by green color)

Usage Examples

For all available methods please look into javadoc

Opening component group on "Components" tab
sidekick.clickComponentGroupToggle("General");
Checking if component group is present on "Components" tab
sidekick.isComponentGroupPresent("General");
Checking if component is present on "Components" tab
sidekick.isComponentPresent("Component", "Incorrect group");
Activating page
sidekick.activatePage();
Opening page properties dialog
sidekick.clickTab(SidekickTab.PAGE);
sidekick.clickOperation(PageOperation.PAGE_PROPERTIES);
Go to preview mode
sidekick.clickModeIcon(ModeIcon.PREVIEW);

Example test

The example below shows how to implement a test for activating page from the sidekick:

package com.cognifide.test.summer;

import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;

import com.cognifide.qa.bb.aem.AemLogin;
import com.cognifide.qa.bb.aem.ui.messages.AemBubbleMessage;
import com.cognifide.qa.bb.aem.ui.sidekick.AemSidekick;
import com.cognifide.qa.bb.junit.Modules;
import com.cognifide.qa.bb.junit.TestRunner;
import com.cognifide.test.GuiceModule;
import com.google.inject.Inject;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;

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

  private static final String PAGE_SUCCESSFULLY_ACTIVATED_MESSAGE = "Page successfully activated";

  @Inject
  private AemLogin aemLogin;

  @Inject
  private SummerBlockbusterHitsPage summerBlockbusterHitsPage;

  @Inject
  private AemSidekick sidekick;

  @Inject
  private AemBubbleMessage bubbleMessage;

  @Before
  public void openSiteadminPage() {
    aemLogin.authorLogin();
    summerBlockbusterHitsPage.open();
    assertTrue(summerBlockbusterHitsPage.isDisplayed());
  }

  @Test
  public void pageShouldBeActivatedProperlyUsingSidekick() {
    sidekick.activatePage();
    String bubbleMessageText = bubbleMessage.waitForAemBubbleMessage().getBubbleMessageText();
    assertThat(bubbleMessageText, is(PAGE_SUCCESSFULLY_ACTIVATED_MESSAGE));
  }

}

The only one thing to explain here is actually the AemBubbleMessage - you can use that when you want to check the notification info that AEM sends you via bubble message as shown below:

Bubble message

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