<commit_before>/*global it:true*/
"use strict";

var should = require("should")
  , request = require('request')
  , describeWd = require("../../helpers/driverblock.js").describe
  , appUrl = 'https://raw.github.com/appium/appium/master/assets/UICatalog.app.zip'
  , describeUrl = require('../../helpers/driverblock.js').describeForApp(appUrl);

describeWd('appium', function(h) {
  it('should fail gracefully after timeout', function(done) {
    var doSomething = function() {
      h.driver.elementsByTagName('textField', function(err) {
        should.exist(err);
        done();
      });
    };
    setTimeout(doSomething, 8000);
  });
}, undefined, undefined, undefined, {newCommandTimeout: 4});

describeWd('appium', function(h) {
  it('should be available after previous timeout', function(done) {
    h.driver.elementsByTagName('textField', function(err) {
      should.not.exist(err);
      done();
    });
  });
}, undefined, undefined, undefined, {newCommandTimeout: 60});

describeUrl('appium', function(h) {
  it('should load a zipped app via url', function(done) {
    h.driver.elementByTagName('tableView', function(err, element) {
      should.exist(element.value);
      element.elementByTagName('tableCell', function(err, label) {
        should.exist(label.value);
        label.text(function(err, text) {
          should.not.exist(err);
          text.should.equal("Buttons, Various uses of UIButton");
          done();
        });
      });
    });
  });
});

describeWd('appium', function(h) {
  it('should go back to using app from before', function(done) {
    h.driver.elementsByTagName('tableView', function(err, elements) {
      should.not.exist(err);
      elements = elements.should.be.empty;
      done();
    });
  });
});
<commit_msg>fix this appium test using the wrong finder logic<commit_after>/*global it:true*/
"use strict";

var should = require("should")
  , request = require('request')
  , describeWd = require("../../helpers/driverblock.js").describe
  , appUrl = 'https://raw.github.com/appium/appium/master/assets/UICatalog.app.zip'
  , describeUrl = require('../../helpers/driverblock.js').describeForApp(appUrl);

describeWd('appium', function(h) {
  it('should fail gracefully after timeout', function(done) {
    var doSomething = function() {
      h.driver.elementsByTagName('textField', function(err) {
        should.exist(err);
        done();
      });
    };
    setTimeout(doSomething, 8000);
  });
}, undefined, undefined, undefined, {newCommandTimeout: 4});

describeWd('appium', function(h) {
  it('should be available after previous timeout', function(done) {
    h.driver.elementsByTagName('textField', function(err) {
      should.not.exist(err);
      done();
    });
  });
}, undefined, undefined, undefined, {newCommandTimeout: 60});

describeUrl('appium', function(h) {
  it('should load a zipped app via url', function(done) {
    h.driver.elementByTagName('tableView', function(err, element) {
      should.exist(element.value);
      element.elementByTagName('tableCell', function(err, el2) {
        should.exist(el2.value);
        el2.value.should.equal("Buttons, Various uses of UIButton");
        done();
      });
    });
  });
});

describeWd('appium', function(h) {
  it('should go back to using app from before', function(done) {
    h.driver.elementsByTagName('tableView', function(err, elements) {
      should.not.exist(err);
      elements = elements.should.be.empty;
      done();
    });
  });
});

{'fraction_non_alphanumeric': 0.1683395468884428, 'fraction_numerical': 0.004875250932033267, 'mean_word_length': 3.6015831134564644, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '950928', 'n_tokens_mistral': 1086, 'n_tokens_neox': 1064, 'n_words': 205}