diff --git a/Assets/Tests/LMV_ExtendedTests/Helpers.cs b/Assets/Tests/LMV_ExtendedTests/Helpers.cs index 06bea2c..717d1a2 100644 --- a/Assets/Tests/LMV_ExtendedTests/Helpers.cs +++ b/Assets/Tests/LMV_ExtendedTests/Helpers.cs @@ -27,8 +27,8 @@ namespace Raindrop.Tests.LMV_ExtendedTests * UnityEngine.TestTools.LogAssert.Expect */ instance.Client.Settings.SEND_AGENT_APPEARANCE = false; - var fullUsername = Secrets.GridUsers[userIdx]; - var password = Secrets.GridPass[userIdx]; + var fullUsername = Secrets.GetUsername(); + var password = Secrets.GetPassword(); Assert.IsFalse(string.IsNullOrWhiteSpace(fullUsername), "LMVTestAgentUsername is empty. " + "Live NetworkTests cannot be performed."); diff --git a/Assets/Tests/OpenMetaverse/NetworkTests.cs b/Assets/Tests/OpenMetaverse/NetworkTests.cs index efd2ad6..0b4a103 100644 --- a/Assets/Tests/OpenMetaverse/NetworkTests.cs +++ b/Assets/Tests/OpenMetaverse/NetworkTests.cs @@ -60,8 +60,8 @@ namespace OpenMetaverse.Tests [OneTimeSetUp] public void Init() { - var fullusername = Secrets.GridUsers[0]; - var password = Secrets.GridPass[0]; + var fullusername = Secrets.GetUsername(); + var password = Secrets.GetPassword(); Assert.IsFalse(string.IsNullOrWhiteSpace(fullusername), "LMVTestAgentUsername is empty. Live NetworkTests cannot be performed."); Assert.IsFalse(string.IsNullOrWhiteSpace(password), "LMVTestAgentPassword is empty. Live NetworkTests cannot be performed."); var username = fullusername.Split(' '); diff --git a/Assets/Tests/Raindrop/RaindropFullIntegrationTests/LoginTests.cs b/Assets/Tests/Raindrop/RaindropFullIntegrationTests/LoginTests.cs index fcc2e42..e7db994 100644 --- a/Assets/Tests/Raindrop/RaindropFullIntegrationTests/LoginTests.cs +++ b/Assets/Tests/Raindrop/RaindropFullIntegrationTests/LoginTests.cs @@ -68,17 +68,14 @@ namespace Raindrop.Tests.RaindropFullIntegrationTests var uiSrv = ServiceLocator.Instance.Get(); - //Finally, perform 2x login-logout for each test-user! - for (int loginCredIdx = 0; loginCredIdx < Secrets.GridUsers.Count; loginCredIdx++) - { - int times = 2; - yield return Login.DoExhaustiveLogins( - Secrets.GridUsers[loginCredIdx], - Secrets.GridPass[loginCredIdx], - Secrets._gridFriendlyNames[loginCredIdx], - times, - instance, uiSrv); - } + // Login,logout 2 times for the test-user + int times = 2; + yield return Login.DoExhaustiveLogins( + Secrets.GetUsername(), + Secrets.GetPassword(), + Secrets.GetGridFriendlyName(), + times, + instance, uiSrv); yield break; } @@ -87,9 +84,9 @@ namespace Raindrop.Tests.RaindropFullIntegrationTests [Timeout(100000000)] public IEnumerator LoginAndDoNothing() { - int userIdx = 2; - - Debug.Log("Logging to " + Secrets._gridFriendlyNames[userIdx]); + string friendlyName_grid = Secrets.GetGridFriendlyName(); + + Debug.Log("Logging to " + friendlyName_grid); GetTo_LoginScreen(); @@ -107,7 +104,6 @@ namespace Raindrop.Tests.RaindropFullIntegrationTests // 1c. do "select grid by ui" //get knwon grids var grids = instance.GridManger.Grids; - string friendlyName_grid = Secrets._gridFriendlyNames[userIdx]; yield return LoginTests.Utils.UIHelpers.Click_Dropdown_Then_Select_ByString( "GridDropdown", friendlyName_grid @@ -119,7 +115,9 @@ namespace Raindrop.Tests.RaindropFullIntegrationTests //1b. we are on the login screen. do login. assert logged in. Assert.IsTrue(uiSrv.GetPresentCanvasType() == CanvasType.Login); - yield return Login.StartLogin(Secrets.GridUsers[userIdx], Secrets.GridPass[userIdx]); + yield return Login.StartLogin( + Secrets.GetUsername(), + Secrets.GetPassword()); // Assert.True(uiSrv._loadingController.IsVisible, "expected: loading screen is visible."); yield return new WaitForSeconds(12); diff --git a/Assets/Tests/secrets.cs b/Assets/Tests/secrets.cs index 3bb36be..d3eed7a 100644 --- a/Assets/Tests/secrets.cs +++ b/Assets/Tests/secrets.cs @@ -1,34 +1,38 @@ -using System.Collections.Generic; +using System; +using UnityEngine.Assertions; namespace Tests { //store the passwords used in integration test. public static class Secrets { - // the names of the grid service, defined in the friendlyname attribute in the grids.xml file. - public static List _gridFriendlyNames = new List() + public static string GetUsername() { - "Second Life (agni)", - "Metropolis Metaversum", - "Local Host" - // "https://login.agni.lindenlab.com/cgi-bin/login.cgi", - // "login.metro.land" - }; - - // user name - public static List GridUsers = new List() + string res = + Environment.GetEnvironmentVariable("USERNAME_SECONDLIFE"); + Assert.IsTrue( + res != null, + "Env: USERNAME_SECONDLIFE undefined."); + return res; + } + + public static string GetPassword() { - "***REMOVED*** Resident", - "Raindrop Raindrop", - "Test User" - }; - - // password - public static List GridPass = new List() + string res = + Environment.GetEnvironmentVariable("PASSWORD_SECONDLIFE"); + Assert.IsTrue( + res != null, + "Env: PASSWORD_SECONDLIFE undefined."); + return res; + } + public static string GetGridFriendlyName() { - "I am a little ", - "silly to put the password ", - "into source control " - }; + string res = + Environment.GetEnvironmentVariable("GRIDFRIENDLYNAME_SECONDLIFE"); + Assert.IsTrue( + res != null, + "Env: GRIDFRIENDLYNAME_SECONDLIFE undefined."); + return res; + } } } \ No newline at end of file