Skip to content

Commit a135dd8

Browse files
author
yennj12
committed
add
1 parent beb1fcf commit a135dd8

File tree

4 files changed

+48
-1
lines changed

4 files changed

+48
-1
lines changed

mobly/README.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pip install mobly aware
99
```
1010

1111
```bash
12-
# linux
12+
# install mobly
1313

1414
cd ~
1515

@@ -22,6 +22,20 @@ source yen_py_env/bin/activate
2222
pip install mobly
2323
```
2424

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+
2539
## Cmd
2640

2741
```bash
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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 numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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+
}

mobly/hello_world_test.py

+3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ def setup_class(self):
77
# Registering android_device controller module declares the test's
88
# dependency on Android device hardware. By default, we expect at least one
99
# object is created from this.
10+
print(">>> android_device = " + str(android_device))
1011
self.ads = self.register_controller(android_device)
1112
self.dut = self.ads[0]
13+
print(">>> self.ads = " + str(self.ads))
14+
print(">>> self.dut = " + str(self.dut))
1215
# Start Mobly Bundled Snippets (MBS).
1316
self.dut.load_snippet('mbs', android_device.MBS_PACKAGE)
1417

0 commit comments

Comments
 (0)