Beispiel #1
0
        /// <summary>
        ///     Simple test runner.
        /// </summary>
        /// <param name="config">Configuration.</param>
        public static void RunTests(Configuration config)
        {
            ITest baseTest = new BaseTest();
            try
            {
                var driver = new Driver(config.Get[Configuration.BrowserName],
                    int.Parse(config.Get[Configuration.ImplicitTimeout]));

                var test = new GmailTest(config, driver);
                test.SetUp();
                test.SendMailTest();
                baseTest = test;
            }
            catch (TestFailedException testFailedException)
            {
                Log.Info("Test failed. Reason: " + testFailedException.Message);
                return;
            }
            catch (Exception e)
            {
                Log.Info("Test failed. Reason: " + e.Message);
                Log.Fatal(e);
                return;
            }

            try
            {
                baseTest.TearDown();
            }
            catch (Exception tearDownException)
            {
                Log.Info("Error. Test runner tear down failed.");
                Log.Fatal(tearDownException);
            }
        }
 public void TestInit()
 {
     var path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), nameof(SemDiff), repo.ConfigFile);
     Directory.CreateDirectory(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), nameof(SemDiff)));
     File.Delete(path);
     var auth = new Core.Configuration();
     auth.AuthToken = authToken;
     auth.Username = authUsername;
     var json = JsonConvert.SerializeObject(auth, Formatting.Indented);
     File.WriteAllText(path, json);
 }
Beispiel #3
0
        public YandexTest(Configuration config, IDriver driver)
            : base(config, driver)
        {
            this.loginPage = new LoginPage(driver, config);

            this.userName = config.Get[Configuration.UserName];
            this.password = config.Get[Configuration.Password];
            this.recipient = config.Get[Configuration.Recipient];
            this.subject = config.Get[Configuration.BrowserName] + " test " +
                           DateTime.Now.ToString("yyyy.MM.dd HH:mm:ss");
            this.message = config.Get[Configuration.Message];
        }
Beispiel #4
0
        public void TestInit()
        {
            var path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), nameof(SemDiff), repo.ConfigFile);

            Directory.CreateDirectory(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), nameof(SemDiff)));
            File.Delete(path);
            var auth = new Core.Configuration();

            auth.AuthToken = authToken;
            auth.Username  = authUsername;
            var json = JsonConvert.SerializeObject(auth, Formatting.Indented);

            File.WriteAllText(path, json);
        }
		private IEnumerator LoadConfiguration()
		{
			config = Resource.Find<Configuration>();
			Log.mode = config.mode;

			Log.Info("AppEngine loaded setting: " + config.setting.title + " [v" + config.setting.version + "]");

			StartCoroutine(LoadScene(config.setting.loader.name, true, delegate(Scene scene)
			{
				loader = scene;
			}));

			yield return new WaitUntil(delegate
			{
				return loader.isLoaded;
			});

			Log.Info("Initializing application  ...");

			//TODO: setup resources

			states = new Dictionary<string,AppState>();
			foreach(Core.State state in config.setting.states)
			{
				StartCoroutine(LoadScene(state.name, false, delegate(Scene scene)
				{
					StateController controller = scene.FindComponentInRoot<StateController>();
					if(controller == null)
					{
						Log.Fatal("Loaded state but does not contain a StateController: " + state.name);
					}
					else
					{
						AppState appState = new AppState(scene, controller, state);
						states[appState.name] = appState;
						Log.Info("Loaded state: " + state.name);
					}
				}));

				yield return new WaitUntil(delegate
				{
					return states.ContainsKey(state.name);
				});
			}

			Log.Info("Complete; setting boot state ...");
			SetState(config.setting.bootState);
		}
Beispiel #6
0
 public BaseTest(Configuration config, IDriver driver)
 {
     this.driver = driver;
     this.config = config;
     this.stopwatch = new Stopwatch();
 }
 public ComposeMailPage(IDriver driver, Configuration config)
     : base(driver, config)
 {
     this.url = "https://mail.google.com/mail/#inbox?compose=new";
     this.title = "Inbox";
 }
Beispiel #8
0
 public LoginPage(IDriver driver, Configuration config)
     : base(driver, config)
 {
     this.url = config.Get[Configuration.MailServer];
     this.title = "Gmail";
 }
 public ComposeMailPage(IDriver driver, Configuration config)
     : base(driver, config)
 {
     this.url = "https://mail.yandex.ru/";
     this.title = string.Empty;
 }
 /// <summary>
 ///     Initializes a new instance of the <see cref="AbstractLoginPage"/> class.
 /// </summary>
 /// <param name="driver">Web driver.</param>
 /// <param name="config">Configuration.</param>
 protected AbstractLoginPage(IDriver driver, Configuration config)
     : base(driver, config)
 {
 }
Beispiel #11
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="Page"/> class.
 /// </summary>
 /// <param name="driver">Web driver.</param>
 /// <param name="config">Configuration.</param>
 protected Page(IDriver driver, Configuration config)
 {
     this.Driver = driver;
     this.config = config;
 }