-
Notifications
You must be signed in to change notification settings - Fork 257
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
[Docs] Provide documentation for testing with Amplify #1256
Comments
did this documentation ever get created? If so, can you point me to it? I'd like to understand how to do integration testing when using the Amplify Authenticator component and other Amplify libraries needing Auth (storage and API, in particular). Thank you. |
@94Sip no, I don't believe there are any public docs on integration or end to end testing. Are you looking to write tests that make network calls to AWS services (a full end to end test), or are you looking to stub/mock some portion to test your application logic? |
I am looking to do end-to-end testing - I am using the Authenticator UI component, and all my API calls are AWS_IAM authorization. @Jordan-Nelson |
Got it. Is there a particular challenge you are facing with the tests? One common problem with Auth is creating new users, as by default that requires sending a confirmation code either via phone or email. |
nothing in general, but I would like to see how it is done. Meaning, do I just load my app (just like all the integration test scenarios show), let Amplify configure() happen and then wait for pump and settle for the Authenticator to show the login form, and then proceed as usual? I guess just seeing some working code, or even pseudo code for this type of scenario would be helpful. Do I need to do anything so that the IAM authorization works as expected in an integration testing setup? And thank you for helping with this @Jordan-Nelson ! |
Update @Jordan-Nelson - I was able to get it to work! Its probably worth saying that I had to spend a good bit of time hunting in the Widget Explorer to figure out the widgets/types that I needed to interact with that are part of the Authenticator UI component. That was easily the hardest part. After typing in my thoughts above, I figured why not just try it out, and sure enough, it worked. Caveat: I did not create a integration test for creating new users. |
Got it. Most of the widgets in the Authenticator have specific Keys, which we use for our own widget tests. These are not part of the public API and could change in the future, but could be helpful for testing. |
yes! I looked thru Widget explored to identify those keys - i didn't realize they were documented in source, as you linked. Question @Jordan-Nelson - back to one of your previous questions: how do I integration test user signup where a confirmation code is sent by Cognito? |
@94Sip there are a couple options you could use in a testing environment. You would not want to use any of these options in a production environment.
|
Extremely helpful @Jordan-Nelson thank you! |
Context
There have been a few issues opened asking questions about testing flutter apps with Amplify (unit and integration). The amplify flutter docs currently don't offer much guidance on testing.
Request
At a minimum:
Ideally:
Related issues
The text was updated successfully, but these errors were encountered: