Class: Fastlane::Saucectl::Storage

Inherits:
Object
  • Object
show all
Defined in:
lib/fastlane/plugin/saucectl/helper/storage.rb

Overview

This class provides the ability to store, delete, and retrieve data from the Sauce Labs Storage API

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Storage

Returns a new instance of Storage.



10
11
12
# File 'lib/fastlane/plugin/saucectl/helper/storage.rb', line 10

def initialize(config)
  @config = config
end

Instance Method Details

#delete_all_apps_for_group_idObject

Deletes the specified group of files from Sauce Storage. The Sauce Labs identifier of the group of files. You can look up file IDs using the Get App Storage Groups endpoint. docs.saucelabs.com/dev/api/storage/#get-app-storage-groups

Returns:

  • json response containing the group ID and the number of files deleted.



33
34
35
36
37
# File 'lib/fastlane/plugin/saucectl/helper/storage.rb', line 33

def delete_all_apps_for_group_id
  path = "v1/storage/files/#{@config[:group_id]}"
  api = Fastlane::Saucectl::Api.new(@config)
  api.delete_app(path)
end

#delete_app_with_file_idObject

Delete app by the Sauce Labs identifier of the stored file. You can look up file IDs using the Get App Storage Files endpoint. docs.saucelabs.com/dev/api/storage/#get-app-storage-files

Returns:

  • json response containing the file id and the number of files deleted.



24
25
26
27
# File 'lib/fastlane/plugin/saucectl/helper/storage.rb', line 24

def delete_app_with_file_id
  api = Fastlane::Saucectl::Api.new(@config)
  api.delete_app("v1/storage/files/#{@config[:app_id]}")
end

#retrieve_all_appsObject

Get App Storage Files

Returns:

  • the set of files that have been uploaded to Sauce Storage by the requester.



16
17
18
19
# File 'lib/fastlane/plugin/saucectl/helper/storage.rb', line 16

def retrieve_all_apps
  api = Fastlane::Saucectl::Api.new(@config)
  api.retrieve_all_apps
end

#upload_appObject

Uploads an application file to Sauce Storage for the purpose of mobile application testing

Returns:

  • a unique file ID assigned to the app.



41
42
43
# File 'lib/fastlane/plugin/saucectl/helper/storage.rb', line 41

def upload_app
  Fastlane::Saucectl::Api.new(@config).upload
end