Last active
April 30, 2020 15:02
-
-
Save nadvolod/f07e45cae6799042974ed0b1127df954 to your computer and use it in GitHub Desktop.
A test that shows how to use composition
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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