Exemplo n.º 1
0
        public void ThenClientShouldBeRedirectedToLoginPage()
        {
            LoginPage loginPage = new LoginPage();

            AssertClass.AssertElementIsPresent(loginPage.loginButton);
            DriverClass.CloseTest();
        }
Exemplo n.º 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();
        }
Exemplo n.º 3
0
        public ScreenManager(IScreen startScreen, DriverClass game)
        {
            _game = game;

            _currentScreen = startScreen;
            PushScreen(_currentScreen);

            _currentScreen.Initialize(this);
        }
Exemplo n.º 4
0
        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");
        }
Exemplo n.º 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);
            });
        }
Exemplo n.º 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();
        }
Exemplo n.º 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();
        }
Exemplo n.º 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();
        }
Exemplo n.º 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;
     }
 }
Exemplo n.º 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;
     }
 }
Exemplo n.º 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;
     }
 }
Exemplo n.º 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;
     }
 }
Exemplo n.º 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;
     }
 }
Exemplo n.º 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;
     }
 }
Exemplo n.º 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;
     }
 }
Exemplo n.º 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;
     }
 }
Exemplo n.º 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;
     }
 }
Exemplo n.º 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);
        }
Exemplo n.º 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;
     }
 }
Exemplo n.º 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();
        }
Exemplo n.º 21
0
 public void GivenINavigatedToTheWebsite(string URL)
 {
     DriverClass.initiateDriver(URL);
 }
 public void StartDriverWorkflow()
 {
     driverClass = new DriverClass();
     driver      = driverClass.CreateDriver();
 }
Exemplo n.º 23
0
 public void CloseBrowser()
 {
     DriverClass.CloseBrowser();
 }
Exemplo n.º 24
0
 public SecondPage ClickSearchTicket()
 {
     search_btn.Click();
     return(new SecondPage(DriverClass.GetInstance()));
 }
Exemplo n.º 25
0
 public void ThenTestCompletedSuccesfully()
 {
     DriverClass.CloseTest();
 }
Exemplo n.º 26
0
 public void OneTimeSetUp()
 {
     DriverClass.SetDriver(WebDriverProvider.GetDriver(_browser));
     DriverClass.SetWait(5);
     DriverClass.MaximizeWindow();
 }
Exemplo n.º 27
0
 public void OneTimeTearDown()
 {
     DriverClass.Dispose();
 }
Exemplo n.º 28
0
 public void InitBrowser()
 {
     driver = DriverClass.GetInstance();
 }