Skip to content

Commit 1d7dc3d

Browse files
authored
Implemented a new wizard-based Create Artifact modal (#4883)
* Implemented a new wizard based Create Artifact modal * Fix a build issue * Fix UI tests to work with new create artifact modal
1 parent 0303a8f commit 1d7dc3d

13 files changed

+612
-419
lines changed

typescript-sdk/package-lock.json

+28-28
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/tests/specs/e2e.spec.ts

+29-9
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,42 @@ test("End to End - Create artifact", async ({ page }) => {
1515

1616
// Click the "Create artifact" button
1717
await page.getByTestId("btn-toolbar-create-artifact").click();
18-
await expect(page.getByTestId("create-artifact-form-group")).toHaveValue("");
18+
await expect(page.getByTestId("create-artifact-modal-group")).toHaveValue("");
1919

2020
// Create a new artifact
21-
await page.getByTestId("create-artifact-form-group").fill("e2e");
22-
await page.getByTestId("create-artifact-form-id").fill("MyArtifact");
23-
await page.getByTestId("create-artifact-form-type-select").click();
24-
await page.getByTestId("create-artifact-form-OPENAPI").click();
21+
22+
// Fill out page 1 of the create artifact wizard
23+
await page.getByTestId("create-artifact-modal-group").fill("e2e");
24+
await page.getByTestId("create-artifact-modal-id").fill("MyArtifact");
25+
await page.getByTestId("create-artifact-modal-type-select").click();
26+
await page.getByTestId("create-artifact-modal-OPENAPI").click();
27+
28+
// Click "Next" on the wizard
29+
await page.locator("#next-wizard-page").click();
30+
31+
// Fill out page 2 of the create artifact wizard
32+
await page.getByTestId("create-artifact-modal-artifact-metadata-name").fill("Test Artifact");
33+
await page.getByTestId("create-artifact-modal-artifact-metadata-description").fill("Artifact description.");
34+
35+
// Click "Next" on the wizard
36+
await page.locator("#next-wizard-page").click();
37+
38+
// Fill out page 3 of the create artifact wizard
39+
await page.getByTestId("create-artifact-modal-version").fill("1.0.0");
2540
await page.locator("#artifact-content").fill(OPENAPI_DATA_STR);
26-
await page.getByTestId("create-artifact-modal-btn-create").click();
41+
42+
// Click "Next" on the wizard
43+
await page.locator("#next-wizard-page").click();
44+
45+
// Leave page 4 empty and click "Complete"
46+
await page.locator("#next-wizard-page").click();
2747

2848
// Make sure we redirected to the artifact page.
2949
await expect(page).toHaveURL(/.+\/explore\/e2e\/MyArtifact/);
3050

3151
// Assert the meta-data is as expected
32-
await expect(page.getByTestId("artifact-details-name")).toHaveText("No name");
33-
await expect(page.getByTestId("artifact-details-description")).toHaveText("No description");
52+
await expect(page.getByTestId("artifact-details-name")).toHaveText("Test Artifact");
53+
await expect(page.getByTestId("artifact-details-description")).toHaveText("Artifact description.");
3454
await expect(page.getByTestId("artifact-details-labels")).toHaveText("No labels");
3555
});
3656

@@ -41,7 +61,7 @@ test("End to End - Edit artifact metadata", async ({ page }) => {
4161

4262
// Click the "Edit" button to show the modal
4363
await page.getByTestId("artifact-btn-edit").click();
44-
await expect(page.getByTestId("edit-metadata-modal-name")).toBeEmpty();
64+
await expect(page.getByTestId("edit-metadata-modal-name")).toHaveValue("Test Artifact");
4565

4666
// Change/add some values
4767
await page.getByTestId("edit-metadata-modal-name").fill("Empty API Spec");

ui/ui-app/src/app/components/modals/CreateArtifactForm.css

-17
This file was deleted.

0 commit comments

Comments
 (0)