You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
913 B
35 lines
913 B
using System.Text; |
|
using Newtonsoft.Json; |
|
|
|
namespace TestAutomation; |
|
|
|
[SetUpFixture] |
|
public class Tests : BaseTest |
|
{ |
|
[OneTimeSetUp] |
|
public void Setup() |
|
{ |
|
Website.WebDriver.Navigate().GoToUrl(WebsiteUrl); |
|
Website.WebDriver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(15); |
|
} |
|
|
|
[OneTimeTearDown] |
|
public void TearDown() |
|
{ |
|
HttpClient HttpClient = new(); |
|
|
|
Website.WebDriver.Quit(); |
|
|
|
var message = new |
|
{ |
|
content = "Test Report " + DateTime.Now.ToString("dd/MM/yyyy"), |
|
embeds = TestReport.GetMessages() |
|
}; |
|
|
|
var content = new StringContent(JsonConvert.SerializeObject(message), Encoding.UTF8, "application/json"); |
|
|
|
if (Environment.GetEnvironmentVariable("TEST_HOOK") == null) return; |
|
|
|
HttpClient.PostAsync(Environment.GetEnvironmentVariable("TEST_HOOK"), content).Wait(); |
|
} |
|
} |