summaryrefslogtreecommitdiffstats
path: root/testapi/opnfv_testapi/tests
diff options
context:
space:
mode:
Diffstat (limited to 'testapi/opnfv_testapi/tests')
-rw-r--r--testapi/opnfv_testapi/tests/UI/e2e/scenarioControllerSpec.js40
-rw-r--r--testapi/opnfv_testapi/tests/unit/handlers/test_deploy_result.py17
2 files changed, 55 insertions, 2 deletions
diff --git a/testapi/opnfv_testapi/tests/UI/e2e/scenarioControllerSpec.js b/testapi/opnfv_testapi/tests/UI/e2e/scenarioControllerSpec.js
index 60d4949..564fbcf 100644
--- a/testapi/opnfv_testapi/tests/UI/e2e/scenarioControllerSpec.js
+++ b/testapi/opnfv_testapi/tests/UI/e2e/scenarioControllerSpec.js
@@ -336,7 +336,7 @@ describe('testing the scenarios page for anonymous user', function () {
});
-describe('testing the scenarios page for anonymous user', function () {
+describe('testing the scenarios page for user', function () {
beforeEach(function(){
mock([
{
@@ -662,7 +662,7 @@ describe('testing the scenarios page for anonymous user', function () {
browser.wait(EC.urlContains(baseURL+ '#/scenarios/test-scenario'), 10000);
});
- it( 'should not show the add installer option for user', function() {
+ it( 'should show the add installer option for user', function() {
browser.get(baseURL+"#/scenarios/test-scenario");
var EC = browser.ExpectedConditions;
browser.wait(EC.urlContains(baseURL+ '#/scenarios/test-scenario'), 10000);
@@ -1009,6 +1009,42 @@ describe('testing the scenarios page for anonymous user', function () {
.isDisplayed()).toBe(true);
});
+ it( 'Add multiple Customs by user', function() {
+ browser.get(baseURL+"#/scenarios/test-scenario");
+ var EC = browser.ExpectedConditions;
+ browser.wait(EC.urlContains(baseURL+ '#/scenarios/test-scenario'), 10000);
+ var installersShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/td[2]/div[1]/a/p'))
+ installersShow.click();
+ var installerShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/td[2]/div[3]/div/table/tbody/tr[1]/td[2]/a'))
+ installerShow.click();
+ var versionsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/td[2]/div[3]/div/table/tbody/tr[2]/td[2]/div[1]/a/p'))
+ versionsShow.click();
+ var versionShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/td[2]/div[3]/div/table/tbody/tr[2]/td[2]/div[3]/div/table/tbody/tr[1]/td[2]/a'))
+ versionShow.click()
+ var projectsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/td[2]/div[3]/div/table/tbody/tr[2]/td[2]/div[3]/div/table/tbody/tr[3]/td[2]/div[1]/a'))
+ projectsShow.click();
+ var projectShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/td[2]/div[3]/div/table/tbody/tr[2]/td[2]/div[3]/div/table/tbody/tr[3]/td[2]/div[3]/div/table/tbody/tr[1]/td[2]/a'))
+ projectShow.click();
+ var customsShow = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/td[2]/div[3]/div/table/tbody/tr[2]/td[2]/div[3]/div/table/tbody/tr[3]/td[2]/div[3]/div/table/tbody[1]/tr[4]/td[2]/a/p'))
+ customsShow.click();
+ var row = element.all(by.repeater('(indexCU, custom) in project.customs')).first();
+ var cells = row.all(by.tagName('td'));
+ expect(cells.get(0).getText()).toContain("dvs");
+ var buttonAdd = element(by.xpath('//*[@id="ng-app"]/body/div/div[1]/div/table/tbody/tr[5]/td[2]/div[3]/div/table/tbody/tr[2]/td[2]/div[3]/div/table/tbody/tr[3]/td[2]/div[3]/div/table/tbody[1]/tr[4]/td[2]/button'))
+ buttonAdd.click()
+ var custom = element(by.model('customModalCtrl.custom'));
+ browser.wait(EC.visibilityOf(custom), 5000);
+ custom.sendKeys('testC');
+ // browser.pause();
+ var buttonAddCustom = element(by.xpath('//*[@id="ng-app"]/body/div[3]/div/div/div/div[1]/div/fieldset/div/div/div/table/tfoot/tr/td[2]/input'))
+ buttonAddCustom.click();
+ custom.sendKeys('testB');
+ var buttonOk = element(by.xpath('//*[@id="ng-app"]/body/div[3]/div/div/div/div[2]/button[1]'))
+ buttonOk.click()
+ expect(element(by.cssContainingText(".alert","Customs are successfully updated."))
+ .isDisplayed()).toBe(true);
+ });
+
it( 'Delete Customs by user', function() {
browser.get(baseURL+"#/scenarios/test-scenario");
var EC = browser.ExpectedConditions;
diff --git a/testapi/opnfv_testapi/tests/unit/handlers/test_deploy_result.py b/testapi/opnfv_testapi/tests/unit/handlers/test_deploy_result.py
index 65e765e..8f2ca76 100644
--- a/testapi/opnfv_testapi/tests/unit/handlers/test_deploy_result.py
+++ b/testapi/opnfv_testapi/tests/unit/handlers/test_deploy_result.py
@@ -92,6 +92,10 @@ class DeployResultGet(DeployResultBase):
self.req_d_id = self._create_d()
self.req_10d_later = self._create_changed_date(days=10)
+ @executor.get(httplib.OK, 'assert_res')
+ def test_getOne(self):
+ return self.req_d_id
+
@executor.query(httplib.OK, '_query_success', 3)
def test_queryInstaller(self):
return self._set_query('installer')
@@ -165,6 +169,19 @@ class DeployResultGet(DeployResultBase):
self._create_error_start_date('')
return self._set_query(period=5)
+ @executor.query(httplib.OK, '_query_success', 0)
+ def test_notFound(self):
+ return self._set_query('installer',
+ 'version',
+ 'job_name',
+ 'build_id',
+ 'scenario',
+ 'upstream_job_name',
+ 'upstream_build_id',
+ 'criteria',
+ pod='notExistPod',
+ period=1)
+
def _query_success(self, body, number):
self.assertEqual(number, len(body.deployresults))