<commit_before>module("ngSeed:Auth",{
  setup : function(){
    S.open('test-index.html');
  },
  teardown : function(){

  }
});

test("Navigation", function () {
  S("ul.nav").visible(function () {
    ok( S("ul.nav"), "Nav bar is here");
  });
});

test("Login Tests", function () {
  S('ul.nav').visible(function () {
    // Click on the users link
    S("a[href='/login']").click(function () {
      S('.container').visible(function(){
        // Check if the login form exists
        // And type username and password
        S("input#username").exists()
        .click()
        .type('admin');

        S("input#password").exists()
        .click()
        .type('<PASSWORD>');

        // Click to login
        S("button[type=submit]").exists()
        .click({}, function () {

          S("a[href='/users']").click();

          // See if the container has the text
          S('.container').visible(2000, function(){
            equal( S('h1').text(), "This is a private area.", "Access the private area")
          });

        });

        // Click on the logout button
        S("a[href='/logout']").click();

        // Click again in the users link
        S("a[href='/users']").click(); 

        S('.container').visible(function(){
          ok( S('input#username'), "Login form is being displayed after logout")
        });
      });
    });
  });<commit_msg>tests($auth): Fixed Functional Test for $auth, had to add waits and more callback soup.<commit_after>module("ngSeed:Auth",{
  setup : function(){
    S.open('test-index.html');
  },
  teardown : function(){

  }
});

test("Navigation", function () {
  S("ul.nav").visible(function () {
    ok( S("ul.nav"), "Nav bar is here");
  });
});

test("Login Tests", function () {
  S('ul.nav').visible(function () {
    // Click on the users link
    S("a[href='/login']").click(function () {

      S('.container').visible(function(){
        // Check if the login form exists
        // And type username and password
        S("input#username").exists()
        .click()
        .type('admin');

        S("input#password").exists()
        .click()
        .type('<PASSWORD>');

        // Click to login
        S("button[type=submit]").exists().click();
        S.wait(2000, function() {
          // Click on Users
          S("a[href='/users']").click();
          S.wait(100, function() {

            equal( S('h1').text(), "This is a private area.", "Access the private area");

            // Click on the logout button
            S("a[href='/logout']").click();
            S.wait(100, function() {

              // Click again in the users link
              S("a[href='/users']").click();
              S.wait(100, function() {
                ok( S('input#username'), "Login form is being displayed after logout")
              });
            });
          });
        });
      });
    });
  });
{'fraction_non_alphanumeric': 0.1987534626038781, 'fraction_numerical': 0.006578947368421052, 'mean_word_length': 2.0474683544303796, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3704228', 'n_tokens_mistral': 862, 'n_tokens_neox': 828, 'n_words': 198}