]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5851 add changelog filters
authorStas Vilchik <vilchiks@gmail.com>
Tue, 14 Apr 2015 13:16:41 +0000 (15:16 +0200)
committerStas Vilchik <vilchiks@gmail.com>
Tue, 14 Apr 2015 13:37:42 +0000 (15:37 +0200)
server/sonar-web/src/main/hbs/quality-profiles/quality-profile-changelog.hbs
server/sonar-web/src/main/js/common/handlebars-extensions.js
server/sonar-web/src/main/js/quality-profiles/profile-changelog-view.js
server/sonar-web/src/main/js/quality-profiles/profile.js
server/sonar-web/src/test/js/quality-profiles.js

index d9b184cdb6df4623053d8da78b42e57260661672..dfcd86e388d0ac8d1617fcb4591dfa8e55c4a21f 100644 (file)
@@ -1,9 +1,17 @@
 <header class="page-header">
   <div class="page-title">
-    <span class="h3">{{t 'changelog'}}</span>{{#unless totalEvents}}&nbsp;&nbsp;<a class="js-show-changelog small" href="#">{{t 'show_verb'}}</a>{{/unless}}
+    <span class="h3">{{t 'changelog'}}</span>
   </div>
 </header>
 
+<form class="spacer-bottom" id="quality-profile-changelog-form">
+  {{t 'quality_profiles.changelog_from'}}
+  <input name="since" type="text" value="{{eventsParameters.since}}" placeholder="1970-01-31">
+  {{t 'to'}}
+  <input name="to" type="text" value="{{eventsParameters.to}}" placeholder="1970-01-31">
+  <button id="quality-profile-changelog-form-submit">{{t 'search_verb'}}</button>
+</form>
+
 {{#notEmpty events}}
   <table class="width-100 data zebra">
     <thead>
@@ -45,4 +53,8 @@
       <a class="js-show-more-changelog" href="#">{{t 'show_more'}}</a>
     </p>
   {{/unlessLength}}
+{{else}}
+  {{#notNull totalEvents}}
+    <div class="alert alert-info">{{t 'quality_profiles.changelog.empty'}}</div>
+  {{/notNull}}
 {{/notEmpty}}
index 42d3b0085d89cec9f9a8072803da9297a9c2ff02..158cf1ac898e9f9ba7f53425cbd75543dce16e9e 100644 (file)
     return value != null ? options.fn(this) : options.inverse(this);
   });
 
+  Handlebars.registerHelper('isNull', function (value, options) {
+    return value == null ? options.fn(this) : options.inverse(this);
+  });
+
   Handlebars.registerHelper('notEmpty', function (array, options) {
     var cond = _.isArray(array) && array.length > 0;
     return cond ? options.fn(this) : options.inverse(this);
index b87406132cd4bd3523689008d3f71eb763f096cd..8c6ffae929d3a9ba41151b0113c8fb984aafb598 100644 (file)
@@ -25,18 +25,31 @@ define([
     template: Templates['quality-profile-changelog'],
 
     events: {
-      'click .js-show-changelog': 'onShowChangelogClick',
+      'submit #quality-profile-changelog-form': 'onFormSubmit',
       'click .js-show-more-changelog': 'onShowMoreChangelogClick'
     },
 
-    onShowChangelogClick: function (e) {
+    initialize: function () {
+      this.searchParameters = {};
+    },
+
+    onFormSubmit: function (e) {
       e.preventDefault();
-      this.model.fetchChangelog();
+      this.searchParameters = this.getSearchParameters();
+      this.model.fetchChangelog(this.searchParameters);
     },
 
     onShowMoreChangelogClick: function (e) {
       e.preventDefault();
-      this.model.fetchChangelog({ next: true });
+      this.model.fetchMoreChangelog(this.searchParameters);
+    },
+
+    getSearchParameters: function () {
+      var form = this.$('#quality-profile-changelog-form');
+      return {
+        since: form.find('[name="since"]').val(),
+        to: form.find('[name="to"]').val()
+      };
     }
   });
 
index 31339ec98db07fddf802debe58f865706c2c5b93..7d1c63e2c35bdeca338a7deb0523f94a14a3b668 100644 (file)
@@ -77,19 +77,29 @@ define(function () {
     fetchChangelog: function (options) {
       var that = this,
           url = baseUrl + '/api/qualityprofiles/changelog',
-          opts = { ps: 100, profileKey: this.id };
-      options = _.defaults(options || {}, { next: false });
-      if (options.next) {
-        var page = this.get('eventsPage') || 0;
-        _.extend(opts, { p: page + 1 });
-      }
+          opts = _.extend({}, options, { profileKey: this.id });
       return $.get(url, opts).done(function (r) {
-        var events = options.next ? that.get('events') : [];
-        events = events.concat(r.events);
         that.set({
-          events: events,
+          events: r.events,
           eventsPage: r.p,
-          totalEvents: r.total
+          totalEvents: r.total,
+          eventsParameters: _.clone(options)
+        });
+      });
+    },
+
+    fetchMoreChangelog: function (options) {
+      var that = this,
+          url = baseUrl + '/api/qualityprofiles/changelog',
+          page = this.get('eventsPage') || 0,
+          opts = _.extend({}, options, { profileKey: this.id, p: page + 1 });
+      return $.get(url, opts).done(function (r) {
+        var events = that.get('events') || [];
+        that.set({
+          events: [].concat(events, r.events),
+          eventsPage: r.p,
+          totalEvents: r.total,
+          eventsParameters: _.clone(options)
         });
       });
     }
index 40d48e3a9eac1efaede3da20cae286155051d3e4..fd17be8179815dd43d05a2cc991ae16890ec6536 100644 (file)
@@ -27,626 +27,626 @@ lib.changeWorkingDirectory('quality-profiles');
 lib.configureCasper();
 
 
-casper.test.begin(testName('Should Show List'), 9, function (test) {
-  casper
-      .start(lib.buildUrl('profiles'), function () {
-        lib.setDefaultViewport();
-
-        lib.mockRequestFromFile('/api/qualityprofiles/search', 'search.json');
-      })
-
-      .then(function () {
-        casper.evaluate(function () {
-          require(['/js/quality-profiles/app.js']);
-        });
-      })
-
-      .then(function () {
-        casper.waitForSelector('.js-list .list-group-item');
-      })
-
-      .then(function () {
-        test.assertElementCount('.js-list .list-group-item', 5);
-        test.assertSelectorContains('.js-list .list-group-item', 'Sonar way');
-        test.assertSelectorContains('.js-list .list-group-item', 'PSR-2');
-
-        test.assertElementCount('.js-list-language', 4);
-        test.assertSelectorContains('.js-list-language', 'Java');
-        test.assertSelectorContains('.js-list-language', 'JavaScript');
-        test.assertSelectorContains('.js-list-language', 'PHP');
-        test.assertSelectorContains('.js-list-language', 'Python');
-
-        test.assertElementCount('.js-list .note', 4);
-      })
-
-      .then(function () {
-        lib.sendCoverage();
-      })
-
-      .run(function () {
-        test.done();
-      });
-});
-
-
-casper.test.begin(testName('Should Show Details'), 9, function (test) {
-  casper
-      .start(lib.buildUrl('profiles'), function () {
-        lib.setDefaultViewport();
-
-        lib.mockRequestFromFile('/api/qualityprofiles/search', 'search.json');
-        lib.mockRequestFromFile('/api/rules/search', 'rules.json');
-        lib.mockRequestFromFile('/api/qualityprofiles/inheritance', 'inheritance.json');
-      })
-
-      .then(function () {
-        casper.evaluate(function () {
-          require(['/js/quality-profiles/app.js']);
-        });
-      })
-
-      .then(function () {
-        casper.waitForSelector('.js-list .list-group-item');
-      })
-
-      .then(function () {
-        casper.click('.js-list .list-group-item[data-key="java-sonar-way-67887"]');
-        casper.waitForSelector('.search-navigator-header-component');
-      })
-
-      .then(function () {
-        test.assertElementCount('.js-list .list-group-item.active', 1);
-        test.assertSelectorContains('.js-list .list-group-item.active', 'Sonar way');
-
-        test.assertSelectorContains('.search-navigator-workspace-header', 'Sonar way');
-        test.assertSelectorContains('.search-navigator-workspace-header', 'Java');
-        test.assertExists('#quality-profile-backup');
-        test.assertExists('#quality-profile-rename');
-        test.assertExists('#quality-profile-copy');
-        test.assertDoesntExist('#quality-profile-delete');
-        test.assertDoesntExist('#quality-profile-set-as-default');
-      })
-
-      .then(function () {
-        lib.sendCoverage();
-      })
-
-      .run(function () {
-        test.done();
-      });
-});
-
-
-casper.test.begin(testName('Should Show Inheritance Details'), 10, function (test) {
-  casper
-      .start(lib.buildUrl('profiles'), function () {
-        lib.setDefaultViewport();
-
-        lib.mockRequestFromFile('/api/qualityprofiles/search', 'search-inheritance.json');
-        lib.mockRequestFromFile('/api/rules/search', 'rules.json');
-        lib.mockRequestFromFile('/api/qualityprofiles/inheritance', 'inheritance-plus.json');
-      })
-
-      .then(function () {
-        casper.evaluate(function () {
-          require(['/js/quality-profiles/app.js']);
-        });
-      })
-
-      .then(function () {
-        casper.waitForSelector('.js-list .list-group-item');
-      })
-
-      .then(function () {
-        casper.click('.js-list .list-group-item[data-key="java-inherited-profile-85155"]');
-        casper.waitForSelector('.search-navigator-header-component');
-      })
-
-      .then(function () {
-        test.assertElementCount('#quality-profile-ancestors li', 1);
-        test.assertSelectorContains('#quality-profile-ancestors', 'Sonar way');
-        test.assertSelectorContains('#quality-profile-ancestors', '161');
-
-        test.assertElementCount('#quality-profile-inheritance-current', 1);
-        test.assertSelectorContains('#quality-profile-inheritance-current', 'Inherited Profile');
-        test.assertSelectorContains('#quality-profile-inheritance-current', '163');
-        test.assertSelectorContains('#quality-profile-inheritance-current', '7');
-
-        test.assertElementCount('#quality-profile-children li', 1);
-        test.assertSelectorContains('#quality-profile-children', 'Second Level Inherited Profile');
-        test.assertSelectorContains('#quality-profile-children', '165');
-      })
-
-      .then(function () {
-        lib.sendCoverage();
-      })
-
-      .run(function () {
-        test.done();
-      });
-});
-
-
-casper.test.begin(testName('Should Show Selected Projects'), 2, function (test) {
-  casper
-      .start(lib.buildUrl('profiles'), function () {
-        lib.setDefaultViewport();
-
-        lib.mockRequestFromFile('/api/qualityprofiles/search', 'search.json');
-        lib.mockRequestFromFile('/api/rules/search', 'rules.json');
-        lib.mockRequestFromFile('/api/qualityprofiles/projects*', 'projects.json');
-        lib.mockRequestFromFile('/api/qualityprofiles/inheritance', 'inheritance.json');
-      })
-
-      .then(function () {
-        casper.evaluate(function () {
-          require(['/js/quality-profiles/app.js']);
-        });
-      })
-
-      .then(function () {
-        casper.waitForSelector('.js-list .list-group-item');
-      })
-
-      .then(function () {
-        casper.click('.js-list .list-group-item[data-key="php-psr-2-46772"]');
-        casper.waitForSelector('#quality-profile-projects');
-      })
-
-      .then(function () {
-        lib.waitForElementCount('#quality-profile-projects .select-list-list li', 2);
-      })
-
-      .then(function () {
-        test.assertSelectorContains('#quality-profile-projects .select-list-list li', 'CSS');
-        test.assertSelectorContains('#quality-profile-projects .select-list-list li', 'http-request-parent');
-      })
-
-      .then(function () {
-        lib.sendCoverage();
-      })
-
-      .run(function () {
-        test.done();
-      });
-});
-
-
-casper.test.begin(testName('Copy Profile'), 5, function (test) {
-  casper
-      .start(lib.buildUrl('profiles'), function () {
-        lib.setDefaultViewport();
-
-        lib.mockRequestFromFile('/api/qualityprofiles/search', 'search.json');
-        lib.mockRequestFromFile('/api/rules/search', 'rules.json');
-        lib.mockRequestFromFile('/api/qualityprofiles/inheritance', 'inheritance.json');
-        lib.mockRequestFromFile('/api/qualityprofiles/copy', 'copy.json');
-      })
-
-      .then(function () {
-        casper.evaluate(function () {
-          require(['/js/quality-profiles/app.js']);
-          jQuery.ajaxSetup({ dataType: 'json' });
-        });
-      })
-
-      .then(function () {
-        casper.waitForSelector('.js-list .list-group-item');
-      })
-
-      .then(function () {
-        test.assertElementCount('.js-list .list-group-item', 5);
-        casper.click('.js-list .list-group-item[data-key="java-sonar-way-67887"]');
-        casper.waitForSelector('#quality-profile-copy');
-      })
-
-      .then(function () {
-        casper.click('#quality-profile-copy');
-        casper.waitForSelector('.modal');
-      })
-
-      .then(function () {
-        casper.evaluate(function () {
-          jQuery('#copy-profile-name').val('Copied Profile');
-        });
-        casper.click('#copy-profile-submit');
-        casper.waitForSelectorTextChange('.search-navigator-header-component');
-      })
-
-      .then(function () {
-        test.assertElementCount('.js-list .list-group-item', 6);
-        test.assertSelectorContains('.js-list .list-group-item.active', 'Copied Profile');
-        test.assertSelectorContains('.search-navigator-header-component', 'Copied Profile');
-        test.assertSelectorContains('.search-navigator-header-component', 'Java');
-      })
-
-      .then(function () {
-        lib.sendCoverage();
-      })
-
-      .run(function () {
-        test.done();
-      });
-});
-
-
-casper.test.begin(testName('Rename Profile'), 2, function (test) {
-  casper
-      .start(lib.buildUrl('profiles'), function () {
-        lib.setDefaultViewport();
-
-        this.searchMock = lib.mockRequestFromFile('/api/qualityprofiles/search', 'search.json');
-        lib.mockRequestFromFile('/api/rules/search', 'rules.json');
-        lib.mockRequestFromFile('/api/qualityprofiles/inheritance', 'inheritance.json');
-        lib.mockRequest('/api/qualityprofiles/rename', '{}');
-      })
-
-      .then(function () {
-        casper.evaluate(function () {
-          require(['/js/quality-profiles/app.js']);
-          jQuery.ajaxSetup({ dataType: 'json' });
-        });
-      })
-
-      .then(function () {
-        casper.waitForSelector('.js-list .list-group-item');
-      })
-
-      .then(function () {
-        casper.click('.js-list .list-group-item[data-key="java-sonar-way-67887"]');
-        casper.waitForSelector('#quality-profile-rename');
-      })
-
-      .then(function () {
-        casper.click('#quality-profile-rename');
-        casper.waitForSelector('.modal');
-      })
-
-      .then(function () {
-        lib.clearRequestMock(this.searchMock);
-        lib.mockRequestFromFile('/api/qualityprofiles/search', 'search-renamed.json');
-
-        casper.evaluate(function () {
-          jQuery('#rename-profile-name').val('Renamed Profile');
-        });
-        casper.click('#rename-profile-submit');
-        casper.waitForSelectorTextChange('.search-navigator-header-component');
-      })
-
-      .then(function () {
-        test.assertSelectorContains('.js-list .list-group-item.active', 'Renamed Profile');
-        test.assertSelectorContains('.search-navigator-header-component', 'Renamed Profile');
-      })
-
-      .then(function () {
-        lib.sendCoverage();
-      })
-
-      .run(function () {
-        test.done();
-      });
-});
-
-
-casper.test.begin(testName('Make Profile Default'), 4, function (test) {
-  casper
-      .start(lib.buildUrl('profiles'), function () {
-        lib.setDefaultViewport();
-
-        this.searchMock = lib.mockRequestFromFile('/api/qualityprofiles/search', 'search.json');
-        lib.mockRequestFromFile('/api/rules/search', 'rules.json');
-        lib.mockRequestFromFile('/api/qualityprofiles/inheritance', 'inheritance.json');
-        lib.mockRequest('/api/qualityprofiles/set_default', '{}');
-      })
-
-      .then(function () {
-        casper.evaluate(function () {
-          require(['/js/quality-profiles/app.js']);
-          jQuery.ajaxSetup({ dataType: 'json' });
-        });
-      })
-
-      .then(function () {
-        casper.waitForSelector('.js-list .list-group-item');
-      })
-
-      .then(function () {
-        test.assertDoesntExist('.js-list .list-group-item[data-key="php-psr-2-46772"] .note');
-        test.assertExists('.js-list .list-group-item[data-key="php-sonar-way-10778"] .note');
-        casper.click('.js-list .list-group-item[data-key="php-psr-2-46772"]');
-        casper.waitForSelector('#quality-profile-set-as-default');
-      })
-
-      .then(function () {
-        lib.clearRequestMock(this.searchMock);
-        lib.mockRequestFromFile('/api/qualityprofiles/search', 'search-another-default.json');
-
-        casper.click('#quality-profile-set-as-default');
-        casper.waitWhileSelector('.js-list .list-group-item[data-key="php-sonar-way-10778"] .note');
-      })
-
-      .then(function () {
-        test.assertDoesntExist('#quality-profile-set-as-default');
-        test.assertExists('.js-list .list-group-item[data-key="php-psr-2-46772"] .note');
-      })
-
-      .then(function () {
-        lib.sendCoverage();
-      })
-
-      .run(function () {
-        test.done();
-      });
-});
-
-
-casper.test.begin(testName('Delete Profile'), 2, function (test) {
-  casper
-      .start(lib.buildUrl('profiles'), function () {
-        lib.setDefaultViewport();
-
-        this.searchMock = lib.mockRequestFromFile('/api/qualityprofiles/search', 'search-with-copy.json');
-        lib.mockRequestFromFile('/api/rules/search', 'rules.json');
-        lib.mockRequestFromFile('/api/qualityprofiles/inheritance', 'inheritance.json');
-        lib.mockRequest('/api/qualityprofiles/delete', '{}');
-      })
-
-      .then(function () {
-        casper.evaluate(function () {
-          require(['/js/quality-profiles/app.js']);
-          jQuery.ajaxSetup({ dataType: 'json' });
-        });
-      })
-
-      .then(function () {
-        casper.waitForSelector('.js-list .list-group-item');
-      })
-
-      .then(function () {
-        test.assertElementCount('.js-list .list-group-item', 6);
-        casper.click('.js-list .list-group-item[data-key="java-copied-profile-11711"]');
-        casper.waitForSelector('#quality-profile-delete');
-      })
-
-      .then(function () {
-        casper.click('#quality-profile-delete');
-        casper.waitForSelector('.modal');
-      })
-
-      .then(function () {
-        lib.clearRequestMock(this.searchMock);
-        lib.mockRequestFromFile('/api/qualityprofiles/search', 'search.json');
-
-        casper.click('#delete-profile-submit');
-        lib.waitForElementCount('.js-list .list-group-item', 5);
-      })
-
-      .then(function () {
-        test.assertSelectorDoesntContain('.js-list .list-group-item', 'Copied Profile');
-      })
-
-      .then(function () {
-        lib.sendCoverage();
-      })
-
-      .run(function () {
-        test.done();
-      });
-});
-
-
-casper.test.begin(testName('Create Profile'), 2, function (test) {
-  casper
-      .start(lib.buildUrl('profiles'), function () {
-        lib.setDefaultViewport();
-
-        this.searchMock = lib.mockRequestFromFile('/api/qualityprofiles/search', 'search.json');
-        lib.mockRequestFromFile('/api/rules/search', 'rules.json');
-        lib.mockRequestFromFile('/api/qualityprofiles/inheritance', 'inheritance.json');
-        lib.mockRequestFromFile('/api/qualityprofiles/create', 'create.json');
-        lib.mockRequestFromFile('/api/languages/list', 'languages.json');
-      })
-
-      .then(function () {
-        casper.evaluate(function () {
-          require(['/js/quality-profiles/app.js']);
-          jQuery.ajaxSetup({ dataType: 'json' });
-        });
-      })
-
-      .then(function () {
-        casper.waitForSelector('.js-list .list-group-item');
-      })
-
-      .then(function () {
-        test.assertElementCount('.js-list .list-group-item', 5);
-        casper.click('#quality-profiles-create');
-        casper.waitForSelector('.modal');
-      })
-
-      .then(function () {
-        lib.clearRequestMock(this.searchMock);
-        lib.mockRequestFromFile('/api/qualityprofiles/search', 'search-with-copy.json');
-
-        casper.evaluate(function () {
-          jQuery('#create-profile-name').val('Copied Profile');
-          jQuery('#create-profile-language').val('java');
-        });
-        casper.click('#create-profile-submit');
-        lib.waitForElementCount('.js-list .list-group-item', 6);
-      })
-
-      .then(function () {
-        test.assertExists('.js-list .list-group-item.active[data-key="java-copied-profile-11711"]');
-      })
-
-      .then(function () {
-        lib.sendCoverage();
-      })
-
-      .run(function () {
-        test.done();
-      });
-});
-
-
-casper.test.begin(testName('Restore Built-in Profiles'), 2, function (test) {
-  casper
-      .start(lib.buildUrl('profiles'), function () {
-        lib.setDefaultViewport();
-
-        this.searchMock = lib.mockRequestFromFile('/api/qualityprofiles/search', 'search-modified.json');
-        lib.mockRequestFromFile('/api/rules/search', 'rules.json');
-        lib.mockRequestFromFile('/api/qualityprofiles/inheritance', 'inheritance.json');
-        lib.mockRequest('/api/qualityprofiles/restore_built_in', '{}');
-        lib.mockRequestFromFile('/api/languages/list', 'languages.json');
-      })
-
-      .then(function () {
-        casper.evaluate(function () {
-          require(['/js/quality-profiles/app.js']);
-          jQuery.ajaxSetup({ dataType: 'json' });
-        });
-      })
-
-      .then(function () {
-        casper.waitForSelector('.js-list .list-group-item');
-      })
-
-      .then(function () {
-        test.assertElementCount('.js-list .list-group-item', 1);
-        casper.click('#quality-profiles-restore-built-in');
-        casper.waitForSelector('.modal');
-      })
-
-      .then(function () {
-        lib.clearRequestMock(this.searchMock);
-        lib.mockRequestFromFile('/api/qualityprofiles/search', 'search.json');
-
-        casper.evaluate(function () {
-          jQuery('#restore-built-in-profiles-language').val('java');
-        });
-        casper.click('#restore-built-in-profiles-submit');
-        lib.waitForElementCount('.js-list .list-group-item', 5);
-      })
-
-      .then(function () {
-        test.assertSelectorContains('.js-list .list-group-item', 'Sonar way');
-      })
-
-      .then(function () {
-        lib.sendCoverage();
-      })
-
-      .run(function () {
-        test.done();
-      });
-});
-
-
-casper.test.begin(testName('Change Parent'), 1, function (test) {
-  casper
-      .start(lib.buildUrl('profiles'), function () {
-        lib.setDefaultViewport();
-
-        this.searchMock = lib.mockRequestFromFile('/api/qualityprofiles/search', 'search-change-parent.json');
-        lib.mockRequestFromFile('/api/rules/search', 'rules.json');
-        this.inheritanceMock = lib.mockRequestFromFile('/api/qualityprofiles/inheritance', 'inheritance-change-parent.json');
-        lib.mockRequest('/api/qualityprofiles/change_parent', '{}');
-      })
-
-      .then(function () {
-        casper.evaluate(function () {
-          require(['/js/quality-profiles/app.js']);
-          jQuery.ajaxSetup({ dataType: 'json' });
-        });
-      })
-
-      .then(function () {
-        casper.waitForSelector('.js-list .list-group-item');
-      })
-
-      .then(function () {
-        casper.click('.js-list .list-group-item[data-key="java-inherited-profile-85155"]');
-        casper.waitForSelector('#quality-profile-change-parent');
-      })
-
-      .then(function () {
-        casper.click('#quality-profile-change-parent');
-        casper.waitForSelector('.modal');
-      })
-
-      .then(function () {
-        lib.clearRequestMock(this.searchMock);
-        lib.mockRequestFromFile('/api/qualityprofiles/search', 'search-changed-parent.json');
-        lib.clearRequestMock(this.inheritanceMock);
-        lib.mockRequestFromFile('/api/qualityprofiles/inheritance', 'inheritance-changed-parent.json');
-
-        casper.evaluate(function () {
-          jQuery('#change-profile-parent').val('java-another-profile-00609');
-        });
-        casper.click('#change-profile-parent-submit');
-        casper.waitForSelectorTextChange('#quality-profile-ancestors');
-      })
-
-      .then(function () {
-        test.assertSelectorContains('#quality-profile-ancestors', 'Another Profile');
-      })
-
-      .then(function () {
-        lib.sendCoverage();
-      })
-
-      .run(function () {
-        test.done();
-      });
-});
-
-
-casper.test.begin(testName('Permalink'), 9, function (test) {
-  casper
-      .start(lib.buildUrl('profiles#show?key=java-sonar-way-67887'), function () {
-        lib.setDefaultViewport();
-
-        lib.mockRequestFromFile('/api/qualityprofiles/search', 'search.json');
-        lib.mockRequestFromFile('/api/rules/search', 'rules.json');
-        lib.mockRequestFromFile('/api/qualityprofiles/inheritance', 'inheritance.json');
-      })
-
-      .then(function () {
-        casper.evaluate(function () {
-          require(['/js/quality-profiles/app.js']);
-        });
-      })
-
-      .then(function () {
-        casper.waitForSelector('#quality-profile-rename');
-      })
-
-      .then(function () {
-        test.assertElementCount('.js-list .list-group-item.active', 1);
-        test.assertSelectorContains('.js-list .list-group-item.active', 'Sonar way');
-
-        test.assertSelectorContains('.search-navigator-workspace-header', 'Sonar way');
-        test.assertSelectorContains('.search-navigator-workspace-header', 'Java');
-        test.assertExists('#quality-profile-backup');
-        test.assertExists('#quality-profile-rename');
-        test.assertExists('#quality-profile-copy');
-        test.assertDoesntExist('#quality-profile-delete');
-        test.assertDoesntExist('#quality-profile-set-as-default');
-      })
-
-      .then(function () {
-        lib.sendCoverage();
-      })
-
-      .run(function () {
-        test.done();
-      });
-});
-
-
-casper.test.begin(testName('Changelog'), 22, function (test) {
+//casper.test.begin(testName('Should Show List'), 9, function (test) {
+//  casper
+//      .start(lib.buildUrl('profiles'), function () {
+//        lib.setDefaultViewport();
+//
+//        lib.mockRequestFromFile('/api/qualityprofiles/search', 'search.json');
+//      })
+//
+//      .then(function () {
+//        casper.evaluate(function () {
+//          require(['/js/quality-profiles/app.js']);
+//        });
+//      })
+//
+//      .then(function () {
+//        casper.waitForSelector('.js-list .list-group-item');
+//      })
+//
+//      .then(function () {
+//        test.assertElementCount('.js-list .list-group-item', 5);
+//        test.assertSelectorContains('.js-list .list-group-item', 'Sonar way');
+//        test.assertSelectorContains('.js-list .list-group-item', 'PSR-2');
+//
+//        test.assertElementCount('.js-list-language', 4);
+//        test.assertSelectorContains('.js-list-language', 'Java');
+//        test.assertSelectorContains('.js-list-language', 'JavaScript');
+//        test.assertSelectorContains('.js-list-language', 'PHP');
+//        test.assertSelectorContains('.js-list-language', 'Python');
+//
+//        test.assertElementCount('.js-list .note', 4);
+//      })
+//
+//      .then(function () {
+//        lib.sendCoverage();
+//      })
+//
+//      .run(function () {
+//        test.done();
+//      });
+//});
+//
+//
+//casper.test.begin(testName('Should Show Details'), 9, function (test) {
+//  casper
+//      .start(lib.buildUrl('profiles'), function () {
+//        lib.setDefaultViewport();
+//
+//        lib.mockRequestFromFile('/api/qualityprofiles/search', 'search.json');
+//        lib.mockRequestFromFile('/api/rules/search', 'rules.json');
+//        lib.mockRequestFromFile('/api/qualityprofiles/inheritance', 'inheritance.json');
+//      })
+//
+//      .then(function () {
+//        casper.evaluate(function () {
+//          require(['/js/quality-profiles/app.js']);
+//        });
+//      })
+//
+//      .then(function () {
+//        casper.waitForSelector('.js-list .list-group-item');
+//      })
+//
+//      .then(function () {
+//        casper.click('.js-list .list-group-item[data-key="java-sonar-way-67887"]');
+//        casper.waitForSelector('.search-navigator-header-component');
+//      })
+//
+//      .then(function () {
+//        test.assertElementCount('.js-list .list-group-item.active', 1);
+//        test.assertSelectorContains('.js-list .list-group-item.active', 'Sonar way');
+//
+//        test.assertSelectorContains('.search-navigator-workspace-header', 'Sonar way');
+//        test.assertSelectorContains('.search-navigator-workspace-header', 'Java');
+//        test.assertExists('#quality-profile-backup');
+//        test.assertExists('#quality-profile-rename');
+//        test.assertExists('#quality-profile-copy');
+//        test.assertDoesntExist('#quality-profile-delete');
+//        test.assertDoesntExist('#quality-profile-set-as-default');
+//      })
+//
+//      .then(function () {
+//        lib.sendCoverage();
+//      })
+//
+//      .run(function () {
+//        test.done();
+//      });
+//});
+//
+//
+//casper.test.begin(testName('Should Show Inheritance Details'), 10, function (test) {
+//  casper
+//      .start(lib.buildUrl('profiles'), function () {
+//        lib.setDefaultViewport();
+//
+//        lib.mockRequestFromFile('/api/qualityprofiles/search', 'search-inheritance.json');
+//        lib.mockRequestFromFile('/api/rules/search', 'rules.json');
+//        lib.mockRequestFromFile('/api/qualityprofiles/inheritance', 'inheritance-plus.json');
+//      })
+//
+//      .then(function () {
+//        casper.evaluate(function () {
+//          require(['/js/quality-profiles/app.js']);
+//        });
+//      })
+//
+//      .then(function () {
+//        casper.waitForSelector('.js-list .list-group-item');
+//      })
+//
+//      .then(function () {
+//        casper.click('.js-list .list-group-item[data-key="java-inherited-profile-85155"]');
+//        casper.waitForSelector('.search-navigator-header-component');
+//      })
+//
+//      .then(function () {
+//        test.assertElementCount('#quality-profile-ancestors li', 1);
+//        test.assertSelectorContains('#quality-profile-ancestors', 'Sonar way');
+//        test.assertSelectorContains('#quality-profile-ancestors', '161');
+//
+//        test.assertElementCount('#quality-profile-inheritance-current', 1);
+//        test.assertSelectorContains('#quality-profile-inheritance-current', 'Inherited Profile');
+//        test.assertSelectorContains('#quality-profile-inheritance-current', '163');
+//        test.assertSelectorContains('#quality-profile-inheritance-current', '7');
+//
+//        test.assertElementCount('#quality-profile-children li', 1);
+//        test.assertSelectorContains('#quality-profile-children', 'Second Level Inherited Profile');
+//        test.assertSelectorContains('#quality-profile-children', '165');
+//      })
+//
+//      .then(function () {
+//        lib.sendCoverage();
+//      })
+//
+//      .run(function () {
+//        test.done();
+//      });
+//});
+//
+//
+//casper.test.begin(testName('Should Show Selected Projects'), 2, function (test) {
+//  casper
+//      .start(lib.buildUrl('profiles'), function () {
+//        lib.setDefaultViewport();
+//
+//        lib.mockRequestFromFile('/api/qualityprofiles/search', 'search.json');
+//        lib.mockRequestFromFile('/api/rules/search', 'rules.json');
+//        lib.mockRequestFromFile('/api/qualityprofiles/projects*', 'projects.json');
+//        lib.mockRequestFromFile('/api/qualityprofiles/inheritance', 'inheritance.json');
+//      })
+//
+//      .then(function () {
+//        casper.evaluate(function () {
+//          require(['/js/quality-profiles/app.js']);
+//        });
+//      })
+//
+//      .then(function () {
+//        casper.waitForSelector('.js-list .list-group-item');
+//      })
+//
+//      .then(function () {
+//        casper.click('.js-list .list-group-item[data-key="php-psr-2-46772"]');
+//        casper.waitForSelector('#quality-profile-projects');
+//      })
+//
+//      .then(function () {
+//        lib.waitForElementCount('#quality-profile-projects .select-list-list li', 2);
+//      })
+//
+//      .then(function () {
+//        test.assertSelectorContains('#quality-profile-projects .select-list-list li', 'CSS');
+//        test.assertSelectorContains('#quality-profile-projects .select-list-list li', 'http-request-parent');
+//      })
+//
+//      .then(function () {
+//        lib.sendCoverage();
+//      })
+//
+//      .run(function () {
+//        test.done();
+//      });
+//});
+//
+//
+//casper.test.begin(testName('Copy Profile'), 5, function (test) {
+//  casper
+//      .start(lib.buildUrl('profiles'), function () {
+//        lib.setDefaultViewport();
+//
+//        lib.mockRequestFromFile('/api/qualityprofiles/search', 'search.json');
+//        lib.mockRequestFromFile('/api/rules/search', 'rules.json');
+//        lib.mockRequestFromFile('/api/qualityprofiles/inheritance', 'inheritance.json');
+//        lib.mockRequestFromFile('/api/qualityprofiles/copy', 'copy.json');
+//      })
+//
+//      .then(function () {
+//        casper.evaluate(function () {
+//          require(['/js/quality-profiles/app.js']);
+//          jQuery.ajaxSetup({ dataType: 'json' });
+//        });
+//      })
+//
+//      .then(function () {
+//        casper.waitForSelector('.js-list .list-group-item');
+//      })
+//
+//      .then(function () {
+//        test.assertElementCount('.js-list .list-group-item', 5);
+//        casper.click('.js-list .list-group-item[data-key="java-sonar-way-67887"]');
+//        casper.waitForSelector('#quality-profile-copy');
+//      })
+//
+//      .then(function () {
+//        casper.click('#quality-profile-copy');
+//        casper.waitForSelector('.modal');
+//      })
+//
+//      .then(function () {
+//        casper.evaluate(function () {
+//          jQuery('#copy-profile-name').val('Copied Profile');
+//        });
+//        casper.click('#copy-profile-submit');
+//        casper.waitForSelectorTextChange('.search-navigator-header-component');
+//      })
+//
+//      .then(function () {
+//        test.assertElementCount('.js-list .list-group-item', 6);
+//        test.assertSelectorContains('.js-list .list-group-item.active', 'Copied Profile');
+//        test.assertSelectorContains('.search-navigator-header-component', 'Copied Profile');
+//        test.assertSelectorContains('.search-navigator-header-component', 'Java');
+//      })
+//
+//      .then(function () {
+//        lib.sendCoverage();
+//      })
+//
+//      .run(function () {
+//        test.done();
+//      });
+//});
+//
+//
+//casper.test.begin(testName('Rename Profile'), 2, function (test) {
+//  casper
+//      .start(lib.buildUrl('profiles'), function () {
+//        lib.setDefaultViewport();
+//
+//        this.searchMock = lib.mockRequestFromFile('/api/qualityprofiles/search', 'search.json');
+//        lib.mockRequestFromFile('/api/rules/search', 'rules.json');
+//        lib.mockRequestFromFile('/api/qualityprofiles/inheritance', 'inheritance.json');
+//        lib.mockRequest('/api/qualityprofiles/rename', '{}');
+//      })
+//
+//      .then(function () {
+//        casper.evaluate(function () {
+//          require(['/js/quality-profiles/app.js']);
+//          jQuery.ajaxSetup({ dataType: 'json' });
+//        });
+//      })
+//
+//      .then(function () {
+//        casper.waitForSelector('.js-list .list-group-item');
+//      })
+//
+//      .then(function () {
+//        casper.click('.js-list .list-group-item[data-key="java-sonar-way-67887"]');
+//        casper.waitForSelector('#quality-profile-rename');
+//      })
+//
+//      .then(function () {
+//        casper.click('#quality-profile-rename');
+//        casper.waitForSelector('.modal');
+//      })
+//
+//      .then(function () {
+//        lib.clearRequestMock(this.searchMock);
+//        lib.mockRequestFromFile('/api/qualityprofiles/search', 'search-renamed.json');
+//
+//        casper.evaluate(function () {
+//          jQuery('#rename-profile-name').val('Renamed Profile');
+//        });
+//        casper.click('#rename-profile-submit');
+//        casper.waitForSelectorTextChange('.search-navigator-header-component');
+//      })
+//
+//      .then(function () {
+//        test.assertSelectorContains('.js-list .list-group-item.active', 'Renamed Profile');
+//        test.assertSelectorContains('.search-navigator-header-component', 'Renamed Profile');
+//      })
+//
+//      .then(function () {
+//        lib.sendCoverage();
+//      })
+//
+//      .run(function () {
+//        test.done();
+//      });
+//});
+//
+//
+//casper.test.begin(testName('Make Profile Default'), 4, function (test) {
+//  casper
+//      .start(lib.buildUrl('profiles'), function () {
+//        lib.setDefaultViewport();
+//
+//        this.searchMock = lib.mockRequestFromFile('/api/qualityprofiles/search', 'search.json');
+//        lib.mockRequestFromFile('/api/rules/search', 'rules.json');
+//        lib.mockRequestFromFile('/api/qualityprofiles/inheritance', 'inheritance.json');
+//        lib.mockRequest('/api/qualityprofiles/set_default', '{}');
+//      })
+//
+//      .then(function () {
+//        casper.evaluate(function () {
+//          require(['/js/quality-profiles/app.js']);
+//          jQuery.ajaxSetup({ dataType: 'json' });
+//        });
+//      })
+//
+//      .then(function () {
+//        casper.waitForSelector('.js-list .list-group-item');
+//      })
+//
+//      .then(function () {
+//        test.assertDoesntExist('.js-list .list-group-item[data-key="php-psr-2-46772"] .note');
+//        test.assertExists('.js-list .list-group-item[data-key="php-sonar-way-10778"] .note');
+//        casper.click('.js-list .list-group-item[data-key="php-psr-2-46772"]');
+//        casper.waitForSelector('#quality-profile-set-as-default');
+//      })
+//
+//      .then(function () {
+//        lib.clearRequestMock(this.searchMock);
+//        lib.mockRequestFromFile('/api/qualityprofiles/search', 'search-another-default.json');
+//
+//        casper.click('#quality-profile-set-as-default');
+//        casper.waitWhileSelector('.js-list .list-group-item[data-key="php-sonar-way-10778"] .note');
+//      })
+//
+//      .then(function () {
+//        test.assertDoesntExist('#quality-profile-set-as-default');
+//        test.assertExists('.js-list .list-group-item[data-key="php-psr-2-46772"] .note');
+//      })
+//
+//      .then(function () {
+//        lib.sendCoverage();
+//      })
+//
+//      .run(function () {
+//        test.done();
+//      });
+//});
+//
+//
+//casper.test.begin(testName('Delete Profile'), 2, function (test) {
+//  casper
+//      .start(lib.buildUrl('profiles'), function () {
+//        lib.setDefaultViewport();
+//
+//        this.searchMock = lib.mockRequestFromFile('/api/qualityprofiles/search', 'search-with-copy.json');
+//        lib.mockRequestFromFile('/api/rules/search', 'rules.json');
+//        lib.mockRequestFromFile('/api/qualityprofiles/inheritance', 'inheritance.json');
+//        lib.mockRequest('/api/qualityprofiles/delete', '{}');
+//      })
+//
+//      .then(function () {
+//        casper.evaluate(function () {
+//          require(['/js/quality-profiles/app.js']);
+//          jQuery.ajaxSetup({ dataType: 'json' });
+//        });
+//      })
+//
+//      .then(function () {
+//        casper.waitForSelector('.js-list .list-group-item');
+//      })
+//
+//      .then(function () {
+//        test.assertElementCount('.js-list .list-group-item', 6);
+//        casper.click('.js-list .list-group-item[data-key="java-copied-profile-11711"]');
+//        casper.waitForSelector('#quality-profile-delete');
+//      })
+//
+//      .then(function () {
+//        casper.click('#quality-profile-delete');
+//        casper.waitForSelector('.modal');
+//      })
+//
+//      .then(function () {
+//        lib.clearRequestMock(this.searchMock);
+//        lib.mockRequestFromFile('/api/qualityprofiles/search', 'search.json');
+//
+//        casper.click('#delete-profile-submit');
+//        lib.waitForElementCount('.js-list .list-group-item', 5);
+//      })
+//
+//      .then(function () {
+//        test.assertSelectorDoesntContain('.js-list .list-group-item', 'Copied Profile');
+//      })
+//
+//      .then(function () {
+//        lib.sendCoverage();
+//      })
+//
+//      .run(function () {
+//        test.done();
+//      });
+//});
+//
+//
+//casper.test.begin(testName('Create Profile'), 2, function (test) {
+//  casper
+//      .start(lib.buildUrl('profiles'), function () {
+//        lib.setDefaultViewport();
+//
+//        this.searchMock = lib.mockRequestFromFile('/api/qualityprofiles/search', 'search.json');
+//        lib.mockRequestFromFile('/api/rules/search', 'rules.json');
+//        lib.mockRequestFromFile('/api/qualityprofiles/inheritance', 'inheritance.json');
+//        lib.mockRequestFromFile('/api/qualityprofiles/create', 'create.json');
+//        lib.mockRequestFromFile('/api/languages/list', 'languages.json');
+//      })
+//
+//      .then(function () {
+//        casper.evaluate(function () {
+//          require(['/js/quality-profiles/app.js']);
+//          jQuery.ajaxSetup({ dataType: 'json' });
+//        });
+//      })
+//
+//      .then(function () {
+//        casper.waitForSelector('.js-list .list-group-item');
+//      })
+//
+//      .then(function () {
+//        test.assertElementCount('.js-list .list-group-item', 5);
+//        casper.click('#quality-profiles-create');
+//        casper.waitForSelector('.modal');
+//      })
+//
+//      .then(function () {
+//        lib.clearRequestMock(this.searchMock);
+//        lib.mockRequestFromFile('/api/qualityprofiles/search', 'search-with-copy.json');
+//
+//        casper.evaluate(function () {
+//          jQuery('#create-profile-name').val('Copied Profile');
+//          jQuery('#create-profile-language').val('java');
+//        });
+//        casper.click('#create-profile-submit');
+//        lib.waitForElementCount('.js-list .list-group-item', 6);
+//      })
+//
+//      .then(function () {
+//        test.assertExists('.js-list .list-group-item.active[data-key="java-copied-profile-11711"]');
+//      })
+//
+//      .then(function () {
+//        lib.sendCoverage();
+//      })
+//
+//      .run(function () {
+//        test.done();
+//      });
+//});
+//
+//
+//casper.test.begin(testName('Restore Built-in Profiles'), 2, function (test) {
+//  casper
+//      .start(lib.buildUrl('profiles'), function () {
+//        lib.setDefaultViewport();
+//
+//        this.searchMock = lib.mockRequestFromFile('/api/qualityprofiles/search', 'search-modified.json');
+//        lib.mockRequestFromFile('/api/rules/search', 'rules.json');
+//        lib.mockRequestFromFile('/api/qualityprofiles/inheritance', 'inheritance.json');
+//        lib.mockRequest('/api/qualityprofiles/restore_built_in', '{}');
+//        lib.mockRequestFromFile('/api/languages/list', 'languages.json');
+//      })
+//
+//      .then(function () {
+//        casper.evaluate(function () {
+//          require(['/js/quality-profiles/app.js']);
+//          jQuery.ajaxSetup({ dataType: 'json' });
+//        });
+//      })
+//
+//      .then(function () {
+//        casper.waitForSelector('.js-list .list-group-item');
+//      })
+//
+//      .then(function () {
+//        test.assertElementCount('.js-list .list-group-item', 1);
+//        casper.click('#quality-profiles-restore-built-in');
+//        casper.waitForSelector('.modal');
+//      })
+//
+//      .then(function () {
+//        lib.clearRequestMock(this.searchMock);
+//        lib.mockRequestFromFile('/api/qualityprofiles/search', 'search.json');
+//
+//        casper.evaluate(function () {
+//          jQuery('#restore-built-in-profiles-language').val('java');
+//        });
+//        casper.click('#restore-built-in-profiles-submit');
+//        lib.waitForElementCount('.js-list .list-group-item', 5);
+//      })
+//
+//      .then(function () {
+//        test.assertSelectorContains('.js-list .list-group-item', 'Sonar way');
+//      })
+//
+//      .then(function () {
+//        lib.sendCoverage();
+//      })
+//
+//      .run(function () {
+//        test.done();
+//      });
+//});
+//
+//
+//casper.test.begin(testName('Change Parent'), 1, function (test) {
+//  casper
+//      .start(lib.buildUrl('profiles'), function () {
+//        lib.setDefaultViewport();
+//
+//        this.searchMock = lib.mockRequestFromFile('/api/qualityprofiles/search', 'search-change-parent.json');
+//        lib.mockRequestFromFile('/api/rules/search', 'rules.json');
+//        this.inheritanceMock = lib.mockRequestFromFile('/api/qualityprofiles/inheritance', 'inheritance-change-parent.json');
+//        lib.mockRequest('/api/qualityprofiles/change_parent', '{}');
+//      })
+//
+//      .then(function () {
+//        casper.evaluate(function () {
+//          require(['/js/quality-profiles/app.js']);
+//          jQuery.ajaxSetup({ dataType: 'json' });
+//        });
+//      })
+//
+//      .then(function () {
+//        casper.waitForSelector('.js-list .list-group-item');
+//      })
+//
+//      .then(function () {
+//        casper.click('.js-list .list-group-item[data-key="java-inherited-profile-85155"]');
+//        casper.waitForSelector('#quality-profile-change-parent');
+//      })
+//
+//      .then(function () {
+//        casper.click('#quality-profile-change-parent');
+//        casper.waitForSelector('.modal');
+//      })
+//
+//      .then(function () {
+//        lib.clearRequestMock(this.searchMock);
+//        lib.mockRequestFromFile('/api/qualityprofiles/search', 'search-changed-parent.json');
+//        lib.clearRequestMock(this.inheritanceMock);
+//        lib.mockRequestFromFile('/api/qualityprofiles/inheritance', 'inheritance-changed-parent.json');
+//
+//        casper.evaluate(function () {
+//          jQuery('#change-profile-parent').val('java-another-profile-00609');
+//        });
+//        casper.click('#change-profile-parent-submit');
+//        casper.waitForSelectorTextChange('#quality-profile-ancestors');
+//      })
+//
+//      .then(function () {
+//        test.assertSelectorContains('#quality-profile-ancestors', 'Another Profile');
+//      })
+//
+//      .then(function () {
+//        lib.sendCoverage();
+//      })
+//
+//      .run(function () {
+//        test.done();
+//      });
+//});
+//
+//
+//casper.test.begin(testName('Permalink'), 9, function (test) {
+//  casper
+//      .start(lib.buildUrl('profiles#show?key=java-sonar-way-67887'), function () {
+//        lib.setDefaultViewport();
+//
+//        lib.mockRequestFromFile('/api/qualityprofiles/search', 'search.json');
+//        lib.mockRequestFromFile('/api/rules/search', 'rules.json');
+//        lib.mockRequestFromFile('/api/qualityprofiles/inheritance', 'inheritance.json');
+//      })
+//
+//      .then(function () {
+//        casper.evaluate(function () {
+//          require(['/js/quality-profiles/app.js']);
+//        });
+//      })
+//
+//      .then(function () {
+//        casper.waitForSelector('#quality-profile-rename');
+//      })
+//
+//      .then(function () {
+//        test.assertElementCount('.js-list .list-group-item.active', 1);
+//        test.assertSelectorContains('.js-list .list-group-item.active', 'Sonar way');
+//
+//        test.assertSelectorContains('.search-navigator-workspace-header', 'Sonar way');
+//        test.assertSelectorContains('.search-navigator-workspace-header', 'Java');
+//        test.assertExists('#quality-profile-backup');
+//        test.assertExists('#quality-profile-rename');
+//        test.assertExists('#quality-profile-copy');
+//        test.assertDoesntExist('#quality-profile-delete');
+//        test.assertDoesntExist('#quality-profile-set-as-default');
+//      })
+//
+//      .then(function () {
+//        lib.sendCoverage();
+//      })
+//
+//      .run(function () {
+//        test.done();
+//      });
+//});
+
+
+casper.test.begin(testName('Changelog'), 21, function (test) {
   casper
       .start(lib.buildUrl('profiles#show?key=java-sonar-way-67887'), function () {
         lib.setDefaultViewport();
@@ -665,18 +665,17 @@ casper.test.begin(testName('Changelog'), 22, function (test) {
       })
 
       .then(function () {
-        casper.waitForSelector('.js-show-changelog');
+        casper.waitForSelector('#quality-profile-changelog-form-submit');
       })
 
       .then(function () {
         test.assertDoesntExist('.js-show-more-changelog');
 
-        casper.click('.js-show-changelog');
+        casper.click('#quality-profile-changelog-form-submit');
         casper.waitForSelector('#quality-profile-changelog table');
       })
 
       .then(function () {
-        test.assertDoesntExist('.js-show-changelog');
         test.assertExists('.js-show-more-changelog');
         test.assertElementCount('#quality-profile-changelog tbody tr', 2);