Github user vladimir-kotikov commented on a diff in the pull request:

    https://github.com/apache/cordova-paramedic/pull/7#discussion_r65332533
  
    --- Diff: lib/paramedic.js ---
    @@ -284,7 +380,147 @@ ParamedicRunner.prototype.uninstallApp = function() {
         logger.info("Uninstalling the app.");
         var paramedicAppUninstall = new 
ParamedicAppUninstall(this.tempFolder.name, this.config.getPlatformId());
         
paramedicAppUninstall.uninstallApp(this.targetObj,util.PARAMEDIC_DEFAULT_APP_NAME);
    -}
    +};
    +
    +
    +ParamedicRunner.prototype.getPackageFolder = function() {
    +    var packageFolder;
    +    switch (this.config.getPlatformId()) {
    +        case 'android':
    +            packageFolder = path.join(this.tempFolder.name, 
'platforms/android/build/outputs/apk/');
    +            break;
    +        case 'ios':
    +            packageFolder = path.join(this.tempFolder.name, 
'platforms/ios/build/emulator/');
    +            break;
    +        default:
    +            throw new Error('Unsupported platform for sauce labs testing: 
' + this.config.getPlatformId());
    +    }
    +    return packageFolder;
    +};
    +
    +ParamedicRunner.prototype.getPackageName = function () {
    +    var packageName;
    +    switch (this.config.getPlatformId()) {
    +        case 'ios':
    +            packageName = 'HelloCordova.zip';
    +            break;
    +        case 'android':
    +            packageName = this.getBinaryName();
    +            break;
    +        default:
    +            throw new Error('Unsupported platform for sauce labs testing: 
' + this.config.getPlatformId());
    +    }
    +    return packageName;
    +};
    +
    +ParamedicRunner.prototype.getBinaryPath = function() {
    +    var binaryPath;
    +    switch (this.config.getPlatformId()) {
    +        case 'android':
    +            binaryPath = path.join(this.tempFolder.name, 
'platforms/android/build/outputs/apk', this.getBinaryName());
    +            break;
    +        case 'ios':
    +            binaryPath = path.join(this.tempFolder.name, 
'platforms/ios/build/emulator/', this.getBinaryName());
    +            break;
    +        default:
    +            throw new Error('Unsupported platform for sauce labs testing: 
' + this.config.getPlatformId());
    +    }
    +    return binaryPath;
    +};
    +
    +ParamedicRunner.prototype.getBinaryName = function() {
    +    var binaryName;
    +    switch (this.config.getPlatformId()) {
    +        case 'android':
    +            binaryName = 'android-debug.apk';
    +            break;
    +        case 'ios':
    +            binaryName = 'HelloCordova.app';
    +            break;
    +        default:
    +            throw new Error('Unsupported platform for sauce labs testing: 
' + this.config.getPlatformId());
    +    }
    +    return binaryName;
    +};
    +
    +ParamedicRunner.prototype.getAppName = function() {
    +    var appName;
    +    switch (this.config.getPlatformId()) {
    +        case 'android':
    +            appName = 'mobilespec.apk';
    +            break;
    +        case 'ios':
    +            appName = 'HelloCordova.zip';
    +            break;
    +        default:
    +            throw new Error('Unsupported platform for sauce labs testing: 
' + this.config.getPlatformId());
    +    }
    +    return appName;
    +};
    +
    +ParamedicRunner.prototype.runSauceTests = function() {
    +    logger.info('cordova-paramedic: running sauce tests');
    +    var self = this;
    +
    +    return self.packageApp()
    +    .then(self.uploadApp.bind(self))
    +    .then(function() {
    +        logger.normal('cordova-paramedic: app uploaded; starting tests');
    +
    +        var user = process.env[SAUCE_USER_ENV_VAR];
    --- End diff --
    
    It would be useful if we could set this parameters from command line too


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to