<commit_before>
var setup = require("../test/setup");
var assert = require("assert");
var config = require("../server/config.js");
var Q = require("q");
var waitUntil = require("../test/waitUntil");
var path = require("path");

var fileToUpload = path.resolve(__dirname, "subscriptions.xml");

setup.whenRunningTheServer(exports);

setup.qtest(exports, "can upload rss", setup.usingPhantom(function(page) {

  return page.promise.open(config.urlFor("/upload/from/google"))
  .then(function(status) {

    assert.equal(status, "success");

    return page.promise.uploadFile('form.uploadRss input[type=file]', fileToUpload);
  })
  .then(function() {
    return page.promise.clickElement('form.uploadRss input[type=submit]');
  })
  .then(function() {

    return waitUntil("upload is complete",function() {
      return page.promise.evaluate(function() { return document.title; })
        .then(function(title) {
          console.log("title", title);
          return title.indexOf("Upload complete") > -1;
        });
    }, 2000);
  })<commit_msg>rss smoke test now logs in<commit_after>
var assert = require("assert");
var path = require("path");

var setup = require("../test/setup");
var config = require("../server/config.js");
var waitUntil = require("../test/waitUntil");
var login = require("./login");

var fileToUpload = path.resolve(__dirname, "subscriptions.xml");

setup.whenRunningTheServer(exports);

setup.qtest(exports, "can upload rss", setup.usingPhantom(function(page) {

  return page.promise.open(config.urlFor("/upload/from/google"))
  .then(function(status) {
      
      assert.equal(status, "success");

      return login.doLogin(page);
  })
  .then(function() {
    return page.promise.uploadFile('form.uploadRss input[type=file]', fileToUpload);
  })
  .then(function() {
    return page.promise.clickElement('form.uploadRss input[type=submit]');
  })
  .then(function() {

    return waitUntil("upload is complete",function() {
      return page.promise.evaluate(function() { return document.title; })
        .then(function(title) {
          console.log("title", title);
          return title.indexOf("Upload complete") > -1;
        });
    }, 2000);
  })
{'fraction_non_alphanumeric': 0.1729014598540146, 'fraction_numerical': 0.004562043795620438, 'mean_word_length': 3.984090909090909, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '7307680', 'n_tokens_mistral': 682, 'n_tokens_neox': 662, 'n_words': 126}