public async void FailedSkippedAndPassingFeatureStats()
		{
            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 test run name that displays feature statistics about the test run", async (s) => {
					await browser.WaitTillVisible(Pages.HtmlReportPage.TestRunFeatureStats.Section);
                })
                .And("the section should show the number of passed features with a value of 5", (s) => {
					browser.ElementHasText(Pages.HtmlReportPage.TestRunFeatureStats.Passed, "5");
               	})
                .And("the section should show the number of skipped features with a value of 3", (s) => {
					browser.ElementHasText(Pages.HtmlReportPage.TestRunFeatureStats.Skipped, "3");
               	})
                .And("the section should show the number of failed features with a value of 1", (s) => {
					browser.ElementHasText(Pages.HtmlReportPage.TestRunFeatureStats.Failed, "1");
               	})
                .AndAsync("the section should show a green, yellow, and red bar chart of the percentages of passed, skipped, and failed features", async (s) => {
					await browser.WaitTillVisible(Pages.HtmlReportPage.TestRunFeatureStats.BarChart);
               	})
                .And("the passed, green bar should have a width of 33%", (s) => {
					browser.ElementStyleMatches(Pages.HtmlReportPage.TestRunFeatureStats.SuccessBar, ".*width: 55\\..*");
               	})
                .And("the skipped, yellow bar should have a width of 33%", (s) => {
					browser.ElementStyleMatches(Pages.HtmlReportPage.TestRunFeatureStats.SkippedBar, ".*width: 33\\..*");
               	})
                .And("the failed, red bar should have a width of 33%", (s) => {
					browser.ElementStyleMatches(Pages.HtmlReportPage.TestRunFeatureStats.FailedBar, ".*width: 11\\..*");
               	})
                .Run();
		}
		public async void CollapsedByDefault()
		{
            WebBrowser browser = new WebBrowser(WebDriver.Current);
			string output = "Here\r\n is\r\n my\r\n output!";
			var format = TextFormat.text;
            await xB.CurrentRun.AddScenario(this)
                .Given(HtmlReport.OfAStepWithOutput(output, format))
                .When(WebUser.ViewsReport(browser))
				.AndAsync("the user clicks the first area", async (s) => {
					await browser.ClickWhenVisible(Pages.HtmlReportPage.Area.Name(1));
					await browser.WaitTillVisible(Pages.HtmlReportPage.Area.Features(1));
				})
				.AndAsync("the user clicks the first feature", async (s) => {
					await browser.ClickWhenVisible(Pages.HtmlReportPage.Feature.Name(1));
					await browser.WaitTillVisible(Pages.HtmlReportPage.Feature.Scenarios(1));
				})
				.AndAsync("the user clicks the first scenario", async (s) => {
					await browser.ClickWhenVisible(Pages.HtmlReportPage.Scenario.Name(1));
					await browser.WaitTillVisible(Pages.HtmlReportPage.Scenario.Steps(1));
				})
                .ThenAsync("the report will show an [Output] link to the left of the step name", async (s) => {
					await browser.WaitTillVisible(Pages.HtmlReportPage.Output.Link(1));
                })
                .Run();
		}
		public async void GeneralText()
		{
            WebBrowser browser = new WebBrowser(WebDriver.Current);
			string output = "Here\r\n is\r\n my\r\n output!";
			var format = TextFormat.text;
            await xB.CurrentRun.AddScenario(this)
                .Given(HtmlReport.OfAStepWithOutput(output, format))
                .When(WebUser.ViewsReport(browser))
				.AndAsync("the user clicks the first area", async (s) => {
					await browser.ClickWhenVisible(Pages.HtmlReportPage.Area.Name(1));
					await browser.WaitTillVisible(Pages.HtmlReportPage.Area.Features(1));
				})
				.AndAsync("the user clicks the first feature", async (s) => {
					await browser.ClickWhenVisible(Pages.HtmlReportPage.Feature.Name(1));
					await browser.WaitTillVisible(Pages.HtmlReportPage.Feature.Scenarios(1));
				})
				.AndAsync("the user clicks the first scenario", async (s) => {
					await browser.ClickWhenVisible(Pages.HtmlReportPage.Scenario.Name(1));
					await browser.WaitTillVisible(Pages.HtmlReportPage.Scenario.Steps(1));
				})
				.AndAsync("the user clicks the first scenario", async (s) => {
					await browser.ClickWhenVisible(Pages.HtmlReportPage.Output.Link(1));
					await browser.WaitTillVisible(Pages.HtmlReportPage.Output.Section(1));
				})
                .Then("the report will show the output indented under the step", (s) => {
					s.Output = browser.GetPageSource();
					s.OutputFormat = TextFormat.htmlpreview;
					browser.ElementHasText(Pages.HtmlReportPage.Output.Text(1), output);
                })
                .Run();
		}
Beispiel #4
0
		public async void PassingWithSomeSkipped()
		{
            WebBrowser browser = new WebBrowser(WebDriver.Current);
            await xB.CurrentRun.AddScenario(this)
                .Given(HtmlReport.OfASingleSkippedScenario())
                .When(WebUser.ViewsReport(browser))
                .ThenAsync("the report will show the test run name in yellow to indicate the test run had skipped scenarios", async (s) => {
                    await browser.WaitTillVisible(Pages.HtmlReportPage.TestRun.NameYellow);
                })
                .Run();
		}
Beispiel #5
0
		public async void Failing()
		{
            WebBrowser browser = new WebBrowser(WebDriver.Current);
            await xB.CurrentRun.AddScenario(this)
                .Given(HtmlReport.OfASingleFailedScenario())
                .When(WebUser.ViewsReport(browser))
                .ThenAsync("the report will show the step name in red to indicate a step failed", async (s) => {
					await browser.WaitTillVisible(Pages.HtmlReportPage.Step.Red(2));
                })
                .Run();
		}
Beispiel #6
0
		public async void PassingTestRun()
		{
            WebBrowser browser = new WebBrowser(WebDriver.Current);
            await xB.CurrentRun.AddScenario(this)
                .Given(HtmlReport.OfASinglePassingScenario())
                .When(WebUser.ViewsReport(browser))
                .ThenAsync("the report will show the test run name in green to indicate the test run passed", async (s) => {
                    await browser.WaitTillVisible(Pages.HtmlReportPage.TestRun.NameGreen);
                })
                .Run();
		}
Beispiel #7
0
 internal static Step ViewsReport(WebBrowser browser)
 {
     var step = xB.CreateAsyncStep(
         "the user views the html report",
         async (s) => {
             browser.Load(Pages.HtmlReportPage.Location.PageLocation);
             await browser.WaitTillVisible(Pages.HtmlReportPage.TestRun.Name);
             s.Output = browser.GetPageSource();
             s.OutputFormat = TextFormat.htmlpreview;
         });
     return step;
 }
		public async void Expand()
		{
            WebBrowser browser = new WebBrowser(WebDriver.Current);
            await xB.CurrentRun.AddScenario(this)
                .Given(HtmlReport.OfASingleSkippedScenario())
                .And(WebUser.ViewsReport(browser))
                .WhenAsync("the user cliks the first area", async (s) => { 
					await browser.ClickWhenVisible(Pages.HtmlReportPage.Area.Name(1));
				})
                .ThenAsync("the report should expand the features listed under the area", async (s) => {
					await browser.WaitTillVisible(Pages.HtmlReportPage.Area.Features(1));
                })
                .Run();
		}
Beispiel #9
0
		public async void Failing()
		{
            WebBrowser browser = new WebBrowser(WebDriver.Current);
            await xB.CurrentRun.AddScenario(this)
                .Given(HtmlReport.OfASingleFailedScenario())
                .When(WebUser.ViewsReport(browser))
                .ThenAsync("the report will show the area name in red to indicate a scenario failed", async (s) => {
					await browser.WaitTillVisible(Pages.HtmlReportPage.Area.NameRed(1));
                })
				.AndAsync("the features under the area will be expanded because it has a failing scenario", async (s) => {
					await browser.WaitTillVisible(Pages.HtmlReportPage.Area.Features(1));
				})
                .Run();
		}
Beispiel #10
0
		public async void Skipped()
		{
            WebBrowser browser = new WebBrowser(WebDriver.Current);
            await xB.CurrentRun.AddScenario(this)
                .Given(HtmlReport.OfASingleSkippedScenario())
                .When(WebUser.ViewsReport(browser))
                .ThenAsync("the report will show the area name in yellow to indicate scenarios were skipped", async (s) => {
					await browser.WaitTillVisible(Pages.HtmlReportPage.Area.NameYellow(1));
                })
				.AndAsync("the features under the area will be collapsed because it was not failing", async (s) => {
					await browser.WaitTillNotVisible(Pages.HtmlReportPage.Area.Features(1));
				})
                .Run();
		}
		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();
		}
Beispiel #12
0
		public async void Passing()
		{
            WebBrowser browser = new WebBrowser(WebDriver.Current);
            await xB.CurrentRun.AddScenario(this)
                .Given(HtmlReport.OfASinglePassingScenario())
                .When(WebUser.ViewsReport(browser))
                .ThenAsync("the report will show the area name in green to indicate all features passed", async (s) => {
					await browser.WaitTillVisible(Pages.HtmlReportPage.Area.NameGreen(1));
					browser.ElementHasText(Pages.HtmlReportPage.Area.Name(1), "My Area 1");
                })
				.AndAsync("the features under the area will be collapsed because it passed", async (s) => {
					await browser.WaitTillNotVisible(Pages.HtmlReportPage.Area.Features(1));
				})
                .Run();
		}
		public async void NoStatement()
		{
            WebBrowser browser = new WebBrowser(WebDriver.Current);
            await xB.CurrentRun.AddScenario(this)
                .Given(HtmlReport.OfASinglePassingScenario())
                .When(WebUser.ViewsReport(browser))
				.AndAsync("the user expands to view a feature with a feature statement", async (s) => {
					await browser.ClickWhenVisible(Pages.HtmlReportPage.Area.Name(1));
				})
                .ThenAsync("the report should not show the feature statement", async (s) => {
					await browser.ClickWhenVisible(Pages.HtmlReportPage.Feature.Name(1));
					await browser.WaitTillVisible(Pages.HtmlReportPage.Scenario.Name(1));
					browser.ValidateNotExist(Pages.HtmlReportPage.Feature.Statement(1));
                })
                .Run();
		}
		public async void PartialStatement()
		{
			string featureStatement = "In order to derive some value\r\nAs a [Missing!]\r\nI would like to [Missing!]";
            WebBrowser browser = new WebBrowser(WebDriver.Current);
            await xB.CurrentRun.AddScenario(this)
                .Given(HtmlReport.OfASinglePassingScenario("derive some value"))
                .When(WebUser.ViewsReport(browser))
				.AndAsync("the user expands to view a feature with a feature statement", async (s) => {
					await browser.ClickWhenVisible(Pages.HtmlReportPage.Area.Name(1));
				})
                .ThenAsync("the report should show the feature statement of:", async (s) => {
					await browser.WaitTillVisible(Pages.HtmlReportPage.Feature.Statement(1));
					browser.ElementHasText(Pages.HtmlReportPage.Feature.Statement(1), featureStatement);
                }, featureStatement)
                .Run();
		}
		public async void ExpandAll()
		{
            WebBrowser browser = new WebBrowser(WebDriver.Current);
            await xB.CurrentRun.AddScenario(this)
                .Given(HtmlReport.OfAPassingFullTestRun())
                .And(WebUser.ViewsReport(browser))
                .WhenAsync("the user clicks the expand all areas menu option", async (s) => {
					await browser.ClickWhenVisible(Pages.HtmlReportPage.Menu.MenuButton);
					await browser.ClickWhenVisible(Pages.HtmlReportPage.Menu.ExpandAllAreasButton);
				})
                .ThenAsync("the report should expand the features listed under the area", async (s) => {
					await browser.WaitTillVisible(Pages.HtmlReportPage.Area.Features(1));
					await browser.WaitTillVisible(Pages.HtmlReportPage.Area.Features(2));
					s.Output = browser.GetPageSource();
					s.OutputFormat = TextFormat.htmlpreview;
                })
                .Run();
		}
Beispiel #16
0
		public async void EmptyTestRun()
		{
            WebBrowser browser = new WebBrowser(WebDriver.Current);
            await xB.CurrentRun.AddScenario(this)
                .Given(HtmlReport.OfAnEmptyTestRun())
                .When(WebUser.ViewsReport(browser))
                .ThenAsync("the report will show the test run name at the top", async (s) => {
                    await browser.WaitTillVisible(Pages.HtmlReportPage.TestRun.Name);
                    browser.ElementHasText(Pages.HtmlReportPage.TestRun.Name, "My Test Run");
                })
                .And("the report will show the test run name as the title for the page", (s) => {
                    browser.HasTitle("My Test Run");
                })
                .AndAsync("the report will show the test run name in gray to indicate no scenarios were run", async (s) => {
                    await browser.WaitTillVisible(Pages.HtmlReportPage.TestRun.NameGrey);
                })
                .Run();
		}
Beispiel #17
0
		public async void WithException()
		{
            WebBrowser browser = new WebBrowser(WebDriver.Current);
            await xB.CurrentRun.AddScenario(this)
                .Given(HtmlReport.OfAFailingStepWithAnException())
				.When(WebUser.ViewsReport(browser))
                .ThenAsync("the user should see a section for the exception", async (s) => {
					await browser.WaitTillVisible(Pages.HtmlReportPage.Exception.Section(2));
				})
       			.AndAsync("the section should display the exception type", async (s) => { 
					await browser.WaitTillVisible(Pages.HtmlReportPage.Exception.Type(2));
				})
       			.AndAsync("the section should display the exception message", async (s) => { 
					await browser.WaitTillVisible(Pages.HtmlReportPage.Exception.Message(2));
				})
       			.AndAsync("the section should display the exception stack trace", async (s) => { 
					await browser.WaitTillVisible(Pages.HtmlReportPage.Exception.StackTrace(2));
				})
				.Run();
		}
Beispiel #18
0
		public async void Skipped()
		{
            WebBrowser browser = new WebBrowser(WebDriver.Current);
            await xB.CurrentRun.AddScenario(this)
                .Given(HtmlReport.OfASingleSkippedScenario())
                .When(WebUser.ViewsReport(browser))
				.AndAsync("the user clicks the first area", async (s) => {
					await browser.ClickWhenVisible(Pages.HtmlReportPage.Area.Name(1));
				})
				.AndAsync("the user clicks the first feature", async (s) => {
					await browser.ClickWhenVisible(Pages.HtmlReportPage.Feature.Name(1));
				})
				.AndAsync("the user clicks the first scenario", async (s) => {
					await browser.ClickWhenVisible(Pages.HtmlReportPage.Scenario.Name(1));
				})
                .ThenAsync("the report will show the step name in yellow to indicate the step was skipped", async (s) => {
					await browser.WaitTillVisible(Pages.HtmlReportPage.Step.Yellow(1));
                })
                .Run();
		}
Beispiel #19
0
		public async void Passing()
		{
            WebBrowser browser = new WebBrowser(WebDriver.Current);
            await xB.CurrentRun.AddScenario(this)
                .Given(HtmlReport.OfASinglePassingScenario())
                .When(WebUser.ViewsReport(browser))
				.AndAsync("the user clicks the first area", async (s) => {
					await browser.ClickWhenVisible(Pages.HtmlReportPage.Area.Name(1));
				})
				.AndAsync("the user clicks the first feature", async (s) => {
					await browser.ClickWhenVisible(Pages.HtmlReportPage.Feature.Name(1));
				})
				.AndAsync("the user clicks the first scenario", async (s) => {
					await browser.ClickWhenVisible(Pages.HtmlReportPage.Scenario.Name(1));
				})
                .ThenAsync("the report will show the step name in green to indicate it passed", async (s) => {
					await browser.WaitTillVisible(Pages.HtmlReportPage.Step.Green(1));
					browser.ElementHasText(Pages.HtmlReportPage.Step.Name(1), "Given my step 1");
                })
                .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();
		}