Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for running asynchronous Steps #30

Open
sswaroopgupta opened this issue Nov 30, 2018 · 7 comments
Open

Add support for running asynchronous Steps #30

sswaroopgupta opened this issue Nov 30, 2018 · 7 comments

Comments

@sswaroopgupta
Copy link

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

  • Create a dotnet project
  • Add the following step
    [Step("A step that returns Task")]
    public async Task AsyncStep()
    {
    await Task.Delay(15);
    throw new CustomSerializableException("Step failed");
    }

On execution of the specification using this step, any failure in the step should be taken into account by gauge.

Version

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

Plugins
-------
dotnet (0.1.1.nightly-2018-11-28)
@jiabiao
Copy link

jiabiao commented Jun 18, 2019

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

@nehashri
Copy link
Contributor

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

@jiabiao
Copy link

jiabiao commented Jun 19, 2019

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
Copy link
Contributor

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

@benquinteros
Copy link

bump

@harimadusumilli
Copy link

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
Copy link
Member

zabil commented Jul 26, 2022

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.

@mpekurny mpekurny mentioned this issue Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

6 participants