Skip to content

Commit

Permalink
Refactor e2e test (#3247)
Browse files Browse the repository at this point in the history
  • Loading branch information
EMaksy authored Jan 22, 2025
1 parent fa1c5ba commit 7914c62
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions test/e2e/cypress/e2e/checks_catalog.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ context('Checks catalog', () => {
{
dropdown: 'providers-selection-dropdown',
option: 'AWS',
selectedIcon: selectedIconSelector,
},
],
expectedRequest: `${checksCatalogURL}?provider=aws`,
Expand All @@ -111,12 +110,10 @@ context('Checks catalog', () => {
{
dropdown: 'providers-selection-dropdown',
option: 'AWS',
selectedIcon: selectedIconSelector,
},
{
dropdown: 'targets-selection-dropdown',
option: 'Clusters',
selectedIcon: selectedIconSelector,
},
],
expectedRequest: `${checksCatalogURL}?provider=aws&target_type=cluster`,
Expand All @@ -126,17 +123,14 @@ context('Checks catalog', () => {
{
dropdown: 'providers-selection-dropdown',
option: 'AWS',
selectedIcon: selectedIconSelector,
},
{
dropdown: 'targets-selection-dropdown',
option: 'Clusters',
selectedIcon: selectedIconSelector,
},
{
dropdown: 'cluster-types-selection-dropdown',
option: 'HANA Scale Up Perf. Opt.',
selectedIcon: selectedIconSelector,
},
],
expectedRequest: `${checksCatalogURL}?provider=aws&target_type=cluster&cluster_type=hana_scale_up&hana_scenario=performance_optimized`,
Expand All @@ -146,17 +140,14 @@ context('Checks catalog', () => {
{
dropdown: 'providers-selection-dropdown',
option: 'AWS',
selectedIcon: selectedIconSelector,
},
{
dropdown: 'targets-selection-dropdown',
option: 'Clusters',
selectedIcon: selectedIconSelector,
},
{
dropdown: 'cluster-types-selection-dropdown',
option: 'HANA Scale Up Cost Opt.',
selectedIcon: selectedIconSelector,
},
],
expectedRequest: `${checksCatalogURL}?provider=aws&target_type=cluster&cluster_type=hana_scale_up&hana_scenario=cost_optimized`,
Expand All @@ -168,10 +159,10 @@ context('Checks catalog', () => {
cy.intercept(expectedRequest, {
body: { items: catalog },
}).as('request');
selectedFilters.forEach(({ dropdown, option, selectedIcon }) => {
selectedFilters.forEach(({ dropdown, option }) => {
cy.get(`.${dropdown}`).click();
// test if the selected item has the green SVG icon rendered which shows the current selection
cy.get(selectedIcon).should('be.visible');
cy.get(selectedIconSelector).should('be.visible');
cy.get(`.${dropdown}`).get('span').contains(option).click();
});
cy.wait('@request');
Expand Down

0 comments on commit 7914c62

Please sign in to comment.