fastlane-plugin-automated_test_emulator_run 0.4.1 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 48db1d581d99500b8b3face8530cf4ee36a022c7
4
- data.tar.gz: 555f51d862155fcccb8b326d8d60391338bb5140
3
+ metadata.gz: 2c49d491f28e505ad740a99349488e8ac46aa43f
4
+ data.tar.gz: 6ab230db3d006054f62e3b948165bc9b2ebbe869
5
5
  SHA512:
6
- metadata.gz: 0d0cca502c9cb0bfcd25a7a7b0c6682df8ad86d0a651cfb49e8ae7b0bb3959cb7829960ca5d5c891cc8c576fd76aea2f86f45e070afc053eb0021bb171c12adc
7
- data.tar.gz: f073f79618f46267ce730825ff78411fa8123c438ad90208734bf4a71556e96244accbc4b2d6bc28267aeacc6d2580c13ee3c02adf82bea132e8cac104eea428
6
+ metadata.gz: 3791a996f5e14d2820a1508d8ba5fb88d5c38bdb52398f99e74182e07f0c7fd7e2e34a7609282b9ce1a90de3d15c69596142e9ba2f16cd42515db9500f03ef07
7
+ data.tar.gz: 99c2c583ec1863a6d9d8d4711d03486bbc2cedffc7dcc894a024d992421fd3a86a19d8cb1fcd466b5e8c30e984a5c7502a57cbcce2be20b169392dbf36165a5e
@@ -7,7 +7,6 @@ module Fastlane
7
7
  end
8
8
 
9
9
  class AutomatedTestEmulatorRunAction < Action
10
- emulatorStarted = false
11
10
 
12
11
  def self.run(params)
13
12
  gradle = Helper::GradleHelper.new(gradle_path: Dir["./gradlew"].last)
@@ -71,9 +70,11 @@ module Fastlane
71
70
 
72
71
  # Starting AVD
73
72
  UI.message("Starting AVD....".yellow)
73
+
74
+ emulatorStarted = false
74
75
  begin
75
76
  Action.sh(start_avd_command)
76
- waitFor_emulatorBoot(sdkRoot, port, params)
77
+ emulatorStarted = waitFor_emulatorBoot(sdkRoot, port, params)
77
78
 
78
79
  UI.message("Starting tests".green)
79
80
  begin
@@ -86,8 +87,9 @@ module Fastlane
86
87
  UI.message("Using gradle task".green)
87
88
  gradle.trigger(task: params[:gradle_task], flags: params[:gradle_flags], serial: nil)
88
89
  end
90
+
89
91
  ensure
90
- waitFor_emulatorStop(sdkRoot, port, params, file)
92
+ waitFor_emulatorStop(sdkRoot, port, params, file, emulatorStarted)
91
93
  end
92
94
  ensure
93
95
  file.close
@@ -126,20 +128,19 @@ module Fastlane
126
128
 
127
129
  if (currentTime - startTime) >= timeoutInSeconds
128
130
  UI.message("Emulator loading took more than 2 minutes and 30 seconds. Not waiting anymore and trying to run with devices only!".yellow)
129
- break
131
+ return false
130
132
  end
131
133
 
132
134
  if stdout.strip == "1"
133
- emulatorStarted = true
134
135
  UI.message("Emulator Booted!".green)
135
- break
136
+ return true
136
137
  end
137
138
  end
138
139
  end
139
140
  end
140
141
 
141
- def self.waitFor_emulatorStop(sdkRoot, port, params, file)
142
- if emulatorStarted
142
+ def self.waitFor_emulatorStop(sdkRoot, port, params, file, emulatorStarted)
143
+ if emulatorStarted == true
143
144
  adb = Helper::AdbHelper.new(adb_path: sdkRoot + "/platform-tools/adb")
144
145
  temp = File.open(file.path).read
145
146
 
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module AutomatedTestEmulatorRun
3
- VERSION = "0.4.1"
3
+ VERSION = "0.4.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-automated_test_emulator_run
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kamil Krzyk