I have two simple tests that check the accessibility of a site by URL. Both tests work as intended.
IsUrlAvailableByHttp = Passed IsUrlAvailableByHttps = Failed
But when I create a report using "Allure"
I get "0 test cases" in the Allure UI.

I'm using next command to generate and open report:
allure generate
allure open
Here's code of my test.
public class WebProtocolTest
{
private readonly PingHelper _pingHelper;
[AllureBefore("Setup test context")]
public WebProtocolTest()
{
_pingHelper = new PingHelper();
}
[Fact]
[AllureDescription("Check app availability through http")]
public void IsUrlAvailableByHttp()
{
string url = "http://localhost:5001/";
bool isUrlAvailable = _pingHelper.IsUrlAvailable(url);
Assert.True(isUrlAvailable);
}
[Fact]
[AllureDescription("Check app availability through https")]
public void IsUrlAvailableByHttps()
{
string url = "https://localhost:5001/";
bool isUrlAvailable = _pingHelper.IsUrlAvailable(url);
Assert.True(isUrlAvailable);
}
}
public class PingHelper
{
public bool IsUrlAvailable(string url)
{
bool urlAvailable = false;
var request = (HttpWebRequest)HttpWebRequest.Create(url);
request.AllowAutoRedirect = false;
request.Method = "HEAD";
try
{
var response = request.GetResponse();
if(response != null)
{
urlAvailable = true;
}
}
catch (WebException wex)
{
}
return urlAvailable;
}
}
Instead of using
allure openandallure generate, you should use: