Class TestCase

java.lang.Object
jp.vmi.selenium.selenese.TestCase
All Implemented Interfaces:
IHtmlResultTestCase, IHtmlResultTestTarget, ITestCase, ITestTarget, Selenese

public class TestCase
extends Object
implements Selenese, ITestCase, IHtmlResultTestCase
test-case object for execution.

Supports Selenium IDE flow control plugin.

See Also:
A flow control plugin for Selenium IDE
  • Constructor Details

    • TestCase

      public TestCase()
  • Method Details

    • initialize

      public TestCase initialize​(SourceType sourceType, String filename, String name, String baseURL)
      Initialize after constructed.
      Parameters:
      sourceType - test-case source type.
      filename - selenese script filename. (This base name is used for generating screenshot file)
      name - test-case name.
      baseURL - effective base URL.
      Returns:
      this.
    • getType

      public Selenese.Type getType()
      Description copied from interface: Selenese
      Get script type.
      Specified by:
      getType in interface IHtmlResultTestTarget
      Specified by:
      getType in interface Selenese
      Returns:
      script type.
    • getSourceType

      public SourceType getSourceType()
      Test-case source type.
      Returns:
      source type.
    • isError

      public boolean isError()
      Description copied from interface: ITestTarget
      Is error instance?
      Specified by:
      isError in interface ITestTarget
      Returns:
      true if this is error instance.
    • getFilename

      public String getFilename()
      Get filename of test-case.
      Specified by:
      getFilename in interface IHtmlResultTestCase
      Returns:
      filename.
    • getBaseName

      public String getBaseName()
      Description copied from interface: ITestTarget
      Get test-target file base name. For example, return "def" when file name is "/abc/def.html".
      Specified by:
      getBaseName in interface ITestTarget
      Returns:
      test-target file base name.
    • getName

      public String getName()
      Description copied from interface: ITestTarget
      Get test-target name.
      Specified by:
      getName in interface IHtmlResultTestTarget
      Specified by:
      getName in interface ITestTarget
      Returns:
      test-target name.
    • getId

      public String getId()
      Description copied from interface: Selenese
      Get id.
      Specified by:
      getId in interface Selenese
      Returns:
      id.
    • setId

      public void setId​(String id)
      Set test-case id.
      Parameters:
      id - test-case id.
    • getBaseURL

      public String getBaseURL()
      Get base URL in the test-case.
      Returns:
      base URL.
    • getCommandList

      public CommandList getCommandList()
      Get command list.
      Specified by:
      getCommandList in interface IHtmlResultTestCase
      Returns:
      command list.
    • getStopWatch

      public StopWatch getStopWatch()
      Get stop watch.
      Specified by:
      getStopWatch in interface ITestTarget
      Returns:
      stop watch.
    • setLogRecorder

      public void setLogRecorder​(LogRecorder logRecorder)
      Description copied from interface: ITestCase
      Set log recorder.
      Specified by:
      setLogRecorder in interface ITestCase
      Parameters:
      logRecorder - log recorder.
    • getLogRecorder

      public LogRecorder getLogRecorder()
      Description copied from interface: ITestCase
      Get log recorder.
      Specified by:
      getLogRecorder in interface ITestCase
      Returns:
      log recorder.
    • getResult

      public Result getResult()
      Description copied from interface: Selenese
      Get selenese result.
      Specified by:
      getResult in interface IHtmlResultTestTarget
      Specified by:
      getResult in interface Selenese
      Returns:
      selenese result.
    • getResultList

      public CommandResultList getResultList()
      Get test-case result list.
      Specified by:
      getResultList in interface IHtmlResultTestCase
      Returns:
      test-case result list.
    • hasNativeAlertHandler

      public boolean hasNativeAlertHandler()
      True if this test-case has native alert handler command.
      Returns:
      true if this test-case has native alert handler command.
    • addCommand

      public void addCommand​(ICommand command)
      Add command to command list.
      Parameters:
      command - command.
    • addCommand

      public final void addCommand​(Function<Integer,​ICommand> cmdGenFunc)
      Add command to command list.
      Parameters:
      cmdGenFunc - command generator function.
    • addCommand

      public final void addCommand​(ICommandFactory commandFactory, String name, String... args)
      Add command to command list.
      Parameters:
      commandFactory - command factory.
      name - command name.
      args - command arguments.
    • execute

      public Result execute​(Selenese parent, Context context)
      Description copied from interface: Selenese
      Execute script.
      Specified by:
      execute in interface Selenese
      Parameters:
      parent - parent selenese instance or null.
      context - Selenese Runner context.
      Returns:
      result.
    • toString

      public String toString()
      Overrides:
      toString in class Object