public void Ice_Spirit_headers_are_correct_on_Card_Details_Page() { new CardsPage(driver).GoTo().GetCardByName("Ice Spirit").Click(); var cardDetails = new CardDetailsPage(driver); var(category, arena) = cardDetails.GetCardCategory(); var cardName = cardDetails.Map.CardName.Text; var cardRarity = cardDetails.Map.CardRarity.Text; // WebDriverWait wait = new WebDriverWait(driver, System.TimeSpan.FromSeconds(50)); // wait.Until(driver => driver.FindElement(By.LinkText("Cards"))).Click(); // wait.Until(driver => driver.FindElement(By.CssSelector("a[href*='Ice+Spirit']"))).Click(); // IWebElement cardElement = wait.Until(driver => driver.FindElement(By.CssSelector("[class*='ui__headerMedium card__cardName']"))); // IWebElement cardDetails = wait.Until(driver => driver.FindElement(By.CssSelector("[class*='card__rarity']"))); // String cardRarity = wait.Until(driver => driver.FindElement(By.CssSelector("[class*='card__common']"))).Text; // var cardCategories = cardDetails.Text.Split(", "); // var cardName = cardElement.Text; // var cardType = cardCategories[0]; // var cardArena = cardCategories[1]; Assert.AreEqual("Ice Spirit", cardName); Assert.AreEqual("Troop", category); Assert.AreEqual("Arena 8", arena); Assert.AreEqual("Common", cardRarity); }
public void AssertIceSpiritCardStatsOnDetailsPage() { CardsPage _cardsPage = new CardsPage(driver); _cardsPage.GoTo(); _cardsPage.GetCardByCardName("Ice Spirit").Click(); CardDetailsPage _cardDetailsPage = new CardDetailsPage(driver); var cardRarity = _cardDetailsPage.GetCardRarity().Text.Split(','); Assert.AreEqual("Troop", cardRarity[0]); Assert.AreEqual("Arena 8", cardRarity[1].Trim()); }
public void AssertIceSpiritCardStatsOnDetailsPage() { CardsPage _cardsPage = new CardsPage(driver); _cardsPage.GoTo(); _cardsPage.GetCardByCardName("Ice Spirit").Click(); CardDetailsPage _cardDetailsPage = new CardDetailsPage(driver); Assert.AreEqual("Troop", _cardDetailsPage.GetCardCategory()); Assert.AreEqual("Arena 8", _cardDetailsPage.GetCardArena()); Assert.AreEqual("Ice Spirit", _cardDetailsPage._Map.CardName.Text); Assert.AreEqual("Common", _cardDetailsPage._Map.CardRarityStatus.Text); }
public void VerifyFailedPurchaseFlow() { //Getting the instance of the landing Home Page var homepage = new HomePage(_driver); var prodname = homepage.GetProductTitle(); //Assert the product title is same Assert.AreEqual("Midtrans Pillow", prodname.Trim()); //clicking on Buy button to navigate to shopping cart page homepage.ClickBuyNow(); //getting the instance of the shopping cart page var cartpage = new ShoppingCartPage(_driver); //Asserting the quantity of the item Assert.AreEqual("1", cartpage.GetQuantityValue()); //clicking on Checkout to navigate to order summary page cartpage.ClickCheckout(); //getting the instance of the order summary iframe var osummary = new OrderSummaryPage(_driver); //Assert the product name shown in the order summary Assert.AreEqual("Midtrans Pillow", osummary.GetProductName().Trim()); osummary.ClickContinueButton(); //getting the instance of the payment list iframe var paymentlist = new PaymentListPage(_driver); paymentlist.ClickCreditCard(); //getting the instance of the credit card details page var ccpage = new CardDetailsPage(_driver); // pass the values read from the config file ccpage.EnterCardDetails(failccnumber, ccexpiry, cccvv); ccpage.ClickContinueButton(); //getting the instance of the Bank OTP page var otppage = new OTPPage(_driver); otppage.EnterOTP(bankotp); otppage.ClickOkButton(); //getting the instance of the transaction status page var txpage = new TxStatusPage(_driver); var statusmsg = txpage.GetFailedTxStatusMessage(); //Assert the failed payment status message in transaction page Assert.IsTrue(statusmsg.ToLower().Trim().Contains("failed")); }
public void IceSpirirt_HeadersAreDisplayed_On_CardsDetails_Page() { Pages.cards.Goto().GetCardByName("Ice Spirit").Click(); var CardDetails = new CardDetailsPage(); var(Category, arena) = CardDetails.GetCartCategory(); var cardName = CardDetails.map.CardName.Text; var cardRarity = CardDetails.map.CardRarity.Text.Split('\n')[1]; Assert.AreEqual("Ice Spirit", cardName); Assert.AreEqual("Troop", Category); Assert.AreEqual("Arena 8", arena); Assert.AreEqual("Common", cardRarity); }
public void card_details_displayed(string cardName) { var card = new InMemoryCardService().GetCardByName(cardName); new CardsPage(driver).Goto().GetCardByName(cardName).Click(); var cardOnPage = new CardDetailsPage(driver).GetBaseCard(); Assert.AreEqual(card.Name, cardOnPage.Name); Assert.AreEqual(card.Rarity, cardOnPage.Rarity); Assert.AreEqual(card.Type, cardOnPage.Type); Assert.AreEqual(card.Arena, cardOnPage.Arena); }
public void Mirror_headers_are_correct_on_Card_Details_Page() { new CardsPage(driver).Goto().GetCardByName("Mirror").Click(); var cardDetails = new CardDetailsPage(driver); var(category, arena) = cardDetails.GetCardCategory(); var cardName = cardDetails.Map.CardName.Text; var(rarity, common) = cardDetails.GetCardCommon(); Assert.AreEqual("Mirror", cardName); Assert.AreEqual("Spell", category); Assert.AreEqual("Arena 12", arena); Assert.AreEqual("Epic", common); }
public void AssertMirrorCardStatsOnDetailsPage() { CardsPage _cardsPage = new CardsPage(driver); _cardsPage.GoTo(); Thread.Sleep(TimeSpan.FromSeconds(10)); _cardsPage.GetCardByCardName("Mirror").Click(); CardDetailsPage _cardDetailsPage = new CardDetailsPage(driver); var mirror = new MirrorCard(); Assert.AreEqual(mirror.Category, _cardDetailsPage._Map.CardRarity.Text.Split(',')[0]); Assert.AreEqual(mirror.Arena, _cardDetailsPage._Map.CardRarity.Text.Split(',')[1].Trim()); Assert.AreEqual(mirror.Name, _cardDetailsPage._Map.CardName.Text); Assert.AreEqual(mirror.RarityStatus, _cardDetailsPage._Map.CardRarityStatus.Text); }
public void Ice_Spirit_headers_are_correct_on_Cards_Details_Page() { // 2. accept cookies driver.FindElement(By.CssSelector("span[id='cmpbntyestxt'")).Click(); new CardsPage(driver).Goto().GetCardByName("Ice Spirit").Click(); var cardDetails = new CardDetailsPage(driver); var(Category, Arena) = cardDetails.GetCardCategory(); // 5. Assert basic header stats var cardName = cardDetails.Map.CardName.Text; var cardRarity = cardDetails.Map.CardRarity.Text; Assert.AreEqual("Ice Spirit", cardName); Assert.AreEqual("Troop", Category); Assert.AreEqual("Arena 8", Arena); Assert.AreEqual("Common", cardRarity); }
//[TestCase("Mirror")] //[TestCase("Ice Spirit")] public void AssertDifferentCardStatsOnDetailsPage(string cardName) { CardsPage _cardsPage = new CardsPage(driver); _cardsPage.GoTo(); Thread.Sleep(TimeSpan.FromSeconds(20)); _cardsPage.GetCardByCardName(cardName).Click(); CardDetailsPage _cardDetailsPage = new CardDetailsPage(driver); var cardOnPage = _cardDetailsPage.GetBaseCard(); //var mirror = new MirrorCard(); var targetedCardModel = new InMemoryCardService().GetCardByName(cardName); Assert.AreEqual(targetedCardModel.Category, cardOnPage.Category); Assert.AreEqual(targetedCardModel.Arena, cardOnPage.Arena); Assert.AreEqual(targetedCardModel.Name, cardOnPage.Name); Assert.AreEqual(targetedCardModel.RarityStatus, cardOnPage.RarityStatus); }
public void Ice_Spirit_Header_Are_correct_On_Card_Details_Page() { //2. click Cards link in header nav // driver.FindElement(By.CssSelector("a[href='/cards']")).Click(); //3. Go To ice spirit // driver.FindElement(By.CssSelector("s[href[href*='Ice+Spirit']")).Click(); new CardsPage(driver).Goto().GetCardByName("Ice Spirit").Click(); var cardDetails = new CardDetailsPage(driver); var(category, arena) = cardDetails.GetCardCategory(); //4. Assert basic header ststs var cardName = cardDetails.Map.CardName.Text; var cardRarity = cardDetails.Map.CardRarity.Text; Assert.AreEqual("Ice Spirit", cardName); Assert.AreEqual("Troop", category); Assert.AreEqual("Arena 8", arena); Assert.AreEqual("Common", cardRarity); }
public void Ice_Spirit_headers_are_correct_on_Details_Page() { // 1. go to statsroyale.com //driver.Url = "https://statsroyale.com"; // 2. click Cards link in header nav //driver.FindElement(By.CssSelector("a[href='/cards']")).Click(); // 3. go to ice spirit //driver.FindElement(By.CssSelector("a[href*='Ice+Spirit']")).Click(); // 4. Assert basic header stats new CardsPage(driver).Goto().GetCardByName("Ice Spirit").Click(); var cardDetails = new CardDetailsPage(driver); var(category, arena) = cardDetails.GetCardCategory(); var cardName = cardDetails.Map.CardName.Text; var(rarity, common) = cardDetails.GetCardCommon(); //var cardRarity = cardDetails.Map.CardRarity.Text; Assert.AreEqual("Ice Spirit", cardName); Assert.AreEqual("Troop", category); Assert.AreEqual("Arena 8", arena); Assert.AreEqual("Common", common); }
public void VerifyPurchaseFlow() { //Getting the instance of the landing Home Page var homepage = new HomePage(_driver); var prodname = homepage.GetProductTitle(); //Assert the product title is same Assert.AreEqual("Midtrans Pillow", prodname.Trim()); //clicking on Buy button to navigate to shopping cart page homepage.ClickBuyNow(); //getting the instance of the shopping cart page var cartpage = new ShoppingCartPage(_driver); //Asserting the quantity of the item Assert.AreEqual("1", cartpage.GetQuantityValue()); //clicking on Checkout to navigate to order summary page cartpage.ClickCheckout(); //getting the instance of the order summary iframe var osummary = new OrderSummaryPage(_driver); //Assert the product name shown in the order summary Assert.AreEqual("Midtrans Pillow", osummary.GetProductName().Trim()); osummary.ClickContinueButton(); //getting the instance of the payment list iframe var paymentlist = new PaymentListPage(_driver); paymentlist.ClickCreditCard(); //getting the instance of the credit card details page var ccpage = new CardDetailsPage(_driver); // pass the values read from the config file ccpage.EnterCardDetails(passccnumber, ccexpiry, cccvv); ccpage.ClickContinueButton(); //getting the instance of the Bank OTP page var otppage = new OTPPage(_driver); otppage.EnterOTP(bankotp); otppage.ClickOkButton(); //getting the instance of the transaction status page /* TO-DO: Caputuring Successful Transaction Message in the iframe is flaky * Tried few methods, but still stuck - so doing the verification in the Home page */ var txpage = new TxStatusPage(_driver); //var statusmsg = txpage.GetTxStatusMessage(); //Assert the Success Payment message in transaction page // TO-DO: When the above status message method is stabilized //Assert.IsTrue(statusmsg.ToLower().Trim().Contains("success")); //Assert in Home Page var homemsg = homepage.GetTransMessage(); Assert.IsTrue(homemsg.ToLower().Trim().Contains("thank you")); }