Skip to content

Commit

Permalink
Merge pull request finos#6757 from davidwatkins73/waltz-6750-mc-edit
Browse files Browse the repository at this point in the history
Measurable Category admin/edit
  • Loading branch information
jessica-woodland-scott-db authored Sep 6, 2023
2 parents 4db1609 + a16de5c commit e6edd30
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,32 @@
</div>
</div>
<div class="form-group">
<label for="editable">
Editable
</label>
<div>
<input id="editable"
type="checkbox"
bind:checked={workingCopy.editable}>
<div class="help-inline">
Allow the taxonomy to be edited from within Waltz using the maintenance screen.
</div>
</div>
</div>
<div class="form-group">
<label for="editor_role">
Editor Role
</label>
<div>
<input id="editor_role"
bind:value={workingCopy.ratingEditorRole}>
<div class="help-inline">
Which role is needed to edit the taxonomy
</div>
</div>
</div>
<button type="submit"
class="btn btn-primary">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
public enum Section {
APP_SURVEYS(17),
ASSESSMENTS(200),
BOOKMARKS(5);
BOOKMARKS(5),
MEASURABLE_RATINGS(15);


private int id;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
package org.finos.waltz.test_common.playwright.measurable_ratings;

import com.microsoft.playwright.Locator;
import com.microsoft.playwright.Locator.FilterOptions;
import org.finos.waltz.model.EntityReference;
import org.finos.waltz.test_common.helpers.AppHelper;
import org.finos.waltz.test_common.playwright.BasePlaywrightIntegrationTest;
import org.finos.waltz.test_common.playwright.DocumentationHelper;
import org.finos.waltz.test_common.playwright.Section;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;

import java.io.IOException;
import java.util.regex.Pattern;

import static com.microsoft.playwright.assertions.PlaywrightAssertions.assertThat;
import static org.finos.waltz.common.StringUtilities.mkPath;
import static org.finos.waltz.test_common.helpers.NameHelper.mkName;
import static org.finos.waltz.test_common.playwright.PlaywrightUtilities.login;
import static org.finos.waltz.test_common.playwright.PlaywrightUtilities.mkEmbeddedFrag;

public class MeasurableRatingTests extends BasePlaywrightIntegrationTest {

public static final String HIGHLIGHT_ELEM_SCRIPT = "d => d.style.border = '2px solid red'";

@Autowired
private AppHelper appHelper;

@Test
public void editRatingsViaUI() throws IOException {
DocumentationHelper documentationHelper = new DocumentationHelper(
page,
"measurable-ratings/edit-ratings");

login(page, BASE);

EntityReference app = appHelper.createNewApp(
mkName("mr", "edit"),
10L);

page.navigate(mkPath(BASE, "application", Long.toString(app.id())));
Locator sectionButton = page.locator(".sidebar-expanded button").getByText("Ratings / Roadmap");
sectionButton.evaluate(HIGHLIGHT_ELEM_SCRIPT);
sectionButton.click();
Locator section = page.locator(".waltz-measurable-rating-app-section");
section.isVisible();
section.scrollIntoViewIfNeeded();
documentationHelper.takePageSnapshot(page, "section-button.png");

page.navigate(mkPath(BASE, mkEmbeddedFrag(Section.MEASURABLE_RATINGS, app)));

Locator ratingsSubSection = page
.locator(".waltz-sub-section")
.filter(new FilterOptions().setHasText("Ratings"));

Locator editBtn = ratingsSubSection.getByText("Edit");
editBtn.evaluate(HIGHLIGHT_ELEM_SCRIPT);
documentationHelper.takePageSnapshot(page, "empty-section.png");

editBtn.click();

documentationHelper.prepareDocumentation();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Measurable Ratings

## Creating Ratings

Measurable Ratings can be edited from the '_Ratings / Roadmap_' section, available from the nav bar

{{section-button.png}}

If there are no mappings you will see an empty section, click on the '_Add some ratings_' or '_Edit_' button to open the editor

{{empty-section.png}}

0 comments on commit e6edd30

Please sign in to comment.