1

I.Open("http://google.com");静的コンテキストからアクセスされているため、呼び出し時に「I」変数を使用できません。最悪の場合、セレン テストには常に MSTest を使用し、その他すべてのテストには MSpec を使用できます。

[Tags("Easy","Web")]
[Subject("Verify we can reach google.com.")]
public class ViewGoogleTest: FluentTest
{
    IActionSyntaxProvider result;

    Establish context = () =>
    {
        SeleniumWebDriver.Bootstrap(SeleniumWebDriver.Browser.Chrome);
    };

    Because of = () =>
    {
        result = I.Open("http://google.com");
    };

    It should_display_the_page = () => result.Find("#SomeId");
}
4

1 に答える 1