public void ThenUpdatedComputedPaymentStreamNumberValueShouldDisplayOnArmBestCase() { TotalValueDifference = 0; for (var rowIndex = 0; rowIndex < TridVariable.AbcPaymentStreamNo.Count - 1; rowIndex++) { AbcPaymentScheduleGridElements(rowIndex + 1); try { var actualValue = Math.Round(ProjActions.GetNumericValueFromString(UIActions.GetText(AbcPaymentStreamNumber)), 2); var expectedValue = Math.Round(Convert.ToDouble(TridVariable.AbcPaymentStreamNo[rowIndex]), 2); ValueDifference = Math.Abs(expectedValue - actualValue); Assert.AreEqual(expectedValue, actualValue, "Actual value does not match as expected for the row {0} with the difference of {1}", rowIndex + 1, ValueDifference); Console.WriteLine("==========================================================="); Console.WriteLine("ExpectedValue Row {0} :{1}", rowIndex + 1, expectedValue); Console.WriteLine("ActualValue Row {0} :{1}", rowIndex + 1, actualValue); Console.WriteLine("============================================================"); } catch (Exception e) { TotalValueDifference = 1; Console.WriteLine(e); TestCaseStatus = false; TestFailureCount += 1; CardsFailure += "|| AbcPaymentStreamNo[" + (rowIndex + 1) + "] || : " + e + " \n ====================================================================================\n"; } } }
public void ThenUserIsAtRidersigninPage() { Console.WriteLine("In rider then"); string expected = "hi"; Assert.AreEqual(expected, UIActions.getTitle()); }
PlayerAction lastAction; // Tracks the actively held down button/axi, to assist with the cooloff timer. // Use this for initialization. Occurs before Start(), will execute even if script is disabled (but not if gameObject is disabled). void Awake() { filteredDirection = new TwoAxisInputControl(); filteredDirection.StateThreshold = 0.5f; uiActions = UIActions.CreateWithDefaultBindings(); }
public RaycastSource(IProxy proxy, Transform rayOrigin, Node node, UIActions actionMapInput) { this.proxy = proxy; this.rayOrigin = rayOrigin; this.node = node; this.actionMapInput = actionMapInput; }
private void doRender() { ProgressBarSet d = new ProgressBarSet(SetProgressBarValue); UIActionsParam da = new UIActionsParam(SetRenderName); // do rendering stuff here foreach (listMusicItem i in listFiles.Items) { currentRenderingItem = i; pbarCurFileA.Invoke(d, new object[] { 0, pbarCurFileA }); pbarCurFileV.Invoke(d, new object[] { 0, pbarCurFileV }); statusStrip.Invoke(da, new object[] { i.ToString() }); i.Render(pbarCurFileA, pbarCurFileV); pbarTotal.Invoke(d, new object[] { pbarTotal.Value + 1, pbarTotal }); //pbarTotal.Value = pbarTotal.Value + 1; } currentRenderingItem = null; UIActions de = new UIActions(RenderStopped); pbarTotal.Invoke(de); }
void CreateActions() { actions = new UIActions(); actions.Submit.AddDefaultBinding(InputControlType.Action1); actions.Submit.AddDefaultBinding(InputControlType.Action3); actions.Submit.AddDefaultBinding(Key.E); actions.Submit.AddDefaultBinding(Key.Space); actions.Submit.AddDefaultBinding(Key.Return); actions.Cancel.AddDefaultBinding(InputControlType.Action2); actions.Cancel.AddDefaultBinding(Key.Escape); actions.Up.AddDefaultBinding(InputControlType.LeftStickUp); actions.Up.AddDefaultBinding(InputControlType.DPadUp); actions.Up.AddDefaultBinding(Key.W); actions.Up.AddDefaultBinding(Key.UpArrow); actions.Down.AddDefaultBinding(InputControlType.LeftStickDown); actions.Down.AddDefaultBinding(InputControlType.DPadDown); actions.Down.AddDefaultBinding(Key.S); actions.Down.AddDefaultBinding(Key.DownArrow); actions.Left.AddDefaultBinding(InputControlType.LeftStickLeft); actions.Left.AddDefaultBinding(InputControlType.DPadLeft); actions.Left.AddDefaultBinding(Key.A); actions.Left.AddDefaultBinding(Key.LeftArrow); actions.Right.AddDefaultBinding(InputControlType.LeftStickRight); actions.Right.AddDefaultBinding(InputControlType.DPadRight); actions.Right.AddDefaultBinding(Key.D); actions.Right.AddDefaultBinding(Key.RightArrow); }
public void AddRaycastSource(IProxy proxy, Node node, ActionMapInput actionMapInput, Transform rayOrigin, Func <RaycastSource, bool> validationCallback = null) { UIActions actions = (UIActions)actionMapInput; actions.active = false; m_RaycastSources.Add(rayOrigin, new RaycastSource(proxy, rayOrigin, node, actions, validationCallback)); }
public static void KillProtonVPNProcessAndReopenIt() { KillProtonVpnProcess(); RefreshSession(); UIActions.WaitUntilElementIsNotVisible(By.ClassName("Loading"), 15); RefreshSession(); }
public void WhenAlsoEnters(string accnt, string phno, string add1, string city, string state, string zip, string ind, string weekly, string cnt) { Console.WriteLine("accnt:" + accnt); Console.WriteLine("phno:" + phno); Console.WriteLine("add1:" + add1); Console.WriteLine("city:" + city); Console.WriteLine("state:" + state); Console.WriteLine("zip:" + zip); Console.WriteLine("ind:" + ind); Console.WriteLine("weekly:" + weekly); Console.WriteLine("cnt:" + cnt); UIActions.sendKey(xui.txt_acct, accnt); UIActions.sendKey(xui.txt_phno, phno); UIActions.sendKey(xui.txt_addr, add1); UIActions.selectByVisibleText(xui.dropdn_cnt, cnt); UIActions.sendKey(xui.txt_city, city); UIActions.selectByValue(xui.dropdn_state, state); UIActions.sendKey(xui.txt_zip, zip); UIActions.selectByVisibleText(xui.dropdn_ind, ind); // UIActions.selectByVisibleText(xui.dropdn_weekly, weekly); UIActions.selectByValue(xui.dropdn_weekly, weekly); }
private void doUpload() { ProgressBarSet d = new ProgressBarSet(SetMarqueeSpeed); UIActionsParam da = new UIActionsParam(SetUploadName); pbarCurFileA.Invoke(d, new object[] { 0, pbarCurFileA }); foreach (listMusicItem i in listFiles.Items) { currentRenderingItem = i; if (File.Exists(i.v.VideoPath)) { pbarCurFileA.Invoke(d, new object[] { 100, pbarCurFileA }); statusStrip.Invoke(da, new object[] { i.v.VideoName }); i.Upload(pbarCurFileA); } pbarTotal.Invoke(d, new object[] { pbarTotal.Value + 1, pbarTotal }); } currentRenderingItem = null; UIActions de = new UIActions(UploadStopped); pbarTotal.Invoke(de); }
private static void SetFormRefs(MainForm Ref) { HardwareListener.Init(Ref.Handle); UIActions.SetFormRef(Ref); ScriptManager.SetFormRef(Ref); SkillManager.SetFormRef(Ref); ActiveMode.SetFormRef(Ref); }
public void WhenUserClicksOnLogin() { Console.WriteLine("In when"); UIActions.elementExists(ur.airbnb_login); // bool isdisplayed = UIActions.ElementDisplayed(ur.airbnb_login); // UIActions.Click(ur.airbnb_login); UIActions.javascriptclick(ur.airbnb_login); }
public RaycastSource(IProxy proxy, Transform rayOrigin, Node node, UIActions actionMapInput, Func <RaycastSource, bool> validationCallback) { this.proxy = proxy; this.rayOrigin = rayOrigin; this.node = node; this.actionMapInput = actionMapInput; this.isValid = validationCallback ?? delegate { return(true); }; }
public void ThenIAmNavigatedToBookStore(string url = "") { if (string.IsNullOrEmpty(url)) { url = "https://demoqa.com/books"; } UIActions.VerifyURL(url); }
public void GivenUserIsAtRegistrationPage(string url) { string featureName = FeatureContext.Current.FeatureInfo.Title; string featureFilePath = featurePathBase.GetFeatureFilePath(featureName); Console.Out.WriteLine(featureFilePath); newfeature.NewFeatureCheckCreate(featureName, featureFilePath); UIActions.GoToUrl(url); }
private void CreateMenuItem(string label, UIActions uiAction) { var item = new MenuItem(label); item.Activated += (sender, e) => this.UIActionSelected?.Invoke(this, new UIActionEventArgs(uiAction)); this.popupMenu.Add(item); this.popupMenu.Add(new SeparatorMenuItem()); }
public void GivenIProvideRequiredDetailsFNameLNameMyPSsAndFName_LNameEmail_Com(string fName, string lName, string userName, string password) { registrationPage.FirstNameTextByXPath.SetText(fName); registrationPage.LastNameTextByXPath.SetText(lName); registrationPage.UsernameTextByXPath.SetText(userName); registrationPage.PasswordTextByXPath.SetText(password); UIActions.PressKey(Keys.Tab); registrationPage.CaptchaButton.ClickHiddenElements(); }
private void Awake() { TankControls = false; Joined = false; _uiActions = new UIActions(); SetJoined(false); SetInputDevice(null); UpdateTankControlLabel(); }
public static void UploadJsonFile() { UIActions.Click(BrowseButton); Thread.Sleep(500); SendKeys.SendWait(UploadFilePath + TridVariable.ScenarioNo + ".json"); Thread.Sleep(500); SendKeys.SendWait(@"{Enter}"); Thread.Sleep(500); UIActions.Click(UploadButton); }
private void Start() { uiActions = GetComponent <UIActions>(); uiActions.Player_State_Changed += UpdatePlayerStateUI; uiActions.PlanterState = GameManager.planter_UI_State.None; uiActions.LumberjackState = GameManager.lumberjack_UI_State.None; uiActions.Promote_State_Changed += UpdatePromoteStateUI; uiActions.PromoteState = GameManager.promote_UI_State.None; }
public void NumericValueCardsValidation(string cardName, By actualComputedValue, string expectedComputedValue, By actualDisclosedValue, string expectedDisclosedValue, By actualVarianceValue, string expectedVarianceValue) { try { var actualCValue = Math.Round( ProjActions.GetNumericValueFromString(UIActions.GetText(actualComputedValue)), 2); var expectedCValue = Math.Round(Convert.ToDouble(expectedComputedValue), 2); ValueDifference = Math.Abs(expectedCValue - actualCValue); Assert.AreEqual(expectedCValue, actualCValue, "Computed value does not match as expected with the difference of {0}", ValueDifference); Console.WriteLine("==========================================================="); Console.WriteLine("ExpectedComputedValue :{0}", expectedCValue); Console.WriteLine("ActualComputedValue :{0}", actualCValue); Console.WriteLine("============================================================"); var actualDValue = ProjActions.GetNumericValueFromString(UIActions.GetText(actualDisclosedValue)); var expectedDValue = Math.Round(Convert.ToDouble(expectedDisclosedValue), 2); ValueDifference = Math.Abs(expectedDValue - actualDValue); Assert.AreEqual(expectedDValue, actualDValue, "Disclosed value does not match as expected with the difference of {0}", ValueDifference); Console.WriteLine("==========================================================="); Console.WriteLine("ExpectedDisclosedValue :{0}", expectedDValue); Console.WriteLine("ActualDisclosedValue :{0}", actualDValue); Console.WriteLine("============================================================"); ValueDifference = Math.Abs(actualCValue - actualDValue); Assert.AreEqual(actualDValue, actualCValue, "Disclosed value does not match with computed value with the difference of {0}", ValueDifference); var expectedVValue = Convert.ToDouble(expectedVarianceValue); var actualVValue = ProjActions.GetNumericValueFromString(UIActions.GetText(actualVarianceValue)); ValueDifference = Math.Abs(actualVValue - expectedVValue); Assert.AreEqual(expectedVValue, actualVValue, "Variance does not match as expected with the difference of {0}", ValueDifference); Console.WriteLine("==========================================================="); Console.WriteLine("ExpectedVarianceValue :{0}", expectedVValue); Console.WriteLine("ActualVarianceValue :{0}", actualVValue); Console.WriteLine("============================================================"); ProjActions.CreateCsvFile(ValueDifference.ToString()); } catch (Exception e) { ProjActions.CreateCsvFile(ValueDifference.ToString()); Console.WriteLine(e); if (ValueDifference >= 0.1) { TestCaseStatus = false; TestFailureCount += 1; CardsFailure += "|| " + cardName + " || : " + e + " \n ====================================================================================\n"; } } }
public RaycastSource(IProxy proxy, Transform rayOrigin, Node node, UIActions actionMapInput, Func <RaycastSource, bool> validationCallback) { UIActions actions = (UIActions)actionMapInput; actions.active = false; this.proxy = proxy; this.rayOrigin = rayOrigin; this.node = node; this.actionMapInput = actionMapInput; isValid = validationCallback; }
public void ThenICanClickOnLinkInTheRecivedEmail() { IWebDriver driver = new ChromeDriver(); UIController.Instance.Driver = driver; outlookHelper.ReadOutlookEmail(inbox, "[Subject] = 'Test Automation'"); var htmlLinks = outlookHelper.HTMLLinkList; var match = htmlLinks.FirstOrDefault(stringToCheck => stringToCheck.Contains("github.com")); UIActions.NavigateToUrl(match.ToString()); }
void Awake() { if (_instance != null && _instance != this) { Destroy(this.gameObject); } else { _instance = this; } SetupInput(); }
public static void TearDown() { UIActions.Quit(); if (!TestCaseStatus) { Console.WriteLine("####################################################################################"); Console.WriteLine("===================================================================================="); Console.WriteLine("Scenario Number : {0}", TridVariable.ScenarioNo); Console.WriteLine("The total number of cards Failue: {0}", TestFailureCount); Console.WriteLine("Name of cards Failed: {0}", CardsFailure); Console.WriteLine("===================================================================================="); Console.WriteLine("####################################################################################"); throw new Exception("Test Case failed"); } }
public void WhenUserEnters(string fn, string ln, string jt, string em, string rem, string pwd, string repwd) { Console.WriteLine("repwd:" + repwd); ObjectRepo.driver.SwitchTo().Frame("iframeRegisterNow"); UIActions.elementExists(xui.txt_fn); UIActions.sendKey(xui.txt_fn, fn); UIActions.sendKey(xui.txt_ln, ln); UIActions.sendKey(xui.txt_jobtitle, jt); UIActions.sendKey(xui.txt_email, em); UIActions.sendKey(xui.txt_reemail, rem); UIActions.sendKey(xui.txt_pwd, pwd); UIActions.sendKey(xui.txt_repwd, repwd); UIActions.Click(xui.chk_agree); }
public static void PmiRatesGridEmptyValidation() { var isRowExists = false; try { UIActions.Count(PmiRatesGridRowsCount); isRowExists = true; } catch (Exception) { // ignored } if (isRowExists) { throw new Exception("PMI Grid is not empty"); } }
public static void PrepaidChargesGridEmptyValidation() { var isRowExists = false; try { UIActions.GetText(PrepaidChargeCustomGridCount); isRowExists = true; } catch (Exception) { // ignored } if (isRowExists) { throw new Exception("Prepaid Charges Custom Grid is not empty"); } }
public static void AddPrepaidCustomValues() { if (TridVariable.PrepaidCustomFieldsCustomName != "") { if (TridVariable.PrepaidCustomFieldsCustomName != "0") { UIActions.Clear(PrepaidChargeGridCustomName); UIActions.GiveInput(PrepaidChargeGridCustomName, TridVariable.PrepaidCustomFieldsCustomName); UIActions.Clear(PrepaidChargeGridCustomValue); UIActions.GiveInput(PrepaidChargeGridCustomValue, TridVariable.PrepaidCustomFieldsCustomValue); UIActions.Click(CustomFieldAddButton); } } else { PrepaidChargeGridValidation(); } }
private void Awake() { audioSource = GetComponent <AudioSource>(); animator = GetComponent <Animator>(); sprite = GetComponent <SpriteRenderer>(); actionPanel = FindObjectOfType <ActionPanel>(); terrain = GameObject.FindGameObjectWithTag("Terrain").transform; uIActions = FindObjectOfType <UIActions>(); chopButton = actionPanel.lumberjack_chop.GetComponent <ChopButton>(); digButton = actionPanel.lumberjack_dig.GetComponent <DigButton>(); plantButton = actionPanel.planter_plant.GetComponent <PlantButton>(); waterButton = actionPanel.planter_water.GetComponent <WaterButton>(); fireButton = actionPanel.gameObject.transform.GetChild(8).GetComponent <FireButton>(); selectionIndicator = transform.GetChild(0).gameObject; //Gets the indicator child game object fatigueSlider = transform.SearchForChild("FatigueSlider").GetComponent <Slider>(); moves = new List <direction>(); }
private void ResetUIControls(UIActions uiAction) { if (_isSimple) { btnCorrect.Visible = false; btnIncorrect.Visible = false; btnRemove.Visible = true; pnlGoto.Visible = true; } else { btnCorrect.Visible = true; btnIncorrect.Visible = true; btnRemove.Visible = false; pnlGoto.Visible = false; } switch (uiAction) { case UIActions.NewCard: btnCorrect.Enabled = false; btnIncorrect.Enabled = false; btnRemove.Enabled = false; btnGoto.Enabled = false; txtQuestionNumber.Enabled = false; btnReplay.Enabled = false; btnShowAnswer.Enabled = false; txtAnswer.Text = ""; break; case UIActions.ReplayButtonClicked: btnReplay.Enabled = false; btnShowAnswer.Enabled = false; break; case UIActions.ShowAnswerButtonClicked: btnCorrect.Enabled = true; btnIncorrect.Enabled = true; btnRemove.Enabled = true; btnGoto.Enabled = true; txtQuestionNumber.Enabled = true; btnReplay.Enabled = true; btnShowAnswer.Enabled = false; break; case UIActions.SpeakCompleted: btnReplay.Enabled = true; if (txtAnswer.Text == "") btnShowAnswer.Enabled = true; break; default: throw new ArgumentException(); } }