Skip to content

Commit

Permalink
Merge pull request #93 from MicroFocus/dmoldoveanu_story_1063486_bdd_…
Browse files Browse the repository at this point in the history
…scenario

user story #1063486: Add BDD scenario to mywork. BDD scenario is downloadable and searchable
  • Loading branch information
pikachugb authored Sep 8, 2020
2 parents 25654d2 + 644c342 commit e8b58a3
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public Menu createMenu(EntityModel userItem, Control menuParent) {

new MenuItem(menu, SWT.SEPARATOR);

if (entityType != Entity.COMMENT) {
if (entityType != Entity.COMMENT && entityType != Entity.BDD_SCENARIO) {
addMenuItem(
menu,
"View details",
Expand Down Expand Up @@ -159,7 +159,7 @@ public Menu createMenu(EntityModel userItem, Control menuParent) {
}
}

if (entityType == Entity.GHERKIN_TEST) {
if (entityType == Entity.GHERKIN_TEST || entityType == Entity.BDD_SCENARIO) {
addMenuItem(
menu,
"Download script",
Expand All @@ -168,10 +168,10 @@ public Menu createMenu(EntityModel userItem, Control menuParent) {
File parentFolder = chooseParentFolder();

if (parentFolder != null) {
long gherkinTestId = Long.parseLong(entityModel.getValue("id").getValue().toString());
String gherkinTestName = entityModel.getValue("name").getValue().toString();
String scriptFileName = gherkinTestName + "-" +
gherkinTestId + ".feature";
long testId = Long.parseLong(entityModel.getValue("id").getValue().toString());
String testName = entityModel.getValue("name").getValue().toString();
String scriptFileName = testName + "-" +
testId + ".feature";
File scriptFile = new File(parentFolder.getPath() + File.separator +
scriptFileName);
boolean shouldDownloadScript = true;
Expand All @@ -187,7 +187,7 @@ public Menu createMenu(EntityModel userItem, Control menuParent) {

if (shouldDownloadScript) {
BusyIndicator.showWhile(Display.getCurrent(), () -> {
String content = scriptService.getGherkinTestScriptContent(gherkinTestId);
String content = scriptService.getTestScriptContent(testId);
createTestScriptFile(parentFolder.getPath(), scriptFileName,
content);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,15 @@ public class MyWorkEntityModelRowRenderer implements EntityModelRenderer {
fsAutomationStatus,
// subtitle
fsTestType));

fieldSetterMap.put(Entity.BDD_SCENARIO, asList(
// top
fsPhase,
fsOwner,
// bottom
fsAutomationStatus,
// subtitle
fsTestType));

fieldSetterMap.put(Entity.TEST_SUITE_RUN, asList(
// top
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public class SearchEditor extends EditorPart {
Entity.MANUAL_TEST,
Entity.AUTOMATED_TEST,
Entity.GHERKIN_TEST,
Entity.BDD_SCENARIO,
Entity.REQUIREMENT));

private static final Set<String> searchEntityFilterFields = new HashSet<>(Arrays.asList(FIELD_ID, FIELD_NAME, FIELD_DESCRIPTION));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public class EntityIconFactory {
entityColorMap.put(Entity.AUTOMATED_TEST, new Color(Display.getCurrent(), 186, 71, 226));
entityColorMap.put(Entity.COMMENT, new Color(Display.getCurrent(), 253, 225, 89));
entityColorMap.put(Entity.REQUIREMENT, new Color(Display.getCurrent(), 11, 142, 172));
entityColorMap.put(Entity.BDD_SCENARIO, new Color(Display.getCurrent(),117,218, 77));
}

public EntityIconFactory() {
Expand Down

0 comments on commit e8b58a3

Please sign in to comment.