public void Setup()
 {
     driver            = new ChromeDriver();
     googleMainPage    = new GoogleMainPage(driver);
     googleResultsPage = new GoogleResultsPage(driver);
     wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10));
 }
Ejemplo n.º 2
0
 public TestContext(IWebDriver driver)
 {
     Driver      = driver;
     MainPage    = new GoogleMainPage(Driver);
     ResultsPage = new GoogleResultsPage(Driver);
     WikiPage    = new WikiPage(Driver);
 }
Ejemplo n.º 3
0
        public void GoogleSearchTest()
        {
            var mainPage = new GoogleMainPage(_driver, _webDriverWait);
            SearchResultPage searchResultPage = mainPage.GetSearchResult("Wikipedia");

            searchResultPage.OpenLink("Вікіпедія");
            TimeSpan.FromSeconds(2);
            Assert.AreEqual("Вікіпедія", _driver.Title);
        }
Ejemplo n.º 4
0
        public void GoogleAnyPageNoMatchSearch()
        {
            GoogleMainPage MainGoogle = new GoogleMainPage();
            string         query      = "furniture stores kherson";
            string         word       = "EPAM";

            MainGoogle.GoToPage().InvokeSearch(query);
            Assert.AreEqual(true, MainGoogle.SearchPageWithScreenshotNoMatches(word));
        }
Ejemplo n.º 5
0
        public void GoogleAnyPageSearch()
        {
            GoogleMainPage MainGoogle = new GoogleMainPage();
            string         query      = "furniture";
            string         word       = "Bobs.com";

            MainGoogle.GoToPage().InvokeSearch(query);
            Assert.AreNotEqual((0 | 1), MainGoogle.SearchAnyPage(word));
            MainGoogle.TakeScreenshot(Helper.SetLocation(3));
        }
Ejemplo n.º 6
0
        public void GoogleFirstPageSearch()
        {
            GoogleMainPage MainGoogle = new GoogleMainPage();
            string         query      = "furniture";
            string         word       = "Amazon";

            MainGoogle.GoToPage().InvokeSearch(query);
            Assert.AreEqual(1, MainGoogle.SearchFirstPage(word));
            MainGoogle.TakeScreenshot(Helper.SetLocation(1));
            MainGoogle.TakeScreenshotWithJS(Helper.SetLocation(2));
        }
Ejemplo n.º 7
0
        static void Main(string[] args)
        {
            // The code provided will print ‘Hello World’ to the console.
            // Press Ctrl+F5 (or go to Debug > Start Without Debugging) to run your app.
            Console.WriteLine("Hello World!");
            Console.ReadKey();

            GoogleMainPage googlemainpage = new GoogleMainPage();

            googlemainpage.startChrome();
            googlemainpage.navigateGoogleMainPage();
            // Go to http://aka.ms/dotnet-get-started-console to continue learning how to build a console app!
        }
Ejemplo n.º 8
0
        static void Main(string[] args)
        {
            var chromeOptions = new ChromeOptions();

            chromeOptions.AddArgument("--no-sandbox");
            chromeOptions.AddArgument("--allow-running-insecure-content");
            chromeOptions.AddArgument("--ignore-gpu-blacklist");
            chromeOptions.AcceptInsecureCertificates = true;
            // Disable automation info-bar message
            chromeOptions.AddExcludedArgument("enable-automation");
            // Disable pop up 'Disable developer mode extensions'
            // Disable chrome save your password pop up
            chromeOptions.AddUserProfilePreference("credentials_enable_service", false);
            chromeOptions.AddUserProfilePreference("profile.password_manager_enabled", false);
            chromeOptions.SetLoggingPreference("performance", LogLevel.Info);
            var driver = new ChromeDriver(chromeOptions);

            driver.Manage().Timeouts().ImplicitWait = new TimeSpan(0, 0, 10);
            driver.Manage().Window.Maximize();
            var mainPage = new GoogleMainPage(driver);

            driver.Url = "https://www.betsafe.com/en/configuration";
            var performanceLogs    = driver.Manage().Logs.GetLog("performance");
            var responseReeivedLog = performanceLogs.Where(log => log.Message.Contains("Network.responseReceived\"")).ToList();

            string jsonFormatted = JValue.Parse(responseReeivedLog.First().Message).ToString(Formatting.Indented);

            Console.WriteLine(jsonFormatted);
            driver.Quit();

            //var driver = new ChromeDriver();
            //driver.Manage().Timeouts().ImplicitWait = new TimeSpan(0, 0, 10);
            //driver.Manage().Window.Maximize();

            //var mainPage = new GoogleMainPage(driver);
            //mainPage.Load();
            //mainPage.SearchField.SendKeys("42");
            //mainPage.SearchButton.Click();

            //var googleResultPage = new GoogleResultPage(driver);
            //Assert.IsTrue(googleResultPage.IsLoaded(), "Result page not loaded");
            //googleResultPage.Results.First(x => x.GetAttribute("href").Contains("Phrases_from_The_Hitchhiker")).Click();

            //var wikiPage = new WikiPage(driver);

            //StringAssert.Contains("Phrases from The Hitchhiker's Guide to the Galaxy", wikiPage.Header.Text);
            //Assert.Greater(wikiPage.HeadLines_2.Count, 0);
            //Assert.Greater(wikiPage.HeadLines_3.Count, 0);

            //driver.Quit();
        }
        public void FindVacancies()
        {
            GoogleMainPage.OpenGoogle();

            GoogleMainPage googleMainPage = new GoogleMainPage();

            googleMainPage.SearchByText("epam вакансии");
            googleMainPage.ClickMainRelevantLink();

            EpamMainPage epamMainPage = new EpamMainPage();

            epamMainPage.SearchJobByText("automation testing");
            epamMainPage.ClickFirstRelevantLink();
        }
Ejemplo n.º 10
0
        public void MyGoogleSearchTest()
        {
            // ARRANGE
            var mainPage = new GoogleMainPage();

            PageFactory.InitElements(driver, mainPage);
            var searchResultPage = new GoogleSearchResultPage(driver);

            PageFactory.InitElements(driver, searchResultPage);
            // ACT
            mainPage.SetSearchField("Selenium IDE export to C#");
            mainPage.WaitForVisibleHintList(driver);
            mainPage.PressSearchButton();
            // ASSERT
            bool rowExists = searchResultPage.GetNRowWithMessage(driver, 4, "Selenium IDE") == null ? false : true;

            Assert.IsTrue(rowExists);
        }
        public void WhenIClickLink(string link)
        {
            var googleManiPage = new GoogleMainPage();

            googleManiPage.ClickSearchResultLink(link);
        }
        public void ThenInTextResultsIShouldSee(string results)
        {
            var googleManiPage = new GoogleMainPage();

            Assert.IsTrue(googleManiPage.CheckLinkPresence(results));
        }
        public void WhenITypeToSearchTextField(string textToSearch)
        {
            var googleManiPage = new GoogleMainPage();

            googleManiPage.Search(textToSearch);
        }
Ejemplo n.º 14
0
 public void StartTest()
 {
     googleMainPage = new GoogleMainPage(driver, "http://www.google.com");
 }
Ejemplo n.º 15
0
 public void StartTest()
 {
     googleMainPage = new GoogleMainPage(driver);
     //googleMainPage.sideMenu.element1.Get().Click();
 }