Enum Class W3cBrowserType

java.lang.Object
java.lang.Enum<W3cBrowserType>
io.karatelabs.driver.w3c.W3cBrowserType
All Implemented Interfaces:
Serializable, Comparable<W3cBrowserType>, Constable

public enum W3cBrowserType extends Enum<W3cBrowserType>
Enum-driven configuration for all W3C WebDriver browser types. Encapsulates per-browser differences: executable name, default port, CLI arg format, and W3C capability browserName.

Matches Karate v1 type names for backward compatibility.

  • Enum Constant Details

  • Method Details

    • values

      public static W3cBrowserType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static W3cBrowserType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • isW3cType

      public static boolean isW3cType(String type)
      Check if a type string corresponds to a W3C WebDriver type.
    • fromType

      public static W3cBrowserType fromType(String type)
      Get the W3cBrowserType for a Karate type string.
      Returns:
      the browser type, or null if not a W3C type
    • getKarateType

      public String getKarateType()
    • getBrowserName

      public String getBrowserName()
    • getExecutable

      public String getExecutable()
    • getDefaultPort

      public int getDefaultPort()
    • formatPortArg

      public String formatPortArg(int port)
      Format the port argument for this browser's driver executable.