Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 4af8cf6

Browse files
author
yennj12
committed
update
1 parent 74d14e1 commit 4af8cf6

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-1
lines changed

‎mobly/README.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ adb
4040

4141
```bash
4242

43+
# https://github.com/google/mobly/blob/master/docs/tutorial.md
44+
45+
4346
#-----------------------
4447
# TEST 1
4548
#-----------------------
@@ -50,6 +53,15 @@ python3 hello_world_test.py -c sample_config.yml
5053
python3 test_1.py -c sample_config.yml
5154

5255

56+
#-----------------------
57+
# TEST 2
58+
#-----------------------
59+
60+
# should see words popup at device monitor
61+
python3 hello_world_test_2.py -c sample_config.yml
62+
63+
python3 hello_world_test_2.py -c sample_config.yml --test_case test_bye test_hello test_bye
64+
5365

5466
#-----------------------
5567
# TEST 2

‎mobly/hello_world_test_2.py‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from mobly import base_test
2+
from mobly import test_runner
3+
from mobly.controllers import android_device
4+
5+
6+
class HelloWorldTest(base_test.BaseTestClass):
7+
8+
def setup_class(self):
9+
self.ads = self.register_controller(android_device)
10+
self.dut = self.ads[0]
11+
self.dut.load_snippet('mbs', android_device.MBS_PACKAGE)
12+
13+
def test_hello(self):
14+
self.dut.mbs.makeToast('Hello World!')
15+
16+
def test_bye(self):
17+
self.dut.mbs.makeToast('Goodbye! >>>>')
18+
19+
if __name__ == '__main__':
20+
test_runner.main()

‎mobly/instrumentation_test.py‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@ class InstrumentationTest(base_instrumentation_test.BaseInstrumentationTestClass
88
def setup_class(self):
99

1010
print(">>> InstrumentationTest start")
11+
print(">>> android_device = " + str(android_device))
1112
self.dut = self.register_controller(android_device)[0]
13+
print(">>> self.dut = " + str(self.dut))
1214

1315
def test_instrumentation(self):
14-
self.run_instrumentation_test(self.dut, 'com.example.package.test')
16+
print("dummy test_instrumentation run")
17+
#self.run_instrumentation_test(self.dut, 'com.example.package.test')
18+
#self.dut.run_instrumentation_test('self.dut', android_device.MBS_PACKAGE)
1519

1620

1721
if __name__ == '__main__':

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /