@@ -91,6 +91,103 @@ if (Cypress.env('WORKSPACE_ENABLED')) {
91
91
cy . checkWorkspace ( workspaceId , expectedWorkspace ) ;
92
92
} ) ;
93
93
} ) ;
94
+
95
+ it ( 'should successfully create a workspace from home page' , ( ) => {
96
+ cy . deleteWorkspaceByName ( workspaceName ) ;
97
+ miscUtils . visitPage ( 'app/workspace_initial' ) ;
98
+ cy . getElementByTestId (
99
+ 'workspace-initial-card-createWorkspace-button'
100
+ ) . click ( {
101
+ force : true ,
102
+ } ) ;
103
+ cy . getElementByTestId (
104
+ 'workspace-initial-button-create-observability-workspace'
105
+ ) . click ( {
106
+ force : true ,
107
+ } ) ;
108
+ cy . contains ( 'Observability' )
109
+ . first ( )
110
+ . closest ( '.euiCheckableCard-isChecked' )
111
+ . should ( 'exist' ) ;
112
+
113
+ miscUtils . visitPage ( 'app/workspace_initial' ) ;
114
+ cy . getElementByTestId (
115
+ 'workspace-initial-useCaseCard-security-analytics-button-createWorkspace'
116
+ ) . click ( {
117
+ force : true ,
118
+ } ) ;
119
+ cy . contains ( 'Security Analytics' )
120
+ . first ( )
121
+ . closest ( '.euiCheckableCard-isChecked' )
122
+ . should ( 'exist' ) ;
123
+
124
+ inputWorkspaceName ( workspaceName ) ;
125
+ inputDataSourceWhenMDSEnabled ( dataSourceTitle ) ;
126
+ cy . getElementByTestId ( 'workspaceForm-bottomBar-createButton' ) . click ( {
127
+ force : true ,
128
+ } ) ;
129
+
130
+ let workspaceId ;
131
+ cy . wait ( '@createWorkspaceRequest' ) . then ( ( interception ) => {
132
+ expect ( interception . response . statusCode ) . to . equal ( 200 ) ;
133
+ workspaceId = interception . response . body . result . id ;
134
+
135
+ cy . location ( 'pathname' , { timeout : 6000 } ) . should (
136
+ 'include' ,
137
+ `w/${ workspaceId } /app`
138
+ ) ;
139
+
140
+ const expectedWorkspace = {
141
+ name : workspaceName ,
142
+ features : [ 'use-case-security-analytics' ] ,
143
+ } ;
144
+ cy . checkWorkspace ( workspaceId , expectedWorkspace ) ;
145
+ } ) ;
146
+ } ) ;
147
+
148
+ if (
149
+ Cypress . env ( 'SAVED_OBJECTS_PERMISSION_ENABLED' ) &&
150
+ Cypress . env ( 'SECURITY_ENABLED' )
151
+ ) {
152
+ it ( 'should successfully jump to collaborators page after creating a workspace' , ( ) => {
153
+ cy . deleteWorkspaceByName ( workspaceName ) ;
154
+ inputWorkspaceName ( workspaceName ) ;
155
+ inputDataSourceWhenMDSEnabled ( dataSourceTitle ) ;
156
+ cy . getElementByTestId ( 'workspaceForm-bottomBar-createButton' ) . click ( {
157
+ force : true ,
158
+ } ) ;
159
+
160
+ let workspaceId ;
161
+ cy . wait ( '@createWorkspaceRequest' ) . then ( ( interception ) => {
162
+ expect ( interception . response . statusCode ) . to . equal ( 200 ) ;
163
+ workspaceId = interception . response . body . result . id ;
164
+
165
+ cy . location ( 'pathname' , { timeout : 6000 } ) . should (
166
+ 'include' ,
167
+ `w/${ workspaceId } /app/workspace_collaborators`
168
+ ) ;
169
+ } ) ;
170
+ } ) ;
171
+ }
172
+
173
+ it ( 'should correctly display the summary card' , ( ) => {
174
+ inputWorkspaceName ( workspaceName ) ;
175
+ cy . getElementByTestId (
176
+ 'workspaceForm-workspaceDetails-descriptionInputText'
177
+ ) . type ( 'test_workspace_description.+~!' ) ;
178
+ cy . getElementByTestId ( 'workspaceUseCase-essentials' ) . click ( {
179
+ force : true ,
180
+ } ) ;
181
+ inputDataSourceWhenMDSEnabled ( dataSourceTitle ) ;
182
+ cy . get ( '.workspaceCreateRightSidebar' ) . within ( ( ) => {
183
+ cy . contains ( workspaceName ) . should ( 'exist' ) ;
184
+ cy . contains ( 'test_workspace_description.+~!' ) . should ( 'exist' ) ;
185
+ cy . contains ( 'Essentials' ) . should ( 'exist' ) ;
186
+ if ( MDSEnabled ) {
187
+ cy . contains ( dataSourceTitle ) . should ( 'exist' ) ;
188
+ }
189
+ } ) ;
190
+ } ) ;
94
191
} ) ;
95
192
96
193
describe ( 'Validate workspace name and description' , ( ) => {
0 commit comments