public void TestFullResetNoResetMutualExclusivity() { DefaultAppiumAppSettings settings = new DefaultAppiumAppSettings(); settings.PerformFullAndroidReset = true; settings.ResetApplicationState = false; AppiumServerRunner setup = new AppiumServerRunner("", "", settings); Assert.That(setup.ContainsArgument<FullResetArgument>(), Is.True); Assert.That(setup.ContainsArgument<NoResetArgument>(), Is.False); }
public void TestDeveloperModeExternalAppiumPackageIsUsed() { string test = "app"; DefaultAppiumAppSettings settings = new DefaultAppiumAppSettings(); settings.UseDeveloperMode = true; settings.UseExternalAppiumPackage = true; settings.ExternalAppiumPackage = test; AppiumServerRunner setup = new AppiumServerRunner(NODE_RUNNER, WORKING_DIR, settings); Assert.That(setup.WorkingDirectory, Is.EqualTo(test)); // reset for negative case settings.UseExternalAppiumPackage = false; setup.Setup(settings); Assert.That(setup.WorkingDirectory, Is.EqualTo(WORKING_DIR)); }
public void TestDeveloperModeExternalNodeJsLibraryIsUsed() { string testNodeJs = "testNodeJs"; DefaultAppiumAppSettings settings = new DefaultAppiumAppSettings(); settings.UseDeveloperMode = true; settings.UseExternalNodeJSBinary = true; settings.ExternalNodeJSBinary = testNodeJs; AppiumServerRunner setup = new AppiumServerRunner(NODE_RUNNER, WORKING_DIR, settings); Assert.That(setup.Filename, Is.EqualTo(testNodeJs)); //reset for negative case settings.UseExternalNodeJSBinary = false; setup.Setup(settings); Assert.That(setup.Filename, Is.EqualTo(NODE_RUNNER)); }
public void TestAllDeveloperSettingsIgnoredWhenDevModeDisabled() { DefaultAppiumAppSettings settings = new DefaultAppiumAppSettings(); settings.UseDeveloperMode = false; settings.UseExternalNodeJSBinary = true; settings.ExternalNodeJSBinary = "testNodeJs"; settings.UseExternalAppiumPackage = true; settings.ExternalAppiumPackage = "extApp"; settings.UseNodeJSDebugging = true; settings.NodeJSDebugPort = 1234; settings.BreakOnApplicationStart = true; AppiumServerRunner setup = new AppiumServerRunner(NODE_RUNNER, WORKING_DIR, settings); Assert.That(setup.Filename, Is.EqualTo(NODE_RUNNER)); Assert.That(setup.WorkingDirectory, Is.EqualTo(WORKING_DIR)); Assert.That(setup.ContainsArgument<NodeJSDebugArgument>(), Is.False); Assert.That(setup.ContainsArgument<BreakOnAppStartArgument>(), Is.False); }
public void TestSetupAppPathChangesSettingsAndNotifies() { // setup DefaultAppiumAppSettings settings = new DefaultAppiumAppSettings(); Model mainModel = new Model(null, settings); List<string> events = new List<string>(); mainModel.PropertyChanged += delegate(object s, PropertyChangedEventArgs e) { events.Add(e.PropertyName); }; const string appPath = "testMe"; // test mainModel.SetupNewApplicationPath(appPath); Assert.That(settings.ApplicationPath, Is.EqualTo(appPath)); Assert.That(settings.UseApplicationPath, Is.True); Assert.That(events[0], Is.EqualTo("ApplicationPath"), "Event for ApplicationPath property change has not been fired."); Assert.That(events[1], Is.EqualTo("UseApplicationPath"), "Event for UseApplicationPath property change has not been fired."); }
public void TestDeveloperModeNodeJsDebuggingPortUsage() { uint port = 1234; DefaultAppiumAppSettings settings = new DefaultAppiumAppSettings(); settings.UseDeveloperMode = true; settings.UseNodeJSDebugging = true; settings.NodeJSDebugPort = port; AppiumServerRunnerMock setup = new AppiumServerRunnerMock(NODE_RUNNER, WORKING_DIR, settings); Assert.That(setup.ContainsArgument<NodeJSDebugArgument>(), Is.True); Assert.That(setup.GetArgumentForTest<NodeJSDebugArgument>().Value, Is.EqualTo(port)); // reset for negative case settings.UseNodeJSDebugging = false; setup.Setup(settings); Assert.That(setup.ContainsArgument<NodeJSDebugArgument>(), Is.False); }
public void TestAppiumServerBaseSetup() { string ipAddr = "1.0.0.0"; uint port = 1234; DefaultAppiumAppSettings settings = new DefaultAppiumAppSettings(); settings.IPAddress = ipAddr; settings.Port = port; AppiumServerRunnerMock setup = new AppiumServerRunnerMock(NODE_RUNNER, WORKING_DIR, settings); Assert.That(setup.ContainsArgument<ServerRunnerArgument>(),Is.True); Assert.That(setup.ContainsArgument<ServerAddressArgument>(),Is.True); Assert.That(setup.GetArgumentForTest<ServerAddressArgument>().Value, Is.EqualTo(ipAddr)); Assert.That(setup.ContainsArgument<ServerPortArgument>(),Is.True); Assert.That(setup.GetArgumentForTest<ServerPortArgument>().Value, Is.EqualTo(port)); }
public void TestPrelauchApplicationUsage() { DefaultAppiumAppSettings settings = new DefaultAppiumAppSettings(); AppiumServerRunner setup = new AppiumServerRunner(NODE_RUNNER, WORKING_DIR, settings); // keep artifacts not enabled by default Assert.That(setup.ContainsArgument<PrelauchApplicationArgument>(), Is.False); // keep artifacts enabled settings.PrelaunchApplication = true; setup.Setup(settings); Assert.That(setup.ContainsArgument<PrelauchApplicationArgument>(), Is.True); }
public void TestQuietLoggingUsage() { DefaultAppiumAppSettings settings = new DefaultAppiumAppSettings(); AppiumServerRunner setup = new AppiumServerRunner(NODE_RUNNER, WORKING_DIR, settings); // quiet logging not enabled by default Assert.That(setup.ContainsArgument<QuietLoggingArgument>(), Is.False); // quiet logging enabled settings.QuietLogging = true; setup.Setup(settings); Assert.That(setup.ContainsArgument<QuietLoggingArgument>(), Is.True); }
public void TestAndroidDeviceReadyTimeoutUsage() { uint test = 1234; DefaultAppiumAppSettings settings = new DefaultAppiumAppSettings(); settings.AndroidDeviceReadyTimeout = test; AppiumServerRunnerMock setup = new AppiumServerRunnerMock(NODE_RUNNER, WORKING_DIR, settings); // timeout not enabled by default Assert.That(setup.ContainsArgument<AndroidDeviceReadyTimeoutArgument>(), Is.False); // timeout enabled settings.UseAndroidDeviceReadyTimeout = true; setup.Setup(settings); Assert.That(setup.ContainsArgument<AndroidDeviceReadyTimeoutArgument>(), Is.True); Assert.That(setup.GetArgumentForTest<AndroidDeviceReadyTimeoutArgument>().Value, Is.EqualTo(test)); }
public void TestAndroidWaitActivityUsage() { string test = "wait"; DefaultAppiumAppSettings settings = new DefaultAppiumAppSettings(); settings.AndroidWaitActivity = test; AppiumServerRunnerMock setup = new AppiumServerRunnerMock(NODE_RUNNER, WORKING_DIR, settings); // activity not enabled by default Assert.That(setup.ContainsArgument<AndroidWaitActivityArgument>(), Is.False); // activity enabled settings.UseAndroidWaitActivity = true; setup.Setup(settings); Assert.That(setup.ContainsArgument<AndroidWaitActivityArgument>(), Is.True); Assert.That(setup.GetArgumentForTest<AndroidWaitActivityArgument>().Value, Is.EqualTo(test)); }
public void TestLaunchAVDUsage() { string test = "AVD"; DefaultAppiumAppSettings settings = new DefaultAppiumAppSettings(); settings.AVDToLaunch = test; AppiumServerRunnerMock setup = new AppiumServerRunnerMock(NODE_RUNNER, WORKING_DIR, settings); // avd not enabled by default Assert.That(setup.ContainsArgument<AVDToLaunchArgument>(), Is.False); // avd enabled settings.LaunchAVD = true; setup.Setup(settings); Assert.That(setup.ContainsArgument<AVDToLaunchArgument>(), Is.True); Assert.That(setup.GetArgumentForTest<AVDToLaunchArgument>().Value, Is.EqualTo(test)); }
public void TestDeveloperModeBreakOnAppStartUsage() { DefaultAppiumAppSettings settings = new DefaultAppiumAppSettings(); settings.UseDeveloperMode = true; settings.BreakOnApplicationStart = true; AppiumServerRunner setup = new AppiumServerRunner(NODE_RUNNER, WORKING_DIR, settings); Assert.That(setup.ContainsArgument<BreakOnAppStartArgument>(), Is.True); // reset for negative case settings.BreakOnApplicationStart = false; setup.Setup(settings); Assert.That(setup.ContainsArgument<BreakOnAppStartArgument>(), Is.False); }