.then(function () {
test.assertSelectorContains('.issue.selected', "Add a 'package-info.java' file to document the");
+ test.assertExists('.issue.selected .issue-tags');
+ test.assertSelectorContains('.issue.selected .issue-tags', 'issue.no_tag');
test.assertExists('.issue.selected .js-issue-set-severity');
test.assertSelectorContains('.issue.selected .js-issue-set-severity', 'MAJOR');
test.assertSelectorContains('.issue.selected', 'CONFIRMED');
});
+casper.test.begin(testName('Issue Box', 'Tags'), function (test) {
+ casper
+ .start(lib.buildUrl('issues'), function () {
+ lib.setDefaultViewport();
+
+ lib.mockRequest('/api/l10n/index', '{}');
+ lib.mockRequestFromFile('/api/issue_filters/app', 'app.json');
+ lib.mockRequestFromFile('/api/issues/search', 'search-with-tags.json');
+ this.showMock = lib.mockRequestFromFile('/api/issues/show*', 'show-with-tags.json');
+ })
+
+ .then(function () {
+ casper.waitForSelector('.issue.selected .issue-tags', function () {
+ test.assertSelectorContains('.issue.selected .issue-tags', 'security, cwe');
+ lib.mockRequestFromFile('/api/issues/tags*', 'tags.json');
+ casper.click('.issue.selected .issue-tag-list');
+
+ casper.waitForSelector('.issue.selected .select2-input', function () {
+ lib.mockRequestFromFile('/api/issues/set_tags', 'tags-modified.json');
+ casper.click('.issue.selected .issue-tag-edit-done');
+ casper.waitWhileVisible('.issue.selected .issue-tag-edit');
+ casper.waitUntilVisible('.issue.selected .issue-tag-list', function () {
+ // TODO Find a way to have this assertion work
+ // test.assertSelectorContains('.issue.selected .issue-tags .issue-tag-list', 'security, cwe, cert');
+ });
+ });
+ });
+ })
+
+ .run(function () {
+ test.done();
+ });
+});
+
+
casper.test.begin(testName('Issue Box', 'Transitions'), function (test) {
casper
.start(lib.buildUrl('issues'), function () {
--- /dev/null
+{
+ "total": 1,
+ "p": 1,
+ "ps": 50,
+ "projects": [
+ {
+ "uuid": "015c6451-1709-4360-b4fa-e4508e13082d",
+ "key": "org.codehaus.sonar-plugins.xml:xml",
+ "id": 17156,
+ "qualifier": "TRK",
+ "name": "XML",
+ "longName": "XML"
+ }
+ ],
+ "components": [
+ {
+ "uuid": "639e257b-d3fb-4d10-b94a-31079b71532d",
+ "key": "org.codehaus.sonar-plugins.xml:sonar-xml-plugin:src/main/java/org/sonar/plugins/xml",
+ "id": 26177,
+ "enabled": true,
+ "qualifier": "DIR",
+ "name": "src/main/java/org/sonar/plugins/xml",
+ "longName": "src/main/java/org/sonar/plugins/xml",
+ "path": "src/main/java/org/sonar/plugins/xml",
+ "projectId": 17156,
+ "subProjectId": 17158
+ },
+ {
+ "uuid": "015c6451-1709-4360-b4fa-e4508e13082d",
+ "key": "org.codehaus.sonar-plugins.xml:xml",
+ "id": 17156,
+ "enabled": true,
+ "qualifier": "TRK",
+ "name": "XML",
+ "longName": "XML"
+ }
+
+ ],
+ "issues": [
+ {
+ "key": "94357807-fcb4-40cc-9598-9a715f1eee6e",
+ "component": "org.codehaus.sonar-plugins.xml:sonar-xml-plugin:src/main/java/org/sonar/plugins/xml",
+ "componentId": 26177,
+ "project": "org.codehaus.sonar-plugins.xml:xml",
+ "rule": "squid:S1228",
+ "status": "CONFIRMED",
+ "severity": "MAJOR",
+ "message": "Add a 'package-info.java' file to document the 'src/main/java/org/sonar/plugins/xml' package",
+ "debt": "20min",
+ "creationDate": "2014-10-03T23:26:37+0200",
+ "updateDate": "2014-10-09T06:32:55+0200",
+ "fUpdateAge": "26 days",
+ "tags": [
+ "security",
+ "cwe"
+ ],
+ "actions": [
+ "comment",
+ "assign",
+ "assign_to_me",
+ "plan",
+ "set_severity",
+ "set_tags"
+ ],
+ "transitions": [
+ "unconfirm",
+ "resolve",
+ "falsepositive"
+ ]
+ }
+ ],
+ "rules": [
+ {
+ "key": "squid:S1228",
+ "name": "Packages should have a javadoc file 'package-info.java'",
+ "desc": "<p>Each package in a Java project should include a <code>package-info.java</code> file. The purpose of this file is to document the Java package using javadoc and declare package annotations.</p>\n\n<h2>Compliant Solution</h2>\n<pre>\n/**\n* This package has non null parameters and is documented.\n**/\n@ParametersAreNonnullByDefault\npackage org.foo.bar;\n</pre>",
+ "status": "REMOVED"
+ }
+ ],
+ "users": [],
+ "languages": [
+ {
+ "key": "js",
+ "name": "JavaScript"
+ },
+ {
+ "key": "java",
+ "name": "Java"
+ }
+ ],
+ "maxResultsReached": false,
+ "paging": {
+ "pageIndex": 1,
+ "pageSize": 50,
+ "total": 1,
+ "fTotal": "1",
+ "pages": 1
+ },
+ "facets": [
+ {
+ "property": "severities",
+ "values": [
+ {
+ "val": "MAJOR",
+ "count": 1
+ },
+ {
+ "val": "INFO",
+ "count": 0
+ },
+ {
+ "val": "MINOR",
+ "count": 0
+ },
+ {
+ "val": "CRITICAL",
+ "count": 0
+ },
+ {
+ "val": "BLOCKER",
+ "count": 0
+ }
+ ]
+ },
+ {
+ "property": "statuses",
+ "values": [
+ {
+ "val": "CONFIRMED",
+ "count": 1
+ },
+ {
+ "val": "OPEN",
+ "count": 0
+ },
+ {
+ "val": "REOPENED",
+ "count": 0
+ },
+ {
+ "val": "CLOSED",
+ "count": 0
+ },
+ {
+ "val": "RESOLVED",
+ "count": 0
+ }
+ ]
+ },
+ {
+ "property": "resolutions",
+ "values": [
+ {
+ "val": "",
+ "count": 1
+ },
+ {
+ "val": "FIXED",
+ "count": 0
+ },
+ {
+ "val": "REMOVED",
+ "count": 0
+ },
+ {
+ "val": "FALSE-POSITIVE",
+ "count": 0
+ }
+ ]
+ }
+ ]
+}
--- /dev/null
+{
+ "issue": {
+ "key": "94357807-fcb4-40cc-9598-9a715f1eee6e",
+ "component": "org.codehaus.sonar-plugins.xml:sonar-xml-plugin:src/main/java/org/sonar/plugins/xml",
+ "componentId": 26177,
+ "project": "org.codehaus.sonar-plugins.xml:xml",
+ "rule": "squid:S1228",
+ "status": "CONFIRMED",
+ "severity": "MAJOR",
+ "message": "Add a 'package-info.java' file to document the 'src/main/java/org/sonar/plugins/xml' package",
+ "debt": "20min",
+ "creationDate": "2014-10-03T23:26:37+0200",
+ "updateDate": "2014-10-09T06:32:55+0200",
+ "fUpdateAge": "26 days",
+ "actions": [
+ "comment",
+ "assign",
+ "assign_to_me",
+ "plan",
+ "set_severity"
+ ],
+ "tags": ["security", "cwe"]
+ "transitions": [
+ "unconfirm",
+ "resolve",
+ "falsepositive"
+ ]
+ }
+}
--- /dev/null
+{
+ "tags": [
+ "security",
+ "cwe",
+ "cert"
+ ]
+}
--- /dev/null
+{
+ "tags": [
+ "brain-overload",
+ "bug",
+ "cert",
+ "convention",
+ "cwe",
+ "design",
+ "error-handling",
+ "misra",
+ "misra-c",
+ "misra-c++",
+ "multithreading",
+ "obsolete",
+ "owasp-top10",
+ "performance",
+ "pitfall",
+ "sans-top25",
+ "sans-top25-2011",
+ "security",
+ "sql",
+ "unused"
+ ]
+}