SpecFlowOSS / SpecFlow.Actions

BSD 3-Clause "New" or "Revised" License
57 stars 53 forks source link

make playwright instance public #75

Open SabotageAndi opened 2 years ago

304NotModified commented 2 years ago

Looks good, but its a breaking change. Maybe leave the current property the same and make it obsolete

SabotageAndi commented 2 years ago

We don't care that much about breaking changes in SpecFlow.Actions as in SpecFlow. But still we only do them, when we really have to. In this case, because of the stupid async/await everywhere, I have no really good idea on how to save the old property.

304NotModified commented 2 years ago

I think is really easy to keep it backwardscompatible?

Something like this?

        [Obsolete("Replaced with GetBrowser()"]
        public Task<IBrowser> Current => GetBrowser();

        public async Task<IPlaywright> GetPlaywright()
        {
            return (await _currentBrowserLazy.Value).Playwright;
        }

        public async Task<IBrowser> GetBrowser()
        {
            return (await _currentBrowserLazy.Value).Browser;
        }