Last active
July 18, 2024 10:51
-
-
Save SarahElson/3c12d6eed4f836cb8434cea18c812dc5 to your computer and use it in GitHub Desktop.
What Is the Single Responsibility Principle (SRP)?
This file contains hidden or 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
package com.lambdatest.mainpagecomponents; | |
import com.lambdatest.pagecomponents.MyAccountPage; | |
import com.lambdatest.pagecomponents.NavigationBar; | |
import com.lambdatest.pagecomponents.SearchProduct; | |
import com.lambdatest.pagecomponents.SpecialLinkBar; | |
import org.openqa.selenium.WebDriver; | |
import org.openqa.selenium.support.PageFactory; | |
public class LambdaTestHomePage { | |
private WebDriver driver; | |
private SearchProduct searchProduct; | |
private SpecialLinkBar specialLinkBar; | |
private NavigationBar navigationBar; | |
private MyAccountPage myAccountPage; | |
public LambdaTestHomePage(final WebDriver driver){ | |
this.driver=driver; | |
this.searchProduct= PageFactory.initElements(driver,SearchProduct.class); | |
this.specialLinkBar= PageFactory.initElements(driver,SpecialLinkBar.class); | |
this.navigationBar= PageFactory.initElements(driver,NavigationBar.class); | |
this.myAccountPage=PageFactory.initElements(driver,MyAccountPage.class); | |
} | |
public void goTo() { | |
this.driver.get("https://ecommerce-playground.lambdatest.io/"); | |
} | |
public SearchProduct getSearchProduct() { | |
return searchProduct; | |
} | |
public NavigationBar getNavigationBar() { | |
return navigationBar; | |
} | |
public SpecialLinkBar getSpecialLinkBar() { | |
return specialLinkBar; | |
} | |
public MyAccountPage myAccountPage(){ | |
return myAccountPage; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment