diff --git a/Percy.Tests/AppPercyTest.cs b/Percy.Tests/AppPercyTest.cs index 18ab3a4..a3e9df6 100644 --- a/Percy.Tests/AppPercyTest.cs +++ b/Percy.Tests/AppPercyTest.cs @@ -16,6 +16,9 @@ public class AppPercyTest public AppPercyTest() { + AppPercy.cache.Clear(); + TestHelper.UnsetEnvVariables(); + Environment.SetEnvironmentVariable("PERCY_DISABLE_REMOTE_UPLOADS", "true"); mockDriver = new MockDriverObject(); mockDriver.SessionId = "session-1"; CliWrapper.Healthcheck = () => @@ -47,8 +50,6 @@ private static String LogMessage(String label, String message, String color = "3 public void TestName_WithAndroid_V4() { // Arrange - AppPercy.cache.Clear(); - TestHelper.UnsetEnvVariables(); mockDriver.SetCapability(MetadataBuilder.CapabilityBuilder("Android")); mockDriver.setCommandExecutor("https://browserstack.com/wd/hub"); // Act @@ -66,7 +67,6 @@ public void TestName_WithAndroid_V4() public void TestName_WithIOS_V4() { // Arrange - AppPercy.cache.Clear(); mockDriver.SetCapability(MetadataBuilder.CapabilityBuilder("iOS")); mockDriver.setCommandExecutor("https://browserstack.com/wd/hub"); @@ -85,8 +85,6 @@ public void TestName_WithIOS_V4() public void TestName_WithAndroid_V5() { // Arrange - AppPercy.cache.Clear(); - TestHelper.UnsetEnvVariables(); // Setting v5 mockDriver.setIsV5(true); mockDriver.SetCapability(MetadataBuilder.CapabilityBuilder("Android")); @@ -107,8 +105,6 @@ public void TestName_WithAndroid_V5() public void TestName_WithIOS_V5() { // Arrange - AppPercy.cache.Clear(); - TestHelper.UnsetEnvVariables(); // Setting v5 mockDriver.setIsV5(true); mockDriver.SetCapability(MetadataBuilder.CapabilityBuilder("iOS")); @@ -129,8 +125,6 @@ public void TestName_WithIOS_V5() public void TestName_ShouldThrowError() { // Arrange - AppPercy.cache.Clear(); - TestHelper.UnsetEnvVariables(); // Setting v5 mockDriver.setIsV5(true); mockDriver.SetCapability(MetadataBuilder.CapabilityBuilder("iOS")); diff --git a/Percy.Tests/PercyOnAutomateTest.cs b/Percy.Tests/PercyOnAutomateTest.cs index 6f08391..8eec1cd 100644 --- a/Percy.Tests/PercyOnAutomateTest.cs +++ b/Percy.Tests/PercyOnAutomateTest.cs @@ -23,17 +23,6 @@ public PercyOnAutomateTest() { return true; }; - mockHttp = new MockHttpMessageHandler(); - var obj = new - { - success = true, - type = "automate" - }; - CliWrapper.setHttpClient(new HttpClient(mockHttp)); - // Setup a respond for the user api (including a wildcard in the URL) - mockHttp.When("http://localhost:5338/percy/healthcheck") - .Respond("application/json", JsonConvert.SerializeObject(obj)); - stringWriter = new StringWriter(); Console.SetOut(stringWriter); } diff --git a/Percy.Tests/helper/MockDriverObject.cs b/Percy.Tests/helper/MockDriverObject.cs index 584a6a5..e4004f5 100644 --- a/Percy.Tests/helper/MockDriverObject.cs +++ b/Percy.Tests/helper/MockDriverObject.cs @@ -30,7 +30,7 @@ public void SetCapability(Dictionary caps) } }, { - "pixelRatio", 1 + "pixelRatio", 1l } }; } @@ -69,7 +69,7 @@ public Object GetScreenshot() return new Screenshot(); } - public Object ExecuteScript(String script, Object obj) + public Object ExecuteScript(String script) { return @"{success:'true', osVersion:'11.2', buildHash:'abc', sessionHash:'def'}"; }