/// <summary> /// The log key values. /// </summary> /// <param name="kernelLogfilePath"> /// The kernel logfile path. /// </param> /// <param name="iterationStatus"> /// The iteration status. /// </param> private void LogKeyValues(string kernelLogfilePath, string iterationStatus) { StfLogger.LogKeyValue("Test Iteration", iterationStatus, iterationStatus); StfLogger.LogKeyValue("Kernel Logger", kernelLogfilePath, "Kernel Logger"); StfLogger.LogKeyValue("Test Name", TestContext.TestName, "Name of test"); StfLogger.LogKeyValue("Stf Root", StfRoot, "The Stf Root directory"); var configuration = Get <StfConfiguration>(); StfLogger.LogKeyValue("Environment", configuration.Environment, "Configuration.EnvironmentName"); }
/// <summary> /// The init. /// </summary> /// <returns> /// The <see cref="bool"/>. /// </returns> public bool Init() { var registerMyNeededTypes = new RegisterMyNeededTypes(this); registerMyNeededTypes.Register(); WtConfiguration = SetConfig <WtConfiguration>(); // get what I need - a WebAdapter:-) WebAdapter = StfContainer.Get <IWebAdapter>(); WebAdapter.OpenUrl(WtConfiguration.Url); var currentDomainBaseDirectory = AppDomain.CurrentDomain.BaseDirectory; StfLogger.LogKeyValue("Current Directory", currentDomainBaseDirectory, "Current Directory"); return(true); }
/// <summary> /// The init. /// </summary> /// <returns> /// The <see cref="bool"/>. /// </returns> public bool Init() { // register my needed types StfContainer.RegisterType <ICollection, Collection>(); StfContainer.RegisterType <IMe, Me.Me>(); StfContainer.RegisterType <IExplorer, Explorer>(); StfContainer.RegisterType <IFaq, Faq.Faq>(); // get what I need - a WebAdapter:-) WebAdapter = StfContainer.Get <IWebAdapter>(); WebAdapter.OpenUrl("http://WrapTrack.org/"); var currentDomainBaseDirectory = AppDomain.CurrentDomain.BaseDirectory; StfLogger.LogKeyValue("Current Directory", currentDomainBaseDirectory, "Current Directory"); Login("ida88", "lk8dsafpUqwe"); return(true); }
/// <summary> /// Initializes a new instance of the <see cref="StfKernel"/> class. /// </summary> public StfKernel() { StfTextUtils = new StfTextUtils(); // setup needed kernel directories KernelSetupKernelDirectories(); // lets get a logger and a configuration var uniqueKernelLoggerFilename = StfTextUtils.AppendUniquePartToFileName("KernelLogger.html"); var kernelLoggerFilename = Path.Combine(StfKernelLogDir, uniqueKernelLoggerFilename); var kernelLoggerConfiguration = new StfLoggerConfiguration { LogTitle = "KernelLog", LogFileName = kernelLoggerFilename, LogLevel = StfLogLevel.Internal }; KernelLogger = new StfLogger(kernelLoggerConfiguration); // get the initial configuration together - at this point in time: Only the kernel configuration AssembleStfConfigurationBeforePlugins(); // Any plugins for us? PluginLoader = new StfPluginLoader(KernelLogger, StfConfiguration); PluginLoader.RegisterInstance(typeof(StfConfiguration), StfConfiguration); if (StfConfiguration.TryGetKeyValue("Configuration.StfKernel.PluginPath", out var pluginPath)) { // TODO: Check for existing config file. If file not found then create default template configuration PluginLoader.LoadStfPlugins(pluginPath); } AssembleStfConfigurationAfterPlugins(); // now all configurations are loaded, we can set the Environment. StfConfiguration.Environment = StfConfiguration.DefaultEnvironment; LoadConfigurationForStfTypes(); DumpStfConfiguration(); KernelLogger.LogKeyValue("Stf Root", StfRoot, "The Stf Root directory"); }
/// <summary> /// The sign up. /// </summary> /// <param name="newUserName"> /// The new user name. /// </param> /// <param name="password"> /// The password. /// </param> /// <returns> /// The <see cref="bool"/>. /// </returns> public bool SignUp(string newUserName, string password) { WebAdapter.ButtonClickById("nav_login"); WebAdapter.TextboxSetTextById("input_newuser", newUserName); WebAdapter.TextboxSetTextById("input_newPW", password); WebAdapter.TextboxSetTextById("input_email", newUserName + "@mitsite.org"); WebAdapter.CheckBoxSetValueById("check_cond", true); WebAdapter.ButtonClickById("OpretProfilKnap"); // when debugging, we probably want to get to the signed up user StfLogger.LogKeyValue("SignUpUserName", newUserName, "SignUpUserName"); StfLogger.LogKeyValue("SignUpPassword", password, "SignUpPassword"); // Check If still on LOGIN page <h1>Login</h1> - if so then the signup failed var loginHeader = WebAdapter.FindElement(By.XPath("//h1[text='Login']"), 2); var retVal = loginHeader == null || CheckSignUpValidationMessages(); ChooseEnglish(); return(retVal); }