/// <summary> /// LyricsDownloadTestMethod2 /// </summary> public void LyricsDownloadTestMethod2() { #region Variable Declarations XamlEdit uIArtistBoxEdit = this.UIBassBoosterWindow.UIArtistBoxEdit; #endregion // Verify that the 'ControlType' property of 'ArtistBox' text box is not equal to 'null' Assert.IsNotNull(uIArtistBoxEdit.ControlType, "Artist Fail"); }
/// <summary> /// AssertMethod2 - Use 'AssertMethod2ExpectedValues' to pass parameters into this method. /// </summary> public void AssertMethod2() { #region Variable Declarations XamlEdit uITxtEdit = this.UISampleApplicationWindow.UITxtEdit; #endregion // Verify that the 'AutomationId' property of 'txt' text box equals 'txt' Assert.AreEqual(this.AssertMethod2ExpectedValues.UITxtEditAutomationId, uITxtEdit.AutomationId); }
/// <summary> /// AssertMethod1 - Use 'AssertMethod1ExpectedValues' to pass parameters into this method. /// </summary> public async void AssertMethod1() { #region Variable Declarations XamlButton uIAddMusicButton = this.UIBassBoosterWindow.UIAddMusicButton; XamlEdit uILyricsTextBoxEdit = this.UIBassBoosterWindow.UIItemPane.UILyricsTextBoxEdit; #endregion await Task.Delay(100000); //doesnt work // Verify that the 'ControlType' property of 'Add Music' button equals 'Button' Assert.AreEqual(this.AssertMethod1ExpectedValues.UIAddMusicButtonControlType, uIAddMusicButton.ControlType.ToString(), "aaa"); // Verify that the 'ControlType' property of 'LyricsTextBox' text box contains 'Sometime I just' StringAssert.Contains(uILyricsTextBoxEdit.ControlType.ToString(), this.AssertMethod1ExpectedValues.UILyricsTextBoxEditControlType, "FAil"); }
/// <summary> /// AssertMethod1 - Use 'AssertMethod1ExpectedValues' to pass parameters into this method. /// </summary> public void AssertMethod1() { #region Variable Declarations UITestControl uITake158GetdownatyourText = this.UIItemWindow.UIScrollerPane.UITake158GetdownatyourText; XamlEdit start = this.UICeylonBusRoutesWindow.UITextStartGroup.UITextBoxEdit; XamlEdit end = this.UICeylonBusRoutesWindow.UITextEndGroup.UITextBoxEdit; XamlButton search = this.UICeylonBusRoutesWindow.UIBestRoutesButton; start.Text = "Moratuwa"; end.Text = "Piliyandala"; Gesture.Tap(search); #endregion // Verify that the 'ControlType' property of 'Take 158 . Get down at your destination, Piliyanda...' label equals 'Take 158. Get down at your destination, Piliyandala' Assert.AreEqual("Take 158. Get down at your destination, Piliyandala", uITake158GetdownatyourText, "Wrong Value"); }
/// <summary> /// Get text written in xaml text box /// </summary> /// <param name="viewName"></param> /// <param name="controlName"></param> /// <param name="waitTime"></param> /// <param name="dynamicVariable"></param> /// <returns></returns> public static string GetText(string viewName, string controlName, int waitTime = WaitTime.DefaultWaitTime, string dynamicVariable = "") { Logger.InsertLogLine("Get text- Control: " + controlName + " in View : " + viewName); Control control = PopulateControl(viewName, controlName, dynamicVariable); XamlEdit xamlTextbox = new XamlEdit(xamlAppWindow); foreach (string key in control.SearchProperties.Keys) { xamlTextbox.SearchProperties.Add(key, control.SearchProperties[key]); } xamlTextbox.WindowTitles.Add(windowName); xamlTextbox.WaitForControlExist(waitTime); return xamlTextbox.Text; }