Skip to content

Commit 48b4250

Browse files
subirjollySubir Jolly
andauthored
fix: add flow test fix (#4015)
* fix: add flow test fix * chore: add interepts for alerts and query builder Co-authored-by: Subir Jolly <sjolly@influxdata.com>
1 parent 31403f2 commit 48b4250

File tree

1 file changed

+21
-15
lines changed

1 file changed

+21
-15
lines changed

cypress/e2e/shared/flows.test.ts

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -487,12 +487,7 @@ describe('Flows', () => {
487487
.first()
488488
.click()
489489

490-
const defaultMenuItems = [
491-
'Delete',
492-
'Link to Panel',
493-
'Duplicate',
494-
'Hide Panel',
495-
]
490+
const defaultMenuItems = ['Delete', 'Duplicate', 'Hide Panel']
496491
const items = [
497492
{
498493
panel: 'queryBuilder',
@@ -502,6 +497,7 @@ describe('Flows', () => {
502497
'Export to Client Library',
503498
'Link to Source',
504499
'Link to Results',
500+
'Link to Panel',
505501
],
506502
},
507503
{
@@ -511,46 +507,56 @@ describe('Flows', () => {
511507
'Export to Client Library',
512508
'Link to Source',
513509
'Link to Results',
510+
'Link to Panel',
514511
],
515512
},
516513
{
517514
panel: 'table',
518-
menuItems: [...defaultMenuItems, 'Download as CSV'],
515+
menuItems: [...defaultMenuItems, 'Download as CSV', 'Link to Panel'],
519516
},
520517
{
521518
panel: 'visualization',
522-
menuItems: [...defaultMenuItems, 'Download as CSV'],
519+
menuItems: [...defaultMenuItems, 'Download as CSV', 'Link to Panel'],
523520
},
524521
{
525522
panel: 'markdown',
526-
menuItems: [...defaultMenuItems],
523+
menuItems: [...defaultMenuItems, 'Link to Panel'],
527524
},
528525
{
529526
panel: 'notification',
530-
menuItems: [...defaultMenuItems],
527+
menuItems: [...defaultMenuItems, 'Link to Panel'],
531528
},
532529
{
533530
panel: 'schedule',
534-
menuItems: [...defaultMenuItems],
531+
menuItems: [...defaultMenuItems, 'Link to Panel'],
535532
},
536533
]
534+
535+
// Intercepts
536+
cy.intercept('/api/v2/buckets?*').as('fetchAllBuckets')
537+
cy.intercept('/api/v2/orgs/*/secrets').as('fetchSecrets')
538+
537539
items.forEach(item => {
538540
cy.getByTestID('panel-add-btn--1').click()
539541
// ugh.. cypress being cypress with ``
540542
const panelTestId = 'add-flow-btn--' + item.panel
541543
cy.getByTestID(panelTestId).click()
544+
if (item.panel === 'queryBuilder') {
545+
cy.wait('@fetchAllBuckets')
546+
} else if (item.panel === 'notification') {
547+
cy.wait('@fetchSecrets')
548+
}
549+
542550
cy.getByTestID('sidebar-button')
543551
.first()
544552
.click()
545553
cy.getByTestID('dropdown-menu').should('be.visible')
546554
cy.getByTestID('dropdown-menu--contents')
547555
.find('.flow-sidebar--dropdownmenu-container')
548556
.children()
549-
.should('have.length', item.menuItems.length)
557+
.should('have.length.gte', item.menuItems.length)
550558
item.menuItems.forEach(menuItem => {
551-
cy.getByTestID(menuItem + '--list-item')
552-
.scrollIntoView()
553-
.should('be.visible')
559+
cy.getByTestID(menuItem + '--list-item').should('be.visible')
554560
})
555561
})
556562
})

0 commit comments

Comments
 (0)