Exemple #1
0
        public void ThenClientShouldBeRedirectedToLoginPage()
        {
            LoginPage loginPage = new LoginPage();

            AssertClass.AssertElementIsPresent(loginPage.loginButton);
            DriverClass.CloseTest();
        }
Exemple #2
0
        /// <summary>
        /// Сохранение водителя (редактирование).
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button6RedactionDriver_Click(object sender, EventArgs e)
        {
            DriverClass RedactionDriver = new DriverClass();

            RedactionDriver                  = (DriverClass)listBox2Driver.SelectedItem;
            RedactionDriver.FIOdriver        = textBox2FioDriver.Text;
            RedactionDriver.ExpirienceDriver = textBox3ExpirienceDriver.Text;
            RedactionDriver.DriverHabitSmoke = checkBox6Smoke.Checked;
            RedactionDriver.DriverHabitDrink = checkBox7Drink.Checked;
            RedactionDriver.DriverHabitDrugs = checkBox5Drugs.Checked;

            if (destFile != "")
            {
                ListDeletePhoto.Add(RedactionDriver.PhotoDriver);
                RedactionDriver.PhotoDriver = destFile;
            }

            if (FlagCopy)
            {
                File.Copy(sourcePath, destFile, true);
                destFile = "";
            }
            RedactionDriver.EditDriver();

            UpdateDriversListbox();
            UpdateOrdersListbox();
            FlagCopy = false;
            ClearDriverPanel();
        }
        public ScreenManager(IScreen startScreen, DriverClass game)
        {
            _game = game;

            _currentScreen = startScreen;
            PushScreen(_currentScreen);

            _currentScreen.Initialize(this);
        }
        public void PositiveLoginWithHttpRequest()
        {
            User   user       = new User("FCUKPool2Admin2", "Password_01");
            string url        = new HttpLogin().LogInWithUser("Uk", "qed", DriverClass.GetDriver(), user);
            bool   isLoggined = false;

            DriverClass.GetDriver().Navigate().GoToUrl(url);
            System.Threading.Thread.Sleep(10000);

            Assert.True(isLoggined, "User haven't been loggined");
        }
Exemple #5
0
        ////////////////////////////////// Водители
        /// <summary>
        /// Обновляет содержимое лист-бокса для списка водителей.
        /// </summary>
        private void UpdateDriversListbox()
        {
            listBox2Driver.Items.Clear();

            List <DriverClass> AllDrivers = new List <DriverClass>();

            AllDrivers = DriverClass.ReadAllDrivers();
            AllDrivers.ForEach(delegate(DriverClass Driver)
            {
                listBox2Driver.Items.Add(Driver);
            });
        }
Exemple #6
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main(string[] args)
        {
            /* Running as a Windows Service */
            //if (Environment.UserInteractive)
            //{
            //    string parameter = string.Concat(args);
            //    switch (parameter)
            //    {
            //        case "--install":
            //            ManagedInstallerClass.InstallHelper(new[] { Assembly.GetExecutingAssembly().Location });
            //            break;
            //        case "--uninstall":
            //            ManagedInstallerClass.InstallHelper(new[] { "/u", Assembly.GetExecutingAssembly().Location });
            //            break;
            //    }
            //}
            //else
            //{
            //    ServiceBase[] ServicesToRun;
            //    ServicesToRun = new ServiceBase[]
            //    {
            //        new ReconService()
            //    };
            //    ServiceBase.Run(ServicesToRun);
            //}

            /* Debugging as a Console Application */
            Console.WriteLine("Started");
            int test = ServiceLibrary.returnSomething();

            Console.WriteLine(test);

            ///* Call Methods from Driver Class */
            DriverClass dc = new DriverClass();

            dc.callMethods();

            //GetRouteDetails GRD = new GetRouteDetails();
            //Dictionary<string, string> result = new Dictionary<string, string>();
            //DateTime dutyDate = DateTime.ParseExact("29-May-19", "dd-MMM-yy", null);
            //result = GRD.getRouteData("418A23A10066210519143801", dutyDate, "1");

            //Oracle Connection Test
            //OracleConnection_Class conn = new OracleConnection_Class();
            //DataSet rs = new DataSet();
            //rs = conn.SelectRecordsOleDb("Select * from ETM_DATA_REPORT WHERE BMS_TOTAL_REVENUE = '4303'");

            //SQL Connection Test
            //SQLConnection_Class sql = new SQLConnection_Class();
            //DataSet res = sql.procETM_Recon();

            Console.ReadLine();
        }
Exemple #7
0
        private static void SchedularCallback(object e)
        {
            // This Method will run on Scheduled time.
            int value = returnSomething();
            //IWorker worker = new Worker();
            //worker.work();
            DriverClass DC = new DriverClass();

            DC.callMethods();
            log.Info("Executed Value : " + value);
            ScheduleService();
        }
Exemple #8
0
        /// <summary>
        /// Удаление водителя.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1DelDriver_Click(object sender, EventArgs e)
        {
            DriverClass DriverToDelete = new DriverClass();

            DriverToDelete = (DriverClass)listBox2Driver.SelectedItem;
            DriverToDelete.DeleteDriver();
            ListDeletePhoto.Add(DriverToDelete.PhotoDriver);

            UpdateDriversListbox();
            ClearDriverPanel();

            listBox1DriverForOrder.Items.Clear();
        }
Exemple #9
0
 public void GivenUserINavigatedToApplicationUsing(string BaseURL)
 {
     try
     {
         DriverClass.StartTest(TestConfig.clientUrl);
     }
     catch (Exception E)
     {
         Console.WriteLine("Test Failed: could not load the application : {0}", E.Message);
         DriverClass.CloseTest();
         throw;
     }
 }
Exemple #10
0
 public void ThenUserShouldBeRedirectedToHomePage()
 {
     try
     {
         HomePage homePage = new HomePage(CustomBaseClass.MyDriver);
         AssertClass.AssertElementIsPresent(homePage.linkHome);
     }
     catch (Exception E)
     {
         Console.WriteLine("Test Failed: could not verify Home: {0}", E.Message);
         DriverClass.CloseTest();
         throw;
     }
 }
Exemple #11
0
 public void ThenUserShouldBeAbleToValidateForgotPasswordLink()
 {
     try
     {
         LoginPage loginPage = new LoginPage(CustomBaseClass.MyDriver);
         AssertClass.AssertElementIsPresent(loginPage.linkForgotPassword);
     }
     catch (Exception E)
     {
         Console.WriteLine("Test Failed: could not validate : {0}", E.Message);
         DriverClass.CloseTest();
         throw;
     }
 }
Exemple #12
0
 public void ThenUserShouldBeRedirectedToLoginPage()
 {
     try
     {
         LoginPage loginPage = new LoginPage(CustomBaseClass.MyDriver);
         AssertClass.AssertElementIsPresent(loginPage.buttonLogin);
         DriverClass.CloseTest();
     }
     catch (Exception E)
     {
         Console.WriteLine("Test Failed: could not logout : {0}", E.Message);
         DriverClass.CloseTest();
         throw;
     }
 }
Exemple #13
0
 public void ThenUserShouldBeAbleToLoginSuccesfully(String firstName)
 {
     try
     {
         CustomBaseClass.Thinktime(5);
         LoginPage loginPage = new LoginPage(CustomBaseClass.MyDriver);
         AssertClass.AssertElementIsPresent(CustomBaseClass.MyDriver.FindElement(By.XPath("//div[contains(text(),'" + firstName + "')]")));
     }
     catch (Exception E)
     {
         Console.WriteLine("Test Failed: could not login to the application : {0}", E.Message);
         DriverClass.CloseTest();
         throw;
     }
 }
Exemple #14
0
 public void ThenUserShouldBeAbleToSee(string userFullName)
 {
     try
     {
         HomePage homePage = new HomePage(CustomBaseClass.MyDriver);
         AssertClass.ContainsText(homePage.textUserFullName, userFullName);
         DriverClass.CloseTest();
     }
     catch (Exception E)
     {
         Console.WriteLine("Test Failed: could not verify username: {0}", E.Message);
         DriverClass.CloseTest();
         throw;
     }
 }
Exemple #15
0
 public void ThenThenUserShouldGet(String errorMessage)
 {
     try
     {
         LoginPage loginPage = new LoginPage(CustomBaseClass.MyDriver);
         // AssertClass.ContainsText(loginPage.errorMessage, errorMessage);
         AssertClass.AssertElementIsPresent(loginPage.errorMessage);
         DriverClass.CloseTest();
     }
     catch (Exception E)
     {
         Console.WriteLine("Test Failed: could not verify error message: {0}", E.Message);
         DriverClass.CloseTest();
         throw;
     }
 }
Exemple #16
0
 public void GivenUserNavigatesToApplicationLoginPage(String site)
 {
     try
     {
         DriverClass.StartTest(TestConfig.externalUrl);
         LoginPage loginPage = new LoginPage(CustomBaseClass.MyDriver);
         //Comment for Applications where default page is Login
         //loginPage.linkLogin.Click();
     }
     catch (Exception E)
     {
         Console.WriteLine("Test Failed: could not load the application : {0}", E.Message);
         DriverClass.CloseTest();
         throw;
     }
 }
Exemple #17
0
 public void ThenUserShouldGetMessage(string error)
 {
     try
     {
         CustomBaseClass.Thinktime(10);
         LoginPage loginPage = new LoginPage();
         AssertClass.ContainsText(loginPage.invalidUserError, error);
         DriverClass.CloseTest();
     }
     catch (Exception E)
     {
         Console.WriteLine("Test Fail: Error message is incorrect: {0}", E.Message);
         DriverClass.CloseTest();
         throw;
     }
 }
Exemple #18
0
        /// <summary>
        /// Метод срабатывает при клике на водителе из списка.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void listBox2Driver_SelectedIndexChanged(object sender, EventArgs e)
        {
            // проверка на пустой индекс
            if (listBox2Driver.SelectedItem == null)
            {
                return;
            }

            DriverClass CheckedDriver = new DriverClass();

            CheckedDriver                 = (DriverClass)listBox2Driver.SelectedItem;
            textBox2FioDriver.Text        = CheckedDriver.FIOdriver.ToString();
            textBox3ExpirienceDriver.Text = CheckedDriver.ExpirienceDriver.ToString();
            checkBox7Drink.Checked        = false;
            checkBox6Smoke.Checked        = false;
            checkBox5Drugs.Checked        = false;
            if (CheckedDriver.DriverHabitDrink)
            {
                checkBox7Drink.Checked = true;
            }
            if (CheckedDriver.DriverHabitSmoke)
            {
                checkBox6Smoke.Checked = true;
            }
            if (CheckedDriver.DriverHabitDrugs)
            {
                checkBox5Drugs.Checked = true;
            }

            if (CheckedDriver.PhotoDriver == "")
            {
                /*          pictureBox2.Image = null;
                 *        pictureBox2.BackColor = Color.Gray;
                 */
                pictureBox2.Image = DriverDefaultPhoto;
            }
            else
            {
                pictureBox2.Load(CheckedDriver.PhotoDriver);
            }

            /// Выбераем водителя для оформления заказа
            listBox1DriverForOrder.Items.Clear();
            listBox1DriverForOrder.Items.Add(CheckedDriver);
        }
Exemple #19
0
 public void ThenClientShouldBeAbleToLoginSuccessfully()
 {
     try
     {
         LoginPage loginPage = new LoginPage();
         AssertClass.AssertElementIsPresent(loginPage.signOutButton);
         CustomBaseClass.Thinktime(5);
         //LoginPage loginPage = new LoginPage();
         // loginPage.NavigateToAgileBooks();
         //loginPage.linkBooks.Click();
     }
     catch (Exception E)
     {
         Console.WriteLine("Test Fail: did not landed to Welcome Page  : {0}", E.Message);
         ScreenShotsClass.FailedTestCaptureScreenShot("Login");
         DriverClass.CloseTest();
         throw;
     }
 }
Exemple #20
0
        /// <summary>
        /// Добавление водителя.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button4AddDriver_Click(object sender, EventArgs e)
        {
            DriverClass AddDriver = new DriverClass();

            AddDriver.PhotoDriver      = destFile;
            AddDriver.FIOdriver        = textBox2FioDriver.Text;
            AddDriver.ExpirienceDriver = textBox3ExpirienceDriver.Text;
            AddDriver.DriverHabitSmoke = checkBox6Smoke.Checked;
            AddDriver.DriverHabitDrink = checkBox7Drink.Checked;
            AddDriver.DriverHabitDrugs = checkBox5Drugs.Checked;

            if (FlagCopy)
            {
                File.Copy(sourcePath, destFile, true);
                destFile = "";
            }
            AddDriver.InsertDriver();

            UpdateDriversListbox();
            FlagCopy = false;

            ClearDriverPanel();
        }
Exemple #21
0
 public void GivenINavigatedToTheWebsite(string URL)
 {
     DriverClass.initiateDriver(URL);
 }
 public void StartDriverWorkflow()
 {
     driverClass = new DriverClass();
     driver      = driverClass.CreateDriver();
 }
Exemple #23
0
 public void CloseBrowser()
 {
     DriverClass.CloseBrowser();
 }
Exemple #24
0
 public SecondPage ClickSearchTicket()
 {
     search_btn.Click();
     return(new SecondPage(DriverClass.GetInstance()));
 }
Exemple #25
0
 public void ThenTestCompletedSuccesfully()
 {
     DriverClass.CloseTest();
 }
Exemple #26
0
 public void OneTimeSetUp()
 {
     DriverClass.SetDriver(WebDriverProvider.GetDriver(_browser));
     DriverClass.SetWait(5);
     DriverClass.MaximizeWindow();
 }
Exemple #27
0
 public void OneTimeTearDown()
 {
     DriverClass.Dispose();
 }
Exemple #28
0
 public void InitBrowser()
 {
     driver = DriverClass.GetInstance();
 }