Эх сурвалжийг харах

feat: 😀自动化测试增加token自动登录

喵你个旺呀 1 жил өмнө
parent
commit
5b8f4bc61f

+ 4 - 2
Admin.NET/Admin.NET.Test/BaseTest.cs

@@ -17,10 +17,12 @@ public class BaseTest : IDisposable
     private readonly string _baseUrl = "http://localhost:8888";
     private readonly string _baseUrl = "http://localhost:8888";
     protected readonly EdgeDriver Driver = new ();
     protected readonly EdgeDriver Driver = new ();
 
 
-    protected BaseTest()
+    protected BaseTest(string token = null)
     {
     {
+        var url = _baseUrl;
+        if (!string.IsNullOrWhiteSpace(token)) url += $"/#/login?token={token}";
         Driver.Manage().Window.Maximize();
         Driver.Manage().Window.Maximize();
-        Driver.Navigate().GoToUrl(_baseUrl);
+        Driver.Navigate().GoToUrl(url);
     }
     }
 
 
     /// <summary>
     /// <summary>