<commit_before>describe('Nodes Page', function () {

  beforeEach(function () {
    cy.configureCluster({
      mesos: '1-for-each-health',
      nodeHealth: true
    });
    cy.visitUrl({url: '/nodes'});
  });

  context('Filters nodes table', function () {

    it('should show all nodes', function () {
      cy.get('tbody tr').should('contain', 'dcos-01');
      cy.get('tbody tr').should('contain', '192.168.127.12');
      cy.get('tbody tr').should('contain', '172.16.31.10');
    });

    it('should only show healthy node', function () {
      cy.get('.filter-bar').as('filterBar');
      cy.get('@filterBar').contains('Healthy').click();

      cy.get('tbody tr').should('not.contain', 'dcos-01');
      cy.get('tbody tr').should('not.contain', '172.16.31.10');
      cy.get('tbody tr').should('contain', '192.168.127.12');
    });

    it('should only show unhealthy node', function () {
      cy.get('.filter-bar').as('filterBar');
      cy.get('@filterBar').contains('Unhealthy').click();

      cy.get('tbody tr').should('not.contain', 'dcos-01');
      cy.get('tbody tr').should('not.contain', '192.168.127.12');
      cy.get('tbody tr').should('contain', '172.16.31.10');
    });

    it('should only show nodes with service', function () {
      cy.get('.filter-bar').as('filterBar');
      cy.get('@filterBar').contains('Filter by Service').click();
      cy.get('.dropdown-menu').contains('cassandra-healthy').click();

      cy.get('tbody tr').should('not.contain', '172.16.31.10');
      cy.get('tbody tr').should('not.contain', '192.168.127.12');
      cy.get('tbody tr').should('contain', 'dcos-01');
    });

  });

  context('Filters nodes grid', function () {

    beforeEach(function () {
      cy.visitUrl({url: '/nodes/grid'});
    });

    it('should show all nodes', function () {
      // Navigate to the grid using button
      cy.visitUrl({url: '/nodes'});
      cy.get('.filter-bar').as('filterBar');
      cy.get('@filterBar').contains('Grid').click();

      cy.get('.nodes-grid-dials').should('contain', '3%');
      cy.get('.nodes-grid-dials').should('contain', '5%');
      cy.get('.nodes-grid-dials').should('contain', '19%');
    });

    it('should only show cassandra-healthy nodes', function () {
      cy.get('.filter-bar').as('filterBar');
      cy.get('@filterBar').contains('Filter by Service').click();
      cy.get('.dropdown-menu').contains('cassandra-healthy').click();

      cy.get('.nodes-grid-dials').should('contain', '3%');
      cy.get('.nodes-grid-dials').should('not.contain', '5%');
      cy.get('.nodes-grid-dials').should('not.contain', '19%');
    });

    it('should not display any nodes', function () {
      cy.get('.filter-bar').as('filterBar');
      cy.get('@filterBar').contains('Filter by Service').click();
      cy.get('.dropdown-menu').contains('cassandra-na').click();

      cy.get('.nodes-grid-dials').should('not.contain', '3%');
      cy.get('.nodes-grid-dials').should('not.contain', '5%');
      cy.get('.nodes-grid-dials').should('not.contain', '19%');
    });

    it('should only show unhealthy node', function () {
      cy.get('.filter-bar').as('filterBar');
      cy.get('@filterBar').contains('Filter by Service').click();
      cy.get('.dropdown-menu').contains('cassandra-unhealthy').click();
      cy.get('@filterBar').contains('Healthy').click();

      cy.get('.nodes-grid-dials').should('not.contain', '3%');
      cy.get('.nodes-grid-dials').should('contain', '5%');
      cy.get('.nodes-grid-dials').should('not.contain', '19%');
    });

  });

});
<commit_msg>Cleaned up tests to run more efficiently<commit_after>describe('Nodes Page', function () {

  context('Filters nodes table', function () {

    beforeEach(function () {
      cy.configureCluster({
        mesos: '1-for-each-health',
        nodeHealth: true
      });
      cy.visitUrl({url: '/nodes'});
      cy.get('tbody tr td:first-child').as('hostnames');
    });

    it('should show all nodes', function () {
      cy.get('@hostnames')
        .should('contain', 'dcos-01')
        .should('contain', '192.168.127.12')
        .should('contain', '172.16.31.10');
    });

    it('should only show healthy node', function () {
      cy.get('.filter-bar').as('filterBar');
      cy.get('@filterBar').contains('Healthy').click();

      cy.get('@hostnames')
        .should('not.contain', 'dcos-01')
        .should('not.contain', '172.16.31.10')
        .should('contain', '192.168.127.12');
    });

    it('should only show unhealthy node', function () {
      cy.get('.filter-bar').as('filterBar');
      cy.get('@filterBar').contains('Unhealthy').click();

      cy.get('@hostnames')
        .should('not.contain', 'dcos-01')
        .should('not.contain', '192.168.127.12')
        .should('contain', '172.16.31.10');
    });

    it('should only show nodes with service', function () {
      cy.get('.filter-bar').as('filterBar');
      cy.get('@filterBar').contains('Filter by Service').click();
      cy.get('.dropdown-menu').contains('cassandra-healthy').click();

      cy.get('@hostnames')
        .should('not.contain', '172.16.31.10')
        .should('not.contain', '192.168.127.12')
        .should('contain', 'dcos-01');
    });

  });

  context('Nodes grid', function () {

    beforeEach(function () {
      cy.configureCluster({
        mesos: '1-for-each-health',
        nodeHealth: true
      });
    });

    it('navigates to grid', function () {
      // Navigate to the grid using button
      cy.visitUrl({url: '/nodes'});
      cy.get('.filter-bar').as('filterBar');
      cy.get('@filterBar').contains('Grid').click();

      cy.get('.nodes-grid-dials')
        .should('contain', '3%')
        .should('contain', '5%')
        .should('contain', '19%');
    });

    context('Filters nodes grid', function () {

      beforeEach(function () {
        cy.visitUrl({url: '/nodes/grid'});
      });

      it('should only show cassandra-healthy nodes', function () {
        cy.get('.filter-bar').as('filterBar');
        cy.get('@filterBar').contains('Filter by Service').click();
        cy.get('.dropdown-menu').contains('cassandra-healthy').click();

        cy.get('.nodes-grid-dials')
          .should('contain', '3%')
          .should('not.contain', '5%')
          .should('not.contain', '19%');
      });

      it('should not display any nodes', function () {
        cy.get('.filter-bar').as('filterBar');
        cy.get('@filterBar').contains('Filter by Service').click();
        cy.get('.dropdown-menu').contains('cassandra-na').click();

        cy.get('.nodes-grid-dials')
          .should('not.contain', '3%')
          .should('not.contain', '5%')
          .should('not.contain', '19%');
      });

      it('should only show unhealthy node', function () {
        cy.get('.filter-bar').as('filterBar');
        cy.get('@filterBar').contains('Filter by Service').click();
        cy.get('.dropdown-menu').contains('cassandra-unhealthy').click();
        cy.get('@filterBar').contains('Healthy').click();

        cy.get('.nodes-grid-dials')
          .should('not.contain', '3%')
          .should('contain', '5%')
          .should('not.contain', '19%');
      });

    });

  });

});

{'fraction_non_alphanumeric': 0.23413414803499513, 'fraction_numerical': 0.029301485904735452, 'mean_word_length': 2.861662198391421, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 16, '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': '5088477', 'n_tokens_mistral': 2481, 'n_tokens_neox': 2305, 'n_words': 341}