Пример #1
0
 public LanguageSteps()
 {
     driver       = new ChromeDriver();
     languagePage = new LanguagePage(driver);
     loginPage    = new LoginPage(driver);
     profilePage  = new ProfilePage(driver);
 }
Пример #2
0
        // ############# Create a Constructor #############

        public LanguageTabSteps()
        {
            // Inject the driver
            driver       = new ChromeDriver();
            languagePage = new LanguagePage(driver);
            loginPage    = new LoginPage(driver);
            profilePage  = new ProfilePage(driver);
        }
Пример #3
0
        public void RunMainProcess()
        {
            LanguageDomainReport firstReport  = new LanguageDomainReport();
            LanguagePageReport   secondReport = new LanguagePageReport();
            string targetFile;

            DateTime endPeriod   = StartPeriod.AddDays(this.DaysNumber * Config.OperatorBackDays);
            DateTime startPeriod = StartPeriod;

            string directoryPath = FileData.GetDataPath(startPeriod);

            PageViewsRawData pageViewData = new PageViewsRawData(GZip, FileData, this.DaysNumber);

            pageViewData.DownloadAllPeriodsData(startPeriod, endPeriod, directoryPath);
            pageViewData.DecompressData(directoryPath);

            CollectionsData processData = new CollectionsData(domainData);

            startPeriod = StartPeriod;
            //Process each file (period) and get the ressults
            do
            {
                FileData.SetConfigurationByPeriod(startPeriod, directoryPath);
                targetFile = FileData.GetTargetFileNoExt();

                //for free memory related to last analysis
                using (FileReader fr = new FileReader(targetFile))
                {
                    Console.WriteLine(string.Concat("Processing data in file ", targetFile, "..."));

                    //container of data to analyze
                    PageViewCollection periodCollection = fr.GetDataToCollection();

                    //First report
                    Console.WriteLine("\tProcessing language and domain data for period " + startPeriod.ToShortDateString());
                    LanguageDomain languageDomain = processData.GetLanguageAndDomainCount(periodCollection);
                    languageDomain.Period = startPeriod;
                    firstReport.AddLanguageDomain(languageDomain);

                    //Second report
                    LanguagePage languagePage = processData.GetLanguagePageCount(periodCollection);
                    Console.WriteLine("\tProcessing language page data for period " + startPeriod.ToShortDateString());
                    languagePage.Period = startPeriod;
                    secondReport.AddLanguagePage(languagePage);
                }

                startPeriod = startPeriod.AddDays(Config.OperatorBackDays);
            }while (startPeriod.CompareTo(endPeriod) != 0);


            //Report the results
            Console.Clear();

            ConsoleReport.DisplayLanguageDomainCount(firstReport);
            ConsoleReport.DisplayLanguagePageMaxCount(secondReport);
        }
Пример #4
0
        public void createLanguageTest()
        {
            // Profile Objects
            ProfilePage profileObj = new ProfilePage(driver);

            profileObj.navigateToLanguage(driver);
            // language Page Object
            LanguagePage languageObj = new LanguagePage(driver);

            languageObj.createLanguage(driver);
        }
Пример #5
0
        public void deleteLanguageTest()
        {
            //delete language
            ProfilePage profileObj = new ProfilePage(driver);

            profileObj.navigateToLanguage(driver);
            // language Page Object
            LanguagePage languageObj = new LanguagePage(driver);

            languageObj.deleteLanguage(driver);
        }
Пример #6
0
        public void deleteLanguageTest(IWebDriver driver)
        {
            // Profile Objects
            ProfilePage profileObj = new ProfilePage(driver);

            //profileObj.navigateToEducation(driver);
            profileObj.navigateToLanguage(driver);
            // language Page Object
            LanguagePage languageObj = new LanguagePage(driver);

            languageObj.deleteLanguage(driver);
        }
        public LanguagePage GetLanguagePageCount(PageViewCollection periodCollection)
        {
            LanguagePage report = new LanguagePage();

            var entry = periodCollection.Data.Where(e => e.ViewCount > 0)
                        .GroupBy(x => x.PageTitle)
                        .Select(y => new PageViewEntry
            {
                PageTitle = y.Key,
                ViewCount = Convert.ToUInt32(y.Sum(s => s.ViewCount)),
            })
                        .OrderByDescending(x => x.ViewCount)
                        .FirstOrDefault();

            report.Page      = entry.PageTitle; //page tittle
            report.ViewCount = entry.ViewCount;

            return(report);
        }
Пример #8
0
        public void AddLanguage()
        {
            //Populate the excel data
            GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "Profile");
            test = extent.CreateTest("Add Language Skill");
            test.Log(Status.Info, "Starting the Add Language Test");
            LanguagePage AddLanguage = new LanguagePage();

            AddLanguage.Addlanguage(GlobalDefinitions.ExcelLib.ReadData(2, "Language"), GlobalDefinitions.ExcelLib.ReadData(2, "Level"));
            bool actual = AddLanguage.VerifyLanguage(GlobalDefinitions.ExcelLib.ReadData(2, "Language"));

            if (actual)
            {
                test.Log(Status.Pass, "Add Language Successfull");
                Assert.IsTrue(actual);
            }
            else
            {
                test.Log(Status.Fail, "Add Language Failed");
                Assert.IsTrue(actual);
            }
        }
Пример #9
0
        public void WhenIAddNewLanguageOnTheProfileDetail()
        {
            var addlan = new LanguagePage();

            addlan.AddLanguage();
        }
Пример #10
0
        public void WhenIPressADDNEWButtonAndThenIEnterAddLanguageAndLevelAndPressAdd()
        {
            LanguagePage create = new LanguagePage();

            create.addlanguage();
        }
Пример #11
0
        public void WhenIDeleteExistingLanguage()
        {
            var deletelan = new LanguagePage();

            deletelan.DeleteLanguage();
        }
Пример #12
0
        public void ThenIShouldAbleToAddNewLanguageSuccessfully()
        {
            var lanaddSucessfully = new LanguagePage();

            lanaddSucessfully.LanAdded();
        }
Пример #13
0
        public void ThenIShouldNotBeAbleToSeeTheDELETEDLANGUAGEAndShouldReceiveAPopUpMessage()
        {
            LanguagePage create = new LanguagePage();

            create.ValidateDelLanguage();
        }
Пример #14
0
 public void InitPages()
 {
     loginPage    = new LoginPage(Driver);
     homePage     = new HomePage(Driver);
     languagePage = new LanguagePage(Driver);
 }
Пример #15
0
        public void ThenIShouldAbleToValidateNewUPDATEDLANGUAGERecordSuccessfully()
        {
            LanguagePage create = new LanguagePage();

            create.Validate_Update_language();
        }
Пример #16
0
        public void WhenIPressCROSSDeleteSign()
        {
            LanguagePage create = new LanguagePage();

            create.DeleteLanguage();
        }
Пример #17
0
        public void ThenIAmAbleToDeleteExistingLanguageSuccessfully()
        {
            var landeleted = new LanguagePage();

            landeleted.LanDeleted();
        }
Пример #18
0
        public void GivenEnterTheLanguages()
        {
            LanguagePage p = new LanguagePage();

            p.Languages(driver);
        }
Пример #19
0
        public void WhenIClickOnUpdateExistingLanguage()
        {
            var updatelan = new LanguagePage();

            updatelan.UpdateLan();
        }
Пример #20
0
        public void GivenIClickOnLANGUAGEDataTab()
        {
            LanguagePage create = new LanguagePage();

            create.languagetab();
        }
Пример #21
0
        public void ThenIAmAbleToUpdateExistingLanguage()
        {
            var lanupdate = new LanguagePage();

            lanupdate.LanUpdated();
        }
        public static Uco.Models.Settings GetCurrentSettings()
        {
            if (LS.CurrentEntityContext == null)
            {
                return
                    new Settings()
                    {
                        AdminEmail   = "*****@*****.**",
                        Domain       = "localhost",
                        LanguageCode = "en-US",
                        Roles        = "",
                    }
            }
            ;

            if (SF.UseMultiDomain() == false)
            {
                string Token = "CurrentSettings_" + SF.GetLangCodeThreading();

                if (LS.Cache[Token] == null)
                {
                    lock (s_lock)
                    {
                        Settings s = GetSettingsRepositoryList().FirstOrDefault();
                        if (s == null)
                        {
                            return(null);
                        }

                        string LangCodeThreading = SF.GetLangCodeThreading();
                        if (SF.GetLangCodeWebconfig() != LangCodeThreading)
                        {
                            LanguagePage l = _db.LanguagePages.FirstOrDefault(r => r.DomainID == s.ID && r.LanguageCode == LangCodeThreading);
                            if (l != null)
                            {
                                s.LanguageCode = l.LanguageCode;
                                //s.LanguageRTL = l.ShowOnMainPage;
                                s.HeaderHtml = l.Text2;
                                s.FotterHtml = l.Text3;
                            }
                        }

                        LS.Cache[Token] = s;
                    }
                }
                return((Uco.Models.Settings)LS.Cache[Token]);
            }
            else
            {
                string Domain = SF.GetCurrentDomain();

                if (LS.CurrentHttpContext.Request.IsLocal)
                {
                    string TokenAdmin = "AdminCurrentSettingsRepository";
                    if (LS.CurrentHttpContext.Session[TokenAdmin] != null)
                    {
                        return((Uco.Models.Settings)LS.CurrentHttpContext.Session[TokenAdmin]);
                    }
                    else
                    {
                        string Token = string.Format("CurrentSettingsMultiDomain_{0}_{1}", Domain, SF.GetLangCodeThreading());
                        if (LS.Cache[Token] == null)
                        {
                            lock (s_lock)
                            {
                                Settings s = GetSettingsRepositoryList().FirstOrDefault();
                                if (s == null)
                                {
                                    return(null);
                                }

                                string LangCodeThreading = SF.GetLangCodeThreading();
                                if (SF.GetLangCodeWebconfig() != LangCodeThreading)
                                {
                                    LanguagePage l = _db.LanguagePages.FirstOrDefault(r => r.DomainID == s.ID && r.LanguageCode == LangCodeThreading);
                                    if (l != null)
                                    {
                                        s.LanguageCode = l.LanguageCode;
                                        //s.LanguageRTL = l.ShowOnMainPage;
                                        s.HeaderHtml = l.Text2;
                                        s.FotterHtml = l.Text3;
                                    }
                                }

                                LS.Cache[Token] = s;
                            }
                        }
                        return((Uco.Models.Settings)LS.Cache[Token]);
                    }
                }
                else
                {
                    string Token = string.Format("CurrentSettingsMultiDomain_{0}_{1}", Domain, SF.GetLangCodeThreading());
                    if (LS.Cache[Token] == null)
                    {
                        lock (s_lock)
                        {
                            Settings s = GetSettingsRepositoryList().FirstOrDefault(r => r.Domain == Domain);
                            if (s == null)
                            {
                                return(null);
                            }

                            string LangCodeThreading = SF.GetLangCodeThreading();
                            if (SF.GetLangCodeWebconfig() != LangCodeThreading)
                            {
                                LanguagePage l = _db.LanguagePages.FirstOrDefault(r => r.DomainID == s.ID && r.LanguageCode == LangCodeThreading);
                                if (l != null)
                                {
                                    s.LanguageCode = l.LanguageCode;
                                    //s.LanguageRTL = l.ShowOnMainPage;
                                    s.HeaderHtml = l.Text2;
                                    s.FotterHtml = l.Text3;
                                }
                            }

                            LS.Cache[Token] = s;
                        }
                    }
                    return((Uco.Models.Settings)LS.Cache[Token]);
                }
            }
        }
Пример #23
0
        public void ThenIShouldAbleToValidateAddedNEWLANGUAGERecordSuccessfully()
        {
            LanguagePage create = new LanguagePage();

            create.ValidateAddLanguage();
        }
Пример #24
0
        public void ThenAddAndUpdateOrDeleteTheExistingLanguages()
        {
            LanguagePage le = new LanguagePage();

            le.LangEdit(driver);
        }
Пример #25
0
        public void WhenIPressUpdatePenAndUpdateTheLanguageAndLevelAndPressTheUPDTAEButton()
        {
            LanguagePage create = new LanguagePage();

            create.UpdateLanguage();
        }