public async void FailedSkippedAndPassingStepsStats() { WebBrowser browser = new WebBrowser(WebDriver.Current); await xB.CurrentRun.AddScenario(this) .Given(HtmlReport.OfAFullTestRunWithAllOutcomes()) .When(WebUser.ViewsReport(browser)) .ThenAsync("the total number of steps should show as a badge to the right of the scenario name with a value of 3", async (s) => { await browser.WaitTillVisible(Pages.HtmlReportPage.ScenarioStepStats.Total(19)); browser.ElementHasText(Pages.HtmlReportPage.ScenarioStepStats.Total(19), "3"); }) .And("the badge should show 'Steps' when the user hovers over it", (s) => { browser.ElementHasTitle(Pages.HtmlReportPage.ScenarioStepStats.Total(19), "Steps"); }) .Run(); }
public async void FailedSkippedAndPassingScenarioStats() { WebBrowser browser = new WebBrowser(WebDriver.Current); await xB.CurrentRun.AddScenario(this) .Given(HtmlReport.OfAFullTestRunWithAllOutcomes()) .When(WebUser.ViewsReport(browser)) .ThenAsync("there should be a section under the feature name that displays scenario statistics", async (s) => { await browser.WaitTillVisible(Pages.HtmlReportPage.FeatureScenarioStats.Section(7)); }) .AndAsync("the total number of scenarios should show as a badge to the right of the feature name with a value of 3", async (s) => { await browser.WaitTillVisible(Pages.HtmlReportPage.FeatureScenarioStats.Total(7)); browser.ElementHasText(Pages.HtmlReportPage.FeatureScenarioStats.Total(7), "3"); }) .And("the badge should show 'Scenarios' when the user hovers over it", (s) => { browser.ElementHasTitle(Pages.HtmlReportPage.FeatureScenarioStats.Total(7), "Scenarios"); }) .And("the section should show the number of passed scenarios with a value of 1", (s) => { browser.ElementHasText(Pages.HtmlReportPage.FeatureScenarioStats.Passed(7), "1"); }) .And("the section should show the number of skipped scenarios with a value of 1", (s) => { browser.ElementHasText(Pages.HtmlReportPage.FeatureScenarioStats.Skipped(7), "1"); }) .And("the section should show the number of failed scenarios with a value of 1", (s) => { browser.ElementHasText(Pages.HtmlReportPage.FeatureScenarioStats.Failed(7), "1"); }) .AndAsync("the section should a green, yellow, and red bar chart of the percentages of passed, skipped, and failed scenarios", async (s) => { await browser.WaitTillVisible(Pages.HtmlReportPage.FeatureScenarioStats.BarChart(7)); }) .And("the passed, green bar should have a width of 33%", (s) => { browser.ElementStyleMatches(Pages.HtmlReportPage.FeatureScenarioStats.SuccessBar(7), ".*width: 33\\..*"); }) .And("the skipped, yellow bar should have a width of 33%", (s) => { browser.ElementStyleMatches(Pages.HtmlReportPage.FeatureScenarioStats.SkippedBar(7), ".*width: 33\\..*"); }) .And("the failed, red bar should have a width of 33%", (s) => { browser.ElementStyleMatches(Pages.HtmlReportPage.FeatureScenarioStats.FailedBar(7), ".*width: 33\\..*"); }) .Run(); }
public async void AreaStatsNoAreas() { WebBrowser browser = new WebBrowser(WebDriver.Current); await xB.CurrentRun.AddScenario(this) .Given(HtmlReport.OfAnEmptyTestRun()) .When(WebUser.ViewsReport(browser)) .ThenAsync("there should be a section under the test run name that displays area statistics", async (s) => { await browser.WaitTillVisible(Pages.HtmlReportPage.TestRunAreaStats.Section); }) .AndAsync("the total number of areas should show as a badge to the right of the test run name with a value of 0", async (s) => { await browser.WaitTillVisible(Pages.HtmlReportPage.TestRunAreaStats.Total); browser.ElementHasText(Pages.HtmlReportPage.TestRunAreaStats.Total, "0"); }) .And("the badge should show 'Areas' when the user hovers over it", (s) => { browser.ElementHasTitle(Pages.HtmlReportPage.TestRunAreaStats.Total, "Areas"); }) .And("the section should show the number of passed areas with a value of 0", (s) => { browser.ElementHasText(Pages.HtmlReportPage.TestRunAreaStats.Passed, "0"); }) .And("the section should show the number of areas with skipped scenarios with a value of 0", (s) => { browser.ElementHasText(Pages.HtmlReportPage.TestRunAreaStats.Skipped, "0"); }) .And("the section should show the number of areas with failed scenarios with a value of 0", (s) => { browser.ElementHasText(Pages.HtmlReportPage.TestRunAreaStats.Failed, "0"); }) .AndAsync("the section should show a gray bar to indicate there are no areas", async (s) => { await browser.WaitTillVisible(Pages.HtmlReportPage.TestRunAreaStats.EmptyBar); }) .Run(); }