package ui;

import framework.BrowserManager;
import org.openqa.selenium.WebDriver;
//import ui.pages.ConferenceRoomsPage;
import ui.pages.LoginPage;

/**
 * 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 = "https://172.20.208.216:4040/admin/#/login";
    private  String baseMainPage = "https://172.20.208.216:4040/admin/#/admin";
    private String baseConferenceRooms = "https://172.20.208.121:4040/admin/#/admin/rooms/";

    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 LoginPage navigateToLoginPage(){
      goToURL(baseLoginURL);
        return  new LoginPage();
    }

    public BaseMainPageObject navigateToMainPage(){
        goToURL(baseMainPage);
        System.out.println("Entered to navigate Main Page");
        return  new BaseMainPageObject();
    }

    public void closeLoginPage(){
        driver.close();
    }
}

@@ -39,16 +39,53 @@
 anager;%0A
+import framework.CredentialsManager;%0A
 import o
@@ -114,16 +114,16 @@
 Driver;%0A
-
 //import
@@ -488,51 +488,58 @@
 L = 
-%22https://172.20.208.216:4040/admin/#/login%22
+CredentialsManager.getInstance().getBaseAdminURL()
 ;%0A  
@@ -956,16 +956,17 @@
       %7D%0A
+%0A
         
@@ -1286,24 +1286,26 @@
 oginPage()%7B%0A
+  
       goToUR
@@ -1321,16 +1321,16 @@
 inURL);%0A
-
         
@@ -1448,69 +1448,8 @@
 e);%0A
-        System.out.println(%22Entered to navigate Main Page%22);%0A
     
@@ -1484,33 +1484,32 @@
 Object();%0A    %7D%0A
-%0A
     public void 
@@ -1556,10 +1556,9 @@
 ;%0A    %7D%0A
+
 %7D
-%0A

Update the PageTransporter.java file for read the information from environment.js file