public void Card_details_are_correct_on_card_details_page(string cardName)
        {
            //Arrange
            BasePage.Cards.GetCardByName(cardName).Click();

            //Act
            var card       = new InMemoryCardService().GetCardByName(cardName);
            var cardOnPage = BasePage.CardDetails.GetBaseCard();

            //Assert
            Assert.AreEqual(card.CardName, cardOnPage.CardName);
            Assert.AreEqual(card.CardDescription, cardOnPage.CardDescription);
        }
Пример #2
0
        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);
        }
Пример #3
0
        //[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);
        }
Пример #4
0
        //[TestCase("Mirror")]
        //[TestCase("Ice Spirit")]
        public void AssertDifferentCardStatsOnDetailsPage(string cardName)
        {
            //CardsPage _cardsPage = new CardsPage(Driver.Current);
            // _cardsPage.GoTo();
            Pages.Cards.GoTo();//loading of the page after this action

            if (WaitUtils.isVisible(Driver.Current, TimeSpan.FromSeconds(20), By.XPath("//div[@class='ui__headerMedium'][contains(text(),'Cards')]")) == true)
            {
                Pages.Cards.GetCardByCardName(cardName).Click();
                if (WaitUtils.isVisible(Driver.Current, TimeSpan.FromSeconds(20), By.XPath("//div[text()='Statistics']")) == true)
                {
                    var cardOnPage        = Pages.CardDetails.GetBaseCard();
                    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);
                }
            }
        }