<commit_before>describe("DSL", function() {

  var lastStep, executeStep, lastDocument;

  beforeEach(function() {
    lastStep = null;
    $scenario = {
      addStep: function(name, stepFunction) {
        lastStep = { name:name, fn: stepFunction};
      }
    };
    executeStep = function(step, html, callback) {
      lastDocument =_jQuery('<div>' + html + '</div>');
      var specThis = {
        testWindow: window,
        testDocument: lastDocument
      };
      step.fn.call(specThis, callback || noop);
    };
  });

  describe("input", function() {

    var input = angular.scenario.dsl.input;
    it('should enter', function() {
      input('name').enter('John');
      expect(lastStep.name).toEqual("Set input text of 'name' to 'John'");
      executeStep(lastStep, '<input type="text" name="name" />');
      expect(lastDocument.find('input').val()).toEqual('John');
    });

    it('should select', function() {
      input('gender').select('female');
      expect(lastStep.name).toEqual("Select radio 'gender' to 'female'");
      executeStep(lastStep, '<input type="radio" name="0@gender" value="male"/>' +
        '<input type="radio" name="0@gender" value="female"/>');
      expect(lastDocument.find(':radio:checked').val()).toEqual('female');
    });
  });
});<commit_msg>appended lastDocument to the document.body<commit_after>describe("DSL", function() {

  var lastStep, executeStep, lastDocument;

  beforeEach(function() {
    lastStep = null;
    $scenario = {
      addStep: function(name, stepFunction) {
        lastStep = { name:name, fn: stepFunction};
      }
    };
    executeStep = function(step, html, callback) {
      lastDocument =_jQuery('<div>' + html + '</div>');
      _jQuery(document.body).append(lastDocument);
      var specThis = {
        testWindow: window,
        testDocument: lastDocument
      };
      step.fn.call(specThis, callback || noop);
    };
  });

  describe("input", function() {

    var input = angular.scenario.dsl.input;
    it('should enter', function() {
      input('name').enter('John');
      expect(lastStep.name).toEqual("Set input text of 'name' to 'John'");
      executeStep(lastStep, '<input type="text" name="name" />');
      expect(lastDocument.find('input').val()).toEqual('John');
    });

    it('should select', function() {
      input('gender').select('female');
      expect(lastStep.name).toEqual("Select radio 'gender' to 'female'");
      executeStep(lastStep,
        '<input type="radio" name="0@gender" value="male" checked/>' +
        '<input type="radio" name="0@gender" value="female"/>');
      expect(lastDocument.find(':radio:checked').length).toEqual(1);
      expect(lastDocument.find(':radio:checked').val()).toEqual('female');
    });
  });
});
{'fraction_non_alphanumeric': 0.18643453028654333, 'fraction_numerical': 0.0018135654697134566, 'mean_word_length': 3.4198717948717947, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '889643', 'n_tokens_mistral': 833, 'n_tokens_neox': 822, 'n_words': 155}