Exemplo n.º 1
0
        /// <summary>
        /// 	Initializes a new instance of the <see cref="TwiddlerApplication"/> class. 
        /// 	Launches an instance of Twiddler for testing.
        /// </summary>
        /// <param name="newStore">
        /// 	The new Store.
        /// </param>
        /// <returns>
        /// 	The launched instance.
        /// </returns>
        public TwiddlerApplication(bool newStore)
        {
            var args = new StringBuilder();

            args.Append(" /inMemory");
            args.AppendFormat(" /service={0}", DefaultService);

            string path = Path.GetFullPath(ApplicationPath);

            var startInfo = new ProcessStartInfo(path, args.ToString())
                                {
                                    UseShellExecute = false
                                };
            _application = Application.Launch(startInfo);

            try
            {
                Shell = new Shell(GetShellWindow());
            }
            catch (Exception)
            {
                if (!_application.HasExited)
                    _application.Kill();
                throw;
            }
        }
Exemplo n.º 2
0
		public Application CreateApplication(string name) {
			if(this._applications.Any(a => a.Name == name)) throw new Exception("Application '" + name + "' is already registered");
			Application application = new Application(name, this, this._repository, this._hostingModel);
			application.Init(new ServerContext(application, this));
			this._applications.Add(application);
			Logger.Info(this, "Registered application " + name);
			return (application);
		}
Exemplo n.º 3
0
 public void nextOrCreateCommand()
 {
     AlertViewViewModel.Button button = new AlertViewViewModel.Button {
         name = "Okay"
     };
     if (string.IsNullOrWhiteSpace(_project_model_i.ProjectName) || string.IsNullOrWhiteSpace(_project_model_i.ProjectLocation) || _project_model_i.ProjectModel == null || _project_model_i.ProjectDate == DateTime.MinValue)
     {
         AlertView alertView = new AlertView("Not enough informations", "The informations you have provided to create a new project is not sufficient. Please fill essential fields.", AlertViewType.WARNING, button);
         alertView.ShowDialog();
     }
     else
     {
         DateTime current_date_time = DateTime.Now;
         _project_model_i.ProjectCreationDate = current_date_time;
         if (_project_model_i.ProjectModel.client_id.value == _project_model_i.ClientModels[0].id.value)
         {
             try {
                 this.nextButtonClicked();
             }
             catch (AlreadyExistsError) {
                 AlertView alertView = new AlertView("Project already exist", "The project you are trying to create is already exist, try a different project name.", AlertViewType.ERROR, button);
                 alertView.ShowDialog();
             }
             catch (DirectoryNotFoundException) {
                 AlertView alertView = new AlertView("Invalid path", "The path you are trying to create the project is invalid, insert a correct path or explore a path.", AlertViewType.ERROR, button);
                 alertView.ShowDialog();
             }
             catch (Exception err) {
                 Core.Reference.logger.logError(err);
                 AlertView alertView = new AlertView("Unknown error", "Unknown error has occured while creating a project. Please try again.", AlertViewType.ERROR, button);
                 alertView.ShowDialog();
             }
         }
         else
         {
             try {
                 ProjectModelI.ProjectModelApi.model.client_id.value = ProjectModelI.SelectedClient.id.value;
                 CoreApp.getSingleton().createNewProject(ProjectModelI.ProjectModelApi, FolderBrowseCommand.FolderPath);
                 CoreApp.getSingleton().setDefaultProjectPath(FolderBrowseCommand.FolderPath);
                 NewProject.ProjectManager.closeWindow();
             }
             catch (AlreadyExistsError) {
                 AlertView alertView = new AlertView("Project already exist", "The project you are trying to create is already exist, try a different project name.", AlertViewType.ERROR, button);
                 alertView.ShowDialog();
             }
             catch (DirectoryNotFoundException) {
                 AlertView alertView = new AlertView("Invalid path", "The path you are trying to create the project is invalid, insert a correct path or explore a path.", AlertViewType.ERROR, button);
                 alertView.ShowDialog();
             }
             catch (Exception err) {
                 Core.Reference.logger.logError(err);
                 AlertView alertView = new AlertView("Unknown error", "Unknown error has occured while creating a project. Please try again.", AlertViewType.ERROR, button);
                 alertView.ShowDialog();
             }
         }
     }
 }
Exemplo n.º 4
0
        public void TestInitialize()
        {
            SetupWhiteConfigParameters();

            // Instantiate and initiate the diagnosis process. Diagnosis steps are included
            // to identify the successful launch of the application window without any unexpected
            // exceptions.
            StateDiagnosis.Instance.StartDiagnosis(this);

            app = Application.Launch(ConfigHandler.GetValue("EventAggregationApp"));
            window = app.GetWindow("Shell", Core.Factory.InitializeOption.NoCache);

            //Stop the diagnosis.
            StateDiagnosis.Instance.StopDiagnosis(this);
        }
Exemplo n.º 5
0
        public void TestInitialize()
        {
            SetupWhiteConfigParameters();

            // Instantiate and initiate the diagnosis process. Diagnosis steps are included
            // to identify the successful launch of the application window without any unexpected
            // exceptions.
            StateDiagnosis.Instance.StartDiagnosis(this);

            app = Application.Launch(GetApplicationToLaunch());
            window = app.GetWindow(GetApplicationWindowName(), Core.Factory.InitializeOption.NoCache);
            testDataInfrastructure = new TestDataInfrastructure();

            //Stop the diagnosis.
            StateDiagnosis.Instance.StopDiagnosis(this);
        }
Exemplo n.º 6
0
 public void before_each()
 {
     application = Application.Launch(typeof(ShellView).Assembly.Location);
 }
Exemplo n.º 7
0
 public DashboardScreen(Window window, Application application)
 {
     this.window = window;
     this.application = application;
 }
        public virtual void SetUpWhite()
        {
            Capture.SetCaptionFontSize(24);
            Capture.SetCaptionAlignment(HorizontalAlignment.Left, VerticalAlignment.Bottom);
            Capture.AutoEmbedRecording(TriggerEvent.TestFailedOrInconclusive, "Screen Recording",
                new CaptureParameters() { Zoom = 0.25 }, 5);

            application = LaunchApplication();
            screenRepository = new ScreenRepository(application);
        }
 private void InitializeExcelApplication()
 {
     excelApp = new Application();
     excelApp.Visible = false;
     excelApp.SheetsInNewWorkbook = 1;
     currentSheetIndex = 1;
     globalSheetIndex = 0;
     globalsSheetLastRow = 0;
 }
 public void SetUp()
 {
     application = Application.Launch(@"..\..\..\SampleApplication\bin\debug\SampleApplication.exe");
     window = application.GetWindow("Dashboard", InitializeOption.NoCache);
 }
Exemplo n.º 11
0
		public PackageWatcher(string folder, string filter, Application application) : base(application) {
			this._filter = filter;
			this._folder = folder;
			Logger.Info(this, "Watching folder " + Path.GetFullPath(folder) + " using filter " + filter + " for updates for application " + application.Name);
		}
 public CreateCustomerStep2Screen(Window window, Application application)
 {
     this.window = window;
     this.application = application;
 }
Exemplo n.º 13
0
		public bool TryGetApplication(string name, out Application application) {
			application = this._applications.FirstOrDefault(a => a.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase));
			return (application != null);
		}
Exemplo n.º 14
0
 private void Register_FormClosing(object sender, FormClosingEventArgs e)
 {
     Application.Exit();
 }
Exemplo n.º 15
0
		public ServerWatcher(Uri uri, Application application, TimeSpan interval) : base(application) {
			this._interval = interval;
			this._proxy = new Proxy(uri);
			Logger.Info(this, "Using URL " + uri.AbsoluteUri + " for application " + application.Name);
		}
Exemplo n.º 16
0
		protected Watcher(Application application) {
			this._application = application;
		}
Exemplo n.º 17
0
 public SearchCustomerScreen(Window window, Application application)
 {
     this.window = window;
     this.application = application;
 }
 public void SetUp()
 {
     application = Application.Launch(@"..\..\..\SampleApplication\bin\debug\SampleApplication.exe");
 }
Exemplo n.º 19
0
 public SearchMovieScreen(Window window, Application application)
 {
     this.window = window;
     this.application = application;
 }