Class Properties

java.lang.Object
com.shaft.properties.internal.Properties
Direct Known Subclasses:
SHAFT.Properties

public class Properties extends Object
Central holder for all SHAFT property configuration objects.

Each writable property type is exposed as a thread-safe proxy that dispatches reads to the current thread's config instance (if a per-thread override is active) or falls back to the globally-initialized base config. When a test calls SHAFT.Properties.web.set().targetBrowserName("firefox"), only that thread's config is updated — other threads continue to see their own values, preventing cross-thread contamination during parallel test execution.

Read-only property types (Internal, TestNG, Log4j, Cucumber) are backed by simple static fields because they are never mutated after framework initialisation.

  • Field Details

    • browserStack

      public static final BrowserStack browserStack
    • platform

      public static final Platform platform
    • healenium

      public static final Healenium healenium
    • jira

      public static final Jira jira
    • mobile

      public static final Mobile mobile
    • paths

      public static final Paths paths
    • pattern

      public static final Pattern pattern
    • flags

      public static final Flags flags
    • reporting

      public static final Reporting reporting
    • allure

      public static final Allure allure
    • timeouts

      public static final Timeouts timeouts
    • tinkey

      public static final Tinkey tinkey
    • visuals

      public static final Visuals visuals
    • web

      public static final Web web
    • performance

      public static final Performance performance
    • lambdaTest

      public static final LambdaTest lambdaTest
    • api

      public static final API api
    • internal

      public static Internal internal
    • testNG

      public static TestNG testNG
    • log4j

      public static Log4j log4j
    • cucumber

      public static Cucumber cucumber
  • Constructor Details

    • Properties

      public Properties()
  • Method Details

    • isInitialized

      public static boolean isInitialized()
      Returns true if the framework property system has been fully initialized (i.e. PropertiesHelper.initialize() or equivalent has been called). Use this instead of Properties.xxx == null null-checks because the public fields are now always-non-null proxy objects.

      Uses a dedicated volatile flag rather than a single base-field null check so that partial initialization (an exception partway through loadProperties()) cannot produce a false positive.

      Returns:
      true once base configs have been fully loaded
    • clearForCurrentThread

      public static void clearForCurrentThread()
      Clears all thread-local property overrides for the current thread and resets the per-thread override map maintained by ThreadLocalPropertiesManager.

      This should be called before a new test-class lifecycle begins on a pooled thread so that overrides set by a previous test class do not leak into the next one.