Hi,
I am new to Test Studio and have to say it is nice. However, I have come across a problem with how it inherits. My initial thoughts were I would create a base class with specific coded steps for navigation, I could then easily incorporate these in other tests. The following is a very basic idea, the first draft I did was split into it's own class:
public class BaseTestClass : BaseWebAiiTest
{
[CodedStep(@"Go to My Account")]
public void Account_Links_GotoMyAccounts()
{
var pageLink = Find.ByExpression(LinkAttributes.MyAccountPage);
Assert.IsNotNull(pageLink);
Actions.Click(pageLink);
}
}
public class SearchMusic : BaseTestClass
{
[CodedStep(@"New Coded Step")]
public void SearchMusic_CodedStep()
{
var attr = Find.ByContent<
HtmlSpan
>("18");
Assert.IsNotNull(attr);
}
}
The inheritence used in the test studio will no longer pick up SearchMusic_CodedStep() but does find functions from BaseTestClass as in the attached image. As SearchMusic class descends from BaseTestClass, which descends from BaseWebAiiTest. It should pick up all public methods from BaseTestClass and SearchMusic class.
In the simple example above, any new coded functions added, will be added to BaseTestClass class, not SearchMusic class. If BaseTestClass resides within another .cs file then an error is shown.
If the above worked, it would make it a bit easier for my use, and hopefully others.
FYI I do have simple tests like login etc which are used as"Test as Step" when performing other tests.
regards
Si