testsweets
모든 테스터를 자동화 엔지니어로 만드는 노코드 테스트 자동화 도구
TestSweets 도구용 자동화 키를 생성하고 업로드할 수 있는 TestSweets용 유틸리티 패키지
아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
This package is a utility and helper package to the TestSweets product. It is the package responsible for capturing your widget keys to the database which allows us to provide the auto complete functionality when you script your test cases.
To start using the package you have to add this package to your pubspec.yaml file.
dependencies:
...
testsweets: [latest_version]
After the packages have been added we have to setup the code. TestSweets makes use of Flutter Driver to drive the test cases that we write. This means we have to enable Flutter driver for the version of the app that we build that goes through automation. Flutter driver disables certain things like the on screen keyboard. To disable completely TestSweets is as easy as passing enabled: false to setupTestSweets function.
...
void main() {
// 1. Setup the TestSweets internal dependencies
await setupTestSweets();
...
runApp(MyApp());
}
in your MaterialApp
...
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
// 2. Inside MaterialApp add TestSweetsOverlayView to the builder
// with the projectId you get when you created a new project in Testsweets app
builder: (context, child) => TestSweetsOverlayView(
projectId: '3OezzTovG9xxxxxxxxx',
child: child!,
),
// 3. Finally add TestSweetsNavigatorObserver()
// to determine what view you are on right now
navigatorObservers: [
TestSweetsNavigatorObserver.instance,
],
);
To run the app in capture mode you just start the application and capture mode will be enabled. You can swap between capture mode and drive mode tapping on the screen with 3 fingers.
Note: The view you are on is automatically captured
Note: you can tap the arrow again to close the bottomsheet and move the widget freely and it will preserve the information
https://user-images.githubusercontent.com/89080323/161919116-9d27c9d1-bf6f-47c4-86a5-18cde8e9a514.mp4
Inspecting view is the default state when you open the app.
However, if you’re Creating/Editing a widget and you want to go back to inspect mode you can tap the Clear button.
https://user-images.githubusercontent.com/89080323/161919018-c0ca2a62-c45c-4def-87ee-3809bbb926d3.mp4
If you want to adjust the position only, there is a shortcut
https://user-images.githubusercontent.com/89080323/161918909-1cd79398-f3ad-4fe2-bfe4-d0a1c713f8bd.mp4
https://user-images.githubusercontent.com/89080323/161917599-17be16bb-b2e7-4563-a528-c20845ba359a.mp4
To ensure the app is built for TestSweets to be able to drive it you you should pass --dart-define=FORCE_CAPTURE_MODE=false when building or running the app for TestSweets.
flutter build apk --debug --dart-define=FORCE_CAPTURE_MODE=false