summaryrefslogtreecommitdiffstats
path: root/integration-tests/src/test/resources/ci/testSuites/frontend/onapUiSanity.xml
blob: cb1370865bc4ac830db768bb89628d5d570f54c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd" >
<suite name="uitests" configfailurepolicy="continue" parallel="methods" thread-count="1" data-provider-thread-count="1">

  <parameter name="makeDistribution" value="false"/>

  <test name="uiSanity">
    <classes>
      <class name="org.onap.sdc.frontend.ci.tests.execute.sanity.Vf">
        <methods>
          <include name="changeInstanceNameInVfTest"/>
        </methods>
      </class>
      <class name="org.onap.sdc.frontend.ci.tests.execute.sanity.Service">
        <methods>
          <include name="updateService"/>
        </methods>
      </class>
      <class name="org.onap.sdc.frontend.ci.tests.execute.sanity.OnboardingFlowsUi">
        <methods>
          <include name="onapOnboardVNFflow"/>
          <include name="onboardCNFTest"/>
          <include name="onboardCNFTestShouldFailForInvalidHelmPackage"/>
          <include name="onapOnboardVSPValidationsSanityFlow"/>
          <include name="onboardPNFSoftwareInformationFlow"/>
        </methods>
      </class>
      <class name="org.onap.sdc.frontend.ci.tests.execute.sanity.GAB"/>
      <class name="org.onap.sdc.frontend.ci.tests.execute.sanity.EtsiNetworkServiceUiTests"/>
      <class name="org.onap.sdc.frontend.ci.tests.execute.sanity.EtsiOnboardVnfCnfUiTests">
        <methods>
          <include name="createVlm"/>
          <include name="onboardEtsiVnfCnfFlow"/>
        </methods>
      </class>
      <class name="org.onap.sdc.frontend.ci.tests.execute.sanity.ImportVfcUiTest"/>
      <class name="org.onap.sdc.frontend.ci.tests.execute.sanity.CreateServiceSubstitutionFilterTest"/>
      <class name="org.onap.sdc.frontend.ci.tests.execute.sanity.ServiceTemplateDesignUiTests">
        <methods>
          <include name="importAndCertifyVfc"/>
          <include name="runServiceDesign"/>
        </methods>
      </class>
    </classes>
  </test>
</suite>
pan>:ng.IFilterService, private ModalsHandler:ModalsHandler, private ServiceServiceNg2:ServiceServiceNg2) { } private actualChangeLifecycleState = (component:Component, data:any, scope:any, onSuccessCallback?:Function, onErrorCallback?:Function):void => { let self = this; let getContacts = (component:Component):string => { let testers = this.sdcConfig.testers; let result:string = testers[component.componentType][component.categories[0].name] ? testers[component.componentType][component.categories[0].name] : testers[component.componentType]['default']; return result; }; let onSuccess = (newComponent:Component):void => { //scope.isLoading = false; console.info(component.componentType.toLowerCase + ' change state ', newComponent); if (onSuccessCallback) { onSuccessCallback(self.ComponentFactory.createComponent(newComponent), data.url); } }; let onError = (error):void => { scope.isLoading = false; console.info('Failed to changeLifecycleState to ', data.url); if (onErrorCallback) { onErrorCallback(error); } }; let comment:AsdcComment = new AsdcComment(); if (data.alertModal) { // Show alert dialog if defined in menu.json //------------------------------------------------- let onOk = (confirmationText):void => { comment.userRemarks = confirmationText; scope.isLoading = true; component.changeLifecycleState(data.url, comment).then(onSuccess, onError); }; let onCancel = ():void => { console.info('Cancel pressed'); scope.isLoading = false; }; let modalTitle = this.sdcMenu.alertMessages[data.alertModal].title; let modalMessage = this.sdcMenu.alertMessages[data.alertModal].message.format([component.componentType.toLowerCase()]); this.ModalsHandler.openAlertModal(modalTitle, modalMessage).then(onOk, onCancel); } else if (data.confirmationModal) { // Show confirmation dialog if defined in menu.json //------------------------------------------------- let onOk = (confirmationText):void => { comment.userRemarks = confirmationText; scope.isLoading = true; component.changeLifecycleState(data.url, comment).then(onSuccess, onError); }; let onCancel = ():void => { console.info('Cancel pressed'); scope.isLoading = false; }; let modalTitle = this.sdcMenu.confirmationMessages[data.confirmationModal].title; let modalMessage = this.sdcMenu.confirmationMessages[data.confirmationModal].message.format([component.componentType.toLowerCase()]); let modalShowComment = this.sdcMenu.confirmationMessages[data.confirmationModal].showComment; this.ModalsHandler.openConfirmationModal(modalTitle, modalMessage, modalShowComment).then(onOk, onCancel); } else if (data.emailModal) { // Show email dialog if defined in menu.json //------------------------------------------------- let onOk = (resource):void => { if (resource) { onSuccess(resource); } else { onError("Error changing life cycle state"); } }; let onCancel = ():void => { scope.isLoading = false; }; let emailModel:IEmailModalModel = <IEmailModalModel>{}; emailModel.email = <IEmailModalModel_Email>{}; emailModel.data = <IEmailModalModel_Data>{}; emailModel.title = this.$filter('translate')("EMAIL_MODAL_TITLE"); emailModel.email.to = getContacts(component); emailModel.email.subject = this.$filter('translate')("EMAIL_MODAL_SUBJECT", "{'entityName': '" + this.$filter('resourceName')(component.name) + "','entityVersion': '" + component.version + "'}"); emailModel.email.message = ''; emailModel.data.component = component; emailModel.data.stateUrl = data.url; this.ModalsHandler.openEmailModal(emailModel).then(onOk, onCancel); } else { // Submit to server only (no modal is shown). scope.isLoading = true; component.changeLifecycleState(data.url, comment).then(onSuccess, onError); } } public changeLifecycleState = (component:Component, data:any, scope:any, onSuccessCallback?:Function, onErrorCallback?:Function):void => { if (data.conformanceLevelModal) { this.validateConformanceLevel(component, data, scope, onSuccessCallback, onErrorCallback); } else { this.actualChangeLifecycleState(component, data, scope, onSuccessCallback, onErrorCallback); } } private validateConformanceLevel = (component:Component, data:any, scope:any, onSuccessCallback?:Function, onErrorCallback?:Function):void => { // Validate conformance level if defined in menu.json //------------------------------------------------- this.ServiceServiceNg2.validateConformanceLevel(<Service>component).subscribe((res:boolean) => { if (res === true) { //conformance level is ok - continue this.actualChangeLifecycleState(component, data, scope, onSuccessCallback, onErrorCallback); } else { //show warning modal this.ModalsHandler.openConformanceLevelModal() .then(() => { //continue distribute this.actualChangeLifecycleState(component, data, scope, onSuccessCallback, onErrorCallback); }).catch(() => { //reject distribution this.actualChangeLifecycleState(component, data.conformanceLevelModal, scope, onSuccessCallback, onErrorCallback); }); } }); } }