How to use the saucelabs.username function in saucelabs

To help you get started, we’ve selected a few saucelabs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github chialab / rna-cli / commands / unit / action.js View on Github external
module.exports = async function unit(app, options = {}) {
    let cwd = process.cwd();
    // check sauce values
    if (options.saucelabs) {
        if (options['saucelabs.username']) {
            process.env.SAUCE_USERNAME = options['saucelabs.username'];
        }
        if (options['saucelabs.key']) {
            process.env.SAUCE_ACCESS_KEY = options['saucelabs.key'];
        }
        if (!process.env.SAUCE_USERNAME) {
            throw 'Missing SAUCE_USERNAME variable.';
        }
        if (!process.env.SAUCE_ACCESS_KEY) {
            throw 'Missing SAUCE_ACCESS_KEY variable.';
        }
    }

    // Handle Karma custom context file option
    const customContextFile = options['context'];
github chialab / rna-cli / commands / unit / action.js View on Github external
module.exports = async function unit(app, options = {}) {
    let cwd = process.cwd();
    // check sauce values
    if (options.saucelabs) {
        if (options['saucelabs.username']) {
            process.env.SAUCE_USERNAME = options['saucelabs.username'];
        }
        if (options['saucelabs.key']) {
            process.env.SAUCE_ACCESS_KEY = options['saucelabs.key'];
        }
        if (!process.env.SAUCE_USERNAME) {
            throw 'Missing SAUCE_USERNAME variable.';
        }
        if (!process.env.SAUCE_ACCESS_KEY) {
            throw 'Missing SAUCE_ACCESS_KEY variable.';
        }
    }

    // Handle Karma custom context file option
    const customContextFile = options['context'];

    if (!process.env.hasOwnProperty('NODE_ENV')) {
github chialab / rna-cli / commands / unit / index.js View on Github external
.action(async (app, options = {}) => {
            const { Project } = require('../../lib/File');

            const cwd = process.cwd();
            const project = new Project(cwd);

            // check sauce values
            if (options.saucelabs) {
                if (options['saucelabs.username']) {
                    process.env.SAUCE_USERNAME = options['saucelabs.username'];
                }
                if (options['saucelabs.key']) {
                    process.env.SAUCE_ACCESS_KEY = options['saucelabs.key'];
                }
                if (!process.env.SAUCE_USERNAME && app.store.get('saucelabs.username')) {
                    process.env.SAUCE_USERNAME = app.store.get('saucelabs.username');
                }
                if (!process.env.SAUCE_ACCESS_KEY && app.store.get('saucelabs.accessKey')) {
                    process.env.SAUCE_ACCESS_KEY = app.store.get('saucelabs.accessKey');
                }
                if (!process.env.SAUCE_USERNAME) {
                    throw new Error('missing SAUCE_USERNAME variable');
                }
                if (!process.env.SAUCE_ACCESS_KEY) {
                    throw new Error('missing SAUCE_ACCESS_KEY variable');
github chialab / rna-cli / commands / e2e / action.js View on Github external
// override the path
                            config.test_settings.default.screenshots.path = options.screenshots;
                        } else {
                            // set a default path
                            config.test_settings.default.screenshots.path = config.test_settings.default.screenshots.path || 'reports/e2e/screenshots';
                        }
                    } else {
                        // option.screenshots is false
                        config.test_settings.default.screenshots = { enabled: false };
                    }
                }
            }
            let sauceConnectProcess;
            if (options.saucelabs) {
                // check sauce values
                if (options['saucelabs.username']) {
                    process.env.SAUCE_USERNAME = options['saucelabs.username'];
                }
                if (options['saucelabs.key']) {
                    process.env.SAUCE_ACCESS_KEY = options['saucelabs.key'];
                }
                if (!process.env.SAUCE_USERNAME) {
                    app.log(colors.red('Missing SAUCE_USERNAME variable.'));
                    app.log(colors.grey('export a `SAUCE_USERNAME` environment variable or use the `--saucelabs.username` flag.'));
                    return global.Promise.reject();
                }
                if (!process.env.SAUCE_ACCESS_KEY) {
                    app.log(colors.red('Missing SAUCE_ACCESS_KEY variable.'));
                    app.log(colors.grey('export a `SAUCE_ACCESS_KEY` environment variable or use the `--saucelabs.key` flag.'));
                    return global.Promise.reject();
                }
                promise = promise.then(() => new global.Promise((resolve, reject) => {
github chialab / rna-cli / commands / unit / index.js View on Github external
.action(async (app, options = {}) => {
            const { Project } = require('../../lib/File');

            const cwd = process.cwd();
            const project = new Project(cwd);

            // check sauce values
            if (options.saucelabs) {
                if (options['saucelabs.username']) {
                    process.env.SAUCE_USERNAME = options['saucelabs.username'];
                }
                if (options['saucelabs.key']) {
                    process.env.SAUCE_ACCESS_KEY = options['saucelabs.key'];
                }
                if (!process.env.SAUCE_USERNAME && app.store.get('saucelabs.username')) {
                    process.env.SAUCE_USERNAME = app.store.get('saucelabs.username');
                }
                if (!process.env.SAUCE_ACCESS_KEY && app.store.get('saucelabs.accessKey')) {
                    process.env.SAUCE_ACCESS_KEY = app.store.get('saucelabs.accessKey');
                }
                if (!process.env.SAUCE_USERNAME) {
                    throw new Error('missing SAUCE_USERNAME variable');
                }
                if (!process.env.SAUCE_ACCESS_KEY) {
                    throw new Error('missing SAUCE_ACCESS_KEY variable');
                }
github chialab / rna-cli / commands / e2e / action.js View on Github external
config.test_settings.default.screenshots.path = options.screenshots;
                        } else {
                            // set a default path
                            config.test_settings.default.screenshots.path = config.test_settings.default.screenshots.path || 'reports/e2e/screenshots';
                        }
                    } else {
                        // option.screenshots is false
                        config.test_settings.default.screenshots = { enabled: false };
                    }
                }
            }
            let sauceConnectProcess;
            if (options.saucelabs) {
                // check sauce values
                if (options['saucelabs.username']) {
                    process.env.SAUCE_USERNAME = options['saucelabs.username'];
                }
                if (options['saucelabs.key']) {
                    process.env.SAUCE_ACCESS_KEY = options['saucelabs.key'];
                }
                if (!process.env.SAUCE_USERNAME) {
                    app.log(colors.red('Missing SAUCE_USERNAME variable.'));
                    app.log(colors.grey('export a `SAUCE_USERNAME` environment variable or use the `--saucelabs.username` flag.'));
                    return global.Promise.reject();
                }
                if (!process.env.SAUCE_ACCESS_KEY) {
                    app.log(colors.red('Missing SAUCE_ACCESS_KEY variable.'));
                    app.log(colors.grey('export a `SAUCE_ACCESS_KEY` environment variable or use the `--saucelabs.key` flag.'));
                    return global.Promise.reject();
                }
                promise = promise.then(() => new global.Promise((resolve, reject) => {
                    // setup sauce connect for localhost tunnel

saucelabs

A wrapper around Sauce Labs REST API

Apache-2.0
Latest version published 3 months ago

Package Health Score

92 / 100
Full package analysis