Beispiel #1
0
        protected BaseForm(InputParams settings         = null,
                           bool addDefaultConsoleLogger = true,
                           params Logger[] loggersCollection)
        {
            if (settings != null)
            {
                this.settings = settings;
            }
            browserClosedTougle = !this.settings.Browser.IsOpened;
            logedBrowserClosed  = browserClosedTougle;

            Handle = this.settings.Browser.Window.Handle;

            this.settings.Browser.WindowChanged += WindowChanged;
            this.settings.Browser.BrowserClosed += BrowserClosed;
            this.settings.Browser.WindowClosed  += WindowClosed;

            if (loggersCollection != null && loggersCollection.Length > 0)
            {
                loggers.Add(loggersCollection);
            }
            if (addDefaultConsoleLogger)
            {
                loggers.Add(LoggerCreator.GetLogger(LoggerTypes.ConsoleLogger, null));
            }

            Log(SeleniumWrapper.Logging.LogType.Info, $"Opened page \"{this.settings.Browser.Window.Url}\"", null);
        }
Beispiel #2
0
 public DownloadSteam(IBrowser browser, Link link, string pathToDownload, TimeSpan timeout, string logFilePath, string url) :
     base(null, true, LoggerCreator.GetLogger(LoggerTypes.FileLogger, null, logFilePath))
 {
     link.Click();
     this.pathToDownload = pathToDownload;
     this.timeout        = timeout;
 }
Beispiel #3
0
        public DafnyLanguageServer(string[] args)
        {
            var configInitializer = new ConfigInitializer(args);

            configInitializer.SetUp();
            configInitErrors = configInitializer.Errors;
            log = LoggerCreator.GetLogger();
        }
        public MainPage(MainPageSettings settings) : base(null, true, LoggerCreator.GetLogger(LoggerTypes.FileLogger, null, settings.PathToLogFile))
        {
            pageSettings = settings;

            if (!string.IsNullOrEmpty(settings.PathToLogFile) && !string.IsNullOrWhiteSpace(settings.PathToLogFile))
            {
                loggers.Add();
            }

            ChangeLanguage();
        }
        public GamesPage(IBrowser browser, AgeVerificationData verificationData, TimeSpan timeout, Language ln, string gameType, string pathToLogFile) :
            base(null, true, LoggerCreator.GetLogger(LoggerTypes.FileLogger, null, pathToLogFile))
        {
            this.verificationData = verificationData;
            this.timeout          = timeout;
            this.language         = ln;
            this.pathToLogFile    = pathToLogFile;
            this.gameType         = gameType;

            var elem = settings.Browser.Window.FindElement <Text>(By.XPath(headderLocator)).WaitForExists <Text>(timeout);

            Headder = elem.InnerHTML;
        }
        public void Setup()
        {
            if (File.Exists(fileWithSettings))
            {
                config = Config.Deserialization();
            }
            else
            {
                config = new Config();
                config.Serialization();
            }

            LocalisationKeeper.Configure(config.PathToLocalisationForTest_1, config.PathToLocalisationForTest_2,
                                         config.PathToMonthLocalisation, config.PathToLanguageNames);

            loggers.Add(new [] { LoggerCreator.GetLogger(LoggerTypes.ConsoleLogger, null),
                                 LoggerCreator.GetLogger(LoggerTypes.FileLogger, null, config.LogFileName) });

            browser            = BrowserCreator.GetConfiguredBrowser(config.browser);
            browser.Window.Url = config.MainUrl;
            browser.Window.Maximize();
            browser.Window.Scroll(0, 0);

            homePage = new MainPage(new MainPageSettings
            {
                Language         = config.Language,
                PathToDownload   = config.PathToDownload,
                PathToLogFile    = config.LogFileName,
                Timeout          = TimeSpan.FromSeconds(config.TimeautSeconds),
                DownloadUrl      = config.DownloadUrl,
                verificationData = new AgeVerificationData
                {
                    Day   = config.Day,
                    Month = config.Month,
                    Year  = config.Year
                }
            });
        }
        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;
        }
 public AgeVerificationPage(string pathToLogFile) :
     base(null, true, LoggerCreator.GetLogger(LoggerTypes.FileLogger, null, pathToLogFile))
 {
 }