Exemplo n.º 1
0
        public frmMain()
        {
            InitializeComponent();
            string SolutionDirectory = TestEngineClass.GetDirectoryAppIsRunningIn() + "..\\..\\..\\TestDataFiles\\";

            openFileDialog1.InitialDirectory = SolutionDirectory;
        }
Exemplo n.º 2
0
 private void btnOpenLogFile_Click(object sender, EventArgs e)
 {
     System.Diagnostics.Process.Start(TestEngineClass.GetDirectoryAppIsRunningIn() + "\\Application.log");
 }
Exemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            /**LAFUserName = txtUserName.Text;
             * LAFPassword = txtPassword.Text;
             * Engine.TestEngine.TestEngineClass.testEngine(testData, users, applicationData, environment, environmentSettings, LAFUserName, LAFPassword);
             **/
            environment = comboEnvironment.Text;
            UserName    = txtUserName.Text;
            Password    = txtPassword.Text;
            browser     = cmbBrowser.Text;
            if (environment == "")
            {
                MessageBox.Show("You must select an environment before proceeding", "No environment selected",
                                MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            if (UserName == "")
            {
                MessageBox.Show("You must enter a Username before proceeding", "No username entered",
                                MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            if (Password == "")
            {
                MessageBox.Show("You must enter a Password before proceeding", "No password entered",
                                MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            if (browser == "")
            {
                MessageBox.Show("You must select a browser before proceeding", "No browser selected",
                                MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            DialogResult msgResult = new DialogResult();

            try
            {
                //Get Objects from Spreadsheet
                //TestSettingsObject testRunSettings = ExcelDrivenFunctional.GetTestRunSettings();



                testData = ExcelDataTools.GetTestData(excelConnection, tabName);



                applicationData     = ExcelDataTools.GetApplicationData(environment, excelConnection);
                environmentSettings = ExcelDataTools.GetEnvironmentSettings(environment, excelConnection);

                msgResult = MessageBox.Show("All Test Data loaded successfully. There are " + testData.Count + " tests specified to run in this suite. Click OK to begin", "Test data loaded successfully",
                                            MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk);

                if (msgResult.ToString() == "OK")
                {
                    msgResult = MessageBox.Show(String.Format("Before proceding, ensure that the input Excel file '{0}' is closed to ensure test results are correctly updated. When closed, click OK to proceed.", this.filename), "Ensure Excel file is closed",
                                                MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Problem reading input file - check format and content and try again.", "Could not load input file",
                                MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }

            if (msgResult.ToString() == "OK")
            {
                try
                {
                    TestResults testResults = TestEngineClass.testEngine(testData, applicationData, environment, environmentSettings, UserName, Password, browser, excelConnection, tabName);

                    frmResults frmResults1 = new frmResults(testResults, browser, filename);
                    frmResults1.Show();
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Unhandled Exception while running the test:\n\n\n\n " + ex.ToString(), "Error",
                                    MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }


                /**
                 * ThreadStart childref = new ThreadStart(StartExecutionThread);
                 * childThread = new Thread(childref);
                 * childThread.Start();
                 * //childThread.Join();
                 * TestResults testResults = new TestResults(5, 3, 2, "a long time");
                 * frmResults frmResults1 = new frmResults(testResults, "Chrome");
                 * frmResults1.Show();
                 *
                 **/
            }



            //this.Close();
        }