Class TestCase

    • Constructor Detail

      • TestCase

        public TestCase()
    • Method Detail

      • 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.
      • 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.
      • 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.
      • 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.
      • setLogRecorder

        public void setLogRecorder​(LogRecorder logRecorder)
        Description copied from interface: ITestCase
        Set log recorder.
        Specified by:
        setLogRecorder in interface ITestCase
        Parameters:
        logRecorder - log recorder.
      • 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.