-
Notifications
You must be signed in to change notification settings - Fork 143
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
IOS Sign Up E2E Test #2422
IOS Sign Up E2E Test #2422
Conversation
@@ -37,6 +37,11 @@ class MSALNativeAuthEndToEndBaseTestCase: XCTestCase { | |||
static let signInEmailPasswordMFAUsernameKey = "sign_in_email_password_mfa_username" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pull request does not update CHANGELOG.md.
Please consider if this change would be noticeable to a partner or user and either update CHANGELOG.md or resolve this conversation.
Cloned PR for yuki/sign-up-e2e AI description (iteration 1)PR ClassificationNew feature PR SummaryThis pull request adds new end-to-end tests for various sign-up and sign-in scenarios, including handling custom domain formats and error conditions.
|
Cloned PR for yuki/sign-up-e2e AI description (iteration 1)PR ClassificationNew feature PR SummaryThis pull request adds new end-to-end tests for various sign-up and sign-in scenarios, including handling of email OTP, password complexity, and custom domain formats.
|
@@ -129,4 +171,15 @@ class MSALNativeAuthEndToEndBaseTestCase: XCTestCase { | |||
return Constants.clientIdEmailCodeAttributesKey | |||
} | |||
} | |||
|
|||
private func getCustomTenantSubdomain(tenantName: String, tenantId: String, format: AuthorityURLFormat) -> String { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please call this method getAuthotityURLString
? It seems more accurate.
private func getCustomTenantSubdomain(tenantName: String, tenantId: String, format: AuthorityURLFormat) -> String { | |
private func getAuthotityURLString(tenantSubdomain: String, tenantId: String, format: AuthorityURLFormat) -> String { |
And could you please use tenantSubdomain
instead of tenantName
. They are two different properties
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -125,4 +125,130 @@ final class MSALNativeAuthSignInUsernameEndToEndTests: MSALNativeAuthEndToEndBas | |||
XCTAssertNotNil(signInVerifyCodeDelegateSpy.result?.idToken) | |||
XCTAssertEqual(signInVerifyCodeDelegateSpy.result?.account.username, username) | |||
} | |||
|
|||
// Sign In - Verify Custom URL Domain - "https://<tenantName>.ciamlogin.com/<tenantName>.onmicrosoft.com" | |||
func test_signInCustomDomain1InSuccess() async throws { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please include the name of the authority URL format in use instead of a number? Same comment applies for other tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
||
// Verify error condition | ||
XCTAssertTrue(signUpStartDelegate.onSignUpPasswordErrorCalled) | ||
XCTAssertEqual(signUpStartDelegate.error!.isInvalidUsername, true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to never use !
to force unwrap an optional. This can cause a crash and stop the execution of all tests
XCTAssertEqual(signUpStartDelegate.error!.isInvalidUsername, true) | |
XCTAssertEqual(signUpStartDelegate.error?.isInvalidUsername, true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Done and modify and check all the sign up cases. error!.isBrowserRequired
needs to use ! instead of ?. The others use ?.
|
||
// Verify error condition | ||
XCTAssertTrue(signUpStartDelegate.onSignUpPasswordErrorCalled) | ||
XCTAssertEqual(signUpStartDelegate.error!.isInvalidUsername, true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
XCTAssertEqual(signUpStartDelegate.error!.isInvalidUsername, true) | |
XCTAssertEqual(signUpStartDelegate.error?.isInvalidUsername, true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
// Verify error condition | ||
XCTAssertTrue(signUpStartDelegate.onSignUpPasswordErrorCalled) | ||
XCTAssertEqual(signUpStartDelegate.error!.isInvalidPassword, true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
XCTAssertEqual(signUpStartDelegate.error!.isInvalidPassword, true) | |
XCTAssertEqual(signUpStartDelegate.error?.isInvalidPassword, true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
||
// Verify error condition | ||
XCTAssertTrue(signUpStartDelegate.onSignUpErrorCalled) | ||
XCTAssertEqual(signUpStartDelegate.error!.isUserAlreadyExists, true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
XCTAssertEqual(signUpStartDelegate.error!.isUserAlreadyExists, true) | |
XCTAssertEqual(signUpStartDelegate.error?.isUserAlreadyExists, true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
||
// Verify error condition | ||
XCTAssertTrue(signUpStartDelegate.onSignUpPasswordErrorCalled) | ||
XCTAssertEqual(signUpStartDelegate.error!.isInvalidUsername, true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
XCTAssertEqual(signUpStartDelegate.error!.isInvalidUsername, true) | |
XCTAssertEqual(signUpStartDelegate.error?.isInvalidUsername, true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
||
// Verify error condition | ||
XCTAssertTrue(signUpStartDelegate.onSignUpPasswordErrorCalled) | ||
XCTAssertEqual(signUpStartDelegate.error!.isInvalidUsername, true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
XCTAssertEqual(signUpStartDelegate.error!.isInvalidUsername, true) | |
XCTAssertEqual(signUpStartDelegate.error?.isInvalidUsername, true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
||
// Sign In - Verify Custom URL Domain - "https://<tenantName>.ciamlogin.com/<tenantName>.onmicrosoft.com" | ||
func test_signInCustomDomain1InSuccess() async throws { | ||
guard let sut = initialisePublicClientApplication(clientIdType: .code, customAuthorityURLFormat: AuthorityURLFormat.tenantSubdomainLongVersion), let username = retrieveUsernameForSignInCode() else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: you can avoid specifying the Enum name here :)
guard let sut = initialisePublicClientApplication(clientIdType: .code, customAuthorityURLFormat: AuthorityURLFormat.tenantSubdomainLongVersion), let username = retrieveUsernameForSignInCode() else { | |
guard let sut = initialisePublicClientApplication(clientIdType: .code, customAuthorityURLFormat: .tenantSubdomainLongVersion), let username = retrieveUsernameForSignInCode() else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
} | ||
|
||
// Hero Scenario 2.1.11. Sign up – Server requires password authentication, which is supported by the developer | ||
// The same as 1.1.4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it is the same as the 1.1.4 why we're duplicating this test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Repeat confirmation on the duplication. I will remove the test case but keep the comment for future tracking.
Cloned PR for yuki/sign-up-e2e AI description (iteration 1)PR ClassificationNew feature PR SummaryThis pull request adds new end-to-end tests for various sign-up and sign-in scenarios in the MSAL Native Auth module.
|
Cloned PR for yuki/sign-up-e2e AI description (iteration 1)PR ClassificationNew feature PR SummaryThis pull request adds new end-to-end test cases for sign-up and sign-in functionalities, including various edge cases and custom URL domain verifications.
|
…by the Kevault component
Cloned PR for yuki/sign-up-e2e AI description (iteration 1)PR ClassificationNew feature PR SummaryThis pull request adds new end-to-end tests for various sign-up and sign-in scenarios, including handling of custom URL domains and error conditions.
|
Cloned PR for yuki/sign-up-e2e AI description (iteration 1)PR ClassificationNew feature PR SummaryThis pull request adds new end-to-end tests for various sign-up and sign-in scenarios, including handling of email OTP, password complexity, and custom URL domains.
|
Cloned PR for yuki/sign-up-e2e AI description (iteration 1)PR ClassificationNew feature PR SummaryThis pull request adds new end-to-end tests for various sign-up and sign-in scenarios, including handling of email OTP, password complexity, and custom URL domains.
AI description (iteration 1)PR ClassificationNew feature PR SummaryThis pull request adds new end-to-end tests for various sign-up and sign-in scenarios, including handling of email OTP, password complexity, and custom URL domains.
|
1 similar comment
Cloned PR for yuki/sign-up-e2e AI description (iteration 1)PR ClassificationNew feature PR SummaryThis pull request adds new end-to-end tests for various sign-up and sign-in scenarios, including handling of email OTP, password complexity, and custom URL domains.
AI description (iteration 1)PR ClassificationNew feature PR SummaryThis pull request adds new end-to-end tests for various sign-up and sign-in scenarios, including handling of email OTP, password complexity, and custom URL domains.
|
…tion-library-for-objc into yuki/sign-up-e2e
Cloned PR for yuki/sign-up-e2e AI description (iteration 1)PR ClassificationNew feature PR SummaryThis pull request adds new end-to-end tests for various sign-up and sign-in scenarios, including handling custom URL domains and error conditions.
|
…tion-library-for-objc into yuki/sign-up-e2e
Cloned PR for yuki/sign-up-e2e AI description (iteration 1)PR ClassificationNew feature PR SummaryThis pull request adds new end-to-end tests for various sign-up and sign-in scenarios, including handling of email OTP, password complexity, and custom URL domains.
|
Proposed changes
2.1.11 - test_signUpWithCode_withPasswordConfiguration_succeeds()
1.1.10 - test_signUpWithEmailPassword_andAgainSameEmail_fails()
1.1.11 - test_signUpWithEmailPassword_socialAccount_fails() - environment not ready
1.1.12 - test_signUpWithEmailPassword_invalidEmail_fails
1.1.13 - test_signUpWithEmailPassword_invalidPassword_fails
1.1.2 - test_signUpWithEmailPassword_resendEmail_success
1.1.5 - test_signUpWithEmailOTP_andSetPasswordAfterOTP_success
2.1.5 - test_signUpWithEmailOTP_resendEmail_success
2.1.6 - test_signUpWithEmailOTP_andExistingAccount
2.1.7 - test_signUpWithEmailPassword_socialAccount_fails - environment not ready
2.1.8 - test_signUpWithEmailPassword_invalidEmailFormat_fails
Web fallback test to automate:
Verify Custom URL Domain - Sign In
test_signInCustomDomain1InSuccess
test_signInCustomDomain2InSuccess
test_signInCustomDomain3InSuccess
Type of change
Risk