public void PageBar_GoToNextPage_Test_1()
        {
            using (var driver = new ChromeDriver())
            {
                /* Initialization */
                var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60));

                driver.Manage().Window.Maximize();
                driver.Navigate().GoToUrl("https://tms.lionbridge.com/");

                string       projectTitle = "Qlik";
                ProjectsPage testPage     = new ProjectsPage(driver, projectTitle);

                testPage.ClickChosenProject();
                ParticularProjectPage testProjectPage = new ParticularProjectPage(driver);

                testProjectPage.ProfileClick(driver);
                testProjectPage.ChangeItemsPerPageMin(driver);

                testProjectPage.StatusClick(driver);
                StatusPage testStatusPage = new StatusPage(driver);

                PageBar testPageBar = new PageBar(driver);

                /* Set of assertions */

                Assert.AreEqual(0, testPageBar.CurrentPageIsNull);
                Assert.AreEqual(1, testPageBar.CurrentPageIsFirst);
                Assert.AreEqual(0, testPageBar.CurrentPageIsLast);

                Assert.AreEqual(1, testPageBar.GetCurrentPageNumber);
                Assert.AreEqual(1, testPageBar.PreviousPageIsNull);
                Assert.AreEqual(0, testPageBar.NextPageIsNull);
            }
        }
        public void StatusPage_ParsingCorrectly_Test_2()
        {
            using (var driver = new ChromeDriver())
            {
                /* Initialization */
                var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60));

                driver.Manage().Window.Maximize();
                driver.Navigate().GoToUrl("https://tms.lionbridge.com/");

                string       projectTitle = "Corteva";
                ProjectsPage testPage     = new ProjectsPage(driver, projectTitle);

                testPage.ClickChosenProject();
                ParticularProjectPage testProjectPage = new ParticularProjectPage(driver);

                testProjectPage.StatusClick(driver);
                StatusPage testStatusPage = new StatusPage(driver);

                /* Set of assertions */

                Assert.IsTrue(testStatusPage.IsParsingCorrect);
                Assert.AreEqual("status", testStatusPage.GetPageName);

                Assert.AreEqual(1, testStatusPage.IsActivitiesSelected);
                Assert.AreEqual(0, testStatusPage.IsAssigneesSelected);

                Assert.AreEqual("", testStatusPage.ActivitiesFilterSelection);
                Assert.AreEqual("", testStatusPage.LanguagesFilterSelection);
            }
        }
        public void PageBar_ItemsPerPageSetMaxMinValue_Test_2()
        {
            using (var driver = new ChromeDriver())
            {
                /* Initialization */
                var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60));

                driver.Manage().Window.Maximize();
                driver.Navigate().GoToUrl("https://tms.lionbridge.com/");

                string       projectTitle = "Qlik";
                ProjectsPage testPage     = new ProjectsPage(driver, projectTitle);

                testPage.ClickChosenProject();
                ParticularProjectPage testProjectPage = new ParticularProjectPage(driver);

                testProjectPage.StatusClick(driver);
                StatusPage testStatusPage = new StatusPage(driver);

                PageBar testPageBar = new PageBar(driver);

                /* Set of assertions */

                Assert.IsTrue(testPageBar.IsParsingCorrect);
                Assert.AreEqual(0, testPageBar.ItemsPerPageOptionsContainerIsDisplayed);

                Assert.AreEqual("250", testPageBar.ItemsPerPageCurrentSelection);
                testPageBar.ItemsPerPageSetMinimalValue(driver);

                testPageBar = new PageBar(driver);

                Assert.AreEqual(0, testPageBar.ItemsPerPageOptionsContainerIsDisplayed);
                Assert.AreEqual("25", testPageBar.ItemsPerPageCurrentSelection);
            }
        }
Exemplo n.º 4
0
        public void AssigneesPage_SectionSelected_Test_1()
        {
            using (var driver = new ChromeDriver())
            {
                /* Initialization */
                var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60));

                driver.Manage().Window.Maximize();
                driver.Navigate().GoToUrl("https://tms.lionbridge.com/");

                string       projectTitle = ""; // Project Name
                ProjectsPage testPage     = new ProjectsPage(driver, projectTitle);

                testPage.ClickChosenProject();
                ParticularProjectPage testProjectPage = new ParticularProjectPage(driver);

                testProjectPage.StatusClick(driver);
                StatusPage testStatusPage = new StatusPage(driver);

                testStatusPage.AssigneesClick(driver);
                AssigneesPage porscheAssigneesPage = new AssigneesPage(driver);

                /* Set of assertions */

                Assert.AreEqual(0, porscheAssigneesPage.IsActivitiesSelected);
                Assert.AreEqual(1, porscheAssigneesPage.IsAssigneesSelected);
            }
        }
Exemplo n.º 5
0
        public StatusPageControl(StatusPage statusPage)
        {
            InitializeComponent();

            StatusPageId    = statusPage.Id;
            Title           = statusPage.Title;
            Description     = statusPage.Description;
            BackgroundImage = statusPage.BackgroundImage;
            EquipmentGroups = statusPage.StatusPageGroupings;
        }
Exemplo n.º 6
0
        public void Assignees_ParsingCorrectly_Test_6()
        {
            using (var driver = new ChromeDriver())
            {
                /* Initialization */
                Assignee auxiliaryAssignee;
                var      wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60));

                driver.Manage().Window.Maximize();
                driver.Navigate().GoToUrl("https://tms.lionbridge.com/");

                string       projectTitle = ""; // Project Name
                ProjectsPage testPage     = new ProjectsPage(driver, projectTitle);

                testPage.ClickChosenProject();
                ParticularProjectPage testProjectPage = new ParticularProjectPage(driver);

                testProjectPage.StatusClick(driver);
                StatusPage testStatusPage = new StatusPage(driver);

                testStatusPage.AssigneesClick(driver);
                AssigneesPage assigneesPage = new AssigneesPage(driver);

                PageBar assigneesPageBar = new PageBar(driver);
                assigneesPageBar.ItemsPerPageSetMaximalValue(driver);

                assigneesPage = new AssigneesPage(driver);
                assigneesPage.ChosenActivityClick(driver, "InternalReview");

                IReadOnlyCollection <IWebElement> r_LHObjects = driver.FindElements(By.ClassName("r_LH"));
                List <Assignee> assignees = new List <Assignee>();

                foreach (IWebElement r_LH in r_LHObjects)
                {
                    auxiliaryAssignee = new Assignee(r_LH);
                    assignees.Add(auxiliaryAssignee);
                }

                /* Set of assertions */

                Assert.AreNotEqual(0, assignees.Count);

                foreach (Assignee assignee in assignees)
                {
                    Assert.IsFalse(assignee.AssigneeNameObjectIsNull);
                    Assert.AreEqual(1, assignee.AssigneeNameObjectIsEnabled);
                    Assert.AreEqual(0, assignee.AssigneeJobsNumberIsNull);
                    Assert.AreEqual(true, assignee.IsParsingCorrect);

                    Assert.AreNotEqual("", assignee.GetAssigneeName);
                    Assert.AreNotEqual("", assignee.GetAssigneeJobsNumberString);
                    Assert.AreNotEqual(0, assignee.GetAssingeeJobsNumberInt);
                }
            }
        }
Exemplo n.º 7
0
 public FrmExpenseDrawD(XtrimControl x, String id, String cusid, String cusnamet, String cusaddr, String custax, StatusPage statuspage, StatusPayType statuspaytype)
 {
     InitializeComponent();
     xC                 = x;
     drawdId            = id;
     cusId              = cusid;
     cusNameT           = cusnamet;
     cusAddr            = cusaddr;
     cusTax             = custax;
     this.statusPage    = statuspage;
     this.statuspaytype = statuspaytype;
     initConfig();
 }
Exemplo n.º 8
0
        private void NewStatusPage(object sender, AddNewStatusPageEventArgs e)
        {
            var newPage = new StatusPage()
            {
                Title       = e.Title,
                Description = e.Description,
                IsDisplayed = true,
                Index       = DatabaseAccess.GetAllStatusPages().Where(p => p.Index != -1).Count()
            };

            DatabaseAccess.AddNewStatusPage(newPage);
            statusPages.SelectedItem = ((ObservableCollection <StatusPage>)statusPages.ItemsSource).First(p => p.Id == newPage.Id);
        }
        public void PageBar_ParsingCorrectly_Test_2()
        {
            using (var driver = new ChromeDriver())
            {
                /* Initialization */
                var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60));

                driver.Manage().Window.Maximize();
                driver.Navigate().GoToUrl("https://tms.lionbridge.com/");

                string       projectTitle = "Qlik";
                ProjectsPage testPage     = new ProjectsPage(driver, projectTitle);

                testPage.ClickChosenProject();
                ParticularProjectPage testProjectPage = new ParticularProjectPage(driver);

                testProjectPage.ProfileClick(driver);
                testProjectPage.ChangeItemsPerPageMin(driver);

                testProjectPage.StatusClick(driver);
                StatusPage testStatusPage = new StatusPage(driver);

                testStatusPage.ActivitiesFilterClick(driver);
                testStatusPage.ChosenActivityClick(driver, "Buffer_for_FreewayReview_H");

                PageBar testPageBar = new PageBar(driver);

                /* Set of assertions */

                Assert.IsFalse(testPageBar.PageBarContainerIsNull);
                Assert.AreEqual(1, testPageBar.PageBarContainerIsDisplayed);

                Assert.AreEqual(0, testPageBar.NumberOfAllItemsIsNull);
                Assert.AreEqual(1, testPageBar.NumberOfAllItemsIsDisplayed);

                Assert.IsTrue(testPageBar.IsParsingCorrect);
                Assert.IsTrue(testPageBar.GetNumberOfAllItems > 0);

                Assert.AreEqual(1, testPageBar.PageNavigationContainerIsNull);

                Assert.AreEqual(-1, testPageBar.CurrentPageIsFirst);
                Assert.AreEqual(-1, testPageBar.GetCurrentPageNumber);

                Assert.AreEqual(-1, testPageBar.CurrentPageIsLast);
                Assert.AreEqual(-1, testPageBar.GetLastPageNumber);

                Assert.AreEqual(-1, testPageBar.NextPageIsNull);
                Assert.AreEqual(-1, testPageBar.PreviousPageIsNull);
            }
        }
Exemplo n.º 10
0
        public void AssigneeJobs_ParsingCorrectly_Test_3()
        {
            using (var driver = new ChromeDriver())
            {
                /* Initialization */
                var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60));

                driver.Manage().Window.Maximize();
                driver.Navigate().GoToUrl("https://tms.lionbridge.com/");

                string       projectTitle = "Corteva";
                ProjectsPage testPage     = new ProjectsPage(driver, projectTitle);

                testPage.ClickChosenProject();
                ParticularProjectPage testProjectPage = new ParticularProjectPage(driver);

                testProjectPage.StatusClick(driver);
                StatusPage testStatusPage = new StatusPage(driver);

                testStatusPage.AssigneesClick(driver);
                AssigneesPage porscheAssigneesPage = new AssigneesPage(driver);

                porscheAssigneesPage.ChosenActivityClick(driver, "Buffer_For_FreewayReview_H");
                porscheAssigneesPage = new AssigneesPage(driver);

                IReadOnlyCollection <IWebElement> r_LObjects = driver.FindElements(By.ClassName("r_L"));
                List <AssigneeJobs> assigneesJobs            = new List <AssigneeJobs>();

                AssigneeJobs auxiliaryAssigneesJob;

                /* Set of assertions */

                foreach (IWebElement r_L in r_LObjects)
                {
                    auxiliaryAssigneesJob = new AssigneeJobs(r_L);
                    assigneesJobs.Add(auxiliaryAssigneesJob);

                    Assert.AreEqual(0, auxiliaryAssigneesJob.JobsButtonIsNull);
                    Assert.IsFalse(auxiliaryAssigneesJob.JobsNameIsNull);
                    Assert.IsTrue(auxiliaryAssigneesJob.IsParsingCorrect);
                    Assert.AreNotEqual("", auxiliaryAssigneesJob.GetJobsName);
                    Assert.AreNotEqual("", auxiliaryAssigneesJob.GetSourceLanguage);
                    Assert.AreNotEqual("", auxiliaryAssigneesJob.GetTargetLanguage);
                }

                Assert.AreEqual(15, assigneesJobs.Count);
            }
        }
        public void StatusPage_ParsingCorrectly_Test_3()
        {
            using (var driver = new ChromeDriver())
            {
                /* Initialization */
                var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60));

                driver.Manage().Window.Maximize();
                driver.Navigate().GoToUrl("https://lionbridge.com/");

                StatusPage testStatusPage = new StatusPage(driver);

                /* Set of assertions */

                Assert.IsFalse(testStatusPage.IsParsingCorrect);
            }
        }
Exemplo n.º 12
0
        public void AssigneesAndJobs_TaggingSingleJob_Test_2()
        {
            using (var driver = new ChromeDriver())
            {
                /* Initialization */
                var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60));

                driver.Manage().Window.Maximize();
                driver.Navigate().GoToUrl("https://tms.lionbridge.com/");

                string       projectTitle = ""; // Project Name
                ProjectsPage testPage     = new ProjectsPage(driver, projectTitle);

                testPage.ClickChosenProject();
                ParticularProjectPage testProjectPage = new ParticularProjectPage(driver);

                testProjectPage.StatusClick(driver);
                StatusPage testStatusPage = new StatusPage(driver);

                testStatusPage.AssigneesClick(driver);
                AssigneesPage porscheAssigneesPage = new AssigneesPage(driver);

                porscheAssigneesPage.ChosenActivityClick(driver, "InternalReview");
                porscheAssigneesPage = new AssigneesPage(driver);

                AssigneesAndJobs asob    = new AssigneesAndJobs(driver);
                string           jobName = asob.GetListOfAssigneesJobNames.ElementAt(asob.GetAssigneeJobsListSize - 1);

                /* Set of assertions */

                asob.TagSingleJob(driver, asob.GetAssigneeJobsListSize - 1);

                porscheAssigneesPage = new AssigneesPage(driver);
                asob = new AssigneesAndJobs(driver);

                Assert.AreEqual(true, asob.IsParsingCorrect);
                Assert.AreNotEqual(0, asob.GetAssigneeJobsListSize);
                Assert.AreNotEqual(0, asob.GetAssigneesListSize);

                foreach (string searchJobName in asob.GetListOfAssigneesJobNames)
                {
                    Assert.AreEqual(jobName, searchJobName);
                }
            }
        }
Exemplo n.º 13
0
        public void AssigneesAndJobs_SelectingMultipleJobs_Test_4()
        {
            using (var driver = new ChromeDriver())
            {
                /* Initialization */
                var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60));

                driver.Manage().Window.Maximize();
                driver.Navigate().GoToUrl("https://tms.lionbridge.com/");

                string       projectTitle = ""; // Project Name
                ProjectsPage testPage     = new ProjectsPage(driver, projectTitle);

                testPage.ClickChosenProject();
                ParticularProjectPage testProjectPage = new ParticularProjectPage(driver);

                testProjectPage.StatusClick(driver);
                StatusPage testStatusPage = new StatusPage(driver);

                testStatusPage.AssigneesClick(driver);
                AssigneesPage porscheAssigneesPage = new AssigneesPage(driver);

                porscheAssigneesPage.ChosenActivityClick(driver, "InternalReview");
                porscheAssigneesPage = new AssigneesPage(driver);

                AssigneesAndJobs asob = new AssigneesAndJobs(driver);

                /* Set of assertions */

                asob.SelectMultipleJobs(driver, asob.GetAssigneeJobsListSize - 2, asob.GetAssigneeJobsListSize - 1);

                AssingeesOnClickJobsMenu testMenu = new AssingeesOnClickJobsMenu(driver);
                Assert.AreEqual(1, testMenu.MenuContainerIsDisplayed);

                foreach (AssigneeJobs assigneeJob in asob.assigneesJobsList.GetRange(asob.GetAssigneeJobsListSize - 2, 2))
                {
                    Assert.AreEqual(1, assigneeJob.JobIsSelected);
                }

                Assert.AreEqual(true, asob.IsParsingCorrect);
                Assert.AreNotEqual(0, asob.GetAssigneeJobsListSize);
                Assert.AreNotEqual(0, asob.GetAssigneesListSize);
            }
        }
Exemplo n.º 14
0
    // Use this for initialization
    void Start()
    {
        FoodRegisterButton.onClick.AddListener(FoodRegisterButtonClicked);
        BuildButton.onClick.AddListener(BuildButtonClicked);
        AchevementButton.onClick.AddListener(AchevementButtonClicked);
        StatusButton.onClick.AddListener(StatusButtonClicked);

        FoodRegisterPageIsShowing = false;
        FoodRegisterPage.SetActive(FoodRegisterPageIsShowing);

        BuildPageIsShowing = false;
        BuildPage.SetActive(BuildPageIsShowing);

        AchevementPageIsShowing = false;
        AchevementPage.SetActive(AchevementPageIsShowing);

        StatusPageIsShowing = false;
        StatusPage.SetActive(StatusPageIsShowing);
    }
Exemplo n.º 15
0
        public void AssigneesAndJobs_ParsingCorrectly_Test_2()
        {
            using (var driver = new ChromeDriver())
            {
                /* Initialization */
                var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60));

                driver.Manage().Window.Maximize();
                driver.Navigate().GoToUrl("https://tms.lionbridge.com/");

                string       projectTitle = ""; // Project Name
                ProjectsPage testPage     = new ProjectsPage(driver, projectTitle);

                testPage.ClickChosenProject();
                ParticularProjectPage testProjectPage = new ParticularProjectPage(driver);

                testProjectPage.StatusClick(driver);
                StatusPage testStatusPage = new StatusPage(driver);

                testStatusPage.AssigneesClick(driver);
                AssigneesPage porscheAssigneesPage = new AssigneesPage(driver);

                porscheAssigneesPage.ChosenActivityClick(driver, "InternalReview");
                porscheAssigneesPage = new AssigneesPage(driver);

                AssigneesAndJobs asob = new AssigneesAndJobs(driver);

                /* Set of assertions */

                Assert.IsFalse(asob.AssigneesListIsEmpty);
                Assert.AreNotEqual(0, asob.GetAssigneesListSize);

                Assert.IsFalse(asob.AssigneesJobsListIsEmpty);
                Assert.AreNotEqual(0, asob.GetAssigneeJobsListSize);

                Assert.AreNotEqual(0, asob.GetListOfAssigneeNames.Count);
                Assert.AreNotEqual(0, asob.GetListOfAssigneesJobNames.Count);
                Assert.AreNotEqual(0, asob.GetListOfJobsSourceLanguages.Count);
                Assert.AreNotEqual(0, asob.GetListOfJobsTargetLanguages.Count);

                Assert.IsTrue(asob.IsParsingCorrect);
            }
        }
Exemplo n.º 16
0
        public void AssingeesOnClickJobsMenu_ParsingCorrectly_Test_1()
        {
            using (var driver = new ChromeDriver())
            {
                /* Initialization */
                var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60));

                driver.Manage().Window.Maximize();
                driver.Navigate().GoToUrl("https://tms.lionbridge.com/");

                string       projectTitle = ""; // Project Name
                ProjectsPage testPage     = new ProjectsPage(driver, projectTitle);

                testPage.ClickChosenProject();
                ParticularProjectPage testProjectPage = new ParticularProjectPage(driver);

                testProjectPage.StatusClick(driver);
                StatusPage testStatusPage = new StatusPage(driver);

                testStatusPage.AssigneesClick(driver);
                AssigneesPage porscheAssigneesPage = new AssigneesPage(driver);

                IReadOnlyCollection <IWebElement> r_LObjects = driver.FindElements(By.ClassName("r_L"));
                List <AssigneeJobs> assigneesJobs            = new List <AssigneeJobs>();

                AssigneeJobs auxiliaryAssigneesJob = new AssigneeJobs(r_LObjects.ElementAt(0));
                assigneesJobs.Add(auxiliaryAssigneesJob);

                auxiliaryAssigneesJob.AssigneeJobButtonClick(driver);
                AssingeesOnClickJobsMenu testJobMenu = new AssingeesOnClickJobsMenu(driver);

                /* Set of assertions */

                Assert.IsFalse(testJobMenu.MenuContainerIsNull);
                Assert.AreEqual(1, testJobMenu.MenuContainerIsDisplayed);
                Assert.AreEqual(0, testJobMenu.TagJobButtonIsNull);
                Assert.AreEqual(1, testJobMenu.TagJobButtonIsEnabled);
            }
        }
Exemplo n.º 17
0
        private async void ShowMetrics(string duration)
        {
            if (ChangedMetricsDisplay)
            {
                HideChart.Begin();
            }

            ChangedMetricsDisplay = true;
            var metrics = await StatusPage.GetMetrics(duration);

            if (metrics != null && metrics.Metrics != null && metrics.Metrics.Length > 0)
            {
                var metric = metrics.Metrics[0];
                int pos    = 0;
                _data.Clear();
                datavalues.Clear();
                _max = 0;
                _min = 0;
                for (var i = 0; i < metric.Data.Length; i++)
                {
                    datavalues.Add(i, metric.Data[i]);
                    _data.Add(metric.Data[i].Value);
                    if (metric.Data[i].Value > _max)
                    {
                        _max = metric.Data[i].Value;
                    }
                    if (metric.Data[i].Value < _min || _min == 0)
                    {
                        _min = metric.Data[i].Value;
                    }
                }
                chartCanvas.Invalidate();
                if (HideChart.GetCurrentState() != ClockState.Stopped)
                {
                    HideChart.Stop();
                }
                ShowChart.Begin();
            }
        }
Exemplo n.º 18
0
 // Start is called before the first frame update
 void Start()
 {
     transform.tag = "GameManager";
     foreach (CanvasGroup canvasGroup in canvasGroupsPages)
     {
         canvasGroup.alpha              = 0;
         canvasGroup.blocksRaycasts     = false;
         canvasGroup.ignoreParentGroups = false;
         canvasGroup.interactable       = false;
     }
     statusPage                 = StatusPage.mainPage;
     currentPage                = canvasGroupsPages[0];
     currentPage.alpha          = 1;
     currentPage.blocksRaycasts = true;
     //currentPage.ignoreParentGroups = true;
     currentPage.interactable = true;
     foreach (ImageAssets assets in imageAssets)
     {
         ImageAssetsToStore imageAssetsToStores = new ImageAssetsToStore();
         imageAssetsToStores.name  = assets.name;
         imageAssetsToStores.image = loadTex(assets.image);
         imageAssetsToStore.Add(imageAssetsToStores);
     }
 }
Exemplo n.º 19
0
        public void AssigneesAndJobs_ListOfDifferentLanguages_Test_2()
        {
            using (var driver = new ChromeDriver())
            {
                /* Initialization */
                var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60));

                driver.Manage().Window.Maximize();
                driver.Navigate().GoToUrl("https://tms.lionbridge.com/");

                string       projectTitle = ""; // Project Name
                ProjectsPage testPage     = new ProjectsPage(driver, projectTitle);

                testPage.ClickChosenProject();
                ParticularProjectPage testProjectPage = new ParticularProjectPage(driver);

                testProjectPage.StatusClick(driver);
                StatusPage testStatusPage = new StatusPage(driver);

                testStatusPage.AssigneesClick(driver);
                AssigneesPage porscheAssigneesPage = new AssigneesPage(driver);

                porscheAssigneesPage.ChosenActivityClick(driver, "Agency_NoReview");
                porscheAssigneesPage = new AssigneesPage(driver);

                AssigneesAndJobs asob = new AssigneesAndJobs(driver);

                /* Set of assertions */

                Assert.AreEqual(asob.GetListOfAssigneesJobNames.Count, asob.GetListOfJobsAllSourceLanguages.Count);
                Assert.AreEqual(asob.GetListOfAssigneesJobNames.Count, asob.GetListOfJobsAllTargetLanguages.Count);

                Assert.AreEqual(2, asob.GetListOfJobsSourceLanguages.Count);
                Assert.AreEqual(15, asob.GetListOfJobsTargetLanguages.Count);
            }
        }
Exemplo n.º 20
0
        public void AssingeeJobs_AssigneeJobButtonClick_Test_1()
        {
            using (var driver = new ChromeDriver())
            {
                /* Initialization */
                var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60));

                driver.Manage().Window.Maximize();
                driver.Navigate().GoToUrl("https://tms.lionbridge.com/");

                string       projectTitle = ""; // Project Name
                ProjectsPage testPage     = new ProjectsPage(driver, projectTitle);

                testPage.ClickChosenProject();
                ParticularProjectPage testProjectPage = new ParticularProjectPage(driver);

                testProjectPage.StatusClick(driver);
                StatusPage testStatusPage = new StatusPage(driver);

                testStatusPage.AssigneesClick(driver);
                AssigneesPage porscheAssigneesPage = new AssigneesPage(driver);

                IReadOnlyCollection <IWebElement> r_LObjects = driver.FindElements(By.ClassName("r_L"));
                List <AssigneeJobs> assigneesJobs            = new List <AssigneeJobs>();

                AssigneeJobs auxiliaryAssigneesJob = new AssigneeJobs(r_LObjects.ElementAt(0));
                assigneesJobs.Add(auxiliaryAssigneesJob);

                auxiliaryAssigneesJob.AssigneeJobButtonClick(driver);
                IWebElement dropDownElement = driver.FindElement(By.XPath("//*[@class=\"m1 lay_flt\"]"));

                /* Set of assertions */

                Assert.IsTrue(dropDownElement.Displayed);
            }
        }
Exemplo n.º 21
0
        public MSProApp()
        {
            Version = "1.1";

            StatusPage       = (StatusPage)FreshPageModelResolver.ResolvePageModel <StatusViewModel>();
            StatusPage.Title = Translation.GetString("Status");
            StatusVM         = (StatusViewModel)StatusPage.BindingContext;

            CountriesPage       = (CountriesPage)FreshPageModelResolver.ResolvePageModel <CountriesViewModel>();
            CountriesPage.Title = Translation.GetString("Countries");
            CountriesVM         = (CountriesViewModel)CountriesPage.BindingContext;

            CitiesPage       = (CitiesPage)FreshPageModelResolver.ResolvePageModel <CitiesViewModel>();
            CitiesPage.Title = Translation.GetString("Cities");
            CitiesVM         = (CitiesViewModel)CitiesPage.BindingContext;

            TorLogPage       = (TorLogPage)FreshPageModelResolver.ResolvePageModel <TorLogViewModel>();
            TorLogPage.Title = Translation.GetString("Tor log");
            TorLogVM         = (TorLogViewModel)TorLogPage.BindingContext;

            SettingsPage       = (SettingsPage)FreshPageModelResolver.ResolvePageModel <SettingsViewModel>();
            SettingsPage.Title = Translation.GetString("Settings");
            SettingsVM         = (SettingsViewModel)SettingsPage.BindingContext;

            AboutPage       = (AboutPage)FreshPageModelResolver.ResolvePageModel <AboutViewModel>();
            AboutPage.Title = Translation.GetString("About");
            AboutVM         = (AboutViewModel)AboutPage.BindingContext;

            ProxyTips = new TabbedPage();
            ProxyTipsWifiPage wfPage = (ProxyTipsWifiPage)FreshPageModelResolver.ResolvePageModel <ProxyTipsWifiViewModel>();

            wfPage.Title = Translation.GetString("Wi-Fi");
            PTWFVM       = (ProxyTipsWifiViewModel)wfPage.BindingContext;

            ProxyTipsAPNPage apnPage = (ProxyTipsAPNPage)FreshPageModelResolver.ResolvePageModel <ProxyTipsAPNViewModel>();

            apnPage.Title = Translation.GetString("APN");
            PTAPNVM       = (ProxyTipsAPNViewModel)apnPage.BindingContext;
            ProxyTips.Children.Add(wfPage);
            ProxyTips.Children.Add(apnPage);

            MainPage = new NavigationPage(StatusPage);

            MessagingCenter.Subscribe <MSProApp, string>(this, "TorOutput", (sender, arg) =>
            {
                if (arg.CompareTo(System.String.Empty) != 0)
                {
                    TorLogVM.TorLog.Add(arg);
                    MessagingCenter.Send <StatusViewModel, string>(StatusVM, "NewLoadMessage", arg);
                }
                if (arg.IndexOf("[err]") != -1)
                {
                    //error!
                }
                if (arg.IndexOf("100%") != -1)
                {
                    Task tc = Task.Run(() =>
                    {
                        Tor.Connect();
                    });
                    tc.Wait();
                    MessagingCenter.Send <StatusPage>((StatusPage)StatusVM.CurrentPage, "BootstrappFinished");
                }
            });
            MessagingCenter.Subscribe <MSProApp>(this, "Start", (sender) =>
            {
                OnStart();
            });
        }
Exemplo n.º 22
0
    public void OnChangeStatus(string status)
    {
        //CancelInvoke("Timecount");
        StatusPage newStatus = (StatusPage)System.Enum.Parse(typeof(StatusPage), status);

        statusPage = newStatus;
        switch (statusPage)
        {
        case StatusPage.mainPage:
            previousPage = currentPage;
            currentPage  = canvasGroupsPages[0];
            PageTransition(currentPage, previousPage);
            currentPage.GetComponent <MainPage>().OnChangeTo();
            break;

        case StatusPage.tutorial:
            previousPage = currentPage;
            currentPage  = canvasGroupsPages[1];
            PageTransition(currentPage, previousPage);
            currentPage.GetComponent <TutorialScript>().OnChangeTo();
            break;

        case StatusPage.stage1:
            previousPage = currentPage;
            currentPage  = canvasGroupsPages[2];
            PageTransition(currentPage, previousPage);
            currentPage.GetComponent <Stage_1>().OnChangeTo(1);
            break;

        case StatusPage.stage2:
            previousPage = currentPage;
            currentPage  = canvasGroupsPages[3];
            PageTransition(currentPage, previousPage);
            currentPage.GetComponent <Stage_1>().OnChangeTo(16);
            break;

        case StatusPage.stage3:
            previousPage = currentPage;
            currentPage  = canvasGroupsPages[4];
            PageTransition(currentPage, previousPage);
            currentPage.GetComponent <Stage_1>().OnChangeTo(31);
            break;

        case StatusPage.stage4:
            previousPage = currentPage;
            currentPage  = canvasGroupsPages[5];
            PageTransition(currentPage, previousPage);
            currentPage.GetComponent <Stage_45>().OnChangeTo(46);
            break;

        case StatusPage.stage5:
            previousPage = currentPage;
            currentPage  = canvasGroupsPages[6];
            PageTransition(currentPage, previousPage);
            currentPage.GetComponent <Stage_45>().OnChangeTo(61);
            break;

        case StatusPage.setting:
            OCSettingPage();
            break;

        default:
            break;
        }
    }
Exemplo n.º 23
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            if (e.Parameter != null)
            {
                OfflineMode = true;
                cache.Fill  = (SolidColorBrush)Application.Current.Resources["AcrylicMessageBackground"];
            }
            grid.Opacity         = 0;
            grid.Visibility      = Visibility.Collapsed;
            LoadingRing.IsActive = true;
            base.OnNavigatedTo(e);

            LoadingRing.Visibility = Visibility.Visible;
            status = await StatusPage.GetStatus();

            if (status == null)
            {
                FailedToLoad.Visibility = Visibility.Visible;
                return;
            }
            else
            {
                FailedToLoad.Visibility = Visibility.Collapsed;
            }
            if (status.Incidents != null)
            {
                foreach (var incident in status.Incidents)
                {
                    if (incident.Status != "resolved")
                    {
                        List <SimpleComponent> updates = new List <SimpleComponent>();
                        for (int i = 0; i < incident.IncidentUpdates.Length; i++)
                        {
                            updates.Add(new SimpleComponent()
                            {
                                Status      = incident.IncidentUpdates[i].Status,
                                Description = incident.IncidentUpdates[i].Body,
                                Name        = incident.IncidentUpdates[i].UpdatedAt.ToString("t")
                            });
                        }
                        ComplexComponent sc = new ComplexComponent()
                        {
                            Name   = incident.Name,
                            Status = incident.Status,
                            Color  = ColorFromStatus(incident.Status),
                            Items  = updates
                        };

                        if (!string.IsNullOrWhiteSpace(sc.Name))
                        {
                            IncidentsPanel.Items.Add(sc);
                        }
                    }
                }
            }

            if (IncidentsPanel.Items.Count > 0)
            {
                IncidentsPanel.Visibility    = Visibility.Visible;
                IncidentsScroller.Visibility = Visibility.Visible;
            }
            else
            {
                IncidentsPanel.Visibility    = Visibility.Collapsed;
                IncidentsScroller.Visibility = Visibility.Collapsed;
            }

            if (status.Status != null)
            {
                var statusBrush = ColorFromStatus(status.Status.Indicator);
                statusColor = statusBrush.Color;
                statusContainer.Background = statusBrush;
                border.BorderBrush         = statusBrush;
                //dayDuration.Foreground = statusBrush;
                //weekDuration.Foreground = statusBrush;
                //monthDuration.Foreground = statusBrush;
                IncidentsScroller.Background = new SolidColorBrush(statusBrush.Color)
                {
                    Opacity = 0.25
                };
                statusDescription.Text     = status.Status.Description;
                statusContainer.Visibility = Visibility.Visible;
            }
            if (status.Components != null)
            {
                foreach (var component in status.Components)
                {
                    SimpleComponent sc = new SimpleComponent()
                    {
                        Name        = component.Name,
                        Status      = component.Status.Replace("_", " "),
                        Color       = ColorFromStatus(component.Status),
                        Description = component.Description
                    };
                    ComponentsPanel.Items.Add(sc);
                }
            }
            grid.Visibility = Visibility.Visible;
            scale2.CenterY  = grid.ActualHeight / 2;
            scale2.CenterX  = grid.ActualWidth / 2;
            LoadIn.Begin();
            ShowMetrics("day");
        }
        public void WholeProgram_NewParsingCorrectly_Test_1()
        {
            using (var driver = new ChromeDriver())
            {
                /* Initialization */
                var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60));

                driver.Manage().Window.Maximize();
                driver.Navigate().GoToUrl("https://tms.lionbridge.com/");

                string       projectName = ""; // Project Name
                ProjectsPage testPage    = new ProjectsPage(driver, projectName);

                testPage.ClickChosenProject();
                ParticularProjectPage testProjectPage = new ParticularProjectPage(driver);

                testProjectPage.ProfileClick(driver);
                testProjectPage.ChangeItemsPerPageMin(driver);

                testProjectPage.StatusClick(driver);
                StatusPage testStatusPage = new StatusPage(driver);

                testStatusPage.AssigneesClick(driver);
                AssigneesPage porscheAssigneesPage = new AssigneesPage(driver);

                porscheAssigneesPage.ChosenActivityClick(driver, "InternalReview");
                porscheAssigneesPage = new AssigneesPage(driver);

                PageBar testPageBar = new PageBar(driver);
                testPageBar.ItemsPerPageSetMaximalValue(driver);

                AssigneesAndJobs asob = new AssigneesAndJobs(driver);

                List <StatusAssigneeInfo> listOfStatusAssgineeInfo = new List <StatusAssigneeInfo>();
                StatusAssigneeInfo        auxiliary;

                foreach (Assignee ass in asob.assigneesList)
                {
                    for (int i = 0; i < ass.GetAssingeeJobsNumberInt; i++)
                    {
                        auxiliary = new StatusAssigneeInfo(ass, asob.assigneesJobsList.ElementAt(i));
                        listOfStatusAssgineeInfo.Add(auxiliary);
                    }
                    asob.assigneesJobsList.RemoveRange(0, ass.GetAssingeeJobsNumberInt - 1);
                }

                asob = new AssigneesAndJobs(driver);
                asob.TagMultipleJobs(driver, 0, asob.GetAssigneeJobsListSize - 1);

                ViewsMenu assigneesViewsMenu = new ViewsMenu(driver);
                assigneesViewsMenu.JobsView.ButtonClick();

                JobsSectionJobs jsj = new JobsSectionJobs(driver);
                jsj.ShowHistoryOfJob(driver, listOfStatusAssgineeInfo.ElementAt(0).jobName.Trim());

                JobHistoryFilter filter = new JobHistoryFilter(driver);

                filter.FiltersPanelInitialization(driver);
                filter.ChosenActivityClick(driver, "Translation");

                filter = new JobHistoryFilter(driver);
                filter.FiltersPanelInitialization(driver);

                filter.SourceLanguageFilterClick(driver);
                filter.ChosenSourceLanguageClick(driver, listOfStatusAssgineeInfo.ElementAt(0).sourceLanguage);

                filter = new JobHistoryFilter(driver);
                filter.FiltersPanelInitialization(driver);

                filter.TargetLanguageFilterClick(driver);
                filter.ChosenTargetLanguageClick(driver, listOfStatusAssgineeInfo.ElementAt(0).targetLanguage);

                IReadOnlyCollection <IWebElement> auxiliaryCollection;
                ResultJob auxiliaryJobs = new ResultJob();

                wait.Until(ExpectedConditions.ElementIsVisible(By.ClassName("r_L")));
                auxiliaryCollection = driver.FindElements(By.Id("pup_avw"));

                IWebElement jobsResultsContainer = auxiliaryCollection.ElementAt(0);

                auxiliaryCollection = jobsResultsContainer.FindElements(By.ClassName("r_L"));
                auxiliaryJobs       = new ResultJob(auxiliaryCollection.ElementAt(0));

                listOfStatusAssgineeInfo.ElementAt(0).TranslatorName = auxiliaryJobs.GetTranlatorName;

                string path = Path.Combine(Directory.GetCurrentDirectory(), "TestFile");

                using (SpreadsheetDocument spreadsheetDocument = SpreadsheetDocument.Create(path, SpreadsheetDocumentType.Workbook))
                {
                    // Add a WorkbookPart to the document.
                    WorkbookPart workbookpart = spreadsheetDocument.AddWorkbookPart();
                    workbookpart.Workbook = new Workbook();

                    // Add a WorksheetPart to the WorkbookPart.
                    WorksheetPart worksheetPart = workbookpart.AddNewPart <WorksheetPart>();
                    worksheetPart.Worksheet = new Worksheet(new SheetData());

                    // Add Sheets to the Workbook.
                    Sheets sheets = spreadsheetDocument.WorkbookPart.Workbook.
                                    AppendChild <Sheets>(new Sheets());

                    // Append a new worksheet and associate it with the workbook.
                    Sheet sheet = new Sheet()
                    {
                        Id = spreadsheetDocument.WorkbookPart.
                             GetIdOfPart(worksheetPart),
                        SheetId = 1,
                        Name    = "mySheet"
                    };


                    sheets.Append(sheet);
                    SheetData sheetData = worksheetPart.Worksheet.GetFirstChild <SheetData>();


                    UInt32 rowIndex = 0;

                    foreach (var info in listOfStatusAssgineeInfo)
                    {
                        var row = new Row()
                        {
                            RowIndex = rowIndex
                        };

                        var firstNameCell = new Cell()
                        {
                            CellReference = "A" + (rowIndex + 1)
                        };
                        firstNameCell.CellValue = new CellValue(info.jobName);
                        firstNameCell.DataType  = CellValues.String;

                        row.AppendChild(firstNameCell);

                        Cell secondNameCell = new Cell()
                        {
                            CellReference = "B" + (rowIndex + 1)
                        };
                        secondNameCell.CellValue = new CellValue(info.sourceLanguage);
                        secondNameCell.DataType  = new EnumValue <CellValues>(CellValues.String);

                        row.AppendChild(secondNameCell);

                        Cell thirdNameCell = new Cell()
                        {
                            CellReference = "C" + (rowIndex + 1)
                        };
                        thirdNameCell.CellValue = new CellValue(info.targetLanguage);
                        thirdNameCell.DataType  = new EnumValue <CellValues>(CellValues.String);

                        row.AppendChild(thirdNameCell);

                        Cell fourthNameCell = new Cell()
                        {
                            CellReference = "D" + (rowIndex + 1)
                        };
                        fourthNameCell.CellValue = new CellValue(info.reviewerName);
                        fourthNameCell.DataType  = new EnumValue <CellValues>(CellValues.String);

                        row.AppendChild(fourthNameCell);

                        Cell fifthNameCell = new Cell()
                        {
                            CellReference = "E" + (rowIndex + 1)
                        };
                        fifthNameCell.CellValue = new CellValue(info.TranslatorName);
                        fifthNameCell.DataType  = new EnumValue <CellValues>(CellValues.String);

                        row.AppendChild(fifthNameCell);

                        sheetData.AppendChild(row);

                        rowIndex++;
                    }

                    workbookpart.Workbook.Save();
                }


                /*SearchResults sr = new SearchResults(driver);
                 * Assert.AreEqual("", sr.jobsList.ElementAt(0).GetTranlatorName);*/

                /*jsj.ShowHistoryOfJob(driver, 0);
                 *
                 * PopUpBody body = new PopUpBody(driver);
                 * JobHistoryFilter filter = new JobHistoryFilter(driver);
                 *
                 * filter.FiltersPanelInitialization(driver);
                 * filter.ChosenActivityClick(driver, "Translation");*/

                //filter.ChosenSourceLanguageClick(driver, asob.)

                Thread.Sleep(5000);
            }
        }
        public void WholeProgram_NewParsingCorrectly_Test_3()
        {
            using (var driver = new ChromeDriver())
            {
                /* Initialization */
                var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60));

                driver.Manage().Window.Maximize();
                driver.Navigate().GoToUrl("https://tms.lionbridge.com/");

                string       projectName = ""; // Project Name
                ProjectsPage testPage    = new ProjectsPage(driver, projectName);

                testPage.ClickChosenProject();
                ParticularProjectPage testProjectPage = new ParticularProjectPage(driver);

                testProjectPage.ProfileClick(driver);
                testProjectPage.ChangeItemsPerPageMin(driver);

                testProjectPage.StatusClick(driver);
                StatusPage testStatusPage = new StatusPage(driver);

                testStatusPage.AssigneesClick(driver);
                AssigneesPage porscheAssigneesPage = new AssigneesPage(driver);

                porscheAssigneesPage.ChosenActivityClick(driver, "InternalReview");
                porscheAssigneesPage = new AssigneesPage(driver);

                PageBar testPageBar = new PageBar(driver);
                testPageBar.ItemsPerPageSetMaximalValue(driver);

                AssigneesAndJobs asob = new AssigneesAndJobs(driver);

                List <StatusAssigneeInfo> listOfStatusAssgineeInfo = new List <StatusAssigneeInfo>();
                StatusAssigneeInfo        auxiliary;

                foreach (Assignee ass in asob.assigneesList)
                {
                    for (int i = 0; i < ass.GetAssingeeJobsNumberInt; i++)
                    {
                        auxiliary = new StatusAssigneeInfo(ass, asob.assigneesJobsList.ElementAt(i));
                        listOfStatusAssgineeInfo.Add(auxiliary);
                    }
                    asob.assigneesJobsList.RemoveRange(0, ass.GetAssingeeJobsNumberInt - 1);
                }

                asob = new AssigneesAndJobs(driver);
                asob.TagMultipleJobs(driver, 0, asob.GetAssigneeJobsListSize - 1);

                ViewsMenu assigneesViewsMenu = new ViewsMenu(driver);
                assigneesViewsMenu.JobsView.ButtonClick();

                JobsSectionJobs jsj = new JobsSectionJobs(driver);

                IReadOnlyCollection <IWebElement> auxiliaryCollection;
                ResultJob   auxiliaryJobs = new ResultJob();
                IWebElement jobsResultsContainer;

                foreach (var info in listOfStatusAssgineeInfo)
                {
                    jsj.ShowHistoryOfJob(driver, info.jobName);

                    JobHistoryFilter filter = new JobHistoryFilter(driver);

                    filter.FiltersPanelInitialization(driver);
                    filter.ChosenActivityClick(driver, "Translation");

                    filter = new JobHistoryFilter(driver);
                    filter.FiltersPanelInitialization(driver);

                    filter.SourceLanguageFilterClick(driver);
                    filter.ChosenSourceLanguageClick(driver, info.sourceLanguage);

                    filter = new JobHistoryFilter(driver);
                    filter.FiltersPanelInitialization(driver);

                    filter.TargetLanguageFilterClick(driver);
                    filter.ChosenTargetLanguageClick(driver, info.targetLanguage);

                    wait.Until(ExpectedConditions.ElementIsVisible(By.ClassName("r_L")));
                    auxiliaryCollection = driver.FindElements(By.Id("pup_avw"));

                    jobsResultsContainer = auxiliaryCollection.ElementAt(0);

                    auxiliaryCollection = jobsResultsContainer.FindElements(By.ClassName("r_L"));
                    auxiliaryJobs       = new ResultJob(auxiliaryCollection.ElementAt(0));

                    listOfStatusAssgineeInfo.ElementAt(listOfStatusAssgineeInfo.IndexOf(info)).TranslatorName = auxiliaryJobs.GetTranlatorName;

                    PopUpBody popuPBody = new PopUpBody(driver);
                    popuPBody.CloseButtonClick(driver);
                }


                string path = Path.Combine(Directory.GetCurrentDirectory(), "TestFile.csv");

                using (StreamWriter sw = new StreamWriter(path))
                {
                    // iterates over the users
                    foreach (var info in listOfStatusAssgineeInfo)
                    {
                        // creates an array of the user's values
                        string[] values = { info.jobName, info.reviewerName, info.translatorName, info.sourceLanguage, info.targetLanguage };
                        // creates a new line
                        string line = String.Join(";", values);
                        // writes the line
                        sw.WriteLine(line);
                    }
                    // flushes the buffer
                    sw.Flush();
                }
            }
        }
        public void AssigneesElement_ParsingCorrectly_Test_1()
        {
            using (var driver = new ChromeDriver())
            {
                /* Initialization */
                var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60));

                driver.Manage().Window.Maximize();
                driver.Navigate().GoToUrl("https://tms.lionbridge.com/");

                string       projectName = ""; // Project Name
                ProjectsPage testPage    = new ProjectsPage(driver, projectName);

                testPage.ClickChosenProject();
                ParticularProjectPage testProjectPage = new ParticularProjectPage(driver);

                testProjectPage.ProfileClick(driver);
                testProjectPage.ChangeItemsPerPageMin(driver);

                testProjectPage.StatusClick(driver);
                StatusPage testStatusPage = new StatusPage(driver);

                testStatusPage.AssigneesClick(driver);
                AssigneesPage porscheAssigneesPage = new AssigneesPage(driver);

                porscheAssigneesPage.ActivitiesFilterClick(driver);
                porscheAssigneesPage.ChosenActivityClick(driver, "InternalReview");

                PageBar pageBar = new PageBar(driver);
                pageBar.ItemsPerPageSetMaximalValue(driver);

                Thread.Sleep(5000);

                IReadOnlyCollection <IWebElement> r_LHObjects = driver.FindElements(By.ClassName("r_LH"));
                IReadOnlyCollection <IWebElement> r_LObjects  = driver.FindElements(By.ClassName("r_L"));

                //AssigneeAndHisJob firstAssingee = new AssigneeAndHisJob(r_LHObjects.ElementAt(0), r_LObjects.ElementAt(0));
                //Assert.AreNotEqual("", firstAssingee.assigneeName);
                //Assert.AreNotEqual("", firstAssingee.sourceLanguage);

                //AssigneesAndTheirJobs aTJ = new AssigneesAndTheirJobs(r_LHObjects, r_LObjects);
                //Assert.AreEqual(4, aTJ.assigneesAngTheirJobsList.Count);
                //Assert.AreEqual(0, aTJ.count);

                //IOrderedEnumerable<AssigneeAndHisJob> aTJOrdered = aTJ.assigneesAngTheirJobsList.OrderBy(x => x.targetLanguage);

                /*IEnumerable<AssigneeAndHisJob> auxiliaryEnumerable;
                 * List<string> differentLanguages = new List<string>();
                 *
                 * string auxiliaryString;
                 * int auxiliaryInt = 0;
                 *
                 * while (auxiliaryInt < aTJ.count)
                 * {
                 *  auxiliaryString = aTJOrdered.ElementAt(auxiliaryInt).targetLanguage;
                 *  if (auxiliaryString != "" && auxiliaryString != null)
                 *  {
                 *      differentLanguages.Add(auxiliaryString);
                 *  }
                 *
                 *  auxiliaryEnumerable = aTJ.assigneesAngTheirJobsList.Where(x => x.targetLanguage == auxiliaryString);
                 *  auxiliaryInt += auxiliaryEnumerable.Count();
                 * }
                 *
                 * //Assert.AreEqual(0, differentLanguages.Count);
                 *
                 * Actions a = new Actions(driver);
                 *
                 * a.Click(aTJ.assigneesAngTheirJobsList.ElementAt(0).webElement)
                 * .KeyDown(Keys.Shift)
                 * .MoveToElement(r_LObjects.ElementAt(2))
                 * .Click(aTJ.assigneesAngTheirJobsList.ElementAt(aTJ.count - 1).webElement)
                 * .Build()
                 * .Perform();
                 *
                 * AssingeesOnClickJobsMenu menu = new AssingeesOnClickJobsMenu(driver);
                 * menu.ClickTagJobsButton(driver);
                 *
                 * AssigneesPage afterTagging = new AssigneesPage(driver);
                 * afterTagging.ActivitiesClick(driver);*/

                StatusPage statusPageAfterTagging = new StatusPage(driver);
                statusPageAfterTagging.ClickAll(driver);

                Thread.Sleep(10000);
                StatusPage statusPageAll = new StatusPage(driver);
                Thread.Sleep(1000);
                statusPageAll.ActivitiesFilterClick(driver);
                Thread.Sleep(1000);

                statusPageAll.ChosenActivityClick(driver, "Translation");
                Thread.Sleep(10000);

                StatusPage translationPage = new StatusPage(driver);

                translationPage.TargetLanguageFilterClick(driver);
                Thread.Sleep(1000);

                //translationPage.ChosenGetTargetLanguageClick(driver, differentLanguages.ElementAt(1));

                Thread.Sleep(5000);

                pageBar = new PageBar(driver);
                pageBar.ItemsPerPageSetMaximalValue(driver);

                Thread.Sleep(5000);

                IReadOnlyCollection <IWebElement> r_LHTranslationJobs = driver.FindElements(By.ClassName("r_LH"));
                List <string> translationJobNames = new List <string>();

                IWebElement auxiliaryElement;

                foreach (IWebElement el in r_LHTranslationJobs)
                {
                    auxiliaryElement = el.FindElement(By.ClassName("grp_ttl"));
                    translationJobNames.Add(auxiliaryElement.Text);
                }

                //Assert.AreEqual("", differentLanguages.ElementAt(0));
                Assert.AreEqual("", translationJobNames.ElementAt(0));

                /* Set of assertions */

                /*AssigneeElement el = new AssigneeElement(assignees[0], assigneesJobs);
                 * Assert.AreEqual("bg-bg", el.AssigneeLanguage);
                 * Assert.AreEqual(el.GetAssigneeJobsNumberString, el.AssigneeJobsList.Count);*/

                Assert.AreEqual(0, r_LHObjects.Count);
                Assert.AreEqual(0, r_LObjects.Count);
            }
        }
Exemplo n.º 27
0
        protected override void OnStart()
        {
            //xlarge screens are at least 960dp x 720dp
            //large screens are at least 640dp x 480dp
            //normal screens are at least 470dp x 320dp
            //small screens are at least 426dp x 320dp

            float dens = DependencyService.Get <IDisplaySize>().GetDensity();
            int   wd = DependencyService.Get <IDisplaySize>().GetWidthDiP();
            int   hd = DependencyService.Get <IDisplaySize>().GetHeightDiP();
            int   bigger, smaller;

            if (wd > hd) //landscape
            {
                bigger  = wd;
                smaller = hd;
            }
            else //portrait
            {
                bigger  = hd;
                smaller = wd;
            }

            if (Device.Idiom == TargetIdiom.Tablet)
            {
                if (smaller >= 500 && smaller < 700) //SW500
                {
                    StatusPageSW500 sp = new StatusPageSW500();
                    sp.Title = Translation.GetString("Status");
                    FreshMvvm.FreshPageModelResolver.BindingPageModel(null, sp, StatusVM);
                    MainPage = new NavigationPage(sp);

                    TorLogPageSW500 tlp = new TorLogPageSW500();
                    tlp.Title = Translation.GetString("Tor log");
                    FreshMvvm.FreshPageModelResolver.BindingPageModel(null, tlp, TorLogVM);

                    CountriesPageSW500 cap = new CountriesPageSW500();
                    cap.Title = Translation.GetString("Countries");
                    FreshMvvm.FreshPageModelResolver.BindingPageModel(null, cap, CountriesVM);

                    CitiesPageSW500 cip = new CitiesPageSW500();
                    cip.Title = Translation.GetString("Cities");
                    FreshMvvm.FreshPageModelResolver.BindingPageModel(null, cip, CitiesVM);
                }
            }

            if (Device.Idiom == TargetIdiom.Phone)
            {
                if (smaller >= 500) //SW500
                {
                    StatusPageSW500 sp = new StatusPageSW500();
                    sp.Title = Translation.GetString("Status");
                    FreshMvvm.FreshPageModelResolver.BindingPageModel(null, sp, StatusVM);
                    MainPage = new NavigationPage(sp);

                    TorLogPageSW500 tlp = new TorLogPageSW500();
                    tlp.Title = Translation.GetString("Tor log");
                    FreshMvvm.FreshPageModelResolver.BindingPageModel(null, tlp, TorLogVM);

                    CountriesPageSW500 cap = new CountriesPageSW500();
                    cap.Title = Translation.GetString("Countries");
                    FreshMvvm.FreshPageModelResolver.BindingPageModel(null, cap, CountriesVM);

                    CitiesPageSW500 cip = new CitiesPageSW500();
                    cip.Title = Translation.GetString("Cities");
                    FreshMvvm.FreshPageModelResolver.BindingPageModel(null, cip, CitiesVM);

                    AboutPage ap = new AboutPage();
                    ap.Title = Translation.GetString("About");
                    FreshMvvm.FreshPageModelResolver.BindingPageModel(null, ap, AboutVM);
                }
                else
                {
                    if (smaller >= 400) //SW400
                    {
                        if (wd > hd)
                        {
                            StatusPagePhoneL       = new StatusPageSW400();
                            StatusPagePhoneL.Title = Translation.GetString("Status");
                            FreshMvvm.FreshPageModelResolver.BindingPageModel(null, StatusPagePhoneL, StatusVM);
                            Application.Current.MainPage.Navigation.PopAsync();
                            MainPage = new NavigationPage(StatusPagePhoneL);
                            StatusPagePhoneL.DisplayPosition = DisplayPos.Landscape;
                        }
                        else
                        {
                            /*
                             * StatusPagePhoneP = new StatusPageSW400p();
                             * StatusPagePhoneP.Title = Translation.GetString("Status");
                             * FreshMvvm.FreshPageModelResolver.BindingPageModel(null, StatusPagePhoneP, StatusVM);
                             * Application.Current.MainPage.Navigation.PopAsync();
                             * MainPage = new NavigationPage(StatusPagePhoneP);
                             * StatusPagePhoneP.DisplayPosition = DisplayPos.Portrait;
                             */
                            var tabbedNavigation = new FreshTabbedNavigationContainer();

                            StatusPageSW400p tab1 = new StatusPageSW400p();
                            FreshMvvm.FreshPageModelResolver.BindingPageModel(null, tab1, StatusVM);

                            tabbedNavigation.AddTab()
                            tabbedNavigation.AddTab <CountriesViewModel>("Countries", null);
                            MainPage = tabbedNavigation;
                        }

                        TorLogPageSW400 tlp = new TorLogPageSW400();
                        tlp.Title = Translation.GetString("Tor log");
                        FreshMvvm.FreshPageModelResolver.BindingPageModel(null, tlp, TorLogVM);

                        CountriesPageSW400 cap = new CountriesPageSW400();
                        cap.Title = Translation.GetString("Countries");
                        FreshMvvm.FreshPageModelResolver.BindingPageModel(null, cap, CountriesVM);

                        CitiesPageSW400 cip = new CitiesPageSW400();
                        cip.Title = Translation.GetString("Cities");
                        FreshMvvm.FreshPageModelResolver.BindingPageModel(null, cip, CitiesVM);

                        AboutPageSW400 ap = new AboutPageSW400();
                        ap.Title = Translation.GetString("About");
                        FreshMvvm.FreshPageModelResolver.BindingPageModel(null, ap, AboutVM);
                    }
                    else
                    {
                        if (smaller >= 300) //SW300
                        {
                            if (wd > hd)
                            {
                                StatusPagePhoneL       = new StatusPageSW300();
                                StatusPagePhoneL.Title = Translation.GetString("Status");
                                FreshMvvm.FreshPageModelResolver.BindingPageModel(null, StatusPagePhoneL, StatusVM);
                                Application.Current.MainPage.Navigation.PopAsync();
                                MainPage = new NavigationPage(StatusPagePhoneL);
                                StatusPagePhoneL.DisplayPosition = DisplayPos.Landscape;
                            }
                            else
                            {
                                /*
                                 * StatusPagePhoneP = new StatusPageSW300p();
                                 * StatusPagePhoneP.Title = Translation.GetString("Status");
                                 * FreshMvvm.FreshPageModelResolver.BindingPageModel(null, StatusPagePhoneP, StatusVM);
                                 * Application.Current.MainPage.Navigation.PopAsync();
                                 */
                                var tabbedNavigation = new FreshTabbedNavigationContainer();
                                tabbedNavigation.AddTab <StatusViewModel>("Status", null);
                                tabbedNavigation.AddTab <CountriesViewModel>("Countries", null);
                                MainPage = tabbedNavigation;
                                //MainPage = new NavigationPage(StatusPagePhoneP);
                                //StatusPagePhoneP.DisplayPosition = DisplayPos.Portrait;
                            }

                            /*
                             * StatusPageSW300 sp = new StatusPageSW300();
                             * sp.Title = Translation.GetString("Status");
                             * FreshMvvm.FreshPageModelResolver.BindingPageModel(null, sp, StatusVM);
                             * MainPage = new NavigationPage(sp);*/

                            TorLogPageSW300 tlp = new TorLogPageSW300();
                            tlp.Title = Translation.GetString("Tor log");
                            FreshMvvm.FreshPageModelResolver.BindingPageModel(null, tlp, TorLogVM);

                            CountriesPageSW300 cap = new CountriesPageSW300();
                            cap.Title = Translation.GetString("Countries");
                            FreshMvvm.FreshPageModelResolver.BindingPageModel(null, cap, CountriesVM);

                            CitiesPageSW300 cip = new CitiesPageSW300();
                            cip.Title = Translation.GetString("Cities");
                            FreshMvvm.FreshPageModelResolver.BindingPageModel(null, cip, CitiesVM);

                            AboutPageSW300 ap = new AboutPageSW300();
                            ap.Title = Translation.GetString("About");
                            FreshMvvm.FreshPageModelResolver.BindingPageModel(null, ap, AboutVM);
                        }
                        else //small (< 300) SW200
                        {
                            //
                        }
                    }
                }
            }
            if (Device.Idiom != TargetIdiom.Tablet && Device.Idiom != TargetIdiom.Phone) //something strange
            {
                if (smaller < 700)
                {
                    if (smaller >= 500) //SW500
                    {
                        StatusPageSW500 sp = new StatusPageSW500();
                        sp.Title = Translation.GetString("Status");
                        FreshMvvm.FreshPageModelResolver.BindingPageModel(null, sp, StatusVM);
                        MainPage = new NavigationPage(sp);

                        TorLogPageSW500 tlp = new TorLogPageSW500();
                        tlp.Title = Translation.GetString("Tor log");
                        FreshMvvm.FreshPageModelResolver.BindingPageModel(null, tlp, TorLogVM);

                        CountriesPageSW500 cap = new CountriesPageSW500();
                        cap.Title = Translation.GetString("Countries");
                        FreshMvvm.FreshPageModelResolver.BindingPageModel(null, cap, CountriesVM);

                        CitiesPageSW500 cip = new CitiesPageSW500();
                        cip.Title = Translation.GetString("Cities");
                        FreshMvvm.FreshPageModelResolver.BindingPageModel(null, cip, CitiesVM);
                    }
                    else
                    {
                        if (smaller >= 400) //SW400
                        {
                            if (wd > hd)
                            {
                                StatusPagePhoneL       = new StatusPageSW400();
                                StatusPagePhoneL.Title = Translation.GetString("Status");
                                FreshMvvm.FreshPageModelResolver.BindingPageModel(null, StatusPagePhoneL, StatusVM);
                                Application.Current.MainPage.Navigation.PopAsync();
                                MainPage = new NavigationPage(StatusPagePhoneL);
                                StatusPagePhoneL.DisplayPosition = DisplayPos.Landscape;
                            }
                            else
                            {
                                StatusPagePhoneP       = new StatusPageSW400p();
                                StatusPagePhoneP.Title = Translation.GetString("Status");
                                FreshMvvm.FreshPageModelResolver.BindingPageModel(null, StatusPagePhoneP, StatusVM);
                                Application.Current.MainPage.Navigation.PopAsync();
                                MainPage = new NavigationPage(StatusPagePhoneP);
                                StatusPagePhoneP.DisplayPosition = DisplayPos.Portrait;
                            }

                            TorLogPageSW400 tlp = new TorLogPageSW400();
                            tlp.Title = Translation.GetString("Tor log");
                            FreshMvvm.FreshPageModelResolver.BindingPageModel(null, tlp, TorLogVM);

                            CountriesPageSW400 cap = new CountriesPageSW400();
                            cap.Title = Translation.GetString("Countries");
                            FreshMvvm.FreshPageModelResolver.BindingPageModel(null, cap, CountriesVM);

                            CitiesPageSW400 cip = new CitiesPageSW400();
                            cip.Title = Translation.GetString("Cities");
                            FreshMvvm.FreshPageModelResolver.BindingPageModel(null, cip, CitiesVM);

                            AboutPageSW400 ap = new AboutPageSW400();
                            ap.Title = Translation.GetString("About");
                            FreshMvvm.FreshPageModelResolver.BindingPageModel(null, ap, AboutVM);
                        }
                        else
                        {
                            if (smaller >= 300) //SW300
                            {
                                if (wd > hd)
                                {
                                    StatusPagePhoneL       = new StatusPageSW300();
                                    StatusPagePhoneL.Title = Translation.GetString("Status");
                                    FreshMvvm.FreshPageModelResolver.BindingPageModel(null, StatusPagePhoneL, StatusVM);
                                    Application.Current.MainPage.Navigation.PopAsync();
                                    MainPage = new NavigationPage(StatusPagePhoneL);
                                    StatusPagePhoneL.DisplayPosition = DisplayPos.Landscape;
                                }
                                else
                                {
                                    StatusPagePhoneP       = new StatusPageSW300p();
                                    StatusPagePhoneP.Title = Translation.GetString("Status");
                                    FreshMvvm.FreshPageModelResolver.BindingPageModel(null, StatusPagePhoneP, StatusVM);
                                    Application.Current.MainPage.Navigation.PopAsync();
                                    MainPage = new NavigationPage(StatusPagePhoneP);
                                    StatusPagePhoneP.DisplayPosition = DisplayPos.Portrait;
                                }

                                /*
                                 * StatusPageSW300 sp = new StatusPageSW300();
                                 * sp.Title = Translation.GetString("Status");
                                 * FreshMvvm.FreshPageModelResolver.BindingPageModel(null, sp, StatusVM);
                                 * MainPage = new NavigationPage(sp);*/

                                TorLogPageSW300 tlp = new TorLogPageSW300();
                                tlp.Title = Translation.GetString("Tor log");
                                FreshMvvm.FreshPageModelResolver.BindingPageModel(null, tlp, TorLogVM);

                                CountriesPageSW300 cap = new CountriesPageSW300();
                                cap.Title = Translation.GetString("Countries");
                                FreshMvvm.FreshPageModelResolver.BindingPageModel(null, cap, CountriesVM);

                                CitiesPageSW300 cip = new CitiesPageSW300();
                                cip.Title = Translation.GetString("Cities");
                                FreshMvvm.FreshPageModelResolver.BindingPageModel(null, cip, CitiesVM);

                                AboutPageSW300 ap = new AboutPageSW300();
                                ap.Title = Translation.GetString("About");
                                FreshMvvm.FreshPageModelResolver.BindingPageModel(null, ap, AboutVM);
                            }
                            else //small (< 300) SW200
                            {
                                //
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 28
0
        protected override void OnStart()
        {
            //xlarge screens are at least 960dp x 720dp
            //large screens are at least 640dp x 480dp
            //normal screens are at least 470dp x 320dp
            //small screens are at least 426dp x 320dp

            MobileCenter.Start("android=7d19d3ff-dec3-42f0-80d7-3d5b74bc3593;", typeof(Analytics), typeof(Crashes));

            float dens = DependencyService.Get <IDisplaySize>().GetDensity();
            int   wd   = DependencyService.Get <IDisplaySize>().GetWidthDiP();
            int   hd   = DependencyService.Get <IDisplaySize>().GetHeightDiP();

            int bigger, smaller;

            if (wd > hd) //landscape
            {
                bigger  = wd;
                smaller = hd;
            }
            else //portrait
            {
                bigger  = hd;
                smaller = wd;
            }

            if (smaller >= 700) //SW700 and above
            {
                StatusPage sp = new StatusPage();
                sp.Title = AppStrings.Status;
                MainTabs.Children.Add(sp);

                CountriesPage cap = new CountriesPage();
                cap.Title = AppStrings.Countries;
                MainTabs.Children.Add(cap);

                CitiesPage cip = new CitiesPage();
                cip.Title = AppStrings.Cities;
                MainTabs.Children.Add(cip);

                TorLogPage tlp = new TorLogPage();
                tlp.Title = AppStrings.TorLog;
                MainTabs.Children.Add(tlp);

                AboutPage ap = new AboutPage();
                ap.Title = AppStrings.About;
                MainTabs.Children.Add(ap);

                MainPage = new NavigationPage(MainTabs);
            }
            else
            {
                if (smaller >= 500 && smaller < 700) //SW500
                {
                    StatusPageSW500 sp = new StatusPageSW500();
                    sp.Title = AppStrings.Status;
                    MainTabs.Children.Add(sp);

                    CountriesPageSW500 cap = new CountriesPageSW500();
                    cap.Title = AppStrings.Countries;
                    MainTabs.Children.Add(cap);

                    TorLogPageSW500 tlp = new TorLogPageSW500();
                    tlp.Title = AppStrings.TorLog;
                    MainTabs.Children.Add(tlp);

                    AboutPageSW400 ap = new AboutPageSW400();
                    ap.Title = AppStrings.About;
                    MainTabs.Children.Add(ap);

                    MainPage = new NavigationPage(MainTabs);
                }
                else
                {
                    if (smaller >= 400) //SW400
                    {
                        if (wd > hd)
                        {
                            StatusPagePhoneL       = new StatusPageSW400();
                            StatusPagePhoneL.Title = AppStrings.Status;
                            //Application.Current.MainPage.Navigation.PopAsync();
                            MainTabs.Children.Add(StatusPagePhoneL);
                            MainPage = new NavigationPage(MainTabs);
                            StatusPagePhoneL.DisplayPosition = DisplayPos.Landscape;
                        }
                        else
                        {
                            StatusPagePhoneP       = new StatusPageSW400p();
                            StatusPagePhoneP.Title = AppStrings.Status;
                            MainTabs.Children.Add(StatusPagePhoneP);
                            MainPage = new NavigationPage(MainTabs);
                            StatusPagePhoneP.DisplayPosition = DisplayPos.Portrait;
                        }

                        TorLogPageSW400 tlp = new TorLogPageSW400();
                        tlp.Title = AppStrings.TorLog;
                        MainTabs.Children.Add(tlp);

                        CountriesPageSW400 cap = new CountriesPageSW400();
                        cap.Title = AppStrings.Countries;
                        MainTabs.Children.Add(cap);

                        AboutPageSW400 ap = new AboutPageSW400();
                        ap.Title = AppStrings.About;
                        MainTabs.Children.Add(ap);
                    }
                    else//SW300
                    {
                        if (wd > hd)
                        {
                            StatusPagePhoneL       = new StatusPageSW300();
                            StatusPagePhoneL.Title = AppStrings.Status;
                            MainTabs.Children.Add(StatusPagePhoneL);
                            MainPage = new NavigationPage(MainTabs);
                            StatusPagePhoneL.DisplayPosition = DisplayPos.Landscape;
                        }
                        else
                        {
                            StatusPagePhoneP       = new StatusPageSW300p();
                            StatusPagePhoneP.Title = AppStrings.Status;
                            MainTabs.Children.Add(StatusPagePhoneP);

                            MainPage = new NavigationPage(MainTabs);
                            StatusPagePhoneP.DisplayPosition = DisplayPos.Portrait;
                        }

                        TorLogPageSW300 tlp = new TorLogPageSW300();
                        tlp.Title = AppStrings.TorLog;
                        MainTabs.Children.Add(tlp);

                        CountriesPageSW300 cap = new CountriesPageSW300();
                        cap.Title = AppStrings.Countries;
                        MainTabs.Children.Add(cap);

                        AboutPageSW300 ap = new AboutPageSW300();
                        ap.Title = AppStrings.About;
                        MainTabs.Children.Add(ap);
                    }
                }
            }
        }
Exemplo n.º 29
0
        static void Main(string[] args)
        {
            using (var driver = new ChromeDriver())
            {
                /* Initialization */


                string projectTitle  = ""; // Project Name
                string firstStepName = "InternalReview";

                Console.WriteLine("Hi, please chose TMS project name: \n" +
                                  "1) Porsche BAL 2.0 \n" +
                                  "2) Porsche Cosima");

                int projectChose = Int32.Parse(Console.ReadLine());

                switch (projectChose)
                {
                case 1:
                    projectTitle = "Porsche BAL 2.0";
                    break;

                case 2:
                    projectTitle = "Porsche Cosima";
                    break;

                default:
                    System.Environment.Exit(1);
                    break;
                }

                Console.WriteLine("Now, please chose TMS setting name: \n" +
                                  "1) Internal Review; " +
                                  "2) Editing");

                int settingChose = Int32.Parse(Console.ReadLine());

                switch (settingChose)
                {
                case 1:
                    firstStepName = "InternalReview";
                    break;

                case 2:
                    firstStepName = "Editing";
                    break;

                default:
                    System.Environment.Exit(1);
                    break;
                }

                var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60));

                driver.Manage().Window.Maximize();
                driver.Navigate().GoToUrl("https://tms.lionbridge.com/");

                ProjectsPage testPage = new ProjectsPage(driver, projectTitle);

                testPage.ClickChosenProject();
                ParticularProjectPage testProjectPage = new ParticularProjectPage(driver);

                testProjectPage.ProfileClick(driver);
                testProjectPage.ChangeItemsPerPageMin(driver);

                testProjectPage.StatusClick(driver);
                StatusPage testStatusPage = new StatusPage(driver);

                testStatusPage.AssigneesClick(driver);
                AssigneesPage porscheAssigneesPage = new AssigneesPage(driver);

                if (porscheAssigneesPage.ChosenActivityClick(driver, firstStepName) != 1)
                {
                    Console.WriteLine("There is no {0} steps!", firstStepName);
                    return;
                }
                porscheAssigneesPage = new AssigneesPage(driver);

                PageBar testPageBar = new PageBar(driver);
                testPageBar.ItemsPerPageSetMaximalValue(driver);

                AssigneesAndJobs asob = new AssigneesAndJobs(driver);

                List <StatusAssigneeInfo> listOfStatusAssgineeInfo = new List <StatusAssigneeInfo>();
                StatusAssigneeInfo        auxiliary;

                foreach (var ass in asob.assigneesJobsList)
                {
                    Console.WriteLine(ass.GetJobsName);
                }


                foreach (Assignee ass in asob.assigneesList)
                {
                    for (int i = 0; i < ass.GetAssingeeJobsNumberInt; i++)
                    {
                        auxiliary = new StatusAssigneeInfo(ass, asob.assigneesJobsList.ElementAt(i));
                        listOfStatusAssgineeInfo.Add(auxiliary);
                    }
                    for (int i = 0; i < ass.GetAssingeeJobsNumberInt; i++)
                    {
                        asob.assigneesJobsList.RemoveAt(0);
                    }

                    Console.WriteLine(ass.GetAssigneeName + " " + ass.GetAssingeeJobsNumberInt);
                }

                foreach (var ass in listOfStatusAssgineeInfo)
                {
                    Console.WriteLine(ass.jobName + " " + ass.reviewerName + " " + ass.sourceLanguage);
                }

                asob = new AssigneesAndJobs(driver);
                asob.TagMultipleJobs(driver, 0, asob.GetAssigneeJobsListSize - 1);

                ViewsMenu assigneesViewsMenu = new ViewsMenu(driver);
                assigneesViewsMenu.JobsView.ButtonClick();

                JobsSectionJobs jsj = new JobsSectionJobs(driver);
                jsj.jobsPageBar.ItemsPerPageSetMaximalValue(driver);

                jsj = new JobsSectionJobs(driver);

                IReadOnlyCollection <IWebElement> auxiliaryCollection;
                ResultJob   auxiliaryJobs = new ResultJob();
                IWebElement jobsResultsContainer;

                IJavaScriptExecutor jse;

                string path = Path.Combine(Directory.GetCurrentDirectory(), "TestFile.csv");

                using (StreamWriter sw = new StreamWriter(path))
                {
                    string[] values1 = { "Job Name", "Reviewer Name", "Translator Name", "Source Language", "Target Language", "Effort", "Wordcount" };
                    string   line1   = String.Join(";", values1);

                    sw.WriteLine(line1);

                    foreach (var info in listOfStatusAssgineeInfo)
                    {
                        jse = (IJavaScriptExecutor)driver;
                        jse.ExecuteScript("arguments[0].scrollIntoView();", jsj.GetJobElement(driver, info.jobName));

                        jsj.ShowHistoryOfJob(driver, info.jobName);

                        JobHistoryFilter filter = new JobHistoryFilter(driver);

                        filter.FiltersPanelInitialization(driver);
                        filter.ChosenActivityClick(driver, "Translation");

                        filter = new JobHistoryFilter(driver);
                        filter.FiltersPanelInitialization(driver);

                        filter.SourceLanguageFilterClick(driver);
                        filter.ChosenSourceLanguageClick(driver, info.sourceLanguage);

                        filter = new JobHistoryFilter(driver);
                        filter.FiltersPanelInitialization(driver);

                        filter.TargetLanguageFilterClick(driver);
                        filter.ChosenTargetLanguageClick(driver, info.targetLanguage);

                        wait.Until(ExpectedConditions.ElementIsVisible(By.ClassName("r_L")));
                        auxiliaryCollection = driver.FindElements(By.Id("pup_avw"));

                        jobsResultsContainer = auxiliaryCollection.ElementAt(0);

                        auxiliaryCollection = jobsResultsContainer.FindElements(By.ClassName("r_L"));
                        auxiliaryJobs       = new ResultJob(auxiliaryCollection.ElementAt(0));

                        listOfStatusAssgineeInfo.ElementAt(listOfStatusAssgineeInfo.IndexOf(info)).TranslatorName = auxiliaryJobs.GetTranlatorName;

                        PopUpBody popuPBody = new PopUpBody(driver);
                        popuPBody.CloseButtonClick(driver);

                        string[] values = { info.jobName, info.reviewerName, info.translatorName, info.sourceLanguage, info.targetLanguage, info.effort, info.wordcount };
                        string   line   = String.Join(";", values);

                        sw.WriteLine(line);
                    }

                    sw.Flush();
                }


                // iterates over the users
                //foreach (var info in listOfStatusAssgineeInfo)
                //   {
                // creates an array of the user's values
                //  string[] values = { info.jobName, info.reviewerName, info.translatorName, info.sourceLanguage, info.targetLanguage };
                // creates a new line
                //   string line = String.Join(";", values);
                // writes the line
                // sw.WriteLine(line);
                //  }
                // flushes the buffer
                // sw.Flush();
                //  }
            }
        }
Exemplo n.º 30
0
        private void setPageStatus(StatusPage _status)
        {
            /*-------------------------------
            -- ** Estados da página **
            -- Botões: Edit, Save, Del, New - Table
            -- 1 Enabled / 0 Disabled
            -- #a Abrir página sem carregar: 0100-1
            -- #b Abrir página carregando: 1011-0
            -- #c Clique em Editar: 0111-1
            -- #d Clique em Salvar: 1011-0
            -- #e Clique em Deletar: 0100-1
            -- #f Clique em Inserir: 0100-1
            -- obs.: a = e = f, b = c
            -------------------------------*/

            Boolean[] enable = new Boolean[5];

            // determina o comportamento de cada estado

            if (_status == StatusPage.OpenUnload || _status == StatusPage.AfterDelClick || _status == StatusPage.AfterInsertClick){
                enable[0] = false;
                enable[1] = true;
                enable[2] = enable[3] = false;
                enable[4] = true;
            }
            else if (_status == StatusPage.OpenLoad || _status == StatusPage.AfterEditClick)
            {
                enable[0] = false;
                enable[1] = enable[2] = enable[3] = enable[4] = true;
            }
            else if (_status == StatusPage.AfterSaveClick)
            {
                enable[0] = true;
                enable[1] = false;
                enable[2] = enable[3] = true;
                enable[4] = false;
            }

            // aplica aos botões
            try { this._btnEdit.Enabled = enable[0]; }
            catch (Exception ex){}

            try { this._btnSave.Enabled = enable[1]; }
            catch (Exception ex) { }

            try { this._btnDel.Enabled = enable[2]; }
            catch (Exception ex) { }

            try { this._btnNew.Enabled = enable[3]; }
            catch (Exception ex) { }

            try { this._htmtable.Disabled = !enable[4]; }
            catch (Exception ex) { }

            // campos não editáveis
            for (int i = 0; i < this._fields.Count; i++)
            {
                if (!this._fields[i].editable())
                {
                    this._fields[i].pageelement().Enabled = false;
                }
            }

            // verifica cadastro de sistema
            this.verifySystemCad();
        }
Exemplo n.º 31
0
        private void changePage(string page)
        {
            if (object.Equals(FrameSource, null).Equals(false))
            {
                if (FrameSource.GetType().Equals(typeof(LteInfoPage)))
                {
                    LteInfoModel lte = Application.Current.FindResource("LteInfoModel") as LteInfoModel;
                    lte.StopTimer();
                }

                if (FrameSource.GetType().Equals(typeof(DslPage)))
                {
                    DslPageModel dsl = Application.Current.FindResource("DslPageModel") as DslPageModel;
                    dsl.StopTimer();
                }
            }

            if (page.Equals("login"))
            {
                FrameSource = new LoginPage();
            }
            else if (page.Equals("status"))
            {
                FrameSource = new StatusPage();
            }
            else if (page.Equals("overview"))
            {
                FrameSource = new OverviewPage();
            }
            else if (page.Equals("dsl"))
            {
                FrameSource = new DslPage();
            }
            else if (page.Equals("lte"))
            {
                FrameSource = new LteInfoPage();
            }
            else if (page.Equals("syslog"))
            {
                FrameSource = new SyslogPage();
            }
            else if (page.Equals("tr181"))
            {
                FrameSource = new TR181Page();
            }
            else if (page.Equals("phone"))
            {
                FrameSource = new PhonePage();
            }
            else if (page.Equals("lan"))
            {
                FrameSource = new LanPage();
            }
            else if (page.Equals("interface"))
            {
                FrameSource = new InterfacePage();
            }
            else if (page.Equals("controls"))
            {
                FrameSource = new ControlsPage();
            }
            else if (page.Equals("about"))
            {
                FrameSource = new AboutPage();
            }

            changeColor(page);
        }