package com.addressbookTesting.appManager;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.remote.BrowserType;

import java.util.Objects;
import java.util.concurrent.TimeUnit;

/**
 * Created by anastasiyam on 2/2/2017.
 */
public class ApplicationManager  {
    private final String browser;
    WebDriver wd;

//to delegate methods to specific classes. First create class, extend class, pull mempublic ApplicationManager(String ) {

// refactor. Create a new reference to the class object, create the constructor
    private  ContactHelper contactHelper;
    private SessionHelper sessionHelper;
    private NavigationHelper navigatioToGroup;
    private GroupHelper groupHelper;
    private String firefox;

    public ApplicationManager(String browser) {
        this.browser= browser;
    }


    public void init() {
               if(Objects.equals(browser, BrowserType.FIREFOX)){
                   wd = new FirefoxDriver();
               }else if (Objects.equals(browser, BrowserType.CHROME)){
                   wd = new ChromeDriver();
               }else if (Objects.equals(browser, BrowserType.IE)){
                   wd = new InternetExplorerDriver();
               }

            wd.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
            wd.get("http://localhost/addressbook/group.php");
            groupHelper = new GroupHelper(wd);
            navigatioToGroup = new NavigationHelper(wd);
            sessionHelper=new SessionHelper(wd);
            contactHelper = new ContactHelper(wd);

            //login
            sessionHelper.login("admin","secret");
    }

  
    public void stop() {
        wd.quit();
    }
//methods which are used in tests
    public GroupHelper getGroupHelper() {
        return groupHelper;
    }

    public NavigationHelper getNavigationToGroup() {
        return navigatioToGroup;
    }

    public ContactHelper getContactHelper() {return contactHelper;}

}


@@ -279,34 +279,8 @@
 e;%0A%0A
-import java.util.Objects;%0A
 impo
@@ -978,31 +978,31 @@
      if(
-Objects
+browser
 .equals(
 browser,
@@ -989,32 +989,24 @@
 wser.equals(
-browser,
  BrowserType
@@ -1083,39 +1083,39 @@
   %7Delse if (
-Objects
+browser
 .equals(
 browser, Bro
@@ -1098,33 +1098,24 @@
 wser.equals(
-browser, 
 BrowserType.
@@ -1197,23 +1197,23 @@
 if (
-Objects
+browser
 .equals(
 brow
@@ -1212,16 +1212,8 @@
 als(
-browser,
  Bro

Change to equals