コード例 #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();
		}
コード例 #4
0
		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
ファイル: ViewStep.cs プロジェクト: Stewartarmbrecht/xBDD
		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
ファイル: ViewStep.cs プロジェクト: Stewartarmbrecht/xBDD
		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();
		}
コード例 #7
0
		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
ファイル: ViewFeature.cs プロジェクト: Stewartarmbrecht/xBDD
		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();
		}