Ejemplo n.º 1
0
        public void TestCase()
        {
            //Sayfa Goruntulenme testi
            outputMessages.TestPageLoad(driver.Url);

            //giris
            loginPage.Login("*****@*****.**", "deneme123");

            //arama
            searchPage.Search("samsung");


            //sonuc bulundugunun testi
            try
            {
                driver.FindElement(By.Id("view"));
                Console.WriteLine("Urun bulundu");
            }
            catch (Exception)
            {
                Console.WriteLine("urun bulunamadi");
            }
            Console.Read();


            //Sayfa degistir
            searchPage.ChangePageBtn();

            //sayfanin degistiginin testi
            outputMessages.TestChangePage(driver.Url);

            //urunu favorilere ekle
            findProductPage.FindProduct();

            //urunun Data id yakala
            var element1 = findProductPage.elementID();

            //favorilere git
            favoritesPage.GoFavorites();

            //tum favorileri goster
            favoritesPage.ShowAllFavorites();

            //favorideki urunun Data id yakala
            var element2 = favoritesPage.FavoritesElementID();

            //Data id  karsilastir
            Assert.AreEqual(element1, element2, "Urun izlemeye alindi");


            //favori urunu sil
            favoritesPage.DeleteFavorites();

            //acilan confirm i kapat
            favoritesPage.CloseConfirm();

            //favori listesini kontrol et
            WaitSeconds(3);
            try
            {
                var deleteTest = driver.FindElement(By.ClassName("emptyWatchList"));
                Console.WriteLine("Urun silindi");
            }
            catch (Exception)
            {
                Console.WriteLine("Urun silinmedi");
            }
            Console.Read();
        }