-
Notifications
You must be signed in to change notification settings - Fork 40
Working with Context Menu
Let's say that we want to perform some action by selecting an option from the context menu. How to do that? Here's an example:
@Test
public void editComponentFromContextMenu() {
SectionHeaderComponent sectionHeaderComponent = parsys.insertComponent(SectionHeaderComponent.class);
AemContextMenu contextMenu = parsys.openContextMenuFirstComponent(SectionHeaderComponent.class);
contextMenu.clickOption(MenuOption.EDIT);
sectionHeaderComponent.getDialog().ok();
}
In the first line we are inserting our SectionHeaderComponent
into parsys. If you don't know how to find and use parsys on the page, please refer to Finding a parsys tutorial where we defined it in this class. Then we are obtaining AemContextMenu
from first component in the parsys (you can select also n-th component if you want, but in this case we are inserting only one component to the empty parsys). Using obtained AemContextMenu
instance we can click on desired option using MenuOption
enum.
As the click action on Edit option causes dialog window to open - we can get it form the component's instance and click OK button to close it.
- 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