package io.tromba.testdriver.core;

import io.tromba.testdriver.core.listeners.TestdriverAnnotationTransformer;
import io.tromba.testdriver.core.listeners.TestdriverListener;
import org.openqa.selenium.WebDriver;
import org.testng.annotations.Listeners;

/**
 * Base test from which all testdriver tests will inherit.
 */
@Listeners({ TestdriverListener.class, TestdriverAnnotationTransformer.class })
public class BaseTestdriverTest {

    private TestdriverManager testdriverManager = new TestdriverManager();

    /**
     * Get the driver that belongs to the calling test.
     * @return the correct webdriver.
     */
    public WebDriver driver() {
        return testdriverManager.driver();
    }
}

@@ -179,37 +179,139 @@
 ort 
-org.openqa.selenium.WebDriver
+io.tromba.testdriver.environment.EnvironmentHandler;%0Aimport org.openqa.selenium.WebDriver;%0Aimport org.testng.annotations.BeforeTest
 ;%0Aim
@@ -532,16 +532,67 @@
 Test %7B%0A%0A
+    private EnvironmentHandler environmentHandler;%0A
     priv
@@ -659,16 +659,357 @@
 ger();%0A%0A
+    public BaseTestdriverTest() %7B%0A%0A    %7D%0A%0A    public BaseTestdriverTest(EnvironmentHandler environmentHandler) %7B%0A        this.environmentHandler = environmentHandler;%0A    %7D%0A%0A    @BeforeTest%0A    public void getStartUrl() %7B%0A        if (null != environmentHandler) %7B%0A            driver().get(environmentHandler.getStartUrl());%0A        %7D%0A    %7D%0A%0A
     /**%0A

add get start url to before test