I have been writing loads of Kotlin code currently, and with this code comes the duty of offering a high-quality and maintainable codebase. Ever since Kotlin Multiplatform aka KMP was launched to builders, I have been testing between expectations and actuality.
So go on to the sort of app I constructed lately?
So this can be a Proof of Idea that I constructed for potential shoppers and I wish to automate one thing like amazon go! You’ll be able to learn extra about it within the hyperlink right here
So the excessive degree options of this app embrace
- accuracy
- Consumer data
- Scan the shop by way of QR code : To realize entry to the shop
- Scan barcodes: So as to add gadgets to your cart
- Keep gadgets in cart by SqlDelight
- Test/Cost
What sort of check did I write right here?
- Check ViewModel working on JVM (As a result of then they will run on CI/CD pipeline)
- UI testing for fundamental software flows like login, registration, QR code scanning, and many others.
- Check API: How nicely our API integrates with Ktor and gives acceptable success/error messages.
- Integration Check: To test how nicely we combine our code with the SDK. Instance: Integration of Repository and SqlDelight.
Sneak Peak into automation exams for Compose UI
Now transfer on to the setup for the ViewModel Check
I created a delegate Kotlin to supply dummy as wanted as a result of my software will depend on excessive degree interface and never direct implementation. It is vitally simple for me to provide fakes/fashions
after which the implementation gives dummy or dummy variants for these dependencies.
For instance: LoginViewModelCheck
Within the above instance, you possibly can see that Generators come in useful throughout our testing StateFlows.
Equally, if we take a look at shared #JetpackCompose UI check setup, On this setup I’ve UI Assessments with robotic automation for every display screen.
On this setup you possibly can see how we created variations of those Robots for the display screen and use Kotlin ContextReceivers to name automation strategies.
A super robotic class would have automation strategies that can help you work together with UI components, and because the information is mock the exams will run quicker!
Nice! That is all for now In case you like this content material and wish to be taught extra you possibly can observe me on Twitter And Github DM is at all times open!
Thanks for studying ! 🏻♂️
#JetpackCompose #kotlin #Koin #Espresso #KMM #KMP
John Wick: Chapter 4 (FREE) FULLMOVIE The Super Mario Bros Movie avatar 2 Where To Watch Creed 3 Free At Home Knock at the Cabin (2023) FullMovie Where To Watch Ant-Man 3 and the Wasp: Quantumania Cocaine Bear 2023 (FullMovie) Scream 6 Full Movie