Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A test that shows how to use composition
public class CompositionTest
{
@Test
public void aTestUsingComposition() {
InventoryPage inventoryPage = new InventoryPage(driver);
inventoryPage.open();
//If you want to interact with the header
HeaderComponent header = new HeaderComponent(driver);
header.search("backpack");
//If you want to interact with items on the page
InventoryCollectionComponent collection = new InventoryCollectionComponent(driver);
//Here is us using composition to reference an Item inside of the Collection
collection.item.addToCart(ItemType.hoodie);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.