Ejemplo n.º 1
0
        /// <summary>
        /// TestFail method created specificly for the courses AUTOMATION_001 and _002, _003it will take a test and fail with credentials below
        /// It will take test 3 times and fails and returning GCEP Library Page
        /// </summary>
        ///  TODO : remove Threads sleep after flickiring isssue will be fixed


        public dynamic TestFail()
        {
            Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(160), ElementCriteria.IsNotVisible);
            Browser.WaitForElement(Bys.CourseTestPage.ContinueBtn, TimeSpan.FromSeconds(420), ElementCriteria.IsVisible, ElementCriteria.IsEnabled);
            Thread.Sleep(5000);
            ContinueBtn.Click();

            Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(160), ElementCriteria.IsNotVisible);
            Browser.WaitForElement(Bys.CourseTestPage.ContinueBtn, TimeSpan.FromSeconds(420), ElementCriteria.IsVisible, ElementCriteria.IsEnabled);
            Thread.Sleep(5000);
            ContinueBtn.Click();
            Browser.WaitForElement(Bys.CourseTestPage.ContinueBtn, TimeSpan.FromSeconds(125), ElementCriteria.IsEnabled);

            int i = 0;

            do
            {
                Thread.Sleep(1000);
                TestLaunchBtn.Click();
                Thread.Sleep(0500);
                Browser.SwitchTo().Frame(PostTestFrame);
                ElemSet.RdoBtn_ClickMultipleByText(Browser, "B. False", "A. Harmful, abusive", "A. Low grade/poor class evaluation");
                Thread.Sleep(0500);
                TestSubmitBtn.Click();
                Thread.Sleep(0500);
                FrameCloseBtn.Click();
                i++;
            } while (i < 3);

            Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(160), ElementCriteria.IsNotVisible);
            Browser.WaitForElement(Bys.CourseTestPage.ContinueBtn, TimeSpan.FromSeconds(125), ElementCriteria.IsEnabled, ElementCriteria.IsVisible);
            Thread.Sleep(5000);
            ContinueBtn.Click();

            Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(160), ElementCriteria.IsNotVisible);
            Browser.WaitForElement(Bys.CourseTestPage.ContinueBtn, TimeSpan.FromSeconds(160), ElementCriteria.IsEnabled);
            Thread.Sleep(5000);
            ContinueBtn.Click();

            Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(160), ElementCriteria.IsNotVisible);
            Browser.WaitForElement(Bys.CourseTestPage.CertificateCloseBtn, TimeSpan.FromSeconds(135), ElementCriteria.IsVisible, ElementCriteria.IsEnabled);
            Thread.Sleep(5000);
            CertificateCloseBtn.Click();

            Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(160), ElementCriteria.IsNotVisible);
            return(new GCEPLibraryPage(Browser));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// TestPass method created specificly for the courses AUTOMATION_001 and _002, _003 it will take a test and faipass with credentials below
        /// GCEP Library Page
        /// </summary>
        /// TODO : remove Threads sleep after flickiring isssue will be fixed

        public dynamic TestPass()
        {
            WaitForInitialize();
            Browser.WaitForElement(Bys.CourseTestPage.ContinueBtn, TimeSpan.FromSeconds(125), ElementCriteria.IsVisible, ElementCriteria.IsEnabled);
            ContinueBtn.Click();

            Thread.Sleep(2000);
            WaitForInitialize();
            ContinueBtn.Click();

            //Thread.Sleep(2000);
            //WaitForInitialize();
            //ContinueBtn.Click();

            WaitForInitialize();
            TestLaunchBtn.Click();

            Thread.Sleep(0500);
            Browser.SwitchTo().Frame(PostTestFrame);
            ElemSet.RdoBtn_ClickMultipleByText(Browser, "A. True", "B. Harmful, injurious", "D. All of the above");
            TestSubmitBtn.Click();
            Thread.Sleep(0500);
            FrameCloseBtn.Click();
            Thread.Sleep(0500);

            Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(60), ElementCriteria.IsNotVisible);
            Browser.WaitForElement(Bys.CourseTestPage.ContinueBtn, TimeSpan.FromSeconds(125), ElementCriteria.IsEnabled);

            Thread.Sleep(1000);
            ContinueBtn.Click();
            WaitForInitialize();

            Thread.Sleep(1000);
            ContinueBtn.Click();
            Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(90), ElementCriteria.IsNotVisible);
            Browser.WaitForElement(Bys.CourseTestPage.CertificateCloseBtn, TimeSpan.FromSeconds(95), ElementCriteria.IsEnabled);

            Thread.Sleep(4000);
            CertificateCloseBtn.Click();
            Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(90), ElementCriteria.IsNotVisible);

            return(new GCEPPage(Browser));
        }
Ejemplo n.º 3
0
        public dynamic LearnerTestPass()
        {
            Thread.Sleep(15000);
            // Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(60), ElementCriteria.IsNotVisible);
            Browser.WaitForElement(Bys.CourseTestPage.ContinueBtn, TimeSpan.FromSeconds(25), ElementCriteria.IsEnabled);
            ContinueBtn.Click();
            Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(60), ElementCriteria.IsNotVisible);
            Browser.WaitForElement(Bys.CourseTestPage.ContinueBtn, TimeSpan.FromSeconds(25), ElementCriteria.IsEnabled);
            ContinueBtn.Click();
            Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(60), ElementCriteria.IsNotVisible);
            // Browser.WaitForElement(Bys.CourseTestPage.ContinueBtn, TimeSpan.FromSeconds(25), ElementCriteria.IsEnabled);
            Browser.WaitForElement(Bys.CourseTestPage.AssessmentTbl, TimeSpan.FromSeconds(60), ElementCriteria.IsEnabled);
            ContinueBtn.Click();
            TestLaunchBtn.Click();
            Thread.Sleep(0500);
            Browser.SwitchTo().Frame(PostTestFrame);
            ElemSet.RdoBtn_ClickMultipleByText(Browser, "A. True", "B. Harmful, injurious", "D. All of the above");
            TestSubmitBtn.Click();
            Thread.Sleep(0500);
            FrameCloseBtn.Click();
            Thread.Sleep(0500);

            Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(60), ElementCriteria.IsNotVisible);
            Browser.WaitForElement(Bys.CourseTestPage.ContinueBtn, TimeSpan.FromSeconds(25), ElementCriteria.IsEnabled);
            ContinueBtn.Click();

            // Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(60), ElementCriteria.IsNotVisible);
            ////Browser.WaitForElement(Bys.CourseTestPage.ContinueBtn, TimeSpan.FromSeconds(25), ElementCriteria.IsEnabled);
            //ContinueBtn.Click();

            Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(60), ElementCriteria.IsNotVisible);
            Browser.WaitForElement(Bys.CourseTestPage.CertificateCloseBtn, TimeSpan.FromSeconds(35), ElementCriteria.IsEnabled);
            CertificateCloseBtn.Click();
            Browser.Navigate().Refresh();
            Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(60), ElementCriteria.IsNotVisible);
            return(new EducationCenterPage(Browser));
        }
Ejemplo n.º 4
0
        public dynamic TakeTest(string role, string testStatus)
        {
            if (role == "Resident" && testStatus == "Pass")
            {
                Thread.Sleep(5000);
                // WaitForInitialize();
                // Browser.WaitForElement(Bys.CourseTestPage.AssessmentTbl, TimeSpan.FromSeconds(60), ElementCriteria.IsEnabled);
                ContinueBtn.Click();
                Thread.Sleep(5000);
                // WaitForInitialize();
                Thread.Sleep(0500);
                Browser.SwitchTo().Frame(PostTestFrame);
                ElemSet.RdoBtn_ClickMultipleByText(Browser, "A. True", "B. Harmful, injurious", "D. All of the above");
                TestSubmitBtn.Click();
                Thread.Sleep(0500);
                FrameCloseBtn.Click();
                Thread.Sleep(0500);
                Thread.Sleep(5000);
                // WaitForInitialize();
                // Browser.WaitForElement(Bys.CourseTestPage.AssessmentTbl, TimeSpan.FromSeconds(60), ElementCriteria.IsEnabled);
                ContinueBtn.Click();
                Thread.Sleep(5000);
                //Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(60), ElementCriteria.IsNotVisible);
                //Browser.WaitForElement(Bys.CourseTestPage.CertificateCloseBtn, TimeSpan.FromSeconds(35), ElementCriteria.IsEnabled);
                CertificateCloseBtn.Click();
                Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(60), ElementCriteria.IsNotVisible);

                return(new GCEPLibraryPage(Browser));
            }
            else if (role == "Resident" && testStatus == "Fail")
            {
                Thread.Sleep(5000);
                // WaitForInitialize();
                // Browser.WaitForElement(Bys.CourseTestPage.AssessmentTbl, TimeSpan.FromSeconds(60), ElementCriteria.IsEnabled);
                ContinueBtn.Click();
                Thread.Sleep(5000);
                // WaitForInitialize();
                int i = 0;
                do
                {
                    Thread.Sleep(0500);
                    TestLaunchBtn.Click();
                    Thread.Sleep(0500);
                    Browser.SwitchTo().Frame(PostTestFrame);
                    ElemSet.RdoBtn_ClickMultipleByText(Browser, "B. False", "A. Harmful, abusive", "A. Low grade/poor class evaluation");
                    Thread.Sleep(0500);
                    TestSubmitBtn.Click();
                    Thread.Sleep(0500);
                    FrameCloseBtn.Click();
                    i++;
                } while (i < 3);
                Thread.Sleep(0500);
                // WaitForInitialize();
                // Browser.WaitForElement(Bys.CourseTestPage.AssessmentTbl, TimeSpan.FromSeconds(60), ElementCriteria.IsEnabled);
                ContinueBtn.Click();
                Thread.Sleep(5000);
                // WaitForInitialize();
                // Browser.WaitForElement(Bys.CourseTestPage.AssessmentTbl, TimeSpan.FromSeconds(60), ElementCriteria.IsEnabled);
                ContinueBtn.Click();
                Thread.Sleep(5000);
                //Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(60), ElementCriteria.IsNotVisible);
                //Browser.WaitForElement(Bys.CourseTestPage.CertificateCloseBtn, TimeSpan.FromSeconds(35), ElementCriteria.IsEnabled);
                CertificateCloseBtn.Click();
                Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(60), ElementCriteria.IsNotVisible);
                return(new GCEPLibraryPage(Browser));
            }
            return(null);
        }