/// <summary> /// Sets the Pokeball field to a given pokeball. /// </summary> /// <param name="pokeball">pokeball to use</param> /// <returns>current add form for chaining</returns> public AddPokemonForm WithPokeball(string pokeball) { ElementHelpers.ClickFirstElementById("SelectedPokeballId"); ElementHelpers.ClickFirstElementByXPath(string.Format(Constants.OptionWithTextXPath, pokeball)); return(this); }
/// <summary> /// Initiate logon to Gaiaonline by selecting header tab. /// </summary> /// <returns>login form for chaining</returns> public static LoginForm Logon() { ElementHelpers.ClickFirstElementByCssSelector(".header-login-tab-login"); CurrentLoginForm = new LoginForm(); return(CurrentLoginForm); }
/// <summary> /// Sets the password field to a given password by css selector. /// </summary> /// <param name="password">password to enter</param> /// <returns>current login form for method chaining</returns> public LoginForm WithPassword(string password) { string selector = HeaderLoginInputSelector + nameof(password); ElementHelpers.SetFirstElementByCssSelector(selector, password); return(this); }
/// <summary> /// Sets the sex field to a given sex. /// </summary> /// <param name="sex">sex to use</param> /// <returns>current add form for chaining</returns> public AddPokemonForm WithSex(string sex) { ElementHelpers.ClickFirstElementById("SelectedSexId"); ElementHelpers.ClickFirstElementByXPath(string.Format(Constants.OptionWithTextXPath, sex)); return(this); }
/// <summary> /// Sets the username field to a given username by css selector. /// </summary> /// <param name="username">username to enter</param> /// <returns>current login form for method chaining</returns> public LoginForm WithUsername(string username) { string selector = HeaderLoginInputSelector + nameof(username); ElementHelpers.SetFirstElementByCssSelector(selector, username); return(this); }
public void CheckWidgetTitleNotAllowed(string widgetTitle) { LoggerPage.LogStart(MethodBase.GetCurrentMethod().Name); Assert.IsTrue( ElementHelpers.GetCursorValue(By.XPath($"//div[contains(text(),'{widgetTitle}')]")) .Equals("not-allowed")); LoggerPage.LogEnd(MethodBase.GetCurrentMethod().Name); }
void InitiateNextWave() { if (isGameOver) { return; } nextWaveElement = (Element)Random.Range(1, 6); GetComponent <DialogueController>().DisplayMessages(new string[] { "A wave of " + ElementHelpers.StringForElement(nextWaveElement) + " is incoming! Protect with " + ElementHelpers.StringForElement(ElementHelpers.ElementWeaknessForElement(nextWaveElement)) }); Invoke("SendWave", sendWaveDelay); if (sendWaveDelay > 2.5f) { sendWaveDelay -= 1.0f; } }
public void SingleVtSelectionSearchResult() { LoggerPage.LogStart(MethodBase.GetCurrentMethod().Name); this.SingleVtButton.Click(); ReadOnlyCollection <IWebElement> vtsBeforeSearch = this.elementHelpers.FindElements(ReportHeaderLocators.SingleVtListItem); this.elementHelpers.SendKeys(ReportHeaderLocators.SingleVtSearchInput, "mortgage"); ElementHelpers.Clear(ReportHeaderLocators.SingleVtSearchInput); ReadOnlyCollection <IWebElement> vtsAfterSearch = this.elementHelpers.FindElements(ReportHeaderLocators.SingleVtListItem); this.SingleVtButton.Click(); Assert.AreEqual(vtsBeforeSearch.Count, vtsAfterSearch.Count); LoggerPage.LogEnd(MethodBase.GetCurrentMethod().Name); }
private static void VerifyExpectedErrorOccurred() { ElementHelpers elementHelpers = new ElementHelpers(); var disclaimer = elementHelpers.FindElement(By.CssSelector("mi-disclaimer"), false); var error = elementHelpers.FindElement(By.XPath("//div[contains(text(),'An error occured while processing your request')]"), false); var reportsMenuButton = elementHelpers.FindElement(MiDashboardHeaderLocators.Reports).GetCssValue("cursor").Equals("default"); var maintenanceInfo = elementHelpers.FindElement(By.XPath("//div[contains(text(),'An error occurred. Please try again. If the problem continues, contact application administrator.')]"), false); var maintenanceUrl = Actions.GetCurrentUrl().Contains("maintenance"); if (disclaimer != null) { Helpers.Logger.Logger.Log("*******************************************"); Helpers.Logger.Logger.Log("********** A disclaimer occured **********"); Helpers.Logger.Logger.Log("*******************************************"); } if (error != null) { Helpers.Logger.Logger.Log("********************************************************************"); Helpers.Logger.Logger.Log("********** An error occured while processing your request **********"); Helpers.Logger.Logger.Log("********************************************************************"); } if (reportsMenuButton) { Helpers.Logger.Logger.Log("********************************************"); Helpers.Logger.Logger.Log("********** Reports are not loaded **********"); Helpers.Logger.Logger.Log("********************************************"); } if (maintenanceInfo != null) { Helpers.Logger.Logger.Log("***********************************************************************************************************************"); Helpers.Logger.Logger.Log("********** An error occurred. Please try again. If the problem continues, contact application administrator. **********"); Helpers.Logger.Logger.Log("***********************************************************************************************************************"); } if (maintenanceUrl) { Helpers.Logger.Logger.Log("**********************************************"); Helpers.Logger.Logger.Log("********** Maintenance Url appeared **********"); Helpers.Logger.Logger.Log("**********************************************"); } }
/// <summary> /// Sets the level field to a given level. /// </summary> /// <param name="level">level to use</param> /// <returns>current add form for chaining</returns> public AddPokemonForm WithLevel(string level) { ElementHelpers.SetFirstElementById("Level", level); return(this); }
/// <summary> /// Sets the location field to a given location. /// </summary> /// <param name="location">location to use</param> /// <returns>current add form for chaining</returns> public AddPokemonForm WithLocation(string location) { ElementHelpers.SetFirstElementById("Location", location); return(this); }
/// <summary> /// Logout of Gaiaonline. /// </summary> public static void Logout() { ElementHelpers.HoverOverElementByCssSelector(".user-dropdown-arrow"); ElementHelpers.ClickFirstElementByCssSelector(".user-dropdown-menu ul li:nth-child(3) a"); }
/// <summary> /// Click the submit button by xpath. /// </summary> protected override void OnSubmit() { ElementHelpers.ClickFirstElementByXPath(Constants.SubmitXPath); }
public ReportsPage() { this.elementHelpers = new ElementHelpers(); this.reportsActions = new ReportsActions(); this.Verify = new ReportsVerify(); }
public override string GetSortKey(Element element) { return(ElementHelpers.StructSortKey(element, sortKeyIndices)); }
public void Eliminated(Element e) { GetComponent <SpriteRenderer>().color = ElementHelpers.ColorFor(e); GetComponent <Animator>().Play("KillTile"); Destroy(gameObject, 0.8f); }
public MiDashboardPage() { this.elementHelpers = new ElementHelpers(); this.miDashboardHeaderPage = new MiDashboardHeaderPage(); }
public ReportsHeaderVerify() { this.elementHelpers = new ElementHelpers(); }
/// <summary> /// Sets the nickname field to a given nickname. /// </summary> /// <param name="nickName">nickname to use</param> /// <returns>current add form for chaining</returns> public AddPokemonForm WithNickname(string nickName) { ElementHelpers.SetFirstElementById("Nickname", nickName); return(this); }
/// <summary> /// Release the current Pokemon. /// </summary> public static void ReleaseCurrentPokemon() { ElementHelpers.ClickFirstElementByXPath("//a[contains(@href, 'Delete')]"); }
/// <summary> /// Click the submit button by css selector. /// </summary> protected override void OnSubmit() { string selector = HeaderLoginInputSelector + "submit"; ElementHelpers.ClickFirstElementByCssSelector(selector); }
/// <summary> /// Sets the capture date field to a given date. /// </summary> /// <param name="date">date to use</param> /// <returns>current add form for chaining</returns> public AddPokemonForm WithCaptureDate(string date) { ElementHelpers.SetFirstElementById("Date", date); return(this); }
/// <summary> /// View the Pokemon from Pokedex by given nickname. /// </summary> /// <param name="nickName">nickname to view</param> public static void ViewPokemonByNickname(string nickName) { ElementHelpers.ClickFirstElementByXPath("//h4[text()='Nickname: " + nickName + "']"); }
public void WaveHitWithElement(int e) { if (isGameOver) { return; } GetComponent <AudioSource>().PlayOneShot(incomingWaveSound); if (NeighborCountAtSpot(50, 50) < 6) { SpiritDestroyed(); return; } List <int[]> tilesToRemove = new List <int[]> { }; Element element = (Element)e; Debug.Log("attacking with element: " + element); foreach (int[] spot in ExposedSpots()) { Element elementAtSpot = (Element)tileSpots[spot[0], spot[1]]; if (element == ElementHelpers.ElementResistedForElement(elementAtSpot)) { Debug.Log("safe because I'm: " + elementAtSpot); } else { // potentially unsafe, now check neighbors for protection bool isProtected = false; foreach (int[] neighborSpot in NeighborsAtSpot(spot[0], spot[1])) { // protected next to resisting element if (element == ElementHelpers.ElementResistedForElement((Element)tileSpots[neighborSpot[0], neighborSpot[1]])) { isProtected = true; break; } } if (!isProtected) { // destroy the tile if (TileAtSpot(spot[0], spot[1]) != null) { tileSpots[spot[0], spot[1]] = 0; // placedTiles.Remove(spot); tilesToRemove.Add(spot); TileAtSpot(spot[0], spot[1]).Eliminated(element); } } } } foreach (int[] t in tilesToRemove) { placedTiles.Remove(t); } // destroy any non-protected tiles that are weak to the element foreach (int[] spot in placedTiles) { Element elementAtSpot = (Element)tileSpots[spot[0], spot[1]]; // check if weak to the coming element if (elementAtSpot == ElementHelpers.ElementResistedForElement(element)) { bool isProtected = false; foreach (int[] neighborSpot in NeighborsAtSpot(spot[0], spot[1])) { // protected next to resisting element if (element == ElementHelpers.ElementResistedForElement((Element)tileSpots[neighborSpot[0], neighborSpot[1]])) { isProtected = true; break; } } if (!isProtected) { // destroy the tile if (TileAtSpot(spot[0], spot[1]) != null) { tileSpots[spot[0], spot[1]] = 0; tilesToRemove.Add(spot); TileAtSpot(spot[0], spot[1]).Eliminated(element); } } } } foreach (int[] t in tilesToRemove) { placedTiles.Remove(t); } Invoke("EliminateLoners", 1.0f); }