This repository has been archived by the owner on Nov 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 40
AemContentFinder
Daniel Madejek edited this page Jul 13, 2016
·
2 revisions
#Aem Content Finder
AEM page in classic authoring mode has Content Finder. Bobcat allows to access it by using AemContentFinder class
All methods are described in javadoc
@Inject
private AemContentFinder contentFinder;
AemContentFinder can be injected into test or page
contentFinder.clickTab("Images");
Switching tabs using their names
contentFinder.search("");
Using search field
contentFinder.getResults();
Retrieving search results
contentFinder.getElementByIndex(0)
Retriving first element from list
This test uses AemContentFinder to change image in Image component
package example;
import static org.junit.Assert.assertTrue;
import java.util.List;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import com.cognifide.qa.bb.aem.ui.AemContentFinder;
import com.cognifide.qa.bb.junit.Modules;
import com.cognifide.qa.bb.junit.TestRunner;
import com.cognifide.qa.bb.provider.selenium.BobcatWait;
import com.google.inject.Inject;
import example.GuiceModule;
import example.pageobjects.login.LoginPage;
import example.pageobjects.summer.ImageComponent;
import example.pageobjects.summer.SummerBlockbusterHitsPage;
@RunWith(TestRunner.class)
@Modules(GuiceModule.class)
public class ImageComponentTest {
@Inject
private LoginPage loginPage;
@Inject
private SummerBlockbusterHitsPage page;
@Inject
private AemContentFinder contentFinder;
private ImageComponent imageComponent;
@AfterClass()
public static void afterClass() {
BobcatWait.sleep(1);
}
@Before
public void before() {
logIn();
openPageToTest();
imageComponent = page.getImageComponent();
}
private void openPageToTest() {
page.open();
assertTrue("Page is not displayed", page.isDisplayed());
}
private void logIn() {
assertTrue("Login page is not displayed", loginPage.loginAsAuthor().isDisplayed());
}
@Test
public void insertImageTest() {
contentFinder.clickTab("Images");
contentFinder.search("");
List<String> results = contentFinder.getResults();
if (results.size() > 0) {
imageComponent.getDialog().open();
imageComponent.insert(contentFinder.getElementByIndex(0));
imageComponent.getDialog().ok();
assertTrue("Image not found",
results.get(0).contains(imageComponent.getImgAttribute("title")));
}
}
}
- Configuring Bobcat
- Selenium enhancements
- Cucumber enhancements
- Traffic analyzer
- Email support
- Reporting
- Cloud integration
- Mobile integration
- Executing tests on different environments
- Working with multiple threads
- Tips and tricks
- Authoring tutorial - Classic
- AEM Classic Authoring Advanced usage
- Siteadmin
- Sidekick
- Aem Component
- Working with author pages
- Working with Publish pages
- Advanced component interactions
- Working with Context Menu
- Using Aem Content Tree
- Aem Content Finder
- Storing component configurations
- Working with packages
- Jcr Support
- Authoring tutorial - Touch UI
- Adding and editing a component
- Sites management tutorial