Package jp.vmi.selenium.selenese
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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jp.vmi.selenium.selenese.Selenese
Selenese.Type
-
-
Constructor Summary
Constructors Constructor Description TestCase()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCommand(Function<Integer,ICommand> cmdGenFunc)Add command to command list.voidaddCommand(ICommand command)Add command to command list.voidaddCommand(ICommandFactory commandFactory, String name, String... args)Add command to command list.Resultexecute(Selenese parent, Context context)Execute script.StringgetBaseName()Get test-target file base name.StringgetBaseURL()Get base URL in the test-case.CommandListgetCommandList()Get command list.StringgetFilename()Get filename of test-case.StringgetId()Get id.LogRecordergetLogRecorder()Get log recorder.StringgetName()Get test-target name.ResultgetResult()Get selenese result.CommandResultListgetResultList()Get test-case result list.SourceTypegetSourceType()Test-case source type.StopWatchgetStopWatch()Get stop watch.Selenese.TypegetType()Get script type.booleanhasNativeAlertHandler()True if this test-case has native alert handler command.TestCaseinitialize(SourceType sourceType, String filename, String name, String baseURL)Initialize after constructed.booleanisError()Is error instance?voidsetId(String id)Set test-case id.voidsetLogRecorder(LogRecorder logRecorder)Set log recorder.StringtoString()
-
-
-
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.
-
getType
public Selenese.Type getType()
Description copied from interface:SeleneseGet script type.- Specified by:
getTypein interfaceIHtmlResultTestTarget- Specified by:
getTypein interfaceSelenese- Returns:
- script type.
-
getSourceType
public SourceType getSourceType()
Test-case source type.- Returns:
- source type.
-
isError
public boolean isError()
Description copied from interface:ITestTargetIs error instance?- Specified by:
isErrorin interfaceITestTarget- Returns:
- true if this is error instance.
-
getFilename
public String getFilename()
Get filename of test-case.- Specified by:
getFilenamein interfaceIHtmlResultTestCase- Returns:
- filename.
-
getBaseName
public String getBaseName()
Description copied from interface:ITestTargetGet test-target file base name. For example, return "def" when file name is "/abc/def.html".- Specified by:
getBaseNamein interfaceITestTarget- Returns:
- test-target file base name.
-
getName
public String getName()
Description copied from interface:ITestTargetGet test-target name.- Specified by:
getNamein interfaceIHtmlResultTestTarget- Specified by:
getNamein interfaceITestTarget- Returns:
- test-target name.
-
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:
getCommandListin interfaceIHtmlResultTestCase- Returns:
- command list.
-
getStopWatch
public StopWatch getStopWatch()
Get stop watch.- Specified by:
getStopWatchin interfaceITestTarget- Returns:
- stop watch.
-
setLogRecorder
public void setLogRecorder(LogRecorder logRecorder)
Description copied from interface:ITestCaseSet log recorder.- Specified by:
setLogRecorderin interfaceITestCase- Parameters:
logRecorder- log recorder.
-
getLogRecorder
public LogRecorder getLogRecorder()
Description copied from interface:ITestCaseGet log recorder.- Specified by:
getLogRecorderin interfaceITestCase- Returns:
- log recorder.
-
getResult
public Result getResult()
Description copied from interface:SeleneseGet selenese result.- Specified by:
getResultin interfaceIHtmlResultTestTarget- Specified by:
getResultin interfaceSelenese- Returns:
- selenese result.
-
getResultList
public CommandResultList getResultList()
Get test-case result list.- Specified by:
getResultListin interfaceIHtmlResultTestCase- 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:SeleneseExecute script.
-
-