-
Notifications
You must be signed in to change notification settings - Fork 129
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 #6717 from davidwatkins73/waltz-6716-testing-creat…
…e-user Playwright Testing: create user
- Loading branch information
Showing
13 changed files
with
155 additions
and
17 deletions.
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
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
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
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
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
62 changes: 62 additions & 0 deletions
62
...common/src/test/java/org/finos/waltz/test_common/playwright/user_roles/UserRoleTests.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,62 @@ | ||
package org.finos.waltz.test_common.playwright.user_roles; | ||
|
||
import com.microsoft.playwright.Locator; | ||
import org.finos.waltz.test_common.playwright.BasePlaywrightIntegrationTest; | ||
import org.finos.waltz.test_common.playwright.ScreenshotHelper; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.io.IOException; | ||
|
||
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; | ||
|
||
public class UserRoleTests extends BasePlaywrightIntegrationTest { | ||
|
||
public static final String HIGHLIGHT_ELEM_SCRIPT = "d => d.style.border = '2px solid red'"; | ||
|
||
@Test | ||
public void registerUserViaUI() throws IOException { | ||
ScreenshotHelper screenshotHelper = new ScreenshotHelper( | ||
page, | ||
"user/registration"); | ||
|
||
login(page, BASE); | ||
|
||
page.navigate(mkPath(BASE, "system", "list")); | ||
|
||
Locator userMgmtItem = page.getByTestId("Manage Users"); | ||
assertThat(userMgmtItem).isVisible(); | ||
userMgmtItem.evaluate(HIGHLIGHT_ELEM_SCRIPT); | ||
screenshotHelper.takePageSnapshot(page, "admin_page.png"); | ||
|
||
userMgmtItem.locator("a").click(); | ||
|
||
Locator addUserBtn = page.getByTestId("add-user-btn"); | ||
addUserBtn.evaluate(HIGHLIGHT_ELEM_SCRIPT); | ||
screenshotHelper.takePageSnapshot(page, "add_user_button.png"); | ||
addUserBtn.click(); | ||
|
||
screenshotHelper.takePageSnapshot(page, "blank_add_user_form.png"); | ||
Locator submitBtn = page.getByTestId("submit-new-user-btn"); | ||
assertThat(submitBtn).isDisabled(); | ||
|
||
String username = mkName("add_user"); | ||
String password = mkName("add_user_pwd"); | ||
|
||
page.fill("#username", username); | ||
page.fill("#password", password); | ||
|
||
assertThat(submitBtn).isEnabled(); | ||
screenshotHelper.takePageSnapshot(page, "completed_add_user_form.png"); | ||
submitBtn.click(); | ||
|
||
Locator header = page.locator("h4").getByText(username); | ||
assertThat(header).isVisible(); | ||
screenshotHelper.takePageSnapshot(page, "user_registered.png"); | ||
|
||
screenshotHelper.prepareDocumentation(); | ||
} | ||
|
||
} |
32 changes: 32 additions & 0 deletions
32
waltz-test-common/src/test/resources/report-grid/create-grid/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,32 @@ | ||
# Report Grid Creation | ||
|
||
Report grids display information about whatever apps or change initiatives their parent page includes. | ||
In this example we are going to use starting point of a simple application group with two apps. | ||
We will then build up an example report pulling in some assessments, organisational and other data points. | ||
|
||
|
||
|
||
## Open the Report Grid section | ||
|
||
Report grids are accessible from any grouping page in Waltz and can be found on the left hand navigation menu. | ||
|
||
|
||
| Step | Image | | ||
|----------------------------------------------------|-----------------------------| | ||
| First we need to open the "_Report Grids_" section | {{grid_section_opened.png}} | | ||
|
||
|
||
## Create the basic grid | ||
|
||
To create a grid we need to give it a name, optionally set a description and chose whether | ||
the grid will display information about _Applications_ or _Change Initiatives_ | ||
|
||
|
||
| Step | Image | | ||
|-----------------------------------------------------------------------------------------------------------------------|------------------------| | ||
| Next, create a new grid using the "_Create a new report grid_" button | {{new_grid_form.png}} | | ||
| Fill in a title and description, in this example the report will be about Applications so we will leave that selected | {{completed_form.png}} | | ||
| When we submit the form we will be taken to the column editor to customise the grid | {{submitted_form.png}} | | ||
|
||
## Customising the grid | ||
|
9 changes: 9 additions & 0 deletions
9
waltz-test-common/src/test/resources/user/registration/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,9 @@ | ||
# User Registration | ||
|
||
|
||
| Step | Image | | ||
|--------------------------------------------------------------------------------------------------------|-------------------------------------------------------------| | ||
| Navigate to admin page and click on user management link | {{admin_page.png}} | | ||
| Select the "_add a new user_ " link | {{add_user_button.png}} | | ||
| Fill in the new user registration form, once completed the "_Register_" button will be enables | {{blank_add_user_form.png}} {{completed_add_user_form.png}} | | ||
| When you submit the form the user will be created and you will be presented with the user roles screen | {{user_registered.png}} | |