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

var checkPreferencesApp = require("../../../app/helpers").checkPreferencesApp
  , should = require('should')
  , describeWd;

describe('preferences app', function() {
  beforeEach(function(done) {
    checkPreferencesApp('6.1', function(err, appPath) {
      should.not.exist(err);
      describeWd = require("../../helpers/driverblock.js").describeForApp(appPath);
      done();
    });
  });

  it('', function() {
    describeWd('settings', function(h) {
      // example of a script that turns of auto-complete
      // if you run it on a server with --no-reset, it will keep this state
      // for subsequent app runs. Note that for this to work you'll need to
      // have modified the plist of your preferences.app to run iphone
      // instead of ipad by default (this test is for iphone)
      it('should turn off autocomplete', function(done) {
        h.driver.elementsByTagName('tableCell', function(err, els) {
          els[1].click(function(err) {
            h.driver.elementsByTagName('tableCell', function(err, els) {
              els[1].click(function(err) {
                h.driver.elementByXPath('//switch[@name="Auto-Correction"]', function(err, switchEl) {
                  switchEl.getValue(function(err, checked) {
                    if (checked === 1) {
                      // was checked, click it off
                      switchEl.click(function(err) {
                        setTimeout(done, 5000);
                      });
                    } else {
                      // was unchecked, do nothing
                      setTimeout(done, 5000);
                    }
                  });
                });
              });
            });
          });
        });
      });
    });
  });
});<commit_msg>remove timeouts<commit_after>/*global it:true, before:true, describe: true */
"use strict";

var checkPreferencesApp = require("../../../app/helpers").checkPreferencesApp
  , should = require('should')
  , describeWd;

describe('preferences app', function() {
  beforeEach(function(done) {
    checkPreferencesApp('6.1', function(err, appPath) {
      should.not.exist(err);
      describeWd = require("../../helpers/driverblock.js").describeForApp(appPath);
      done();
    });
  });

  it('', function() {
    describeWd('settings', function(h) {
      // example of a script that turns of auto-complete
      // if you run it on a server with --no-reset, it will keep this state
      // for subsequent app runs. Note that for this to work you'll need to
      // have modified the plist of your preferences.app to run iphone
      // instead of ipad by default (this test is for iphone)
      it('should turn off autocomplete', function(done) {
        h.driver.elementsByTagName('tableCell', function(err, els) {
          els[1].click(function(err) {
            h.driver.elementsByTagName('tableCell', function(err, els) {
              els[1].click(function(err) {
                h.driver.elementByXPath('//switch[@name="Auto-Correction"]', function(err, switchEl) {
                  switchEl.getValue(function(err, checked) {
                    if (checked === 1) {
                      // was checked, click it off
                      switchEl.click(function(err) {
                        done();
                      });
                    } else {
                      // was unchecked, do nothing
                      done();
                    }
                  });
                });
              });
            });
          });
        });
      });
    });
  });
});
{'fraction_non_alphanumeric': 0.13751375137513752, 'fraction_numerical': 0.0049504950495049506, 'mean_word_length': 1.7511346444780636, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '4203819', 'n_tokens_mistral': 989, 'n_tokens_neox': 950, 'n_words': 237}