-
Notifications
You must be signed in to change notification settings - Fork 142
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
Update E2E tests for sign-up with password to use lab tenant #2261
Conversation
...on/native_auth/end_to_end/sign_up/MSALNativeAuthSignUpUsernameAndPasswordEndToEndTests.swift
Outdated
Show resolved
Hide resolved
f735aec
to
93fbf3e
Compare
...on/native_auth/end_to_end/sign_up/MSALNativeAuthSignUpUsernameAndPasswordEndToEndTests.swift
Show resolved
Hide resolved
|
||
let username = generateSignUpRandomEmail() | ||
let attributes = [ | ||
"city": "Dublin", |
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 we move these attributes key in a constant class? So, we can reuse them across multiple test classes without repetition.
Could you call the variables with a generic name? Something like "attribute1".
So, if we want to change the attributes, we can just change the Constant class
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 idea, I have created an AttributesStub
class
guard let sut = initialisePublicClientApplication() else { | ||
guard | ||
let sut = initialisePublicClientApplication(clientIdType: .passwordAndAttributes), | ||
let password = await retrievePasswordForSignInUsername() |
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.
instead of retrieving the signIn password, can you just generate a random valid password? There is no need to access the key vault for those 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.
Thanks, it makes a lot of sense. I've created a generateRandomPassword()
function in MSALNativeAuthEndToEndBaseTestCase
with the SSPR's technique to generate random passwords.
In this way it can also be used by the SSPR code.
...on/native_auth/end_to_end/sign_up/MSALNativeAuthSignUpUsernameAndPasswordEndToEndTests.swift
Outdated
Show resolved
Hide resolved
...on/native_auth/end_to_end/sign_up/MSALNativeAuthSignUpUsernameAndPasswordEndToEndTests.swift
Outdated
Show resolved
Hide resolved
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.
Should this be under the "end_to_end" folder?
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.
Yes, my bad.
I've created a new folder called "mocks" under end_to_end, so we follow the same pattern as the unit tests (all the mocks + stubs are in the "mocks" folder)
private let attributes = ["age": 40] | ||
|
||
// Hero Scenario 2.1.1. Sign up - with Email verification as LAST step (Email & Password) | ||
final class MSALNativeAuthSignUpUsernameAndPasswordEndToEndTests: MSALNativeAuthEndToEndPasswordTestCase { |
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.
Does this class still need to extend MSALNativeAuthEndToEndPasswordTestCase
and not MSALNativeAuthEndToEndBaseTestCase.swift
?
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
8d238bb
to
433893f
Compare
* updating automation test to use msidlabciam6 * updating identity core * remove logging comment * updating common core * update commoncore code in MSAL * updating common core * - Converted SSPR E2E tests to use labs tenant * - Converted sign up + username with attributes tests to use labs tenant - Adjusted tests description to follow acceptance criteria doc * - Adjusted test description to match acceptance criteria doc - Adjusted error message to keep consistency with other tests * - Comments pointing to correct items in acceptance criteria doc - Adjusted initial sign up call * - Removed unused code. * Update E2E tests for sign-up with password to use lab tenant (#2261) * Update E2E test for sign-up with password * Clean up comments * PR code review. Add Attributes stub * Stop the execution of the test if any delegate does not get called. * PR code review * - Using attributes stub * - Added extra verification and early finish for tests - Using random password generator from base test class * - Updated submodule * - Updated submodule * Update E2E tests for sign-in with code to use lab tenant (#2272) * - Tidy up * Update submodule to dev common core * [macOS SDK] Update macOS minimum version to 10.15 (#2220) * Increased minimum macOS version to 10.15 * Removed all instances of if (@available(macOS 10.15, *)) * Updated CHANGELOG.md * Corrected version * Removed all API_AVAILABLE that were always satisfied Removed all if (@available) that were always satisfied * Reverted to dev IdentityCore * New IdentityCore * New Idenitycore * Updated IdenityCore to correct version * PR comments * Latest IdentityCore * Updated IdentityCore * Using dev branch after merge * Merge 1.4.2 back to dev (#2289) * update versions and change log * update common core after merging to main * updating cc * Add Native Auth E2E tests to CI. Skip Native Auth E2E tests in pr-validation if label is present (#2274) * Add MSAL Native Auth E2E tests to the pr-validation.yml script * Add condition to skip the NativeAuth E2E tests if label skip-native-auth-e2e-tests is included in the PR * Add MSAL Native Auth E2E tests to the automation.yml script * update code owner file. Add swiftlint to native auth team ownership (#2304) * Changed Link-Time Optimization for macOS to Incremental to prevent build artifacts (#2305) * [macOS SDK] Add Native Auth features to the macOS framework (#2216) * Latest commit * Reverted discarded files * Adding missing unit tests * Sort out warning around Swift 4.0 Fixced pob lint for extension * Changed link-time optimization to Incremental * Removed version from automation scrip as it's now present in MSAL.podspec (#2309) * [macOS SDK] Add Native Auth E2E and Integration tests for macOS (#2250) * MacOS changes to the project * unit tests * Added missing files to Mac Target * Removed unit tests that don't work * Merge dev into branch * Add flag to fix modules and unit tests * Last IC * Swift to dev IC * Add CacheAccessor for macOS for unit tests * fix compilation error integration tests * Set correctly URL for mock API when running end to end tests * use same XCAssert command * Update integration tests, do not skip tests anymore * add new schema dedicated to E2E tests. Move E2E tests from integration to new target * remove empty tests * copy conf json file and add new test to check that file is loaded correctly * retrieve OTP code from email using 1secmail * Read info from conf.json file * generate random email address * Cocoapod * Pointing IdenityCore to spetrescu/macos-version-increase * Updated modulemap * Latest IC * enable first signUp email-code signUp test * disable not runnable signup tests and fix one test * remove not E2E tests, move password tests to dedicated class * update input and output to build script to remove warning * add settings to retry tests on failure, enable all possible tests * remove not needed log in script * update pr validation and nightly build to include E2E tests for native auth * delete jobs redeclaration * update schema name * update target name * Increased minimum macOS version to 10.15 * Create new schema dedicated to E2E tests * execute new schema for E2E tests * set new name for xctestrun file * Removed all instances of if (@available(macOS 10.15, *)) * link conf.json file to target * not run E2E tests in parallel * test new file from secure files * Updated CHANGELOG.md * Corrected version * Run E2E tests in PR validation * fix pr-validation.yml script * update script * move tests execution with conf json to a template * add jobs definition in template * try creating a variables * use template only for steps and not job * fix template file reference * remove not needed comma * set schema name correctly * typo * run E2E tests using template * use id instead of date string to sort emails, refactor email parser * Removed commented file from modulemap Changed how test is split between iOS and macOS * fail the test if conf file can not be serialized * add enum for clientId key, add more log in code retriever, generate email in codeRetriever class * remove clientId type specification * remove changes from build script * remove spaces * Ownership for new testplan and target to MSAL NativeAuth team * Removed all API_AVAILABLE that were always satisfied Removed all if (@available) that were always satisfied * Reverted to dev IdentityCore * add missing owner to file * declare pool for each job * Created E2E and Integration Target tests for macOS * Test plans * Fixed E2E macOS script * Correct test plans * Latest version of IdentityCore * New tests * Run in PR validation * New IdentityCore * Last IdentityCore * Correct IdentityCore * Correct IdentityCore * Added to automation also * Changed job name * Updated for mac * Updated folders * Fix iOS pipeline * Updated xctestrun name for Mac * Changed to arm * Fixed for current pipeline * MacOS version for xctest Changed path for script * Trying new setup * Changed how path gets created * Fixed path * Quotes fix * Changed from moving to copying the file * Add conf.json to target * Update changelog * Updated changelog * Added check for macOS * Added comment to explain why the check happens * PR Comments * Update to mv * Testing with default target path * New Idenitycore * Point to proper IdentityCore * Pointing to correct IdentityCore * Updated IdenityCore to correct version * Updated IdentityCore to correct version * PR comments * Latest IdentityCore * Latest IdentityCore * PR comments, removed null * PR comments, reverted team * Moved script to automation.yml * Updated path * Updated sdk * Corrected path * Set correct scheme * Updated IdentityCore * Latest identityCore * Latest IdentityCore * Updated IdentityCore * Using dev branch after merge * Correct Identity Core * Added keychain access for macOS app Reverted yml file to previous * Update IdentityCore after merge * Latest IC * Reverted change to artifactName * Latest commit * Reverted discarded files * Adding missing unit tests * Sort out warning around Swift 4.0 Fixced pob lint for extension * Changed link-time optimization to Incremental * Latest IdentityCore * Add macOS e2e tests to PR validation and Pipeline * Properly escaped ( character in build.py * Removed xcpretty temporarly * Skipping code signature for macOS * Transformed else if into if * Fixed indetation * Corrected platform name * Added spacing * Added command after report * Reverted order, added xcpretty back * Log full path Fixed warnings * Setting full path to fixed version * Removed condition temporarly * Modified pr validation also * Added logging * Reverted echo, added additional flags * Logging with flags * Added flags to PR validation also * Modify to - * Set codesign to Apple Developer * Fixed synatx * Changed codesign * Trying with Apple development * Revert bundle name change * Added correct bundle back * Removed not needed entitlements Skipped test that requires cache * Removed unit-test-host-mac.entitlements * Reverted code sign * Reverted build.py * Removed flags from tests-with-conf-file Added condition for macOS back * Temp remove depends on check * Added conditions back * Moved e2e plans Fixed TOOD typo --------- Co-authored-by: Danilo Raspa <daniloraspa@microsoft.com> * Merge latest changes from main to dev (#2314) * update versions and change log * update common core after merging to main * Updating MSAL framework checksum & url for 1.4.2 [skip ci] * Updated codeowners file * Added package.swift to MSAL CIAM team also --------- Co-authored-by: Veena Soman <veenasoman@microsoft.com> * Changed files for release 1.5.0 * Merging main into release 1.5.0 (#2316) * update versions and change log * update common core after merging to main * Updating MSAL framework checksum & url for 1.4.2 [skip ci] --------- Co-authored-by: Veena Soman <veenasoman@microsoft.com> * Latest idenittycore --------- Co-authored-by: Fidelia Nawar <fidelia.m589@gmail.com> Co-authored-by: Marcos Borges <marcosborges@microsoft.com> Co-authored-by: Diego Jerez <109726904+diegojerezba@users.noreply.github.com> Co-authored-by: Marcos Borges <116104275+borgesmb@users.noreply.github.com> Co-authored-by: Swasti Gupta <swagup@microsoft.com> Co-authored-by: Swasti Gupta <swastinitb@gmail.com> Co-authored-by: Veena Soman <veenasoman@microsoft.com> Co-authored-by: Fidelia Nawar <89487029+fidelianawar@users.noreply.github.com> Co-authored-by: Danilo Raspa <105228698+nilo-ms@users.noreply.github.com> Co-authored-by: Danilo Raspa <daniloraspa@microsoft.com>
Proposed changes
Tasks:
The above tasks have been done in the following tests:
The following test has been removed due to be duplicated:
Type of change
Risk