AppDiTests.AppDriverFabricTests.AppDriverFactory_Dynamic_PageObjectRegistration.Works_Reistering_A_Single_Page_At_A_time C# (CSharp) Method

Works_Reistering_A_Single_Page_At_A_time() private method

private Works_Reistering_A_Single_Page_At_A_time ( ) : void
return void
        public void Works_Reistering_A_Single_Page_At_A_time()
        {
            //This is the URL configured on appdi.config.json and hence it should be the URL value of our Concrete page object
            //See test "Creates_AppDriver_taking_defaults_from_JSON_config()" for details
            const string EXPECTED_CONFIG_URL = @"http://www.google.com/";

            //Register a Page Object with our app driver
            dynamic driver = SUT.Using<PhantomJSDriver>().Register<ConcretePageObject>().Create();

            //Act
            //Accesing the page we just registered. If this was done correctly, we should be able to access its properties with no issues...
            var pageObjectUrl = driver.Concrete.Url.ToString();

            //Clean up
            driver.WebDriver.Value.Quit();

            //Ensure we have access to the dynamic page object we just registered
            //And that it was created as expected
            Assert.Equal(EXPECTED_CONFIG_URL, pageObjectUrl);
            Assert.NotNull(driver.Concrete.Wait);
        }