예제 #1
0
        public void P_Functional4()
        {
            _mySelenium = new SeleniumWorker.SelWorker(TestContext.DataRow["TestCaseName"].ToString());
            _mySelenium.ChangeLogFileName("RollingLogFileAppender", TestContext.DataRow["TestCaseName"].ToString());
            if (TestContext.DataRow["CreateBorObject"].ToString() == "true")
            {
                var result = SelWorker.SendRequestToRest(DateTime.Now,
                                                         TestContext.DataRow["Category"].ToString(),
                                                         TestContext.DataRow["Location"].ToString(),
                                                         TestContext.DataRow["Channel"].ToString(),
                                                         TestContext.DataRow["Rescan"].ToString(),
                                                         TestContext.DataRow["Sender"].ToString()).Result;
                Assert.IsTrue(result != null);
            }
            _mySelenium.Init(new Uri(TestContext.DataRow["NodeURL"].ToString()), new Uri(TestContext.DataRow["URLTestObject"].ToString()), TestContext.DataRow["Browser"].ToString());
            Assert.IsTrue(_mySelenium.GetBrowserTitle("Voxtron Web Client"));
            _mySelenium.Login(TestContext.DataRow["UserId"].ToString(), TestContext.DataRow["Password"].ToString(), TestContext.DataRow["VoxWebCltStatus"].ToString());
            _mySelenium.AcceptTask(0, int.Parse(TestContext.DataRow["ContactCodeItemIdx"].ToString()));
            _mySelenium.Logout();
            _mySelenium.Terminate();
            var InstanceCaller = new Thread(new ThreadStart(() => _mySelenium.CreateVideo()));

            InstanceCaller.Start();
        }
예제 #2
0
        public void P_AdressaenderungDetailed()
        {
            var test = Extent.CreateTest(TestContext.DataRow["TestCaseName"].ToString(), "This test is about testing usecase Adressänderung within DynamicBrain regression testing");



            test.Log(Status.Info, "Step1: Test case has started");

            _mySelenium = new SeleniumWorker.SelWorker(TestContext.DataRow["TestCaseName"].ToString());
            if (null != _mySelenium)
            {
                test.Log(Status.Pass, "Step2: Selenium instance could by serialized");
            }
            _mySelenium.ChangeLogFileName("RollingLogFileAppender", TestContext.DataRow["TestCaseName"].ToString());
            // Check weather to send task to Rest
            if (TestContext.DataRow["CreateBorObject"].ToString() == "true")
            {
                var result = SelWorker.SendRequestToRest(DateTime.Now,
                                                         TestContext.DataRow["Category"].ToString(),
                                                         TestContext.DataRow["Location"].ToString(),
                                                         TestContext.DataRow["Channel"].ToString(),
                                                         TestContext.DataRow["Rescan"].ToString(),
                                                         TestContext.DataRow["Sender"].ToString()).Result;

                test.Log(Status.Pass, "Step3: Task (Bor-Object) has been created: " + TestContext.DataRow["Category"].ToString() + " ContactID: " + result.ToString());
                Assert.IsTrue(result != null);
            }
            _mySelenium.Init(new Uri(TestContext.DataRow["NodeURL"].ToString()), new Uri(TestContext.DataRow["URLTestObject"].ToString()), TestContext.DataRow["Browser"].ToString());
            test.Log(Status.Pass, "Step4: Selenium-Initialization has been performed");
            var browserTitle = _mySelenium.GetBrowserTitle("Voxtron Web Client");

            Assert.IsTrue(browserTitle);

            var ScreenShotImagePath1 = SelWorker.GetScreenShot(ref _mySelenium._driver);

            test.Log(Status.Info, "Snapshot below: " + test.AddScreenCaptureFromPath(ScreenShotImagePath1, "CheckBrowserName"));

            test.Log(Status.Pass, "Step5: Browser Title: Voxtron Web Client: " + browserTitle);
            _mySelenium.Login(TestContext.DataRow["UserId"].ToString(), TestContext.DataRow["Password"].ToString(), TestContext.DataRow["VoxWebCltStatus"].ToString());
            test.Log(Status.Pass, "Step6: Login has been performed!");
            test.Log(Status.Info, "User:          "******"UserId"].ToString());
            test.Log(Status.Info, "Password:      "******"Password"].ToString());
            test.Log(Status.Info, "Client status: " + TestContext.DataRow["VoxWebCltStatus"].ToString());

            test.Log(Status.Info, "Snapshot below: " + test.AddScreenCaptureFromPath(SelWorker.GetScreenShot(ref _mySelenium._driver), "CheckStatusAfterLogin"));

            _mySelenium.AcceptTask(1, int.Parse(TestContext.DataRow["ContactCodeItemIdx"].ToString()));
            test.Log(Status.Pass, "Step 7: Task has been accpeted");
            _mySelenium.Logout();
            test.Log(Status.Info, "Snapshot below: " + test.AddScreenCaptureFromPath(SelWorker.GetScreenShot(ref _mySelenium._driver), "CheckStatusAfterLogout"));
            test.Log(Status.Pass, "Step 8: Logout has been performed");
            _mySelenium.Terminate();
            test.Log(Status.Pass, "Step 9: Selenium Terminated successful");



            //Create video in another thread
            var InstanceCaller = new Thread(new ThreadStart(() => _mySelenium.CreateVideo()));

            InstanceCaller.Start();

            test.Log(Status.Pass, "Steph 10: Video has been created");

            test.Log(Status.Pass, "Test case has successfully passed");
        }