cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblotsky <...@git.apache.org>
Subject [GitHub] cordova-plugin-camera pull request: Appium tests stability improve...
Date Mon, 11 Apr 2016 22:51:03 GMT
Github user dblotsky commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-camera/pull/202#discussion_r59295343
  
    --- Diff: appium-tests/android/android.spec.js ---
    @@ -27,52 +28,47 @@
     
     'use strict';
     
    -var wdHelper = require('../helpers/wdHelper');
    +var wdHelper = global.WD_HELPER;
    +var screenshotHelper = global.SCREENSHOT_HELPER;
     var wd = wdHelper.getWD();
     var cameraConstants = require('../../www/CameraConstants');
     var cameraHelper = require('../helpers/cameraHelper');
    -var screenshotHelper = require('../helpers/screenshotHelper');
     
    -var STARTING_MESSAGE = 'Ready for action!';
    -var RETRY_COUNT = 3; // how many times to retry taking a picture before failing
     var MINUTE = 60 * 1000;
    +var BACK_BUTTON = 4;
     var DEFAULT_SCREEN_WIDTH = 360;
     var DEFAULT_SCREEN_HEIGHT = 567;
     var DEFAULT_WEBVIEW_CONTEXT = 'WEBVIEW';
    +var PROMISE_PREFIX = 'appium_camera_promise_';
     
     describe('Camera tests Android.', function () {
         var driver;
         // the name of webview context, it will be changed to match needed context if there
are named ones:
         var webviewContext = DEFAULT_WEBVIEW_CONTEXT;
         // this indicates that the device library has the test picture:
         var isTestPictureSaved = false;
    -    // this indicates that there was a critical error and we should try to recover:
    -    var errorFlag = false;
    -    // this indicates that we couldn't restore Appium session and should fail fast:
    -    var stopFlag = false;
         // we need to know the screen width and height to properly click on an image in the
gallery:
         var screenWidth = DEFAULT_SCREEN_WIDTH;
         var screenHeight = DEFAULT_SCREEN_HEIGHT;
    +    // promise count to use in promise ID
    +    var promiseCount = 0;
     
    -    function win() {
    -        expect(true).toBe(true);
    +    function getNextPromiseId() {
    +        return PROMISE_PREFIX + promiseCount++;
    --- End diff --
    
    Or even break up the update and the read into two lines, so it's easier to read.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Mime
View raw message