package ui;

import framework.BrowserManager;
import framework.CredentialsManager;
import org.openqa.selenium.WebDriver;
import ui.pages.ConferenceRoomsPage;
import ui.pages.LoginPage;
import ui.pages.tablet.LoginTablePage;


/**
 * Created with IntelliJ IDEA.
 * User: DamianVillanueva
 * Date: 12/7/15
 * Time: 8:33 PM
 * To change this template use File | Settings | File Templates.
 */
public class PageTransporter {

    private WebDriver driver = BrowserManager.getInstance().getDriver();
    private String baseLoginURL = CredentialsManager.getInstance().getBaseAdminURL();
    private  String baseMainPage = "https://172.20.208.216:4040/admin/#/admin";
    private String baseConferenceRooms = "https://172.20.208.121:4040/admin/#/admin/rooms/";
    private String baseTabletLoginPage= "https://172.20.208.216:4040/tablet";

    private static PageTransporter instance;

    protected PageTransporter() {
        initialize();
    }

    public static PageTransporter getInstance() {
        if(instance == null) {
            instance = new PageTransporter();
        }

        return instance;
    }

    private void initialize() {
//        log.info("Initialize the page transporter");
    }

    private void goToURL(String url) {
        driver.navigate().to(url);
    }

    public String getCurrentURL() {
        return driver.getCurrentUrl();
    }

    public ConferenceRoomsPage navigateToConferenceRoomPage() {
        goToURL(baseConferenceRooms);
        return new ConferenceRoomsPage();
    }

    public LoginPage navigateToLoginPage(){
        goToURL(baseLoginURL);
        return  new LoginPage();
    }

    public BaseMainPageObject navigateToMainPage(){
        goToURL(baseMainPage);
        return  new BaseMainPageObject();
    }

    public LoginTablePage navigateToLoginTablePage(){
        goToURL(baseTabletLoginPage);
       return new LoginTablePage();
    }

    public void closeLoginPage(){
        driver.close();
    }
}
@@ -521,16 +521,28 @@
 ginURL =
+%0A           
  Credent
@@ -548,38 +548,80 @@
 tialsManager
-.getInstance()
+%0A                    .getInstance()%0A                    
 .getBaseAdmi
@@ -626,16 +626,29 @@
 minURL()
+%0A            
 ;%0A    pr
@@ -679,223 +679,285 @@
 ge =
- %22https://172.20.208.216:4040/admin/#/admin%22;%0A    private String baseConferenceRooms = %22https://172.20.208.121:4040/admin/#/admin/rooms/%22;%0A    private String baseTabletLoginPage= %22https://172.20.208.216:4040/tablet%22
+%0A            CredentialsManager%0A                    .getInstance()%0A                    .getBaseMainURL()%0A            ;%0A    private String baseTabletLoginPage=%0A            CredentialsManager%0A                    .getInstance()%0A                    .getBaseTabletURL()%0A            
 ;%0A%0A 
@@ -1495,159 +1495,8 @@
  %7D%0A%0A
-    public ConferenceRoomsPage navigateToConferenceRoomPage() %7B%0A        goToURL(baseConferenceRooms);%0A        return new ConferenceRoomsPage();%0A    %7D%0A%0A
     

Read the variables of CredentialManager