fastlane-plugin-lambdatest 0.1.0 → 0.1.3

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: 2c29d18b65ecf78e982c1fb33779bc322dc9ae2333f82abd22b5cdb55fdb929e
4
- data.tar.gz: 7d99ee13cc4608d156e6b61de36d9aa357da2f3ef353b4c33e85541f7e7166f3
3
+ metadata.gz: 762e42e58d0941317c807e6c068f0d6bcc9bba655117738c283b692b1007f58f
4
+ data.tar.gz: 9abb3399bdee2887fd3b3fba2368357e7db2e6ae28ce8a885ae276d666e2bdfc
5
5
  SHA512:
6
- metadata.gz: 3d6da40b7f481dee047c1788ed5a2d9ba9107415d5a541ac80e2a55ab0a2a3998cc44f2f3a32122c3d68f9a14f2ed6c42ebbaf1588132c7cdc448d32645a0a5f
7
- data.tar.gz: 1039cc02f134c81f014713edf66a3fa24042625621d3683f38936ec13febe1f7a2267067880d286b8b424e7ae91342dbaabbec86f84e8fbc793a0d2a72e6eadc
6
+ metadata.gz: 5879b51084d28e251aa6e88bd935359d123adb68c1140dc4eb73c4f32d1a3c990f2f8e1c51754a64599ff34badf0a6d43ae592445baa0f88c8bed58767eb3b59
7
+ data.tar.gz: 808dc966ffdfdc11d220aca6786567f9c7caae6f12344922924aae9f97d9c3829b8dc94d2b5468d984e4d2f47dfa000d93168d10b817e9504ba06f53111b6062
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2023 lambdatest <pawanr@lambdatest.com>
3
+ Copyright (c) 2023 lambdatest <support@lambdatest.com>
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,23 +1,19 @@
1
- # lambdatest plugin
1
+ ![LambdaTest Logo](https://www.lambdatest.com/resources/images/logos/logo.svg)
2
+
3
+ # LambdaTest fastlane plugin
2
4
 
3
5
  [![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-lambdatest)
4
6
 
5
7
  ## Getting Started
6
8
 
7
- This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-lambdatest`, add it to your project by running:
9
+ This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin to upload app to LambdaTest. To get started with `fastlane-plugin-lambdatest`, add it to your project by running:
8
10
 
9
11
  ```bash
10
12
  fastlane add_plugin lambdatest
11
13
  ```
12
14
 
13
- ## About lambdatest
14
-
15
- Upload apps to lambdatest for testing.
16
-
17
- **Note to author:** Add a more detailed description about this plugin here. If your plugin contains multiple actions, make sure to mention them here.
18
-
19
15
  ## Example
20
- In order to configure the plugin add below action in your Fastfile.
16
+ In order to use this plugin first obtain your `LT_USERNAME` and `LT_ACCESS_KEY` from your [_account_](https://accounts.lambdatest.com/security),configure the plugin add below action in your Fastfile.
21
17
 
22
18
  ```
23
19
  upload_to_lambdatest(
@@ -26,18 +22,25 @@ upload_to_lambdatest(
26
22
  file_path: "app_file_path"
27
23
  )
28
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
+ ```
29
34
 
30
35
  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`.
31
36
 
32
- Once the app is uploaded , the app_url of the app will be stored in an environment variable, "APP_URL" and it can be accessed in your tests in the following way :
37
+ Once the app is uploaded , the app_url of the app will be stored in an environment variable, "APP_URL" and it can be accessed in your tests in same lane in the following way :
33
38
 
34
39
  ```
35
40
  String app = System.getenv("APP_URL"); // Get app url from environment variable.
36
41
  capabilities.setCapability("app", app); // Add app url to driver capability.
37
42
  ```
38
43
 
39
- **Note to author:** Please set up a sample project to make it easy for users to explore what your plugin does. Provide everything that is necessary to try out the plugin in this project (including a sample Xcode/Android project if necessary)
40
-
41
44
  ## Run tests for this plugin
42
45
 
43
46
  To run both the tests, and code style validation, run
@@ -59,10 +62,7 @@ For any other issues and feedback about this plugin, please submit it to this re
59
62
 
60
63
  If you have trouble using plugins, check out the [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.
61
64
 
62
- ## Using _fastlane_ Plugins
63
-
64
- For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).
65
65
 
66
- ## About _fastlane_
66
+ ## About LambdaTest
67
67
 
68
- _fastlane_ is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out [fastlane.tools](https://fastlane.tools).
68
+ [LambdaTest](https://www.lambdatest.com/) is a cloud based selenium grid infrastructure that can help you run automated cross browser compatibility tests on 2000+ different browser and operating system environments. LambdaTest supports all programming languages and frameworks that are supported with Selenium, and have easy integrations with all popular CI/CD platforms. It's a perfect solution to bring your [selenium automation testing](https://www.lambdatest.com/selenium-automation) to cloud based infrastructure that not only helps you increase your test coverage over multiple desktop and mobile browsers, but also allows you to cut down your test execution time by running tests on parallel.
@@ -9,19 +9,20 @@ module Fastlane
9
9
  end
10
10
  class UploadToLambdatestAction < Action
11
11
 
12
- UPLOAD_API_ENDPOINT = "https://manual-api.lambdatest.com/app/upload/realDevice"
13
- SUPPORTED_FILE_EXTENSIONS = ["apk", "ipa", "aab"]
12
+ API_ENDPOINT = "https://manual-api.lambdatest.com/app/upload/realDevice"
13
+ SUPPORTED_EXTENSIONS = ["apk", "ipa", "aab"]
14
14
 
15
15
  def self.run(params)
16
16
  lt_username = params[:lt_username] # Required
17
17
  lt_access_key = params[:lt_access_key] # Required
18
18
  file_path = params[:file_path].to_s # Required
19
+ custom_id = params[:custom_id] # Optional
19
20
 
20
21
  validate_file_path(file_path)
21
22
 
22
23
  UI.message("Started Uploading app to Lambdatest...")
23
24
 
24
- lt_app_url = Helper::LambdatestHelper.upload_file(lt_username, lt_access_key, file_path, UPLOAD_API_ENDPOINT)
25
+ lt_app_url = Helper::LambdatestHelper.upload_file(lt_username, lt_access_key, file_path, API_ENDPOINT,custom_id)
25
26
 
26
27
  # Set 'APP_URL' environment variable, if app upload was successful.
27
28
  ENV['APP_URL'] = lt_app_url
@@ -35,14 +36,12 @@ module Fastlane
35
36
  Actions.lane_context[SharedValues::APP_URL] = lt_app_url
36
37
  end
37
38
 
38
- # Validate file_path.
39
+ # Validating file_path and extension.
39
40
  def self.validate_file_path(file_path)
40
41
  UI.user_error!("file not found at '#{file_path}' ❌ .") unless File.exist?(file_path)
41
-
42
- # Validate file extension.
43
42
  file_path_parts = file_path.split(".")
44
- unless file_path_parts.length > 1 && SUPPORTED_FILE_EXTENSIONS.include?(file_path_parts.last)
45
- UI.user_error!("Invalid file extension, only files with extensions " + SUPPORTED_FILE_EXTENSIONS.to_s + " are allowed to be uploaded.")
43
+ unless file_path_parts.length > 1 && SUPPORTED_EXTENSIONS.include?(file_path_parts.last)
44
+ UI.user_error!("Invalid file extension, only files with extensions " + SUPPORTED_EXTENSIONS.to_s + " are allowed to be uploaded.")
46
45
  end
47
46
  end
48
47
 
@@ -89,7 +88,11 @@ module Fastlane
89
88
  description: "app file path",
90
89
  optional: true,
91
90
  is_string: true,
92
- default_value: default_file_path)
91
+ default_value: default_file_path),
92
+ FastlaneCore::ConfigItem.new(key: :custom_id,
93
+ description: "Custom ID",
94
+ optional: true,
95
+ is_string: false)
93
96
  ]
94
97
  end
95
98
 
@@ -22,12 +22,12 @@ module Fastlane
22
22
  # +url+:: Lambdatest's app upload endpoint.
23
23
  def self.upload_file(lt_username, lt_access_key, file_path, url, custom_id = nil)
24
24
  payload = {
25
- name: "xyz",
25
+ name: "app",
26
26
  appFile: File.new(file_path, 'rb')
27
27
  }
28
28
 
29
29
  unless custom_id.nil?
30
- payload[:data] = '{ "custom_id": "' + custom_id + '" }'
30
+ payload[:custom_id] = custom_id
31
31
  end
32
32
 
33
33
  headers = {
@@ -44,9 +44,7 @@ module Fastlane
44
44
  )
45
45
  response_json = JSON.parse(response.to_s)
46
46
 
47
- if !response_json["custom_id"].nil?
48
- return response_json["custom_id"]
49
- else
47
+ if !response_json["app_url"].nil?
50
48
  return response_json["app_url"]
51
49
  end
52
50
  rescue RestClient::ExceptionWithResponse => err
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Lambdatest
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.3"
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.0
4
+ version: 0.1.3
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-12 00:00:00.000000000 Z
11
+ date: 2023-05-17 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
@@ -187,8 +187,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
187
187
  - !ruby/object:Gem::Version
188
188
  version: '0'
189
189
  requirements: []
190
- rubygems_version: 3.0.1
191
- signing_key:
190
+ rubygems_version: 3.1.2
191
+ signing_key:
192
192
  specification_version: 4
193
193
  summary: fastlane plugin to upload app to lambdatest
194
194
  test_files: []