How to decrease automation page objects using 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 HeaderComponent { | |
//All of the things related to the Header go here | |
//Elements related to the header section | |
//Methods to interact with the header | |
} |
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 IndividualItemComponent { | |
public void addToCart(ItemType itemType) | |
{ | |
//actions to add the item to the cart | |
} | |
} |
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 InventoryCollectionComponent { | |
IndividualItemComponent item; | |
} |
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 InventoryPage { | |
HeaderComponent header; | |
InventoryCollectionComponent inventoryCollection; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment