From 0d383d0e5afd5e7fa192f4477234f0f76eb271ee Mon Sep 17 00:00:00 2001 From: cleeding <50547620+cleeding@users.noreply.github.com> Date: Sun, 23 Mar 2025 20:54:48 +0000 Subject: [PATCH] Update BaseTest.cs Replaced --user-data-dir argument options with incognito mode --- Tests/BaseTest.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Tests/BaseTest.cs b/Tests/BaseTest.cs index 59d9b5d..b2665a0 100644 --- a/Tests/BaseTest.cs +++ b/Tests/BaseTest.cs @@ -22,15 +22,12 @@ public class BaseTest public virtual void Setup() { var options = new ChromeOptions(); - + // Common Chrome options for both local and CI environments options.AddArguments("headless", "disable-gpu", "window-size=1280x1024", "no-sandbox"); - // Conditionally add user data dir for CI environment (GitHub Actions) - if (Environment.GetEnvironmentVariable("GITHUB_ACTIONS") != null) - { - options.AddArguments($"--user-data-dir=/tmp/chrome-{Guid.NewGuid()}"); // Unique directory for CI - } + // Using Incognito mode in both local and CI environments to avoid session sharing + options.AddArguments("incognito"); _driver = new ChromeDriver(); _basePage = new BasePage(_driver);