Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow bypassing/streamlining of login using browser profiles #87

Merged
merged 41 commits into from
Jun 24, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
fecaac5
Inital logic commit to enable use of Chrome Profiles
Jun 15, 2021
578f047
Refactored work to apply to both Firefox & Chrome. Added Workaround f…
Jun 15, 2021
5851084
Tidied up and added switch to disable/enable the use of profiles
Jun 15, 2021
19f79c6
Reverted project version used in testing
Jun 15, 2021
e135286
Updated method name to not specifically refer to chrome
Jun 15, 2021
83d052c
Fixed a few naming &formatting issues
Jun 15, 2021
7aa4ce6
Updated inline with review comments
Jun 16, 2021
2772a08
Refactored custom login logic
Jun 16, 2021
836e0f1
Tweaked connection string
Jun 16, 2021
c28fa91
Removed debugging steps
Jun 16, 2021
28a52a9
Reworked the setting of userProfileDirectories
Jun 16, 2021
f116ad5
Removed logging
Jun 16, 2021
5b61846
Removed WaitForTransaction calls
Jun 16, 2021
26669ed
Updated readme
Jun 16, 2021
d94c733
Added logic to create a copy of the chrome profile for each test - WIP
Jun 18, 2021
84acbb1
Updated to reduce the length of the profile file paths
Jun 18, 2021
36a450c
Added hook to cleanup used profiles
Jun 18, 2021
7c252ba
Switched to use the default dir for profiles when building in ADO
Jun 18, 2021
d87365b
Fixed issue where variable wasn't set
Jun 18, 2021
4029d54
Added polly to retry the folder delete - as no way to tell when the d…
Jun 18, 2021
9c604fe
Updated after scenario hooks to handle errors
Jun 21, 2021
9da076c
Updated to use events rather than run order
Jun 21, 2021
4f03282
Updated to give up deleting profile folder after 4 attempts
Jun 21, 2021
cb6739a
Disabled the use of profiles - testing ADO pipeline
Jun 21, 2021
be67e0f
fix: multi-threading issues
ewingjm Jun 22, 2021
deb1939
Fixed errors when running tests locally
Jun 22, 2021
ab44036
Fixed issue with config file
Jun 22, 2021
6870368
fix: issue with locking and getting environment variables
Jun 22, 2021
b641940
fix: issues deleting profile directories
ewingjm Jun 22, 2021
27ef9ee
fix: condition for deleting profile directory
ewingjm Jun 22, 2021
eb8bacb
fix: errors copying and deleting profile directories
ewingjm Jun 22, 2021
b6c7296
ci: fix issues copying to new profile folder
ewingjm Jun 23, 2021
4786d4b
fix: force headless during profile setup
Jun 23, 2021
de7cf9b
fix: remove unnecessary lock
ewingjm Jun 23, 2021
229cbb9
Merge branch 'AB/bypass-login' of https://github.com/bancey/powerapps…
ewingjm Jun 23, 2021
c73ede7
fix: reported code smell
Jun 23, 2021
64b3e62
Resolved build issue
Jun 23, 2021
d789047
fix: issues disposing driver
ewingjm Jun 23, 2021
8ee2af8
ci: ignore test failing due to EasyRepro issue
ewingjm Jun 23, 2021
7571a41
docs: fix Markdown linting issues in README
ewingjm Jun 24, 2021
7ac87f6
fix: creates user profile for users without passwords
ewingjm Jun 24, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: issue with locking and getting environment variables
  • Loading branch information
Alex Bance committed Jun 22, 2021
commit 68703689fbf888b958906c0d3f035d1910887a90
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ public static class ConfigHelper
/// <returns>The environment variable value (if found) or the passed in value.</returns>
public static string GetEnvironmentVariableIfExists(string value)
{
if (string.IsNullOrEmpty(value))
{
return value;
}

var environmentVariableValue = Environment.GetEnvironmentVariable(value);

if (!string.IsNullOrEmpty(environmentVariableValue))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public abstract class PowerAppsStepDefiner
private static XrmApp xrmApp;

private static IDictionary<string, string> userProfilesDirectories;
private static object userProfilesDirectoriesLock = new object();

/// <summary>
/// Gets access token used to authenticate as the application user configured for testing.
Expand Down Expand Up @@ -176,14 +177,9 @@ protected static IDictionary<string, string> UserProfileDirectories
throw new NotSupportedException($"The {testConfig.BrowserOptions.BrowserType} does not support profiles.");
}

if (userProfilesDirectories == null)
lock (userProfilesDirectoriesLock)
{
userProfilesDirectories = new Dictionary<string, string>();
}

lock (userProfilesDirectories)
{
if (userProfilesDirectories.Any())
if (userProfilesDirectories != null)
{
return userProfilesDirectories;
}
Expand Down