Skip to content

Instantly share code, notes, and snippets.

@nadvolod
Created April 30, 2020 14:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nadvolod/4d022885d4a8caf12fd9ff1953f9ee4d to your computer and use it in GitHub Desktop.
Save nadvolod/4d022885d4a8caf12fd9ff1953f9ee4d to your computer and use it in GitHub Desktop.
How to decrease automation page objects using composition
public class HeaderComponent {
//All of the things related to the Header go here
//Elements related to the header section
//Methods to interact with the header
}
public class IndividualItemComponent {
public void addToCart(ItemType itemType)
{
//actions to add the item to the cart
}
}
public class InventoryCollectionComponent {
IndividualItemComponent item;
}
public class InventoryPage {
HeaderComponent header;
InventoryCollectionComponent inventoryCollection;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment