コード例 #1
0
        private void ChangeLanguage()
        {
            BaseElement     element = settings.Browser.Window.FindElement <Contaner>(By.XPath(LanguageButton));
            Action <string> logger  = (string msg) => Log(LogType.Info, msg, null, null);
            var             data    = new LanguageDropDown(element, logger, settings.Browser, pageSettings.Timeout);

            if (data.Items.Any(x => x.Name == LocalisationKeeper.LanguageNames[GenericParams.Language][pageSettings.Language]))
            {
                foreach (var item in data.Items)
                {
                    if (item.Name == LocalisationKeeper.LanguageNames[GenericParams.Language][pageSettings.Language])
                    {
                        item.Click();
                        BrowserWait.Wait(pageSettings.Timeout, (IBrowser b) =>
                        {
                            return(b.Window.Title == LocalisationKeeper.Get(Test_1.Title, pageSettings.Language));
                        });
                        break;
                    }
                }
            }
            else
            {
                element.Click();
            }
        }
コード例 #2
0
        public GamesPage Games(Test_2 gameType)
        {
            Log(LogType.Info, $"Open pagewith list of games", null, null);
            var element = GetDropDownElement(GamesDiv, string.Format(GamesA, LocalisationKeeper.Get(gameType, pageSettings.Language)));

            element.Click();

            return(new GamesPage(settings.Browser, pageSettings.verificationData,
                                 pageSettings.Timeout, pageSettings.Language,
                                 LocalisationKeeper.Get(gameType, pageSettings.Language),
                                 pageSettings.PathToLogFile));
        }
コード例 #3
0
        public SelectedGamePage(TimeSpan timeout, AgeVerificationData verificationData, Language ln, string gameName, string pathToLogFile) :
            base(null, true, LoggerCreator.GetLogger(LoggerTypes.FileLogger, null, pathToLogFile))
        {
            AgeVerificationPage verificationPage = new AgeVerificationPage(pathToLogFile);

            if (verificationPage.IsPageOpened)
            {
                verificationPage.Day.SelectByValue(verificationData.Day.ToString());
                verificationPage.Month.SelectByValue(LocalisationKeeper.Get(verificationData.Month, ln));
                verificationPage.Year.SelectByValue(verificationData.Year.ToString());
                verificationPage.Submit();
            }
            this.gameName = gameName;

            BrowserWait.Wait(timeout, (IBrowser b) =>
            {
                return(b.Window.FindElement <Contaner>(By.XPath(programNameLocator)).InnerHTML == gameName);
            }, null, typeof(NoSuchElementException));

            Name          = gameName;
            this.timeout  = timeout;
            this.language = ln;
        }