forked from finos/waltz
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request finos#6757 from davidwatkins73/waltz-6750-mc-edit
Measurable Category admin/edit
- Loading branch information
Showing
4 changed files
with
104 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
...java/org/finos/waltz/test_common/playwright/measurable_ratings/MeasurableRatingTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
waltz-test-common/src/test/resources/measurable-ratings/edit-ratings/template.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}} |