コード例 #1
0
        public void Ice_Spirit_is_on_Cards_Page()
        {
            var cardsPage = new CardsPage(driver);
            var iceSpirit = cardsPage.GoTo().GetCardByName("Ice Spirit");

            Assert.That(iceSpirit.Displayed);
        }
コード例 #2
0
        public void ThreeMusketeersIsOnTheCardsPage()
        {
            var cardsPage       = new CardsPage(driver);
            var threeMusketeers = cardsPage.GoTo().GetCardByName("Three Musketeers");

            Assert.That(threeMusketeers.Displayed);
        }
コード例 #3
0
        public void AssertIceSpiritCardIsOnCardPage()
        {
            //use our Page Map Pattern Classes
            CardsPage _cardsPage = new CardsPage(driver);

            _cardsPage.GoTo();
            var card = _cardsPage.GetCardByCardName("Ice Spirit");

            Assert.IsTrue(card.Displayed);
        }
コード例 #4
0
        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());
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        public void Ice_Spirit_is_on_the_cards_page()
        {
            // 1. go to statsroyale.com
            //driver.Url = "https://statsroyale.com";

            // 2. click cards links in header nav
            //driver.FindElement(By.CssSelector("a[href='/cards']")).Click();
            var cardPage  = new CardsPage(driver);
            var IceSpirit = cardPage.GoTo().GetCardByName("Ice Spirit");

            // 3. Assert ice spirit is displayed
            //var IceSpirit = driver.FindElement(By.CssSelector("a[href*='Ice+Spirit']"));
            Assert.That(IceSpirit.Displayed);
        }
コード例 #7
0
        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);
        }
コード例 #8
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);
        }