Class EngineService

java.lang.Object
com.shaft.mcp.EngineService

@Service public class EngineService extends Object
  • Constructor Details

    • EngineService

      public EngineService()
  • Method Details

    • initializeDriver

      @Tool(name="driver_initialize", description="launches browser") public void initializeDriver(BrowserType targetBrowser)
      Initializes the WebDriver for the specified browser type.
      Parameters:
      targetBrowser - The type of browser to initialize (e.g., CHROME, FIREFOX).
    • quitDriver

      @Tool(name="driver_quit", description="closes browser") public void quitDriver()
      Quits the WebDriver, closing all associated browser windows.
    • generateTestReport

      @Tool(name="generate_test_report", description="generates a test report for the current session") public void generateTestReport()
      Generate a test report for the current session. This method compiles and generates a detailed test report based on the actions performed during the session. It utilizes SHAFT's reporting capabilities to create a comprehensive report that includes information such as test steps, outcomes, screenshots, and logs. The generated report is saved in a predefined location for easy access and review. This method should be called at the end of the test session to ensure all actions are documented.
    • getPageSource

      public String getPageSource()
      Get the source code of the current page. This is a support method for the AI agent to better explore the page.
      Returns:
      The HTML source code of the current page as a string.