FluentAutomation icon indicating copy to clipboard operation
FluentAutomation copied to clipboard

FluentTest.Provider == null until CommandProvider.webDriver used once

Open davious opened this issue 11 years ago • 2 comments

In your (quite nice) documentation, I see:

public class SampleTest : FluentTest<IWebDriver>  
{
    public void TestMethod()
    {
        var webDriver = this.Provider;
    }
}

I'm finding Provider is null until I do something like the following:

public class SampleTest : FluentTest<IWebDriver>  
{
    public void TestMethod()
    {
        I.DoSomethingFirst();
        var webDriver = this.Provider;
    }
}

Would you change the code to have FluentTest.Provider invoke the lazy load I see in CommandProvider.webDriver and ensure that FluentTest.Provider returns a value, even when the CommandProvider.webDriver has yet to be accessed?

davious avatar Mar 11 '14 09:03 davious

We can probably do something about this, yes. Though normally the 'something first' is I.Open(). I'll queue it up for 2.4 and see where we get with it! Thanks!

stirno avatar Mar 11 '14 21:03 stirno

proving way more difficult than originally expected because of how I populate FluentTest.Provider (a static) inside of the lazy loaded bits.

Going to spend some time on it tomorrow but if nothing elegant pops up I might just update the docs instead and live with this.

stirno avatar Mar 29 '14 05:03 stirno