package common;

import framework.BrowserManager;
import org.openqa.selenium.By;
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.WebDriver;
import ui.PageTransporter;

/**
 * Created with IntelliJ IDEA.
 * User: BrayanRosas
 * Date: 12/8/15
 * Time: 1:52 PM
 * To change this template use File | Settings | File Templates.
 */
public class CommonMethod {

    public static void navigateLoginPage() {
        PageTransporter.getInstance().navigateToLoginPage();
    }

    public static void signInToMainPage(){
        String user="BrayanRosas";
        String password ="Client123"  ;
        PageTransporter.getInstance().navigateToLoginPage().signIn(user, password);
    }

    public static void signOut(){
        PageTransporter.getInstance().navigateToMainPage().clickSignOutSuccessfully();
    }

    public static boolean theUserIsLogIn()
    {
        WebDriver driver = BrowserManager.getInstance().getDriver();
        if(driver.getCurrentUrl().contains("login"))  {
            System.out.println("****** The user is not logged");
            return false;
        }
        else {
            System.out.println("+++++++++++++ The user is logged");
            return true;
        }
    }
}




@@ -54,81 +54,36 @@
 ort 
-org.openqa.selenium.By;%0Aimport org.openqa.selenium.NoSuchElementException
+framework.CredentialsManager
 ;%0Aim
@@ -514,61 +514,142 @@
 ser=
-%22BrayanRosas%22;%0A        String password =%22Client123%22  
+CredentialsManager.getInstance().getAdminUserName();%0A        String password = CredentialsManager.getInstance().getAdminUserPassword()
 ;%0A  
@@ -1269,8 +1269,4 @@
  %7D%0A%7D
-%0A%0A%0A%0A

Update the CommonMethod.java file for read the information from environment.json file