package com.example.support;

import org.openqa.selenium.WebDriver;

/**
 * Per-scenario WebDriver holder for the plain (no-self-healing) format. {@link PlainHooks}
 * creates the browser before each scenario and puts it here; each generated test's step class
 * reads it via {@link #get()}. ThreadLocal keeps parallel scenarios isolated. No editing needed.
 */
public final class Driver {

    private static final ThreadLocal<WebDriver> CURRENT = new ThreadLocal<>();

    private Driver() {}

    public static WebDriver get()      { return CURRENT.get(); }
    public static void set(WebDriver driver)  { CURRENT.set(driver); }
    public static void remove()               { CURRENT.remove(); }
}
