Skip to content

Commit

Permalink
Merge pull request #139 from Lombiq/issue/NEST-305
Browse files Browse the repository at this point in the history
NEST-305: Making RegisterWithAsync method work with privacy policy consent
  • Loading branch information
Piedone authored Mar 4, 2022
2 parents c0a9b60 + b0c021d commit 725fedb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Lombiq.Tests.UI/Pages/OrchardCoreRegistrationPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,19 @@ public _ ShouldStayOnRegistrationPage() =>
public _ ShouldLeaveRegistrationPage() =>
PageUrl.Should.Not.StartWith(Context.BaseUrl + DefaultUrl);

public async Task<_> RegisterWithAsync(UITestContext context, UserRegistrationParameters parameters)
public async Task<_> RegisterWithAsync(
UITestContext context, UserRegistrationParameters parameters, bool checkPrivacyConsent = true)
{
UserName.Set(parameters.UserName);
Email.Set(parameters.Email);
Password.Set(parameters.Password);
ConfirmPassword.Set(parameters.ConfirmPassword);

if (PrivacyPolicyAgreement.Exists() && checkPrivacyConsent)
{
PrivacyPolicyAgreement.Click();
}

Register.Click();

await context.TriggerAfterPageChangeEventAndRefreshAtataContextAsync();
Expand Down

0 comments on commit 725fedb

Please sign in to comment.