Пример #1
0
        public void GivenIHaveLaunchedApplictionWithCredentials(string login, string password, string client)
        {
            //Start application
            EC4 = Application.Launch(@"D:\EchoContactClient.Host.exe.lnk");
            Window LoginWindow = EC4.GetWindow(SearchCriteria.ByClassName("Window"), InitializeOption.NoCache);

            //Set login
            LoginTextBox = LoginWindow.Get <TextBox>(SearchCriteria.ByAutomationId("LoginField"));
            LoginTextBox.SetTextToTextbox(login);
            //Set password
            PasswordField = LoginWindow.Get <TextBox>(SearchCriteria.ByAutomationId("PasswordField"));
            PasswordField.SetTextToTextbox(password);
            //Set client
            ClientField = LoginWindow.Get <TextBox>(SearchCriteria.ByAutomationId("ClientField"));
            ClientField.SetTextToTextbox(client);
            //Check if remember me check box isn't selected
            RememberMeCheckBox = LoginWindow.Get <CheckBox>(SearchCriteria.ByClassName("CheckBox"));
            if (!RememberMeCheckBox.Checked)
            {
                RememberMeCheckBox.Click();
            }
            //Click Login button to open Desk selection window
            LoginButton = LoginWindow.Get <Button>(SearchCriteria.ByAutomationId("LoginButton"));
            LoginButton.Click();
            //Wait till desk selection window appears
            Thread.Sleep(40000);
            DeskSelection = LoginWindow.Get <ComboBox>(SearchCriteria.ByAutomationId("deskSelectionCombobox"));
            //Select make me immediatly available option
            MakeMeImmediatlyAvailable = LoginWindow.Get <CheckBox>(SearchCriteria.ByAutomationId("makeMeImmediatelyAvailableCheckBox"));
            if (!MakeMeImmediatlyAvailable.Checked)
            {
                MakeMeImmediatlyAvailable.Click();
            }
            //Click OK to open agent dashboard window
            OkButton = LoginWindow.Get <Button>(SearchCriteria.ByAutomationId("OkButton"));
            OkButton.Click();
            Thread.Sleep(2000);
        }