public static BaseApp UseControlDataHandlers(this BaseApp baseApp)
        {
            // Editable Control DataHandlers - need to be registered both as readonly and editable
            ServicesCollection.Current.RegisterType <IEditableControlDataHandler <Date>, DateControlDataHandler>();
            ServicesCollection.Current.RegisterType <IEditableControlDataHandler <DateTimeLocal>, DateTimeLocalControlDataHandler>();
            ServicesCollection.Current.RegisterType <IEditableControlDataHandler <Email>, EmailControlDataHandler>();
            ServicesCollection.Current.RegisterType <IEditableControlDataHandler <Month>, MonthControlDataHandler>();
            ServicesCollection.Current.RegisterType <IEditableControlDataHandler <Password>, PasswordControlDataHandler>();
            ServicesCollection.Current.RegisterType <IEditableControlDataHandler <Phone>, PhoneControlDataHandler>();
            ServicesCollection.Current.RegisterType <IEditableControlDataHandler <Range>, RangeControlDataHandler>();
            ServicesCollection.Current.RegisterType <IEditableControlDataHandler <Search>, SearchControlDataHandler>();
            ServicesCollection.Current.RegisterType <IEditableControlDataHandler <Time>, TimeControlDataHandler>();
            ServicesCollection.Current.RegisterType <IEditableControlDataHandler <Url>, UrlControlDataHandler>();
            ServicesCollection.Current.RegisterType <IEditableControlDataHandler <Week>, WeekControlDataHandler>();
            ServicesCollection.Current.RegisterType <IEditableControlDataHandler <CheckBox>, CheckBoxControlDataHandler>();
            ServicesCollection.Current.RegisterType <IEditableControlDataHandler <RadioButton>, RadioButtonControlDataHandler>();
            ServicesCollection.Current.RegisterType <IEditableControlDataHandler <Select>, SelectControlDataHandler>();
            ServicesCollection.Current.RegisterType <IEditableControlDataHandler <TextArea>, TextAreaControlDataHandler>();
            ServicesCollection.Current.RegisterType <IEditableControlDataHandler <TextField>, TextFieldControlDataHandler>();

            // Readonly Control DataHandlers - need to be registered only as readonly
            ServicesCollection.Current.RegisterType <IReadonlyControlDataHandler <Number>, NumberControlDataHandler>();
            ServicesCollection.Current.RegisterType <IReadonlyControlDataHandler <Output>, OutputControlDataHandler>();
            ServicesCollection.Current.RegisterType <IReadonlyControlDataHandler <Anchor>, AnchorControlDataHandler>();
            ServicesCollection.Current.RegisterType <IReadonlyControlDataHandler <Button>, ButtonControlDataHandler>();
            ServicesCollection.Current.RegisterType <IReadonlyControlDataHandler <Div>, DivControlDataHandler>();
            ServicesCollection.Current.RegisterType <IReadonlyControlDataHandler <Image>, ImageControlDataHandler>();
            ServicesCollection.Current.RegisterType <IReadonlyControlDataHandler <Label>, LabelControlDataHandler>();
            ServicesCollection.Current.RegisterType <IReadonlyControlDataHandler <Reset>, ResetControlDataHandler>();
            ServicesCollection.Current.RegisterType <IReadonlyControlDataHandler <Span>, SpanControlDataHandler>();
            ServicesCollection.Current.RegisterType <IReadonlyControlDataHandler <Color>, ColorControlDataHandler>();
            return(baseApp);
        }
        public static BaseApp UseDynamicTestCases(this BaseApp baseApp)
        {
            var elementEventHandlers = new List <ElementEventHandlers>()
            {
                new DynamicTestCasesTextFieldEventHandlers(),
                new DynamicTestCasesDateEventHandlers(),
                new DynamicTestCasesColorEventHandlers(),
                new DynamicTestCasesCheckboxEventHandlers(),
                new DynamicTestCasesDateTimeLocalEventHandlers(),
                new DynamicTestCasesElementEventHandlers(),
                new DynamicTestCasesEmailEventHandlers(),
                new DynamicTestCasesInputFileEventHandlers(),
                new DynamicTestCasesMonthEventHandlers(),
                new DynamicTestCasesNumberEventHandlers(),
                new DynamicTestCasesPasswordEventHandlers(),
                new DynamicTestCasesPhoneEventHandlers(),
                new DynamicTestCasesRangeEventHandlers(),
                new DynamicTestCasesSearchEventHandlers(),
                new DynamicTestCasesSelectEventHandlers(),
                new DynamicTestCasesTextAreaEventHandlers(),
                new DynamicTestCasesTimeEventHandlers(),
                new DynamicTestCasesUrlEventHandlers(),
                new DynamicTestCasesWeekEventHandlers(),
            };

            foreach (var elementEventHandler in elementEventHandlers)
            {
                elementEventHandler.SubscribeToAll();
            }

            return(baseApp);
        }
示例#3
0
        /// <summary>
        /// 第三步
        /// 添加-User,包含UserDetail、Apps
        /// </summary>
        static void Add_BaseUser_WithUserDetail_WithApps()
        {
            var user = new BaseUser();

            user.Account  = "demo";
            user.Password = "******";
            user.Category = BaseUserCategory.Customer;

            var userDetail = new BaseUserDetail()
            {
                Name  = "梁智慧",
                Email = "*****@*****.**",
                Sex   = BaseSex.Boy,
                Note  = "首席布道师"
            };

            var app = new BaseApp();

            app.Name   = "Test";
            app.Secret = Guid.NewGuid().ToString();

            user.UserDetail = userDetail;
            user.Apps.Add(app);
            var reuslt = BaseUserBLL.Instance.Add(user);
        }
        public static BaseApp UseMSTestResults(this BaseApp baseApp)
        {
            baseApp.RegisterType <IScreenshotPlugin, MSTestResultsWorkflowPlugin>(Guid.NewGuid().ToString());
            baseApp.RegisterType <IVideoPlugin, MSTestResultsWorkflowPlugin>(Guid.NewGuid().ToString());

            return(baseApp);
        }
示例#5
0
        private void btnCreateCsm_Click(object sender, EventArgs e)
        {
            if (lbxIniEntries.Items.Count > 0 && pbProgress.Value == 100)
            {
                BaseApp bApp    = GetBaseApp();
                string  baseApp = Application.StartupPath + "\\" + ((int)bApp).ToString("x8") + ".app";
                if (!File.Exists(baseApp) || (int)bApp == 0)
                {
                    OpenFileDialog ofd = new OpenFileDialog();
                    if ((int)bApp > 0)
                    {
                        ofd.Title = "Standard System Menu base app wasn't found";
                    }
                    ofd.Filter = "app|*.app";

                    if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    {
                        baseApp = ofd.FileName;
                    }
                    else
                    {
                        return;
                    }
                }

                CreateCsm(baseApp, string.Empty);
            }
        }
        public static BaseApp UseBugReporting(this BaseApp baseApp)
        {
            var elementEventHandlers = new List <ElementEventHandlers>()
            {
                new BugReportingTextFieldEventHandlers(),
                new BugReportingDateEventHandlers(),
                new BugReportingColorEventHandlers(),
                new BugReportingCheckboxEventHandlers(),
                new BugReportingDateTimeLocalEventHandlers(),
                new BugReportingElementEventHandlers(),
                new BugReportingEmailEventHandlers(),
                new BugReportingInputFileEventHandlers(),
                new BugReportingNumberEventHandlers(),
                new BugReportingPasswordEventHandlers(),
                new BugReportingPhoneEventHandlers(),
                new BugReportingRangeEventHandlers(),
                new BugReportingSearchEventHandlers(),
                new BugReportingSelectEventHandlers(),
                new BugReportingTextAreaEventHandlers(),
                new BugReportingTimeEventHandlers(),
                new BugReportingUrlEventHandlers(),
                new BugReportingWeekEventHandlers(),
            };

            foreach (var elementEventHandler in elementEventHandlers)
            {
                elementEventHandler.SubscribeToAll();
            }

            return(baseApp);
        }
示例#7
0
    //-------------------------------------------------------------------------
    public override void init()
    {
        CoApp = (BaseApp <DefApp>)Entity.getCacheData("CoApp");

        defNodeRpcMethod <PlayerRequest>(
            (ushort)MethodType.c2sPlayerRequest, c2sPlayerRequest);
    }
 public static BaseApp UseScreenshotsOnFail(this BaseApp baseApp)
 {
     baseApp.RegisterType <IScreenshotEngine, VanillaWebDriverScreenshotEngine>();
     baseApp.RegisterType <IScreenshotOutputProvider, ScreenshotOutputProvider>();
     baseApp.RegisterType <Bellatrix.SpecFlow.TestExecutionExtensions.Screenshots.IScreenshotPluginProvider, Bellatrix.SpecFlow.TestExecutionExtensions.Screenshots.ScreenshotPluginProvider>();
     baseApp.RegisterType <TestWorkflowPlugin, Bellatrix.SpecFlow.TestExecutionExtensions.Screenshots.ScreenshotWorkflowPlugin>(Guid.NewGuid().ToString());
     return(baseApp);
 }
        public static BaseApp UseAssertExtensionsBugReporting(this BaseApp baseApp)
        {
            var dynamicTestCasesAssertExtensions = new BugReportingAssertExtensions();

            dynamicTestCasesAssertExtensions.SubscribeToAll();

            return(baseApp);
        }
        public static BaseApp UseAssertExtensionsBddLogging(this BaseApp baseApp)
        {
            var bddLoggingAssertExtensions = new BDDLoggingAssertExtensions();

            bddLoggingAssertExtensions.SubscribeToAll();

            return(baseApp);
        }
示例#11
0
        public static BaseApp UseQTestDynamicTestCases(this BaseApp baseApp)
        {
            baseApp.RegisterInstance(new DynamicTestCasesService());
            baseApp.RegisterType <ITestCaseManagementService, QTestTestCaseManagementService>();
            baseApp.RegisterType <TestWorkflowPlugin, DynamicTestCasesPlugin>(Guid.NewGuid().ToString());

            return(baseApp);
        }
        public static BaseApp UseValidateExtensionsBugReporting(this BaseApp baseApp)
        {
            var bugReportingValidateExtensions = new BugReportingValidateExtensionsEventHandlers();

            bugReportingValidateExtensions.SubscribeToAll();

            return(baseApp);
        }
        public static BaseApp UseLayoutAssertionExtensionsBddLogging(this BaseApp baseApp)
        {
            var bddLoggingLayoutAssertionsExtensions = new BDDLoggingAssertionExtensionsService();

            bddLoggingLayoutAssertionsExtensions.SubscribeToAll();

            return(baseApp);
        }
        public static BaseApp UseLayoutAssertionExtensionsDynamicTestCases(this BaseApp baseApp)
        {
            var dynamicTestCasesLayoutAssertionsExtensions = new DynamicTestCasesAssertionExtensions();

            dynamicTestCasesLayoutAssertionsExtensions.SubscribeToAll();

            return(baseApp);
        }
        public static BaseApp UseValidateExtensionsDynamicTestCases(this BaseApp baseApp)
        {
            var bddLoggingValidateExtensions = new DynamicTestCasesValidateExtensions();

            bddLoggingValidateExtensions.SubscribeToAll();

            return(baseApp);
        }
        public static BaseApp UseValidateExtensionsBugReporting(this BaseApp baseApp)
        {
            var bddLoggingValidateExtensions = new BugReportingValidateExtensions();

            bddLoggingValidateExtensions.SubscribeToAll();

            return(baseApp);
        }
        public static BaseApp UseValidateExtensionsBddLogging(this BaseApp baseApp)
        {
            var bddLoggingValidateExtensions = new BDDLoggingValidateExtensionsService();

            bddLoggingValidateExtensions.SubscribeToAll();

            return(baseApp);
        }
示例#18
0
    public void Start()
    {
        UnityEngine.Debug.Log("Enter BaseMain");

        BaseApp.Init();

        BaseMM.base_loader.StartBase();
    }
        public static BaseApp UseValidateExtensionsDynamicTestCases(this BaseApp baseApp)
        {
            var dynamicTestCasesValidateExtensions = new DynamicTestCasesValidateExtensionsEventHandlers();

            dynamicTestCasesValidateExtensions.SubscribeToAll();

            return(baseApp);
        }
示例#20
0
 private void CloseCurrentApp()
 {
     if (currentApp != null)
     {
         currentApp.Hide();
         currentApp = null;
     }
 }
        public static BaseApp UseLayoutAssertionExtensionsBugReporting(this BaseApp baseApp)
        {
            var bugReportingLayoutAssertionsExtensions = new BugReportingAssertionExtensions();

            bugReportingLayoutAssertionsExtensions.SubscribeToAll();

            return(baseApp);
        }
示例#22
0
        public static BaseApp UseFFmpegVideoRecorder(this BaseApp baseApp)
        {
            baseApp.RegisterType <IVideoRecorder, FFmpegVideoRecorder>();
            baseApp.RegisterType <IVideoRecorderOutputProvider, VideoRecorderOutputProvider>();
            baseApp.RegisterType <IVideoPluginProvider, VideoPluginProvider>();
            baseApp.RegisterType <TestWorkflowPlugin, VideoWorkflowPlugin>(Guid.NewGuid().ToString());

            return(baseApp);
        }
        public static BaseApp UseVanillaWebDriverScreenshotsOnFail(this BaseApp baseApp)
        {
            baseApp.RegisterType <IScreenshotEngine, VanillaWebDriverScreenshotEngine>();
            baseApp.RegisterType <IScreenshotOutputProvider, ScreenshotOutputProvider>();
            baseApp.RegisterType <IScreenshotPluginProvider, ScreenshotPluginProvider>();
            baseApp.RegisterType <TestWorkflowPlugin, ScreenshotWorkflowPlugin>(Guid.NewGuid().ToString());

            return(baseApp);
        }
        public static BaseApp UseAllure(this BaseApp baseApp)
        {
            baseApp.RegisterType <TestWorkflowPlugin, AllureWorkflowPlugin>(Guid.NewGuid().ToString());
            baseApp.RegisterType <IScreenshotPlugin, AllureWorkflowPlugin>(Guid.NewGuid().ToString());
            baseApp.RegisterType <IVideoPlugin, AllureWorkflowPlugin>(Guid.NewGuid().ToString());

            Environment.SetEnvironmentVariable("ALLURE_CONFIG", Path.Combine(GetAssemblyDirectory(), "allureConfig.json"));

            return(baseApp);
        }
        public static BaseApp UseJiraBugReporting(this BaseApp baseApp)
        {
            baseApp.RegisterInstance(new BugReportingContextService());
            baseApp.RegisterType <IBugReportingService, JiraBugReportingService>();
            baseApp.RegisterType <TestWorkflowPlugin, BugReportingPlugin>(Guid.NewGuid().ToString());
            baseApp.RegisterType <IScreenshotPlugin, BugReportingPlugin>(Guid.NewGuid().ToString());
            baseApp.RegisterType <IVideoPlugin, BugReportingPlugin>(Guid.NewGuid().ToString());

            return(baseApp);
        }
        protected override void OnAttached()
        {
            base.OnAttached();

            this.g_App = Application.Current as BaseApp;

            if (this.AssociatedObject != null)
            {
                this.AssociatedObject.Initialized += AssociatedObject_Initialized;
            }
        }
示例#27
0
        public static string DeployServerCode(BaseApp app, string code)
        {
            string        adminToken = GetAdminToken(app);
            string        url        = Utils.Path(Kii.BaseUrl, "apps", app.AppId, "server-code");
            KiiHttpClient client     = new KiiClientFactoryImpl().Create(url, app.AppId, app.AppKey, KiiHttpMethod.POST);

            client.Headers["Authorization"] = "Bearer " + adminToken;
            client.ContentType = "application/javascript";
            client.Body        = code;

            ApiResponse response = client.SendRequest();

            return(new JsonObject(response.Body).GetString("versionID"));
        }
        public static BaseApp UseHighlightElements(this BaseApp baseApp)
        {
            if (ConfigurationService.GetSection <WebSettings>() == null)
            {
                throw new ArgumentException("Could not load web settings section from testFrameworkSettings.json");
            }

            if (ConfigurationService.GetSection <WebSettings>().ShouldHighlightElements)
            {
                var highlightElementEventHandler = new HighlightElementEventHandlers();
                highlightElementEventHandler.SubscribeToAll();
            }

            return(baseApp);
        }
        private void AppBrowse()
        {
            BaseApp standardApp = GetStandardBaseApp();

            if (standardApp == (BaseApp)0)
            {
                ErrorBox("You have to choose a Standard System Menu!"); return;
            }

            string browsePath;
            string altPath;

            if (!settings.keepExtractedApp)
            {
                browsePath = tempDir + "appBrowse\\"; altPath = Application.StartupPath + "\\ExtractedBaseApp\\";
            }
            else
            {
                browsePath = Application.StartupPath + "\\ExtractedBaseApp\\"; altPath = tempDir + "appBrowse\\";
            }

            if (standardApp != lastExtracted || !Directory.Exists(browsePath))
            {
                //Extract app
                if (!File.Exists(Application.StartupPath + "\\" + ((int)standardApp).ToString("x8") + ".app"))
                {
                    ErrorBox("app file wasn't found!"); return;
                }

                if (Directory.Exists(browsePath))
                {
                    Directory.Delete(browsePath, true);
                }
                if (Directory.Exists(altPath))
                {
                    Directory.Delete(altPath, true);
                }

                Thread workerThread = new Thread(new ParameterizedThreadStart(this._extractAppForBrowsing));
                workerThread.Start(new object[] { standardApp, browsePath });
            }
            else
            {
                OpenAppBrowser(browsePath);
            }
        }
示例#30
0
        public static string GetAdminToken(BaseApp app)
        {
            JsonObject body = new JsonObject();

            body.Put("grant_type", "client_credentials");
            body.Put("client_id", app.ClientId);
            body.Put("client_secret", app.ClientSecret);

            string        url    = Utils.Path(Kii.BaseUrl, "apps", app.AppId, "oauth2", "token");
            KiiHttpClient client = new KiiClientFactoryImpl().Create(url, app.AppId, app.AppKey, KiiHttpMethod.POST);

            client.Headers["Authorization"] = "Basic " + Convert.ToBase64String(Encoding.UTF8.GetBytes(app.AppId + ":" + app.AppKey));
            client.ContentType = "application/json";
            client.Body        = body.ToString();
            ApiResponse response = client.SendRequest();

            return(new JsonObject(response.Body).GetString("access_token"));
        }