File tree 4 files changed +48
-1
lines changed
get-started-with-modly/exp1
4 files changed +48
-1
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ pip install mobly aware
9
9
```
10
10
11
11
``` bash
12
- # linux
12
+ # install mobly
13
13
14
14
cd ~
15
15
@@ -22,6 +22,20 @@ source yen_py_env/bin/activate
22
22
pip install mobly
23
23
```
24
24
25
+
26
+ ``` bash
27
+
28
+ # install adb
29
+
30
+ sudo apt update
31
+
32
+ sudo apt install adb
33
+
34
+ # validate
35
+
36
+ adb
37
+ ```
38
+
25
39
## Cmd
26
40
27
41
``` bash
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
+
7
+ def setup_class (self ):
8
+ # Registering android_device controller module declares the test's
9
+ # dependency on Android device hardware. By default, we expect at least one
10
+ # object is created from this.
11
+ self .ads = self .register_controller (android_device )
12
+ self .dut = self .ads [0 ]
13
+ self .dut .load_sl4a () # starts sl4a.
14
+
15
+ def test_hello (self ):
16
+ self .dut .sl4a .makeToast ('Hello World!' )
17
+
18
+ if __name__ == "__main__" :
19
+ test_runner .main ()
Original file line number Diff line number Diff line change
1
+ {
2
+ "testbed" :
3
+ [
4
+ {
5
+ "_description" : " A testbed where adb will find Android devices." ,
6
+ "name" : " SampleTestBed" ,
7
+ "AndroidDevice" : " *"
8
+ }
9
+ ],
10
+ "logpath" : " /tmp/logs"
11
+ }
Original file line number Diff line number Diff line change @@ -7,8 +7,11 @@ def setup_class(self):
7
7
# Registering android_device controller module declares the test's
8
8
# dependency on Android device hardware. By default, we expect at least one
9
9
# object is created from this.
10
+ print (">>> android_device = " + str (android_device ))
10
11
self .ads = self .register_controller (android_device )
11
12
self .dut = self .ads [0 ]
13
+ print (">>> self.ads = " + str (self .ads ))
14
+ print (">>> self.dut = " + str (self .dut ))
12
15
# Start Mobly Bundled Snippets (MBS).
13
16
self .dut .load_snippet ('mbs' , android_device .MBS_PACKAGE )
14
17
You can’t perform that action at this time.
0 commit comments