Пример #1
0
        public void GetWeatherUsingGPS(bool toggleScreensBeforeTest)
        {
            //Arrange
            string actualTemperatureLabelText, actualConditionLabelText;

            //Act
            ToggleScreens(toggleScreensBeforeTest);

            WeatherPage.ToggleGPSSwitch();
            WeatherPage.TapGetWeatherButton();

            Thread.Sleep(2000);

            WeatherPage.WaitForNoActivityIndicator();

            //Assert
            actualConditionLabelText   = WeatherPage.GetConditionText();
            actualTemperatureLabelText = WeatherPage.GetTemperatureText();
            Assert.IsNotEmpty(actualConditionLabelText, "Condition Text Is Empty");
            Assert.IsNotEmpty(actualTemperatureLabelText, "Temperature Text Is Empty");
        }
Пример #2
0
        public void GetWeatherUsingText(string location, bool toggleScreensBeforeTest)
        {
            //Arrange
            string expectedConditionCityText = ParseConditionCityFromString(location, ',');
            string actualTemperatureLabelText, actualConditionCityText;

            //Act
            ToggleScreens(toggleScreensBeforeTest);

            WeatherPage.EnterLocation(location);
            WeatherPage.TapGetWeatherButton();

            Thread.Sleep(2000);

            WeatherPage.WaitForNoActivityIndicator();

            //Assert
            actualConditionCityText    = ParseConditionCityFromString(WeatherPage.GetConditionText(), ':');
            actualTemperatureLabelText = WeatherPage.GetTemperatureText();
            Assert.AreEqual(expectedConditionCityText, actualConditionCityText, "Exptected Condition City Does Not Match Actual Condition City");
            Assert.IsNotEmpty(actualTemperatureLabelText, "Temperature Text Is Empty");
        }