<commit_before>var assert = require('assert');
var common = require('../../../common.js');
var Api = common.require('core/api.js');

module.exports = {

  'assert.elementNotPresent' : {
    'elementNotPresent assertion passed' : function(done) {
      var assertionFn = common.require('api/assertions/elementNotPresent.js');
      var client = {
        options : {},
        locateStrategy : 'css selector',
        api : {
          elements : function(using, selector, callback) {
            assert.equal(selector, '.test_element');
            assert.equal(using, 'css selector');
            callback({
              status : 0,
              value : []
            });
          }
        },
        assertion : function(passed, result, expected, msg, abortOnFailure) {
          assert.equal(passed, true);
          assert.equal(result, null);
          assert.equal(expected, 'not present');
          assert.equal(msg, 'Testing if element <.test_element> is not present.');<commit_msg>Updated tests for Fix edge elementNotPresent #836<commit_after>var assert = require('assert');
var common = require('../../../common.js');
var Api = common.require('core/api.js');

module.exports = {

  'assert.elementNotPresent' : {
    'elementNotPresent assertion passed' : function(done) {
      var assertionFn = common.require('api/assertions/elementNotPresent.js');
      var client = {
        options : {},
        locateStrategy : 'css selector',
        api : {
          elements : function(using, selector, callback) {
            assert.equal(selector, '.test_element');
            assert.equal(using, 'css selector');
            callback({
              status : 0,
              value : []
            });
          }
        },
        assertion : function(passed, result, expected, msg, abortOnFailure) {
          assert.equal(passed, true);
          assert.equal(result, 'not present');
          assert.equal(expected, 'not present');
          assert.equal(msg, 'Testing if element <.test_element> is not present.');
          assert.equal(abortOnFailure, true);
          done();
        }
      };
      Api.init(client);
      var m = Api.createAssertion('elementNotPresent', assertionFn, true, client);
      m._commandFn('.test_element');
    },

    'elementNotPresent assertion passed when exceptions are passsed' : function(done) {
      var assertionFn = common.require('api/assertions/elementNotPresent.js');
      var client = {
        options : {},
        locateStrategy : 'css selector',
        api : {
          elements : function(using, selector, callback) {
            assert.equal(selector, '.test_element');
            assert.equal(using, 'css selector');
            callback({
              status : -1,
              value : null
            });
          }
        },
        assertion : function(passed, result, expected, msg, abortOnFailure) {
          assert.equal(passed, true);
          assert.equal(result, 'not present');
          assert.equal(expected, 'not present');
          assert.equal(msg, 'Testing if element <.test_element> is not present.');
{'fraction_non_alphanumeric': 0.13371906139504983, 'fraction_numerical': 0.0019286403085824494, 'mean_word_length': 2.169042769857434, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '6713110', 'n_tokens_mistral': 815, 'n_tokens_neox': 805, 'n_words': 189}