File tree 4 files changed +43
-1
lines changed
android_tests/lib/android/specs/common
4 files changed +43
-1
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,9 @@ def before_first
20
20
Selenium ::WebDriver ::Remote ::Bridge . method_defined? ( :get_network_connection ) . must_equal true
21
21
Selenium ::WebDriver ::Remote ::Bridge . method_defined? ( :get_performance_data_types ) . must_equal true
22
22
Selenium ::WebDriver ::Remote ::Bridge . method_defined? ( :get_performance_data ) . must_equal true
23
+ Selenium ::WebDriver ::Remote ::Bridge . method_defined? ( :get_system_bars ) . must_equal true
24
+ Selenium ::WebDriver ::Remote ::Bridge . method_defined? ( :get_display_density ) . must_equal true
25
+ Selenium ::WebDriver ::Remote ::Bridge . method_defined? ( :is_keyboard_shown ) . must_equal true
23
26
end
24
27
25
28
t 'check all command with arg' do
Original file line number Diff line number Diff line change 23
23
Date . parse ( device_time )
24
24
end
25
25
26
+ t 'get_system_bars' do
27
+ get_system_bars
28
+ end
29
+
30
+ t 'get_display_density' do
31
+ ( get_display_density > 0 ) . must_equal true
32
+ end
33
+
34
+ t 'system_bars' do
35
+ is_keyboard_shown . must_equal false
36
+ end
37
+
26
38
t 'background_app' do
27
39
wait { background_app 5 }
28
40
end
Original file line number Diff line number Diff line change @@ -13,6 +13,9 @@ module Commands
13
13
open_notifications : [ :post , 'session/:session_id/appium/device/open_notifications' . freeze ] ,
14
14
toggle_airplane_mode : [ :post , 'session/:session_id/appium/device/toggle_airplane_mode' . freeze ] ,
15
15
current_activity : [ :get , 'session/:session_id/appium/device/current_activity' . freeze ] ,
16
+ get_system_bars : [ :get , 'session/:session_id/appium/device/system_bars' . freeze ] ,
17
+ get_display_density : [ :get , 'session/:session_id/appium/device/display_density' . freeze ] ,
18
+ is_keyboard_shown : [ :get , 'session/:session_id/appium/device/is_keyboard_shown' . freeze ] ,
16
19
get_network_connection : [ :get , 'session/:session_id/network_connection' . freeze ] ,
17
20
get_performance_data_types : [ :post , 'session/:session_id/appium/performanceData/types' . freeze ] ,
18
21
Original file line number Diff line number Diff line change @@ -23,6 +23,30 @@ module Device
23
23
24
24
# @!method current_activity
25
25
26
+ # @!method get_system_bars
27
+ # Get system bar's information
28
+ # @return [String] System bar
29
+ #
30
+ # ```ruby
31
+ # get_system_bars
32
+ # ```
33
+
34
+ # @!method get_display_density
35
+ # Get connected device's density.
36
+ # @return [Integer] The size of density
37
+ #
38
+ # ```ruby
39
+ # get_display_density # 320
40
+ # ```
41
+
42
+ # @!method is_keyboard_shown
43
+ # Get whether keyboard is displayed or not.
44
+ # @return [Bool] Return true if keyboard is shown. Return false if keyboard is hidden.
45
+ #
46
+ # ```ruby
47
+ # is_keyboard_shown # false
48
+ # ```
49
+
26
50
# @!method launch_app
27
51
# Start the simulator and application configured with desired capabilities
28
52
@@ -538,7 +562,7 @@ def ime_deactivate
538
562
# @return [String] The context currently being used.
539
563
540
564
# @!method available_contexts
541
- # @return [Array<String>] All usable contexts, as an array of strings.
565
+ # @return [Array<String>] All usable contexts, as an array of strings.
542
566
543
567
# Perform a block within the given context, then switch back to the starting context.
544
568
# @param context (String) The context to switch to for the duration of the block.
You can’t perform that action at this time.
0 commit comments