Class BrowserContent

java.lang.Object
dev.comfast.cf.common.utils.BrowserContent

public class BrowserContent extends Object
Utility class to (re)write browser html / css / js using JavaScript
  • Constructor Details

    • BrowserContent

      public BrowserContent()
  • Method Details

    • openResourceFile

      public void openResourceFile(String resourcePath)
      Copy given resource file to temp folder and open it in browser.
      Parameters:
      resourcePath - path to resource file, where root is "src/test/resources"
    • setStyle

      public BrowserContent setStyle(@Language("CSS") String styleContent)
      Set style tag to head section
    • setBody

      public BrowserContent setBody(@Language("HTML") String bodyHtml)
      Set body tag content
    • addJsTools

      public BrowserContent addJsTools()
      Add $ and $$ JS methods to current page for convenience
    • setScriptTag

      public BrowserContent setScriptTag(@Language("JavaScript") String scriptContent)
      Adds script tag to head section
    • clearAll

      public void clearAll()
      Clear all html content