aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2015-06-08 17:39:39 +0200
committerStas Vilchik <vilchiks@gmail.com>2015-06-08 17:39:39 +0200
commit4b6cdca6fe064988494238001827de15d7d5709f (patch)
treeaeb26b157e3df5c337f762d0c665d954b512b9ce /server
parentec0dc9b0b2f66b6749a44d1d1a439b553fe5c80b (diff)
downloadsonarqube-4b6cdca6fe064988494238001827de15d7d5709f.tar.gz
sonarqube-4b6cdca6fe064988494238001827de15d7d5709f.zip
add component issues page web tests
Diffstat (limited to 'server')
-rw-r--r--server/sonar-web/src/test/js/issues-page-spec.js69
-rw-r--r--server/sonar-web/src/test/views/issues-context.jade5
2 files changed, 74 insertions, 0 deletions
diff --git a/server/sonar-web/src/test/js/issues-page-spec.js b/server/sonar-web/src/test/js/issues-page-spec.js
index 053ab3413f8..9a3df230f40 100644
--- a/server/sonar-web/src/test/js/issues-page-spec.js
+++ b/server/sonar-web/src/test/js/issues-page-spec.js
@@ -92,6 +92,75 @@ casper.test.begin(testName('Base'), function (test) {
});
+casper.test.begin(testName('Context'), function (test) {
+ casper
+ .start(lib.buildUrl('issues-context'), function () {
+ lib.setDefaultViewport();
+
+
+ lib.mockRequestFromFile('/api/issue_filters/app', 'app.json');
+ lib.mockRequestFromFile('/api/issues/search', 'search.json');
+ })
+
+ .then(function () {
+ casper.evaluate(function () {
+ window.config = {
+ resource: 'uuid',
+ resourceQualifier: 'TRL',
+ resourceName: 'SonarQube',
+ periodDate: null
+ };
+ require(['apps/issues/app-context']);
+ });
+ })
+
+ .then(function () {
+ casper.waitForSelector('.facet[data-value=BLOCKER]', function () {
+ // Facets
+ test.assertExists('.facet[data-value=BLOCKER]');
+ test.assertExists('.facet[data-value=CRITICAL]');
+ test.assertExists('.facet[data-value=MAJOR]');
+ test.assertExists('.facet[data-value=MINOR]');
+ test.assertExists('.facet[data-value=INFO]');
+
+ test.assertExists('.facet[data-value=OPEN]');
+ test.assertExists('.facet[data-value=REOPENED]');
+ test.assertExists('.facet[data-value=CONFIRMED]');
+ test.assertExists('.facet[data-value=RESOLVED]');
+ test.assertExists('.facet[data-value=CLOSED]');
+
+ test.assertExists('.facet[data-unresolved]');
+ test.assertExists('.facet[data-value=REMOVED]');
+ test.assertExists('.facet[data-value=FIXED]');
+ test.assertExists('.facet[data-value=FALSE-POSITIVE]');
+
+ // Issues
+ test.assertElementCount('.issue', 50);
+ test.assertElementCount('.issue.selected', 1);
+ test.assertSelectorContains('.issue', '1 more branches need to be covered by unit tests to reach');
+
+ // Filters
+ test.assertExists('.js-new-search');
+
+ // Workspace header
+ test.assertSelectorContains('#issues-total', '4623');
+ test.assertExists('.js-prev');
+ test.assertExists('.js-next');
+ test.assertExists('.js-reload');
+ test.assertExists('.js-bulk-change');
+ });
+ })
+
+ .then(function () {
+ lib.sendCoverage();
+ })
+
+ .run(function () {
+ test.done();
+ });
+});
+
+
casper.test.begin(testName('Issue Box', 'Check Elements'), function (test) {
casper
.start(lib.buildUrl('issues'), function () {
diff --git a/server/sonar-web/src/test/views/issues-context.jade b/server/sonar-web/src/test/views/issues-context.jade
new file mode 100644
index 00000000000..12868009181
--- /dev/null
+++ b/server/sonar-web/src/test/views/issues-context.jade
@@ -0,0 +1,5 @@
+extends layouts/main
+
+block body
+ #content
+ .issues.search-navigator