getgauge / gauge-dotnet

C# runner for gauge + DotNet standard 6.0-8.0
Apache License 2.0
27 stars 20 forks source link

Add support for running asynchronous Steps #30

Open sswaroopgupta opened 5 years ago

sswaroopgupta commented 5 years ago

Proposed behavior

Should be able to deal with async/await natively

Actual behavior

Step with async/await is allowed in Gauge-dotnet. However, the failure inside the step is not being taken into account.

Steps to replicate

Version

Gauge version: 1.0.4.nightly-2018-11-26
Commit Hash: f6cb60c

Plugins
-------
dotnet (0.1.1.nightly-2018-11-28)
jiabiao commented 5 years ago

Hi, May I know when this feature will be released?

nehashri commented 5 years ago

@jiabiao We have not decided on a timeline for this feature yet. We will look at this soon though.

jiabiao commented 5 years ago

Thanks @nehashri. If the gauge dotnet supports asynchronous steps, will you also add support for the enable_multithreading flag? Otherwise, running asynchronous tasks one by one makes no sense.

nehashri commented 5 years ago

@jiabiao Can you please raise a separate issue for multithreading?

benquinteros commented 2 years ago

bump

harimadusumilli commented 2 years ago

Hello Gauge Team,

Can you please let us know if the async Task feature will be implemented in DOT-NET.

Gauge version: 1.1.7 Commit Hash: 5d86b72

Plugins

dotnet (0.5.0) html-report (4.0.12) screenshot (0.0.1) xml-report (0.2.3)

Dotnet framework 6.0. I wanted to run it using for e.g:, playwright and although the step gets executed there is no error that is reported. I see from the above discussion that the async feature is not implemented. Here is my code snippet below:

[Step("Launch Browser using Playwright")] public async Task LaunchBrowserUsingPlaywright() {

            Console.WriteLine("Testing Starts");
            using var playwright = await Playwright.CreateAsync();
            var chrome = playwright.Chromium;
            var browser = await chrome.LaunchAsync(new BrowserTypeLaunchOptions { Headless = false });
            //await using var browser = await playwright.Chromium.LaunchAsync(new() { Headless = false });
             var page = await browser.NewPageAsync();
            await page.GotoAsync("https://playwright.dev/dotnet");
            await page.ScreenshotAsync(new() { Path = "screenshot.png" });
            Console.WriteLine("Testing Ends");
    }

Any help or any tentative ETA is appreciated.

Thank you for your support and help.

Hari

zabil commented 2 years ago

Hello Gauge Team,

There's no Gauge team as such and no one is working on this at the moment. However pull requests to add support for async task will be accepted.