Esempio n. 1
0
        public void IWaitForAngularAjaxCallsToCompleteStep_WhenCanGetUrlReturnsFalse_DoesNotTryToGetUrl()
        {
            var browser = new Mock <IBrowser>(MockBehavior.Strict);

            browser.Setup(s => s.IsClosed).Returns(false);
            browser.Setup(s => s.IsDisposed).Returns(false);
            browser.Setup(s => s.CanGetUrl()).Returns(false);
            WebDriverSupport.Browser = browser.Object;

            var pipelineService = new Mock <IActionPipelineService>(MockBehavior.Strict);
            var scenarioContext = new Mock <IScenarioContextHelper>(MockBehavior.Strict);
            var steps           = new WaitingSteps(pipelineService.Object, scenarioContext.Object);

            steps.WaitForAngular();

            browser.VerifyAll();
        }
Esempio n. 2
0
        public void TestIWaitForAngularAjaxCallsToCompleteStepWithNothingPending()
        {
            var browser = new Mock <IBrowser>(MockBehavior.Strict);

            browser.Setup(s => s.IsClosed).Returns(false);
            browser.Setup(s => s.IsDisposed).Returns(false);
            browser.Setup(s => s.Url).Returns("http://www.specbind.org");
            browser.Setup(s => s.ExecuteScript(It.IsAny <string>())).Returns("0");
            WebDriverSupport.Browser = browser.Object;

            var pipelineService = new Mock <IActionPipelineService>(MockBehavior.Strict);
            var scenarioContext = new Mock <IScenarioContextHelper>(MockBehavior.Strict);
            var steps           = new WaitingSteps(pipelineService.Object, scenarioContext.Object);

            steps.WaitForAngular();

            browser.VerifyAll();
        }
Esempio n. 3
0
		public void TestIWaitForAngularAjaxCallsToCompleteStepWithSomethingPending()
		{
			var browser = new Mock<IBrowser>(MockBehavior.Strict);
			browser.Setup(s => s.IsClosed).Returns(false);
			browser.Setup(s => s.IsDisposed).Returns(false);
			browser.Setup(s => s.Url).Returns("http://www.specbind.org");
			browser.SetupSequence(s => s.ExecuteScript(It.IsAny<string>()))
				.Returns("1")
				.Returns("0");
			WebDriverSupport.Browser = browser.Object;

			var pipelineService = new Mock<IActionPipelineService>(MockBehavior.Strict);
			var scenarioContext = new Mock<IScenarioContextHelper>(MockBehavior.Strict);
			var steps = new WaitingSteps(pipelineService.Object, scenarioContext.Object);

			steps.WaitForAngular();

			browser.VerifyAll();
		}