sauce-storage

1.1.0 • Public • Published

Introduction

This package is for saucelabs users. It lets you upload files from your local computer to sauce storage. For more information about sauce storage, please read here.

  • only proceed to upload if there is currently no build with the same name and hash on your sauce-storage
  • returns the string to use in your app capability ("sauce-storage:mybuild.apk")

Installation

npm i sauce-storage

How to use

Promise is the only available interface, callback is not supported:

const sauceStorage = require('sauce-storage')
const storage = new sauceStorage('mySauceUsername', 'mySauceAccessKey')
 
// Within an async function
const appCap = await storage.getAppCapabilityForBuild('./builds/myapp.apk')
 
// Promise
storage.getAppCapabilityForBuild('./builds/myapp.apk')
    .then(app => {
        // do something with app
    })

EU datacenter If you are running tests on the EU datacenter, you should provide the correct hostname when instanciating the class. See saucelabs documentation.

const storage = new sauceStorage('mySauceUsername', 'mySauceAccessKey', 'eu-central-1.saucelabs.com')

For webdriverio users, you may add the app capability using the onPrepare hook (which will wait for the promise to resolve, and hence can be async):

async function onPrepare (config, capabilities) {
    const app = await storage.getAppCapabilityForBuild('./builds/myapp.apk')
    capabilities.forEach(cap => cap.app = app)
}

Contributing

Contributions are welcome, but please be aware that:

  • I built the project without any dependencies in an effort to learn more about the nodejs API
  • I want to keep the project's scope small. It solves just one problem and that is all I want it to do for the moment
  • There is currently no tests

/sauce-storage/

    Package Sidebar

    Install

    npm i sauce-storage

    Weekly Downloads

    0

    Version

    1.1.0

    License

    MIT

    Unpacked Size

    10.5 kB

    Total Files

    8

    Last publish

    Collaborators

    • kignuf
    • sam-viz