Example #1
0
        private void SetFramesContent()
        {
            mCurrentBusPage               = new BusinessFlowPage(App.BusinessFlow, true);
            CurrentBusFrame.Content       = mCurrentBusPage;
            CurrentBusExpander.IsExpanded = false;

            mVariablesPage = new VariablesPage(eVariablesLevel.BusinessFlow);
            mVariablesPage.grdVariables.ShowTitle = System.Windows.Visibility.Collapsed;
            BFVariablesFrame.Content = mVariablesPage;
            mActivitiesGroupsPage    = new ActivitiesGroupsPage();
            mActivitiesGroupsPage.grdActivitiesGroups.ShowTitle = System.Windows.Visibility.Collapsed;
            BFActivitiesGroupsFrame.Content = mActivitiesGroupsPage;

            mActivitiesPage = new ActivitiesPage();
            mActivitiesPage.grdActivities.ShowTitle = System.Windows.Visibility.Collapsed;
            BFActivitiesFrame.Content = mActivitiesPage;

            mActivityVariablesPage = new VariablesPage(eVariablesLevel.Activity);
            mActivityVariablesPage.grdVariables.ShowTitle = System.Windows.Visibility.Collapsed;
            ActivityVariablesFrame.Content = mActivityVariablesPage;

            mActionsPage = new ActionsPage();
            mActionsPage.grdActions.ShowTitle = System.Windows.Visibility.Collapsed;
            ActivityActionsFrame.Content      = mActionsPage;

            mReposiotryPage         = new RepositoryPage();
            RepositoryFrame.Content = mReposiotryPage;
        }
Example #2
0
        public void SteamAutoTest()
        {
            MainPage mainPage = new MainPage();

            mainPage.ChooseCategoryFromMenu();

            ActionsPage actionsPage = new ActionsPage();

            actionsPage.SelectDiscountsTab();

            DiscountsPage discountsPage = new DiscountsPage();

            discountsPage.NavigateToMaxDiscount();
            Game expectedGame = discountsPage.GetGameFromDiscounts();

            AgePage2 agePage2 = new AgePage2();

            agePage2.SubmitView();

            AgePage agePage = new AgePage();

            agePage.FillAgeData(Configuration.GetYear());

            GamePage gamePage   = new GamePage();
            Game     actualGame = gamePage.GetGame();

            Assert.AreEqual(expectedGame.Name, actualGame.Name, "Names are equal. The right game opened.");
            Assert.AreEqual(expectedGame.Discount, actualGame.Discount, "Discounts are equal.");
            Assert.AreEqual(expectedGame.Price, actualGame.Price, "Prices are equal.");

            gamePage.NavigateToDownloadPage();

            DownloadPage downloadPage = new DownloadPage();

            downloadPage.StartDownloadSteam();
            Assert.IsTrue(downloadPage.CheckFinishDownload(filePath), "SteamSetup.exe downloaded successfully");
        }
Example #3
0
        public ActivityEditPage(Activity activity, General.RepositoryItemPageViewMode mode = General.RepositoryItemPageViewMode.Automation, BusinessFlow activityParentBusinessFlow = null)
        {
            InitializeComponent();

            this.Title = "Edit " + GingerDicser.GetTermResValue(eTermResKey.Activity);

            mActivity = activity;
            if (editMode != General.RepositoryItemPageViewMode.View)
            {
                mActivity.SaveBackup();
            }
            editMode = mode;

            RunDescritpion.Init(activity, Activity.Fields.RunDescription);

            if (activityParentBusinessFlow != null)
            {
                mActivityParentBusinessFlow = activityParentBusinessFlow;
            }
            else
            {
                mActivityParentBusinessFlow = App.BusinessFlow;
            }

            List <string> automationStatusList = GingerCore.General.GetEnumValues(typeof(Activity.eActivityAutomationStatus));

            AutomationStatusCombo.ItemsSource = automationStatusList;
            RunOptionCombo.BindControl(activity, Activity.Fields.ActionRunOption);
            HandlerTypeCombo.ItemsSource = GingerCore.General.GetEnumValues(typeof(ErrorHandler.eHandlerType));

            App.FillComboFromEnumVal(cmbErrorHandlerMapping, mActivity.ErrorHandlerMappingType);
            App.ObjFieldBinding(txtActivityName, TextBox.TextProperty, mActivity, Activity.Fields.ActivityName);
            App.ObjFieldBinding(txtActivityDescription, TextBox.TextProperty, mActivity, Activity.Fields.Description);
            App.ObjFieldBinding(txtExpected, TextBox.TextProperty, mActivity, Activity.Fields.Expected);
            App.ObjFieldBinding(txtScreen, TextBox.TextProperty, mActivity, Activity.Fields.Screen);
            App.ObjFieldBinding(txtGroup, TextBox.TextProperty, mActivity, Activity.Fields.ActivitiesGroupID);
            App.ObjFieldBinding(AutomationStatusCombo, ComboBox.TextProperty, mActivity, Activity.Fields.AutomationStatus);
            App.ObjFieldBinding(MandatoryActivityCB, CheckBox.IsCheckedProperty, mActivity, Activity.Fields.Mandatory);

            if (activity.GetType() == typeof(ErrorHandler))
            {
                HandlerTypeStack.Visibility = Visibility.Visible;
                App.ObjFieldBinding(HandlerTypeCombo, ComboBox.TextProperty, mActivity, ErrorHandler.Fields.HandlerType);
            }
            else
            {
                App.ObjFieldBinding(cmbErrorHandlerMapping, ComboBox.SelectedValueProperty, mActivity, Activity.Fields.ErrorHandlerMappingType);
                HandlerMappingStack.Visibility = Visibility.Visible;
                Row1.Height = new GridLength(Row1.Height.Value - 38);
            }

            App.ObjFieldBinding(TargetApplicationComboBox, ComboBox.SelectedValueProperty, mActivity, Activity.Fields.TargetApplication);

            FillTargetAppsComboBox();

            TagsViewer.Init(mActivity.Tags);

            VariablesPage varbsPage;
            ActionsPage   actionsPage;

            if (editMode == General.RepositoryItemPageViewMode.View)
            {
                varbsPage   = new VariablesPage(eVariablesLevel.Activity, mActivity, General.RepositoryItemPageViewMode.View);
                actionsPage = new ActionsPage(mActivity, General.RepositoryItemPageViewMode.View);
                SetViewMode();
            }
            else
            {
                varbsPage   = new VariablesPage(eVariablesLevel.Activity, mActivity);
                actionsPage = new ActionsPage(mActivity);
            }
            varbsPage.grdVariables.ShowTitle = System.Windows.Visibility.Collapsed;
            if (varbsPage.grdVariables.Grid.Items.Count == 0)
            {
                VariablesExpander.IsExpanded = false;
            }

            actionsPage.grdActions.ShowTitle = System.Windows.Visibility.Collapsed;
            VariablesFrame.Content           = varbsPage;
            ActionsFrame.Content             = actionsPage;

            if (editMode == General.RepositoryItemPageViewMode.Automation)
            {
                SharedRepoInstanceUC.Init(mActivity, mActivityParentBusinessFlow);
            }
            else
            {
                SharedRepoInstanceUC.Visibility = Visibility.Collapsed;
                SharedRepoInstanceUC_Col.Width  = new GridLength(0);
            }
            if (!mActivity.IsNotGherkinOptimizedActivity)
            {
                txtActivityName.IsEnabled = false;
            }

            txtActivityName.Focus();
        }