<commit_before>"use strict";

const PORT = require('system').env.PORT;
const BASE = 'http://127.0.0.1:' + PORT;
const SHOTS = 'tests/screenshots/';

casper.test.begin('change sorting of checkin with column clicks', function(test) {
  casper.options.viewportSize = {top: 0, left: 0, width: 1280, height: 720};

  var order_asc_top = null;
  var order_desc_bottom = null;

  casper.start(BASE + '/logmein?as=prabbit', function() {
    test.assertHttpStatus(200, "Login as prabbit");
  });
  casper.thenOpen(BASE, function() {
    test.assertExists('.lpanel.check-in');
    this.click('.lpanel.check-in');
  });
  casper.waitForSelector('#checked-out-items .col-due.header');
  casper.thenClick('#checked-out-items .col-due');
  casper.then(function() {
    order_asc_top = this.evaluate(function(){return document.querySelector('#checked-out-items tr:first-child td[data-date]').getAttribute('data-date');});
    casper.capture(SHOTS + 'checkin-sort-date-asc.png');
  });
  casper.thenClick('#checked-out-items .col-due');
  casper.wait(500);
  casper.then(function() {
    order_desc_bottom = this.evaluate(function(){return document.querySelector('#checked-out-items tr:last-child td[data-date]').getAttribute('data-date');});
    casper.capture(SHOTS + 'checkin-sort-date-desc.png');

    test.assertEquals(order_asc_top, order_desc_bottom);
  });
  casper.then(function(){casper.clear(); test.done()})
  casper.run();
});<commit_msg>Further attempts to fix CasperJS tests.<commit_after>"use strict";

const PORT = require('system').env.PORT;
const BASE = 'http://127.0.0.1:' + PORT;
const SHOTS = 'tests/screenshots/';

casper.test.begin('change sorting of checkin with column clicks', function(test) {
  casper.options.viewportSize = {top: 0, left: 0, width: 1280, height: 720};

  casper.start(BASE + '/logmein?as=prabbit', function() {
    test.assertHttpStatus(200, "Login as prabbit");
  });
  casper.thenOpen(BASE, function() {
    test.assertExists('.lpanel.check-in');
    this.click('.lpanel.check-in');
  });
  casper.waitForSelector('#checked-out-items .col-due.header');
  casper.thenClick('#checked-out-items .col-due');
  casper.wait(250);
  casper.then(function() {
    casper.capture(SHOTS + 'checkin-sort-date-asc.png');
  });
  casper.then(function() {
    var order_asc_top = this.evaluate(function(){return document.querySelector('#checked-out-items tr:last-child td[data-date]').getAttribute('data-date');});
    this.click('#checked-out-items .col-due');
    this.wait(250).then(function() {
      casper.capture(SHOTS + 'checkin-sort-date-desc.png');
      var order_desc_bottom = this.evaluate(function(){return document.querySelector('#checked-out-items tr:first-child td[data-date]').getAttribute('data-date');});
      test.assertEquals(order_asc_top, order_desc_bottom);
    });
  });
  casper.then(function(){casper.clear(); test.done()})
  casper.run();
});
{'fraction_non_alphanumeric': 0.18760816891658014, 'fraction_numerical': 0.01557632398753894, 'mean_word_length': 4.803212851405623, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '3689038', 'n_tokens_mistral': 1022, 'n_tokens_neox': 979, 'n_words': 150}