Skip to content

Commit 6157012

Browse files
authored
feat: update/details e2e (#4318)
1 parent 1a8d04e commit 6157012

File tree

1 file changed

+181
-3
lines changed

1 file changed

+181
-3
lines changed

cypress/e2e/cloud/subscriptions.test.ts

Lines changed: 181 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ describe('Subscriptions', () => {
5353
cy.getByTestID('subscriptions-empty-state').should('exist')
5454
})
5555

56-
it('should create and delete LP subscription', () => {
56+
it('should create, update and delete LP subscription', () => {
5757
cy.getByTestID('subscriptions--tab').click()
5858
cy.getByTestID('create-subscription-button--empty').should('be.visible')
5959
cy.getByTestID('create-subscription-button--empty')
@@ -122,6 +122,56 @@ describe('Subscriptions', () => {
122122
cy.get('.cf-resource-card').should('be.visible')
123123
cy.get('.cf-resource-card').should('have.length', 1)
124124
cy.get('.cf-resource-card').contains('My Subscription')
125+
// update
126+
cy.getByTestID('subscription-card').should('be.visible')
127+
cy.getByTestID('subscription-name').should('be.visible')
128+
cy.getByTestID('subscription-name').click()
129+
cy.get('.subscription-details-page').should('be.visible')
130+
cy.getByTestID('update-broker-form--edit')
131+
.should('be.visible')
132+
.click()
133+
cy.getByTestID('update-broker-form--name').should('be.visible')
134+
cy.getByTestID('update-broker-form--name')
135+
.clear()
136+
.type('My Edited Subscription')
137+
cy.getByTestID('update-broker-form--description')
138+
.clear()
139+
.type('Edited Description')
140+
cy.getByTestID('update-broker-form--host')
141+
.clear()
142+
.type('local.host')
143+
cy.getByTestID('update-broker-form--port')
144+
.clear()
145+
.type('1884')
146+
cy.getByTestID('update-broker-form--user--button').click()
147+
cy.getByTestID('update-broker-form--username')
148+
.clear()
149+
.type('username')
150+
cy.getByTestID('update-broker-form--password')
151+
.clear()
152+
.type('password')
153+
cy.getByTestID('update-broker-form--submit')
154+
.should('be.visible')
155+
.click()
156+
cy.getByTestID('update-subscription-form--topic').should('be.visible')
157+
cy.getByTestID('update-subscription-form--topic')
158+
.clear()
159+
.type('edit/topic')
160+
cy.getByTestID('Create Bucket').click()
161+
cy.getByTestID('form--validation-element').should('be.visible')
162+
cy.getByTestID('bucket-form-name').type('nifid')
163+
cy.getByTestID('bucket-form-submit').click()
164+
cy.getByTestID('update-subscription-form--submit')
165+
.should('be.visible')
166+
.click()
167+
cy.getByTestID('heading')
168+
.should('be.visible')
169+
.contains('Data Format')
170+
cy.getByTestID('update-parsing-form--submit')
171+
.should('be.visible')
172+
.click()
173+
cy.get('.cf-resource-card').should('have.length', 1)
174+
cy.get('.cf-resource-card').contains('My Edited Subscription')
125175
// delete
126176
cy.getByTestID('context-delete-menu--button').should('be.visible')
127177
cy.getByTestID('context-delete-menu--button').click()
@@ -132,7 +182,7 @@ describe('Subscriptions', () => {
132182
cy.wait('@GetSubscriptions')
133183
cy.getByTestID('subscriptions-empty-state').should('be.visible')
134184
})
135-
it('should create and delete a JSON subscription', () => {
185+
it('should create, update and delete a JSON subscription', () => {
136186
cy.getByTestID('subscriptions--tab').click()
137187
cy.getByTestID('create-subscription-button--control-bar').should(
138188
'be.visible'
@@ -205,6 +255,72 @@ describe('Subscriptions', () => {
205255
cy.get('.cf-resource-card').should('be.visible')
206256
cy.get('.cf-resource-card').should('have.length', 1)
207257
cy.get('.cf-resource-card').contains('My Subscription 2')
258+
// update
259+
cy.getByTestID('subscription-name').click()
260+
cy.get('.subscription-details-page').should('be.visible')
261+
cy.getByTestID('update-broker-form--name').should('be.visible')
262+
cy.getByTestID('update-broker-form--name')
263+
.clear()
264+
.type('My Edited Subscription')
265+
cy.getByTestID('update-broker-form--edit')
266+
.should('be.visible')
267+
.click()
268+
cy.getByTestID('update-broker-form--submit')
269+
.should('be.visible')
270+
.click()
271+
cy.getByTestID('update-subscription-form--topic').should('be.visible')
272+
cy.getByTestID('update-subscription-form--topic')
273+
.clear()
274+
.type('edit/topic')
275+
cy.getByTestID('update-subscription-form--submit')
276+
.should('be.visible')
277+
.click()
278+
cy.getByTestID('heading')
279+
.should('be.visible')
280+
.contains('Data Format')
281+
cy.getByTestID('measurement-json-parsing-path')
282+
.should('be.visible')
283+
.clear()
284+
.type('$.m1')
285+
cy.getByTestID('true-json-parsing-name')
286+
.clear()
287+
.type('t2')
288+
cy.getByTestID('true-json-parsing-type')
289+
.contains('String')
290+
.click()
291+
cy.getByTestID('true-json-parsing-path')
292+
.clear()
293+
.type('$.t2')
294+
// add field
295+
cy.getByTestID('json-parsing-add-rule').click()
296+
cy.getByTestID('json-parsing-add-rule-1')
297+
.first()
298+
.click()
299+
// delete field
300+
cy.getByTestID('false-json-delete-label--button').should('be.visible')
301+
cy.getByTestID('false-json-delete-label--button')
302+
.first()
303+
.click()
304+
cy.getByTestID('false-json-delete-label--confirm-button').should(
305+
'be.visible'
306+
)
307+
cy.getByTestID('false-json-delete-label--confirm-button').click()
308+
// add field
309+
cy.getByTestID('false-json-parsing-name')
310+
.clear()
311+
.type('f2')
312+
cy.getByTestID('false-json-parsing-type')
313+
.first()
314+
.contains('String')
315+
.click()
316+
cy.getByTestID('false-json-parsing-path')
317+
.clear()
318+
.type('$.f2')
319+
cy.getByTestID('update-parsing-form--submit')
320+
.should('be.visible')
321+
.click()
322+
cy.get('.cf-resource-card').should('have.length', 1)
323+
cy.get('.cf-resource-card').contains('My Edited Subscription')
208324
// delete
209325
cy.getByTestID('context-delete-menu--button').should('be.visible')
210326
cy.getByTestID('context-delete-menu--button').click()
@@ -216,7 +332,7 @@ describe('Subscriptions', () => {
216332
cy.getByTestID('subscriptions-empty-state').should('be.visible')
217333
})
218334

219-
it('should create and delete a String subscription', () => {
335+
it('should create, update and delete a String subscription', () => {
220336
cy.getByTestID('subscriptions--tab').click()
221337
cy.getByTestID('create-subscription-button--control-bar').should(
222338
'be.visible'
@@ -278,6 +394,68 @@ describe('Subscriptions', () => {
278394
cy.get('.cf-resource-card').should('be.visible')
279395
cy.get('.cf-resource-card').should('have.length', 1)
280396
cy.get('.cf-resource-card').contains('My Subscription 3')
397+
// update
398+
cy.getByTestID('subscription-name').click()
399+
cy.get('.subscription-details-page').should('be.visible')
400+
cy.getByTestID('update-broker-form--name').should('be.visible')
401+
cy.getByTestID('update-broker-form--name')
402+
.clear()
403+
.type('My Edited Subscription')
404+
cy.getByTestID('update-broker-form--edit')
405+
.should('be.visible')
406+
.click()
407+
cy.getByTestID('update-broker-form--submit')
408+
.should('be.visible')
409+
.click()
410+
cy.getByTestID('update-subscription-form--topic').should('be.visible')
411+
cy.getByTestID('update-subscription-form--topic')
412+
.clear()
413+
.type('edit/topic')
414+
cy.getByTestID('update-subscription-form--submit')
415+
.should('be.visible')
416+
.click()
417+
cy.getByTestID('heading')
418+
.should('be.visible')
419+
.contains('Data Format')
420+
cy.getByTestID('measurment-string-parsing-pattern')
421+
.should('be.visible')
422+
.clear()
423+
.type('m1=//m1')
424+
cy.getByTestID('timestamp-string-parsing')
425+
.clear()
426+
.type('987654321')
427+
cy.getByTestID('Tag-string-parsing-name')
428+
.clear()
429+
.type('tag2')
430+
cy.getByTestID('Tag-string-parsing-pattern')
431+
.clear()
432+
.type('t2=//t')
433+
// add field
434+
cy.getByTestID('string-parsing-add-rule').click()
435+
cy.getByTestID('string-parsing-add-rule-1')
436+
.first()
437+
.click()
438+
// delete field
439+
cy.getByTestID('Field-string-delete-label--button').should('be.visible')
440+
cy.getByTestID('Field-string-delete-label--button')
441+
.first()
442+
.click()
443+
cy.getByTestID('Field-string-delete-label--confirm-button').should(
444+
'be.visible'
445+
)
446+
cy.getByTestID('Field-string-delete-label--confirm-button').click()
447+
// add field
448+
cy.getByTestID('Field-string-parsing-name')
449+
.clear()
450+
.type('field2')
451+
cy.getByTestID('Field-string-parsing-pattern')
452+
.clear()
453+
.type('f2=//f')
454+
cy.getByTestID('update-parsing-form--submit')
455+
.should('be.visible')
456+
.click()
457+
cy.get('.cf-resource-card').should('have.length', 1)
458+
cy.get('.cf-resource-card').contains('My Edited Subscription')
281459
// delete
282460
cy.getByTestID('context-delete-menu--button').should('be.visible')
283461
cy.getByTestID('context-delete-menu--button').click()

0 commit comments

Comments
 (0)