aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/test
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2015-04-17 15:18:26 +0200
committerStas Vilchik <vilchiks@gmail.com>2015-04-17 15:20:43 +0200
commit76c0f10693e69f1f943f368252019c7bb0777649 (patch)
tree11d1cd1ebd058c1b6c8cb1d43a7d3b73a21ed0bb /server/sonar-web/src/test
parenta47f28ac8fe315d399fec09504490275a6c146c6 (diff)
downloadsonarqube-76c0f10693e69f1f943f368252019c7bb0777649.tar.gz
sonarqube-76c0f10693e69f1f943f368252019c7bb0777649.zip
SONAR-5851 add profiles test
Diffstat (limited to 'server/sonar-web/src/test')
-rw-r--r--server/sonar-web/src/test/js/quality-profiles.js53
1 files changed, 53 insertions, 0 deletions
diff --git a/server/sonar-web/src/test/js/quality-profiles.js b/server/sonar-web/src/test/js/quality-profiles.js
index 796a395997a..19aec79ae04 100644
--- a/server/sonar-web/src/test/js/quality-profiles.js
+++ b/server/sonar-web/src/test/js/quality-profiles.js
@@ -343,6 +343,59 @@ casper.test.begin(testName('Should Show Selected Projects'), 2, function (test)
});
+casper.test.begin(testName('Should Move Between Profiles'), 1, function (test) {
+ casper
+ .start(lib.buildUrl('profiles'), function () {
+ lib.setDefaultViewport();
+
+ lib.mockRequestFromFile('/api/users/current', 'user.json');
+ lib.mockRequestFromFile('/api/qualityprofiles/search', 'search-inheritance.json');
+ lib.mockRequestFromFile('/api/languages/list', 'languages.json');
+ this.rulesMock = lib.mockRequestFromFile('/api/rules/search', 'rules.json',
+ { data: { qprofile: 'java-inherited-profile-85155', activation: 'true' }});
+ this.inheritanceMock = 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('#quality-profile-ancestors');
+ })
+
+ .then(function () {
+ lib.clearRequestMock(this.rulesMock);
+ lib.clearRequestMock(this.inheritanceMock);
+ lib.mockRequestFromFile('/api/rules/search', 'rules.json',
+ { data: { qprofile: 'java-sonar-way-67887', activation: 'true' }});
+ lib.mockRequestFromFile('/api/qualityprofiles/inheritance', 'inheritance.json');
+
+ casper.click('#quality-profile-ancestors .js-profile[data-key="java-sonar-way-67887"]');
+ casper.waitForSelectorTextChange('.search-navigator-header-component');
+ })
+
+ .then(function () {
+ test.assertSelectorContains('.search-navigator-header-component', 'Sonar way');
+ })
+
+ .then(function () {
+ lib.sendCoverage();
+ })
+
+ .run(function () {
+ test.done();
+ });
+});
+
+
casper.test.begin(testName('Copy Profile'), 5, function (test) {
casper
.start(lib.buildUrl('profiles'), function () {