From e2447f8329e4b81368dfa701c4edc7cd1da2a5eb Mon Sep 17 00:00:00 2001 From: prklm10 Date: Tue, 26 Sep 2023 12:06:23 +0530 Subject: [PATCH] addressing comments --- Percy.Tests/AppPercyTest.cs | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/Percy.Tests/AppPercyTest.cs b/Percy.Tests/AppPercyTest.cs index 9127571..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,9 +50,6 @@ private static String LogMessage(String label, String message, String color = "3 public void TestName_WithAndroid_V4() { // Arrange - AppPercy.cache.Clear(); - TestHelper.UnsetEnvVariables(); - Environment.SetEnvironmentVariable("PERCY_DISABLE_REMOTE_UPLOADS", "true"); mockDriver.SetCapability(MetadataBuilder.CapabilityBuilder("Android")); mockDriver.setCommandExecutor("https://browserstack.com/wd/hub"); // Act @@ -67,9 +67,6 @@ public void TestName_WithAndroid_V4() public void TestName_WithIOS_V4() { // Arrange - AppPercy.cache.Clear(); - TestHelper.UnsetEnvVariables(); - Environment.SetEnvironmentVariable("PERCY_DISABLE_REMOTE_UPLOADS", "true"); mockDriver.SetCapability(MetadataBuilder.CapabilityBuilder("iOS")); mockDriver.setCommandExecutor("https://browserstack.com/wd/hub"); @@ -88,9 +85,6 @@ public void TestName_WithIOS_V4() public void TestName_WithAndroid_V5() { // Arrange - AppPercy.cache.Clear(); - TestHelper.UnsetEnvVariables(); - Environment.SetEnvironmentVariable("PERCY_DISABLE_REMOTE_UPLOADS", "true"); // Setting v5 mockDriver.setIsV5(true); mockDriver.SetCapability(MetadataBuilder.CapabilityBuilder("Android")); @@ -111,9 +105,6 @@ public void TestName_WithAndroid_V5() public void TestName_WithIOS_V5() { // Arrange - AppPercy.cache.Clear(); - TestHelper.UnsetEnvVariables(); - Environment.SetEnvironmentVariable("PERCY_DISABLE_REMOTE_UPLOADS", "true"); // Setting v5 mockDriver.setIsV5(true); mockDriver.SetCapability(MetadataBuilder.CapabilityBuilder("iOS")); @@ -134,9 +125,6 @@ public void TestName_WithIOS_V5() public void TestName_ShouldThrowError() { // Arrange - AppPercy.cache.Clear(); - TestHelper.UnsetEnvVariables(); - Environment.SetEnvironmentVariable("PERCY_DISABLE_REMOTE_UPLOADS", "true"); // Setting v5 mockDriver.setIsV5(true); mockDriver.SetCapability(MetadataBuilder.CapabilityBuilder("iOS"));