예제 #1
0
		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();
		}
예제 #2
0
		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();
		}
예제 #3
0
		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 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();
		}
예제 #5
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();
		}
예제 #6
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 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();
		}
예제 #8
0
		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();
		}
예제 #9
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));
				})
                .ThenAsync("the report will show the feature name in yellow to indicate scenarios were skipped", async (s) => {
					await browser.WaitTillVisible(Pages.HtmlReportPage.Feature.NameYellow(1));
                })
				.AndAsync("the scenarios under the feature will be collapsed because it was not failing", async (s) => {
					await browser.WaitTillNotVisible(Pages.HtmlReportPage.Feature.Scenarios(1));
				})
                .Run();
		}