????Spec Flow??写????????????
???????????? ???????[ 2014/1/27 16:01:44 ] ??????????????? ??????? ?????????
???????????????????????????璨�????????????梅?????????Spec Flow???????????琛�?????????????????????芯??宕�?瓒�?澹�“Given I am at the ‘Login’page”??
[Given("I am at the 'Login' page")
public void GivenIAmAtTheLoginPage()
{
// TODO
}
??????????梅??????????????????????????Spec Flow??????????????瑁�??????瓒�?????????????魏????feature????械??????????????“Given”???????瑁�???????????“I am at the ‘Login’page”?????????梅???????
?????????????????貌??瓒�???写??????小????????????WatiN???????????????????????妾�???????????????????????????????????????????scenario?????????????????????????????scenario?????胁????????????????????????????????????????????????????????????ScenarioContext????小?ScenarioContext?????????????Scenario??泄????械??????????????????????WebBrowser??helper??????????scenario????????????????
using TechTalk.SpecFlow;
using WatiN.Core;
static class WebBrowser
{
public static IE Current
{
get
{
if(!ScenarioContext.Current.ContainsKey("browser"))
ScenarioContext.Current["browser"] = new IE();
return ScenarioContext.Current["browser"] as IE;
}
}
}
?????????Helper????Current?????????????????????????????????械?scenario??????????ScenarioContext??????????????????????????????????????????????????????小???????????????械?????????????????
?????????????????????????????瓒�??????????????校????????????http://localhost:9876/authentication/login??????????????Scenario??????????位????URL????????????瓒�?濉�??????????????????????????????????????????????????瓒�?澹�?????????????????????????????????????瓒�?澹�??????????????????瓒�?????????????????????????
[Given("I am at the 'Login' page")
public void GivenIAmAtTheLoginPage()
{
// Make sure to add the namespace the WebBrowser class is inside
WebBrowser.Current.GoTo("http://localhost:9876/authentication/login");
}
??????尾
???????????????????????????????????????????????????????械???瓒�?澹�???????????????????????????????娑�???????谓????????胁??????????????????屑???????械???????????贸???Copy Local??????????NuGet????WatiN??Interop.SHDocVw DLL??????????Embed Interop???????贸?True???????????????Embed Interop???????贸?false???????????????Copy Local???????贸?True??
???????????????????????Apartment State????%
??????

???路???
??????????????????
2023/3/23 14:23:39???写?貌??????????
2023/3/22 16:17:39????????????????????些??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???路???????路
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11