QaMain.cs :  » Web-Testing » IeUnit-web-testing-framework » QuickFocus » QA » C# / CSharp Open Source

Home
C# / CSharp Open Source
1.2.6.4 mono .net core
2.2.6.4 mono core
3.Aspect Oriented Frameworks
4.Bloggers
5.Build Systems
6.Business Application
7.Charting Reporting Tools
8.Chat Servers
9.Code Coverage Tools
10.Content Management Systems CMS
11.CRM ERP
12.Database
13.Development
14.Email
15.Forum
16.Game
17.GIS
18.GUI
19.IDEs
20.Installers Generators
21.Inversion of Control Dependency Injection
22.Issue Tracking
23.Logging Tools
24.Message
25.Mobile
26.Network Clients
27.Network Servers
28.Office
29.PDF
30.Persistence Frameworks
31.Portals
32.Profilers
33.Project Management
34.RSS RDF
35.Rule Engines
36.Script
37.Search Engines
38.Sound Audio
39.Source Control
40.SQL Clients
41.Template Engines
42.Testing
43.UML
44.Web Frameworks
45.Web Service
46.Web Testing
47.Wiki Engines
48.Windows Presentation Foundation
49.Workflows
50.XML Parsers
C# / C Sharp
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source » Web Testing » IeUnit web testing framework 
IeUnit web testing framework » QuickFocus » QA » QaMain.cs
#if QA_TEST
using System;
using System.Windows.Forms;
using System.Reflection;
using System.Diagnostics;
using VisuMap.AppTest;
using System.IO;

namespace QuickFocus.QA{
  /// <summary>
  /// Summary description for TestMain.
  /// </summary>
  public class QaMain : UnitTest
  {
        internal TestSuite   suite;

        private QaMain(){}

        public static void StartByArguments(string[] appArgs) {
            if ((appArgs.Length > 0) && (appArgs[0] == "-t")) {
                Start();
            } 
        }

        public static void Start() {
            QaMain qaMain = new QaMain();
            qaMain.suite = new TestSuite();
            qaMain.suite.AddCases( Assembly.GetExecutingAssembly() );
            qaMain.StartTest(true);            
        }

        public static void InitConfig() {
            AppConfig cfg = Root.appConfig;
            cfg.focusLevel = 0;
            cfg.showAlternatives = true;
            cfg.commentOutAlt = true;
            cfg.outActionSnip = true;
            cfg.outAssertSnip = true;
            cfg.pageAttached = false;
            cfg.autoClear = false;
            cfg.simulationMode = false;
            cfg.maxKeyTextLength = 10;

            SetWinGeometry(50, 50, 850, 850, 200);
        }

        private static void SetWinGeometry(int left, int top, int width, int height, int lowPanelHeight) {
            Panel lowPanel = (new FormChecker(Root.mainForm)).FindControl("panelLow") as Panel;
            Root.mainForm.Invoke( new MethodInvoker( delegate(){
                Root.mainForm.SetBounds(left, top, width, height, BoundsSpecified.All);
                lowPanel.Height = lowPanelHeight;
            }) );
        }

        public override void TestMain() {
            InitConfig();
            TestRunnerPanel runnerPanel = new TestRunnerPanel("QuickFocus.QA");
            runnerPanel.CfgFile = "QuickFocusQa.xml";
            runnerPanel.BeforeStart += new TestRunnerPanel.CallbackHandler(runnerPanel_BeforeStart);
            runnerPanel.Run(suite);

            //We need BeginInvoke() because TestMain() is running under separate thread.
            if (! Root.mainForm.IsDisposed) {
                Root.mainForm.BeginInvoke(new MethodInvoker(Root.mainForm.Close));
            }
        }

        void runnerPanel_BeforeStart() {
            // Some tests requires the browser react to mouse movement that requires
            // the browser to be the active window.
            Root.mainForm.Invoke(new MethodInvoker(Root.mainForm.Activate));
        }
  }
}
#endif
www.java2v.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.