How to use getAllActionsFromTestcase method of org.cerberus.crud.service.impl.TestCaseService class

Best Cerberus-source code snippet using org.cerberus.crud.service.impl.TestCaseService.getAllActionsFromTestcase

Source:TestCaseService.java Github

copy

Full Screen

...738 LOG.debug(this.updateTestCaseInformation(newTestcaseVersion));739 }740 if (newTestcaseVersion.getSteps() != null && !newTestcaseVersion.getSteps().isEmpty()) {741 this.testCaseStepService.compareListAndUpdateInsertDeleteElements(newTestcaseVersion.getSteps(), oldTestcaseVersion.getSteps(), false);742 List<TestCaseStepAction> newActions = this.getAllActionsFromTestcase(newTestcaseVersion);743 List<TestCaseStepAction> oldActions = this.testCaseStepActionService.readByTestTestCase(testFolderId, testcaseId).getDataList();744 this.testCaseStepActionService.compareListAndUpdateInsertDeleteElements(newActions, oldActions, false);745 List<TestCaseStepActionControl> newControls = this.getAllControlsFromTestcase(newTestcaseVersion);746 List<TestCaseStepActionControl> oldControls = this.testCaseStepActionControlService.findControlByTestTestCase(testFolderId, testcaseId);747 this.testCaseStepActionControlService.compareListAndUpdateInsertDeleteElements(newControls, oldControls, false);748 }749 this.fillTestcaseCountriesFromInvariantsCountry(newTestcaseVersion);750 this.testCaseCountryService.compareListAndUpdateInsertDeleteElements(751 newTestcaseVersion.getTest(),752 newTestcaseVersion.getTestcase(),753 newTestcaseVersion.getTestCaseCountries()754 );755 if (newTestcaseVersion.getTestCaseCountryProperties() != null && !newTestcaseVersion.getTestCaseCountryProperties().isEmpty()) {756 newTestcaseVersion.setTestCaseCountryProperties(757 this.testCaseCountryPropertiesService758 .getFlatListOfTestCaseCountryPropertiesFromAggregate(newTestcaseVersion.getTestCaseCountryProperties())759 );760 }761 LOG.debug(newTestcaseVersion.getTestCaseCountryProperties());762 if (newTestcaseVersion.getTestCaseCountryProperties() != null && !newTestcaseVersion.getTestCaseCountryProperties().isEmpty()) {763 this.testCaseCountryPropertiesService.compareListAndUpdateInsertDeleteElements(764 newTestcaseVersion.getTest(),765 newTestcaseVersion.getTestcase(),766 newTestcaseVersion.getTestCaseCountryProperties()767 );768 }769 if (newTestcaseVersion.getDependencies() != null && !newTestcaseVersion.getDependencies().isEmpty()) {770 this.testCaseDepService.compareListAndUpdateInsertDeleteElements(771 newTestcaseVersion.getTest(),772 newTestcaseVersion.getTestcase(),773 newTestcaseVersion.getDependencies()774 );775 }776 if (newTestcaseVersion.getLabels() != null && !newTestcaseVersion.getLabels().isEmpty()) {777 newTestcaseVersion.setTestCaseLabels(778 this.getTestcaseLabelsFromLabels(779 newTestcaseVersion.getLabels(), newTestcaseVersion.getTest(), newTestcaseVersion.getTestcase(), newTestcaseVersion.getUsrCreated()780 )781 );782 this.testCaseLabelService.compareListAndUpdateInsertDeleteElements(783 newTestcaseVersion.getTest(),784 newTestcaseVersion.getTestcase(),785 newTestcaseVersion.getTestCaseLabels()786 );787 }788 return this.findTestCaseByKeyWithDependencies(newTestcaseVersion.getTest(), newTestcaseVersion.getTestcase(), true).getItem();789 }790 private void fillTestcaseCountriesFromInvariantsCountry(TestCase testcase) {791 if (testcase.getInvariantCountries() == null || testcase.getInvariantCountries().isEmpty()) {792 try {793 testcase.setInvariantCountries(this.invariantService.readByIdName("COUNTRY"));794 } catch (CerberusException e) {795 LOG.warn("Unable to retrieve countries from invariant table" + e);796 }797 }798 testcase.getInvariantCountries()799 .forEach(invariantCountry -> testcase.appendTestCaseCountries(800 TestCaseCountry.builder()801 .test(testcase.getTest())802 .testcase(testcase.getTestcase())803 .country(invariantCountry.getValue())804 .build()805 ));806 }807 private List<TestCaseLabel> getTestcaseLabelsFromLabels(List<Label> labels, String testFolderId, String testcaseId, String userCreated) {808 return labels809 .stream()810 .map(label -> TestCaseLabel.builder()811 .test(testFolderId)812 .testcase(testcaseId)813 .labelId(label.getId())814 .usrCreated(userCreated)815 .label(label)816 .build())817 .collect(Collectors.toList());818 }819 private List<TestCaseStepAction> getAllActionsFromTestcase(TestCase testcase) {820 return testcase.getSteps()821 .stream()822 .filter(step -> !step.isUsingLibraryStep())823 .flatMap(testCaseStep -> testCaseStep.getActions().stream())824 .collect(Collectors.toList());825 }826 private List<TestCaseStepActionControl> getAllControlsFromTestcase(TestCase testcase) {827 return testcase.getSteps()828 .stream()829 .filter(step -> !step.isUsingLibraryStep())830 .flatMap(testCaseStep -> testCaseStep.getActions()831 .stream()832 .flatMap(testCaseStepAction -> testCaseStepAction.getControls().stream())833 )...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful