aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2014-07-25 16:32:48 +0200
committerStas Vilchik <vilchiks@gmail.com>2014-07-28 10:33:55 +0200
commit31d13fb114fd1d0b1f52fe7c18f4d805687cae3e (patch)
treeab93fecf232f3cd59fb947ace9c7c628580c2e74 /server/sonar-web
parent2e6fcca931e81b1c926c9ea2b1562eaacff2b9c2 (diff)
downloadsonarqube-31d13fb114fd1d0b1f52fe7c18f4d805687cae3e.tar.gz
sonarqube-31d13fb114fd1d0b1f52fe7c18f4d805687cae3e.zip
Component Viewer Tests: add issues filters MTs
Diffstat (limited to 'server/sonar-web')
-rw-r--r--server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-issues-filters-spec.js104
-rw-r--r--server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/issues.json4
2 files changed, 106 insertions, 2 deletions
diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-issues-filters-spec.js b/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-issues-filters-spec.js
new file mode 100644
index 00000000000..335550027fc
--- /dev/null
+++ b/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-issues-filters-spec.js
@@ -0,0 +1,104 @@
+var lib = require('../lib'),
+ testName = lib.testName('Component Viewer');
+
+lib.initMessages();
+lib.changeWorkingDirectory('component-viewer-spec');
+
+
+casper.test.begin(testName('Issues Filters'), function (test) {
+ casper
+ .start(lib.buildUrl('component-viewer#component=component'), function () {
+ lib.setDefaultViewport();
+ lib.mockRequest('/api/l10n/index', '{}');
+ lib.mockRequestFromFile('/api/components/app', 'app.json');
+ lib.mockRequestFromFile('/api/sources/show', 'source.json');
+ lib.mockRequestFromFile('/api/resources', 'resources.json');
+ lib.mockRequestFromFile('/api/issues/search', 'issues.json');
+ })
+
+ .then(function () {
+ casper.waitForSelector('.component-viewer-source .row');
+ })
+
+ .then(function () {
+ casper.click('.js-header-tab-issues');
+ casper.waitForSelector('.js-filter-unresolved-issues');
+ })
+
+ .then(function () {
+ casper.click('.js-filter-unresolved-issues');
+ casper.waitForSelector('.code-issue', function () {
+ test.assertElementCount('.code-issue', 6);
+ });
+ })
+
+ .then(function () {
+ casper.click('.js-filter-open-issues');
+ casper.waitForSelector('.code-issue', function () {
+ test.assertElementCount('.code-issue', 1);
+ });
+ })
+
+ .then(function () {
+ casper.click('.js-filter-fixed-issues');
+ casper.waitForSelector('.code-issue', function () {
+ test.assertElementCount('.code-issue', 11);
+ });
+ })
+
+ .then(function () {
+ casper.click('.js-filter-false-positive-issues');
+ casper.waitForSelector('.code-issue', function () {
+ test.assertElementCount('.code-issue', 1);
+ });
+ })
+
+ .then(function () {
+ casper.click('.js-filter-MAJOR-issues');
+ casper.waitForSelector('.code-issue', function () {
+ test.assertElementCount('.code-issue', 1);
+ });
+ })
+
+ .then(function () {
+ casper.click('.js-filter-MINOR-issues');
+ casper.waitForSelector('.code-issue', function () {
+ test.assertElementCount('.code-issue', 1);
+ });
+ })
+
+ .then(function () {
+ casper.click('.js-filter-INFO-issues');
+ casper.waitForSelector('.code-issue', function () {
+ test.assertElementCount('.code-issue', 4);
+ });
+ })
+
+ .then(function () {
+ casper.click('.js-filter-rule[data-rule="common-java:DuplicatedBlocks"]');
+ casper.waitForSelector('.code-issue', function () {
+ test.assertElementCount('.code-issue', 1);
+ test.assertSelectorContains('.code-issue', '2 duplicated blocks of code.');
+ });
+ })
+
+ .then(function () {
+ casper.click('.js-filter-rule[data-rule="squid:S1192"]');
+ casper.waitForSelector('.code-issue', function () {
+ test.assertElementCount('.code-issue', 1);
+ test.assertSelectorContains('.code-issue', 'Define a constant instead of duplicating this literal');
+ });
+ })
+
+ .then(function () {
+ casper.click('.js-filter-rule[data-rule="squid:S1135"]');
+ casper.waitForSelector('.code-issue', function () {
+ test.assertElementCount('.code-issue', 4);
+ test.assertSelectorContains('.code-issue', 'Complete the task associated to this TODO comment');
+ });
+ })
+
+ .run(function () {
+ test.done();
+ });
+});
diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/issues.json b/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/issues.json
index 0d9c4fbae43..bced9b3caab 100644
--- a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/issues.json
+++ b/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/issues.json
@@ -294,7 +294,7 @@
"componentId": 19983,
"project": "org.codehaus.sonar:sonar",
"rule": "squid:S1135",
- "status": "CONFIRMED",
+ "status": "REOPENED",
"severity": "INFO",
"message": "Complete the task associated to this TODO comment.",
"line": 126,
@@ -343,7 +343,7 @@
"project": "org.codehaus.sonar:sonar",
"rule": "squid:S1192",
"status": "CLOSED",
- "resolution": "FIXED",
+ "resolution": "FALSE-POSITIVE",
"severity": "MINOR",
"message": "Define a constant instead of duplicating this literal \"Removing an item is not supported\" 2 times.",
"line": 420,