fastlane-plugin-lambdatest 0.1.3 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 762e42e58d0941317c807e6c068f0d6bcc9bba655117738c283b692b1007f58f
4
- data.tar.gz: 9abb3399bdee2887fd3b3fba2368357e7db2e6ae28ce8a885ae276d666e2bdfc
3
+ metadata.gz: f9cd7ca178c79331ec23fa7e000a64945577cb9a899e11ee0e48266c671b5afe
4
+ data.tar.gz: dcb3040feafc253227d43da92ea3476db117805c3b90c4c0356a991fb5f2f164
5
5
  SHA512:
6
- metadata.gz: 5879b51084d28e251aa6e88bd935359d123adb68c1140dc4eb73c4f32d1a3c990f2f8e1c51754a64599ff34badf0a6d43ae592445baa0f88c8bed58767eb3b59
7
- data.tar.gz: 808dc966ffdfdc11d220aca6786567f9c7caae6f12344922924aae9f97d9c3829b8dc94d2b5468d984e4d2f47dfa000d93168d10b817e9504ba06f53111b6062
6
+ metadata.gz: fe58dcb0ca287018563a692ae5581a4200dc871a916bfdc608df1904dcfe68796a5f96177b1d440b1ce8104ea59086649bd7830ec34f2f574d6f369ff090bc02
7
+ data.tar.gz: bf519cba62ed920c4d0157e97f44625f055f3890c6d9cdb9cca738cd762e0435494a512b926f16a84b6b99b77cf265294a659bf8fc0290ba5d90c6acd38b33b7
data/README.md CHANGED
@@ -22,15 +22,18 @@ upload_to_lambdatest(
22
22
  file_path: "app_file_path"
23
23
  )
24
24
  ```
25
- OR you can also use custom_id
26
- ```
27
- upload_to_lambdatest(
28
- lt_username: ENV["LT_USERNAME"],
29
- lt_access_key: ENV["LT_ACCESS_KEY"],
30
- file_path: "app_file_path",
31
- custom_id:"984792"
32
- )
33
- ```
25
+
26
+ ### Options
27
+
28
+ | Option | Description | Required | Default Value |
29
+ |---------------------|------------------------------------|----------|----------------
30
+ | `lt_username` | LambdaTest username (from ENV) | ✅ Yes | N/A |
31
+ | `lt_access_key` | LambdaTest access key (from ENV) | ✅ Yes | N/A |
32
+ | `file_path` | Path to the app file | ✅ Yes | N/A |
33
+ | `app_name` | App Name | ❌ No | "app" |
34
+ | `visibility` | Visibility | ❌ No | "individual" |
35
+ | `is_real_device` | Real Device or Virual Device | ❌ No | true |
36
+
34
37
 
35
38
  Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane test`.
36
39
 
@@ -9,7 +9,6 @@ module Fastlane
9
9
  end
10
10
  class UploadToLambdatestAction < Action
11
11
 
12
- API_ENDPOINT = "https://manual-api.lambdatest.com/app/upload/realDevice"
13
12
  SUPPORTED_EXTENSIONS = ["apk", "ipa", "aab"]
14
13
 
15
14
  def self.run(params)
@@ -17,12 +16,17 @@ module Fastlane
17
16
  lt_access_key = params[:lt_access_key] # Required
18
17
  file_path = params[:file_path].to_s # Required
19
18
  custom_id = params[:custom_id] # Optional
19
+ app_name = params[:app_name] #Optional
20
+ visibility = params[:visibility] #Optional
21
+ is_real_device = params[:is_real_device] #Optional
20
22
 
21
- validate_file_path(file_path)
23
+ api_endpoint = self.get_api_endpoint(is_real_device)
24
+
25
+ self.validate_file_path(file_path)
22
26
 
23
27
  UI.message("Started Uploading app to Lambdatest...")
24
28
 
25
- lt_app_url = Helper::LambdatestHelper.upload_file(lt_username, lt_access_key, file_path, API_ENDPOINT,custom_id)
29
+ lt_app_url = Helper::LambdatestHelper.upload_file(lt_username, lt_access_key, file_path, api_endpoint, custom_id, app_name, visibility)
26
30
 
27
31
  # Set 'APP_URL' environment variable, if app upload was successful.
28
32
  ENV['APP_URL'] = lt_app_url
@@ -36,6 +40,14 @@ module Fastlane
36
40
  Actions.lane_context[SharedValues::APP_URL] = lt_app_url
37
41
  end
38
42
 
43
+ def self.get_api_endpoint(is_real_device)
44
+ if is_real_device
45
+ "https://manual-api.lambdatest.com/app/upload/realDevice"
46
+ else
47
+ "https://manual-api.lambdatest.com/app/upload/virtualDevice"
48
+ end
49
+ end
50
+
39
51
  # Validating file_path and extension.
40
52
  def self.validate_file_path(file_path)
41
53
  UI.user_error!("file not found at '#{file_path}' ❌ .") unless File.exist?(file_path)
@@ -85,14 +97,31 @@ module Fastlane
85
97
  UI.user_error!("No lt_access_key given.") if value.to_s.empty?
86
98
  end),
87
99
  FastlaneCore::ConfigItem.new(key: :file_path,
88
- description: "app file path",
100
+ description: "App file path",
89
101
  optional: true,
90
102
  is_string: true,
91
103
  default_value: default_file_path),
92
104
  FastlaneCore::ConfigItem.new(key: :custom_id,
93
105
  description: "Custom ID",
94
106
  optional: true,
95
- is_string: false)
107
+ is_string: false,
108
+ default_value: nil),
109
+ FastlaneCore::ConfigItem.new(key: :app_name,
110
+ description: "App name",
111
+ optional: true,
112
+ is_string: true,
113
+ default_value: "app"),
114
+ FastlaneCore::ConfigItem.new(key: :visibility,
115
+ description: "Visibility",
116
+ optional: true,
117
+ is_string: true,
118
+ default_value: "individual"),
119
+ FastlaneCore::ConfigItem.new(key: :is_real_device,
120
+ description: "Real Device or Virtual Device",
121
+ optional: true,
122
+ is_string: false,
123
+ default_value: true,
124
+ type: Boolean)
96
125
  ]
97
126
  end
98
127
 
@@ -112,7 +141,16 @@ module Fastlane
112
141
  'upload_to_lambdatest(
113
142
  lt_username: ENV["LT_USERNAME"],
114
143
  lt_access_key: ENV["LT_ACCESS_KEY"],
115
- file_path: "path_to_app_file"
144
+ file_path: "path_to_app_file",
145
+ app_name: "android_app"
146
+ )',
147
+ 'upload_to_lambdatest(
148
+ lt_username: ENV["LT_USERNAME"],
149
+ lt_access_key: ENV["LT_ACCESS_KEY"],
150
+ file_path: "path_to_app_file",
151
+ app_name: "android_app",
152
+ visibility: "team",
153
+ is_real_device: true
116
154
  )'
117
155
  ]
118
156
  end
@@ -20,10 +20,11 @@ module Fastlane
20
20
  # +custom_id+:: Custom id for app upload.
21
21
  # +file_path+:: Path to the file to be uploaded.
22
22
  # +url+:: Lambdatest's app upload endpoint.
23
- def self.upload_file(lt_username, lt_access_key, file_path, url, custom_id = nil)
23
+ def self.upload_file(lt_username, lt_access_key, file_path, url, custom_id,app_name, visibility)
24
24
  payload = {
25
- name: "app",
26
- appFile: File.new(file_path, 'rb')
25
+ name: app_name,
26
+ appFile: File.new(file_path, 'rb'),
27
+ visibility: visibility
27
28
  }
28
29
 
29
30
  unless custom_id.nil?
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Lambdatest
3
- VERSION = "0.1.3"
3
+ VERSION = "0.1.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-lambdatest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - LambdaTest
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-17 00:00:00.000000000 Z
11
+ date: 2025-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -156,7 +156,7 @@ dependencies:
156
156
  - - ">="
157
157
  - !ruby/object:Gem::Version
158
158
  version: 2.96.1
159
- description:
159
+ description:
160
160
  email: support@lambdatest.com
161
161
  executables: []
162
162
  extensions: []
@@ -172,7 +172,7 @@ homepage: https://github.com/LambdaTest/lambdatest-fastlane-plugin
172
172
  licenses:
173
173
  - MIT
174
174
  metadata: {}
175
- post_install_message:
175
+ post_install_message:
176
176
  rdoc_options: []
177
177
  require_paths:
178
178
  - lib
@@ -188,7 +188,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
188
188
  version: '0'
189
189
  requirements: []
190
190
  rubygems_version: 3.1.2
191
- signing_key:
191
+ signing_key:
192
192
  specification_version: 4
193
193
  summary: fastlane plugin to upload app to lambdatest
194
194
  test_files: []