Class TestCase
A TestCase contains one or several test steps, these steps will be run one after another.
Namespace: AxaFrance.WebEngine
Assembly: AxaFrance.WebEngine.dll
Syntax
[Serializable]
public abstract class TestCase
Properties
| Improve this Doc View SourceContext
The context object for the test case. For Web test using Selenium WebDriver, the Context will be an WebDrive object.
Declaration
public object Context { get; set; }
Property Value
Type | Description |
---|---|
System.Object |
ContextValues
The context of the current test case, which stores variables and values to be shared between different actions within the same test case.
Declaration
public List<Variable> ContextValues { get; protected set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<Variable> |
Information
Test Information. to privide more detailed information during test execution. This information can be visualized in the test report.
Declaration
public StringBuilder Information { get; }
Property Value
Type | Description |
---|---|
System.Text.StringBuilder |
Name
The name of the test case. this name will be shown to users.
The Name is a required parameter to be assigned before the call of Run() or BeginRun() Method
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String |
StartDate
The DateTime value which the Test case has been started.
Declaration
public static DateTime StartDate { get; protected set; }
Property Value
Type | Description |
---|---|
System.DateTime |
TestCaseLogDir
The directory of the log of TestCase. The test script can use this directory to store personalised data.
Declaration
public string TestCaseLogDir { get; }
Property Value
Type | Description |
---|---|
System.String |
testCaseReport
This is the TestCase report which will be updated during test.
Declaration
protected TestCaseReport testCaseReport { get; set; }
Property Value
Type | Description |
---|---|
TestCaseReport |
TestCaseResult
The overall result of the current Test Case. if any of step fails, then the overall test case is failed.
Declaration
public Result TestCaseResult { get; set; }
Property Value
Type | Description |
---|---|
Result |
TestData
The test data (a list of named values) used for the current test case. Test Data is initialized from TestSuiteData by its name.
Declaration
public TestData TestData { get; }
Property Value
Type | Description |
---|---|
TestData |
TestSteps
The test steps to be run sequentially
Declaration
public TestStep[] TestSteps { get; set; }
Property Value
Type | Description |
---|---|
TestStep[] |
UniqueId
[Optional] The uniqueId of the current test case. This id if provided can be used as a key to associate test case and the key in your test management system.
Declaration
public string UniqueId { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Methods
| Improve this Doc View SourceCleanup()
cleanup the context of the test case
Declaration
public abstract string Cleanup()
Returns
Type | Description |
---|---|
System.String | Detailed information about the clean up |
GetReport()
Updates the information of test case execution to the associated TestCase Report.
Declaration
public TestCaseReport GetReport()
Returns
Type | Description |
---|---|
TestCaseReport |
Initialize()
Initialize the context of the test case
Declaration
public abstract void Initialize()
Run(TestCaseReport, Boolean)
This method will be called to run the current Test. Run calls automatically Initialize and Cleanup.
Declaration
public virtual Result Run(TestCaseReport report, bool Pause = false)
Parameters
Type | Name | Description |
---|---|---|
TestCaseReport | report | The testcase report object initiaized by the test framework. After the test execution, use GetReport() method to get a valorized report. |
System.Boolean | Pause | True: When a test case ends or error encounters, the test execution will be paused until user presses Enter key False: do not pause after each test (Default Value) |
Returns
Type | Description |
---|---|
Result | The test Result of test case |
Remarks
When running automated test with IC or remote mode, do not assign Pause = True