File tree 3 files changed +47
-0
lines changed
3 files changed +47
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Mobly
2
+
3
+ ## Setup
4
+
5
+ ``` bash
6
+
7
+ pip install mobly
8
+ ```
9
+
10
+ ## Cmd
11
+
12
+ ``` bash
13
+
14
+ # -----------------------
15
+ # Exp 1
16
+ # -----------------------
17
+
18
+ python3 hello_world_test.py -c sample_config.yml
19
+ ```
20
+
21
+
22
+ ## Ref
23
+ - https://github.com/google/mobly/blob/master/docs/tutorial.md
Original file line number Diff line number Diff line change
1
+ from mobly import base_test
2
+ from mobly import test_runner
3
+ from mobly .controllers import android_device
4
+
5
+ class HelloWorldTest (base_test .BaseTestClass ):
6
+ def setup_class (self ):
7
+ # Registering android_device controller module declares the test's
8
+ # dependency on Android device hardware. By default, we expect at least one
9
+ # object is created from this.
10
+ self .ads = self .register_controller (android_device )
11
+ self .dut = self .ads [0 ]
12
+ # Start Mobly Bundled Snippets (MBS).
13
+ self .dut .load_snippet ('mbs' , android_device .MBS_PACKAGE )
14
+
15
+ def test_hello (self ):
16
+ self .dut .mbs .makeToast ('Hello World!' )
17
+
18
+ if __name__ == '__main__' :
19
+ test_runner .main ()
Original file line number Diff line number Diff line change
1
+ TestBeds :
2
+ # A test bed where adb will find Android devices.
3
+ - Name : SampleTestBed
4
+ Controllers :
5
+ AndroidDevice : ' *'
You can’t perform that action at this time.
0 commit comments