@@ -15,22 +15,42 @@ test("End to End - Create artifact", async ({ page }) => {
15
15
16
16
// Click the "Create artifact" button
17
17
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 ( "" ) ;
19
19
20
20
// 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" ) ;
25
40
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 ( ) ;
27
47
28
48
// Make sure we redirected to the artifact page.
29
49
await expect ( page ) . toHaveURL ( / .+ \/ e x p l o r e \/ e 2 e \/ M y A r t i f a c t / ) ;
30
50
31
51
// 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. " ) ;
34
54
await expect ( page . getByTestId ( "artifact-details-labels" ) ) . toHaveText ( "No labels" ) ;
35
55
} ) ;
36
56
@@ -41,7 +61,7 @@ test("End to End - Edit artifact metadata", async ({ page }) => {
41
61
42
62
// Click the "Edit" button to show the modal
43
63
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" ) ;
45
65
46
66
// Change/add some values
47
67
await page . getByTestId ( "edit-metadata-modal-name" ) . fill ( "Empty API Spec" ) ;
0 commit comments