コード例 #1
0
        public static void ChangingSettings()
        {
            #region ReachingSettings
            IWebDriver wd = new ChromeDriver(Constants.Chrome_Driver_Path);
            wd.Manage().Window.Maximize();
            Debug.WriteLine("Driver initialized.");
            wd.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(3);

            wd.Navigate().GoToUrl(HumanityLoginPage.Humanity_Login_URL);
            HumanityLoginTests.FillOutLogin(wd, "*****@*****.**", "pandanagrani");
            HumanityLoginPage.ClickLoginButton(wd);
            wd.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5);
            #endregion
            #region ChangingSettings
            try
            {
                HumanityMenu.ClickSettingsButton(wd);
                wd.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5);
                //Was reaching Settings successful?
                #region Pass/Fail1
                if (wd.Url.Contains(HumanitySettings.Settings_URL))
                {
                    Console.WriteLine("Pass");
                }
                else
                {
                    Console.WriteLine("Fail");
                }
                #endregion

                HumanitySettings.SelectCountry(wd, "Israel");
                wd.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5);
                //Thread.Sleep(3000);
                HumanitySettings.SelectDefaultLanguage(wd, "Hebrew (machine)");
                wd.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5);
                //Thread.Sleep(3000);
                HumanitySettings.SelectTimeFormat(wd, "24 hour");
                //Thread.Sleep(3000);
                HumanitySettings.ClickSaveSettings(wd);
                wd.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.StackTrace);
            }
            wd.Quit();
            #endregion
        }
コード例 #2
0
        public static void TeostGoToSettings()
        {
            IWebDriver wd = new ChromeDriver(Constants.WEBDRIVER_PATH);

            wd.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(3);
            wd.Manage().Window.Maximize();
            Debug.WriteLine("Drive Initialized!");
            Thread.Sleep(3000);

            wd.Navigate().GoToUrl(HuamnityLogin.URL1);

            TestLogin.FillForm(wd, "*****@*****.**", "Mikica345");
            HuamnityLogin.ClickButtonLogIn(wd);
            HumanityMenu.ClickSettingsButton(wd);
            Thread.Sleep(3000);
            HumanitySettings.SelectCountry(wd, "Italy");
            HumanitySettings.SelectLanguage(wd, "Italian (machine)");
            HumanitySettings.SelectTimeFormat(wd, "24 hour");
            Thread.Sleep(3000);
            HumanityMenu.ClickSettingsButton(wd);
        }