コード例 #1
0
        public void HoversTest()
        {
            var expected = new[] { "name: user1", "name: user2", "name: user3" };

            var homePage = new InternetPage(this.DriverContext)
                .OpenHomePageWithUserCredentials()
                .GoToHoversPage();

            var text1Before = homePage.GetHoverText(1);
            this.LogTest.Info("Text before: '{0}'", text1Before);
            homePage.MouseHoverAt(1);
            var text1After = homePage.GetHoverText(1);
            this.LogTest.Info("Text after: '{0}'", text1After);

            var text2Before = homePage.GetHoverText(2);
            this.LogTest.Info("Text before: '{0}'", text2Before);
            homePage.MouseHoverAt(2);
            var text2After = homePage.GetHoverText(2);
            this.LogTest.Info("Text after: '{0}'", text2After);

            var text3Before = homePage.GetHoverText(3);
            this.LogTest.Info("Text before: '{0}'", text3Before);
            homePage.MouseHoverAt(3);
            var text3After = homePage.GetHoverText(3);
            this.LogTest.Info("Text after: '{0}'", text3After);

            Assert.AreEqual(string.Empty, text1Before);
            Assert.AreEqual(string.Empty, text2Before);
            Assert.AreEqual(string.Empty, text3Before);

            Assert.AreEqual(expected[0], text1After);
            Assert.AreEqual(expected[1], text2After);
            Assert.AreEqual(expected[2], text3After);
        }