diff --git a/cypress.config.js b/cypress.config.js index fd11ced72c..6ce2dc5d61 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -23,14 +23,14 @@ module.exports = defineConfig({ reporterOptions: { endpoint: process.env.REPORTPORTAL_ENDPOINT, apiKey: process.env.REPORTPORTAL_API_KEY, - launch: 'data_visualizer_app_master', + launch: 'data_visualizer_app', project: process.env.REPORTPORTAL_PROJECT, description: '', autoMerge: true, parallel: true, debug: false, restClientConfig: { - timeout: 360000, + timeout: 660000, }, attributes: [ { diff --git a/cypress/integration/confirmLeave.cy.js b/cypress/integration/confirmLeave.cy.js index 0f49e9ff03..f2e136c34f 100644 --- a/cypress/integration/confirmLeave.cy.js +++ b/cypress/integration/confirmLeave.cy.js @@ -17,34 +17,34 @@ import { import { TEST_AOS } from '../utils/data.js' import { getRandomArrayItem } from '../utils/random.js' -describe('confirm leave modal', () => { - const TEST_AO = getRandomArrayItem(TEST_AOS) - - it('navigates to the start page and loads a random saved AO', () => { +describe('Confirm leave modal', () => { + it('Confirm leave modal preserves AO changes when user cancels leave, and discards changes when user approves leave', () => { + const TEST_AO = getRandomArrayItem(TEST_AOS) + // navigates to the start page and loads a random saved AO goToStartPage() openAOByName(TEST_AO.name) expectVisualizationToBeVisible(TEST_AO.type) expectAOTitleToNotBeDirty() - }) - it(`replaces the selected period`, () => { + + // replaces the selected period replacePeriodItems(TEST_AO.type) expectVisualizationToBeVisible(TEST_AO.type) expectAOTitleToBeDirty() - }) - it('tries to open a new AO', () => { + + // tries to open a new AO createNewAO() expectConfirmLeaveModalToBeVisible() - }) - it('cancels leave', () => { + + // cancels leave confirmLeave(false) expectVisualizationToBeVisible(TEST_AO.type) expectAOTitleToBeDirty() - }) - it('tries to open a new AO', () => { + + // tries to open a new AO createNewAO() expectConfirmLeaveModalToBeVisible() - }) - it('confirms leave', () => { + + // confirms leave confirmLeave(true) expectStartScreenToBeVisible() expectVisualizationToNotBeVisible() diff --git a/cypress/integration/new.cy.js b/cypress/integration/new.cy.js index 33a979783d..5d2fcf2717 100644 --- a/cypress/integration/new.cy.js +++ b/cypress/integration/new.cy.js @@ -41,62 +41,61 @@ const TEST_INDICATOR_NAMES = TEST_INDICATORS.slice(1, 3).map( ) describe('creating a new AO', () => { - it('navigates to the start page', () => { - goToStartPage() - }) visTypes.forEach((visType) => { const visTypeName = visTypeDisplayNames[visType] - describe(visTypeName, () => { - it('creates a new AO', () => { - createNewAO() - expectStoreCurrentToBeEmpty() - expectVisualizationToNotBeVisible() - expectVisTypeToBeDefault() - }) - it('changes vis type', () => { - changeVisType(visTypeName) - expectVisTypeToBeValue(visTypeName) - }) - it('adds dimensions', () => { - openDimension(DIMENSION_ID_DATA) - if (visType === VIS_TYPE_SCATTER) { - selectIndicators(TEST_INDICATOR_NAMES.slice(0, 1)) - switchDataTab('Horizontal') - selectDataElements(TEST_DATA_ELEMENT_NAMES.slice(0, 1)) - } else { - if (getAxisMaxNumberOfItems(visType, TEST_AXIS_ID) === 1) { - // Gauge and SV can only have 1 data item - TEST_DATA_ELEMENT_NAMES.splice(1) - } + it(`create AO of type ${visTypeName}`, () => { + // navigates to start page + goToStartPage() + + // creates a new AO + createNewAO() + expectStoreCurrentToBeEmpty() + expectVisualizationToNotBeVisible() + expectVisTypeToBeDefault() + + // changes vis type + changeVisType(visTypeName) + expectVisTypeToBeValue(visTypeName) - selectDataElements(TEST_DATA_ELEMENT_NAMES) + // adds dimensions + openDimension(DIMENSION_ID_DATA) + + if (visType === VIS_TYPE_SCATTER) { + selectIndicators(TEST_INDICATOR_NAMES.slice(0, 1)) + switchDataTab('Horizontal') + selectDataElements(TEST_DATA_ELEMENT_NAMES.slice(0, 1)) + } else { + if (getAxisMaxNumberOfItems(visType, TEST_AXIS_ID) === 1) { + // Gauge and SV can only have 1 data item + TEST_DATA_ELEMENT_NAMES.splice(1) } - clickDimensionModalUpdateButton() + selectDataElements(TEST_DATA_ELEMENT_NAMES) + } - expectVisualizationToBeVisible(visType) + clickDimensionModalUpdateButton() - isYearOverYear(visType) && expectAOTitleToBeUnsaved() + expectVisualizationToBeVisible(visType) - // FIXME: Store is always in default state - /* !isYearOverYear(visType) + isYearOverYear(visType) && expectAOTitleToBeUnsaved() + + // FIXME: Store is always in default state + /* !isYearOverYear(visType) ? expectStoreCurrentColumnsToHaveLength(1) : expectAOTitleToBeUnsaved() */ - if (visType !== VIS_TYPE_SCATTER) { - TEST_DATA_ELEMENT_NAMES.forEach((item) => - expectChartToContainDimensionItem(visType, item) - ) - } - }) + if (visType !== VIS_TYPE_SCATTER) { + TEST_DATA_ELEMENT_NAMES.forEach((item) => + expectChartToContainDimensionItem(visType, item) + ) + } + if ([VIS_TYPE_SINGLE_VALUE, VIS_TYPE_GAUGE].includes(visType)) { - it('Data is locked to Series', () => { - expectDimensionOnAxisToHaveLockIcon( - DIMENSION_ID_DATA, - AXIS_ID_COLUMNS - ) - }) + expectDimensionOnAxisToHaveLockIcon( + DIMENSION_ID_DATA, + AXIS_ID_COLUMNS + ) } }) }) diff --git a/cypress/integration/options/legend.cy.js b/cypress/integration/options/legend.cy.js index 4b1d67b9cd..4246eca033 100644 --- a/cypress/integration/options/legend.cy.js +++ b/cypress/integration/options/legend.cy.js @@ -10,6 +10,7 @@ import { DIMENSION_ID_PERIOD, AXIS_ID_COLUMNS, VIS_TYPE_AREA, + AXIS_ID_ROWS, } from '@dhis2/analytics' import { expectChartTitleToBeVisible, @@ -92,67 +93,67 @@ const TEST_ITEMS = [ const TEST_LEGEND_SET = 'Height in cm' describe('Options - Legend', () => { - describe('Applying a legend: Column', () => { - it('navigates to the start page and adds data items', () => { - goToStartPage() - openDimension(DIMENSION_ID_DATA) - selectIndicators(TEST_ITEMS.map((item) => item.name)) - clickDimensionModalUpdateButton() - expectVisualizationToBeVisible(VIS_TYPE_COLUMN) - }) - it('enables legend', () => { - openOptionsModal(OPTIONS_TAB_LEGEND) - toggleLegend() - expectLegendToBeEnabled() - expectLegendDisplayStrategyToBeByDataItem() - clickOptionsModalUpdateButton() - expectChartTitleToBeVisible() - }) - it('legend by data item is applied', () => { - TEST_ITEMS.forEach((item) => - expectWindowConfigSeriesItemToHaveLegendSet( - item.name, - item.legendSet - ) + it('applies different styles of legend to a Column chart', () => { + cy.log('navigates to the start page and add data items') + goToStartPage() + openDimension(DIMENSION_ID_DATA) + selectIndicators(TEST_ITEMS.map((item) => item.name)) + clickDimensionModalUpdateButton() + expectVisualizationToBeVisible(VIS_TYPE_COLUMN) + + cy.log('enables legend') + openOptionsModal(OPTIONS_TAB_LEGEND) + toggleLegend() + expectLegendToBeEnabled() + expectLegendDisplayStrategyToBeByDataItem() + clickOptionsModalUpdateButton() + expectChartTitleToBeVisible() + + cy.log('verifies legend by data item is applied') + TEST_ITEMS.forEach((item) => + expectWindowConfigSeriesItemToHaveLegendSet( + item.name, + item.legendSet ) - }) - it(`changes legend display strategy to fixed (${TEST_LEGEND_SET})`, () => { - openOptionsModal(OPTIONS_TAB_LEGEND) - expectLegendDisplayStrategyToBeByDataItem() - changeDisplayStrategyToFixed() - expectLegendDisplayStrategyToBeFixed() - changeFixedLegendSet(TEST_LEGEND_SET) - clickOptionsModalUpdateButton() - expectChartTitleToBeVisible() - }) - it('fixed legend is applied', () => { - TEST_ITEMS.forEach((item) => - expectWindowConfigSeriesItemToHaveLegendSet( - item.name, - TEST_LEGEND_SET - ) + ) + + cy.log(`changes legend display strategy to fixed (${TEST_LEGEND_SET})`) + openOptionsModal(OPTIONS_TAB_LEGEND) + expectLegendDisplayStrategyToBeByDataItem() + changeDisplayStrategyToFixed() + expectLegendDisplayStrategyToBeFixed() + changeFixedLegendSet(TEST_LEGEND_SET) + clickOptionsModalUpdateButton() + expectChartTitleToBeVisible() + + cy.log('verifies fixed legend is applied') + TEST_ITEMS.forEach((item) => + expectWindowConfigSeriesItemToHaveLegendSet( + item.name, + TEST_LEGEND_SET ) - }) - it('legend key is hidden', () => { - expectLegendKeyToBeHidden() - }) - it('verifies that options are persisted', () => { - openOptionsModal(OPTIONS_TAB_LEGEND) - expectLegendDisplayStrategyToBeFixed() - expectFixedLegendSetToBe(TEST_LEGEND_SET) - }) - it('enables legend key option', () => { - toggleLegendKeyOption() - expectLegendKeyOptionToBeEnabled() - clickOptionsModalUpdateButton() - expectVisualizationToBeVisible() - }) - it('legend key is shown with 1 item', () => { - expectLegendKeyToBeVisible() - expectLegedKeyItemAmountToBe(1) - }) + ) + + cy.log('verifies legend key is hidden') + expectLegendKeyToBeHidden() + + cy.log('verifies that options are persisted') + openOptionsModal(OPTIONS_TAB_LEGEND) + expectLegendDisplayStrategyToBeFixed() + expectFixedLegendSetToBe(TEST_LEGEND_SET) + + cy.log('enables legend key option') + toggleLegendKeyOption() + expectLegendKeyOptionToBeEnabled() + clickOptionsModalUpdateButton() + expectVisualizationToBeVisible() + + cy.log('verifies legend key is shown with 1 item') + expectLegendKeyToBeVisible() + expectLegedKeyItemAmountToBe(1) }) - describe('Applying a legend: Single value', () => { + + it('applies different styles of legend to a Single Value chart', () => { const TEST_ITEM = TEST_ITEMS[0] const EXPECTED_STANDARD_TEXT_COLOR = '#212934' const EXPECTED_CONTRAST_TEXT_COLOR = '#ffffff' @@ -165,816 +166,849 @@ describe('Options - Legend', () => { const TEST_LEGEND_SET_WITH_CONTRAST = 'Age 15y interval' const EXPECTED_STANDARD_TITLE_COLOR = '#212934' const EXPECTED_STANDARD_SUBTITLE_COLOR = '#4a5768' - it('navigates to the start page and adds data items', () => { - goToStartPage() - changeVisType(visTypeDisplayNames[VIS_TYPE_SINGLE_VALUE]) - openDimension(DIMENSION_ID_DATA) - selectIndicators([TEST_ITEM.name]) - clickDimensionModalUpdateButton() - expectVisualizationToBeVisible(VIS_TYPE_SINGLE_VALUE) - expectSingleValueToHaveTextColor(EXPECTED_STANDARD_TEXT_COLOR) - expectSingleValueToNotHaveBackgroundColor() - }) - it('enables legend', () => { - openOptionsModal(OPTIONS_TAB_LEGEND) - toggleLegend() - expectLegendToBeEnabled() - expectLegendDisplayStrategyToBeByDataItem() - expectLegendDisplayStyleToBeFill() - clickOptionsModalUpdateButton() - expectVisualizationToBeVisible(VIS_TYPE_SINGLE_VALUE) - }) + + cy.log('navigates to the start page and adds data items') + goToStartPage() + changeVisType(visTypeDisplayNames[VIS_TYPE_SINGLE_VALUE]) + openDimension(DIMENSION_ID_DATA) + selectIndicators([TEST_ITEM.name]) + clickDimensionModalUpdateButton() + expectVisualizationToBeVisible(VIS_TYPE_SINGLE_VALUE) + expectSingleValueToHaveTextColor(EXPECTED_STANDARD_TEXT_COLOR) + expectSingleValueToNotHaveBackgroundColor() + + cy.log('enables legend') + openOptionsModal(OPTIONS_TAB_LEGEND) + toggleLegend() + expectLegendToBeEnabled() + expectLegendDisplayStrategyToBeByDataItem() + expectLegendDisplayStyleToBeFill() + clickOptionsModalUpdateButton() + expectVisualizationToBeVisible(VIS_TYPE_SINGLE_VALUE) + // Legend on background, no contrast, no custom title colors - it('background color legend is applied', () => { - expectSingleValueToHaveTextColor(EXPECTED_STANDARD_TEXT_COLOR) - expectSingleValueToHaveBackgroundColor(EXPECTED_BACKGROUND_COLOR_1) - expectSVTitleToHaveColor(EXPECTED_STANDARD_TITLE_COLOR) - expectSVSubtitleToHaveColor(EXPECTED_STANDARD_SUBTITLE_COLOR) - }) - it('changes legend display style to text color', () => { - openOptionsModal(OPTIONS_TAB_LEGEND) - expectLegendDisplayStrategyToBeByDataItem() - expectLegendDisplayStyleToBeFill() - changeDisplayStyleToText() - expectLegendDisplayStyleToBeText() - clickOptionsModalUpdateButton() - expectVisualizationToBeVisible(VIS_TYPE_SINGLE_VALUE) - }) + cy.log('verifies background color legend is applied') + expectSingleValueToHaveTextColor(EXPECTED_STANDARD_TEXT_COLOR) + expectSingleValueToHaveBackgroundColor(EXPECTED_BACKGROUND_COLOR_1) + expectSVTitleToHaveColor(EXPECTED_STANDARD_TITLE_COLOR) + expectSVSubtitleToHaveColor(EXPECTED_STANDARD_SUBTITLE_COLOR) + + cy.log('changes legend display style to text color') + openOptionsModal(OPTIONS_TAB_LEGEND) + expectLegendDisplayStrategyToBeByDataItem() + expectLegendDisplayStyleToBeFill() + changeDisplayStyleToText() + expectLegendDisplayStyleToBeText() + clickOptionsModalUpdateButton() + expectVisualizationToBeVisible(VIS_TYPE_SINGLE_VALUE) + // Legend on text, no contrast, no custom title colors - it('text color legend is applied', () => { - expectSingleValueToHaveTextColor(EXPECTED_TEXT_COLOR_1) - expectSingleValueToNotHaveBackgroundColor() - expectSVTitleToHaveColor(EXPECTED_STANDARD_TITLE_COLOR) - expectSVSubtitleToHaveColor(EXPECTED_STANDARD_SUBTITLE_COLOR) - }) - it(`changes legend display strategy to fixed (${TEST_LEGEND_SET_WITH_CONTRAST})`, () => { - openOptionsModal(OPTIONS_TAB_LEGEND) - expectLegendDisplayStyleToBeText() - expectLegendDisplayStrategyToBeByDataItem() - changeDisplayStrategyToFixed() - expectLegendDisplayStrategyToBeFixed() - changeFixedLegendSet(TEST_LEGEND_SET_WITH_CONTRAST) - clickOptionsModalUpdateButton() - expectVisualizationToBeVisible(VIS_TYPE_SINGLE_VALUE) - }) - // Legend on text, with contrast (N/A), no custom title colors - it('text color legend is applied', () => { - expectSingleValueToHaveTextColor(EXPECTED_TEXT_COLOR_2) - expectSingleValueToNotHaveBackgroundColor() - expectSVTitleToHaveColor(EXPECTED_STANDARD_TITLE_COLOR) - expectSVSubtitleToHaveColor(EXPECTED_STANDARD_SUBTITLE_COLOR) - }) - it('changes legend display style to background color', () => { - openOptionsModal(OPTIONS_TAB_LEGEND) - expectLegendDisplayStrategyToBeFixed() - expectLegendDisplayStyleToBeText() - changeDisplayStyleToFill() - expectLegendDisplayStyleToBeFill() - clickOptionsModalUpdateButton() - expectVisualizationToBeVisible(VIS_TYPE_SINGLE_VALUE) - }) + cy.log('verifies text color legend is applied') + expectSingleValueToHaveTextColor(EXPECTED_TEXT_COLOR_1) + expectSingleValueToNotHaveBackgroundColor() + expectSVTitleToHaveColor(EXPECTED_STANDARD_TITLE_COLOR) + expectSVSubtitleToHaveColor(EXPECTED_STANDARD_SUBTITLE_COLOR) + + cy.log( + `changes legend display strategy to fixed ${TEST_LEGEND_SET_WITH_CONTRAST}` + ) + openOptionsModal(OPTIONS_TAB_LEGEND) + expectLegendDisplayStyleToBeText() + expectLegendDisplayStrategyToBeByDataItem() + changeDisplayStrategyToFixed() + expectLegendDisplayStrategyToBeFixed() + changeFixedLegendSet(TEST_LEGEND_SET_WITH_CONTRAST) + clickOptionsModalUpdateButton() + expectVisualizationToBeVisible(VIS_TYPE_SINGLE_VALUE) + + // Legend on text, with contrast (N/, no custom title colors + cy.log('verifies text color legend is applied') + expectSingleValueToHaveTextColor(EXPECTED_TEXT_COLOR_2) + expectSingleValueToNotHaveBackgroundColor() + expectSVTitleToHaveColor(EXPECTED_STANDARD_TITLE_COLOR) + expectSVSubtitleToHaveColor(EXPECTED_STANDARD_SUBTITLE_COLOR) + + cy.log('changees legend display style to background color') + openOptionsModal(OPTIONS_TAB_LEGEND) + expectLegendDisplayStrategyToBeFixed() + expectLegendDisplayStyleToBeText() + changeDisplayStyleToFill() + expectLegendDisplayStyleToBeFill() + clickOptionsModalUpdateButton() + expectVisualizationToBeVisible(VIS_TYPE_SINGLE_VALUE) + // Legend on background, with contrast, no custom title colors - it('background color legend and contrast text color is applied', () => { - expectSingleValueToHaveTextColor(EXPECTED_CONTRAST_TEXT_COLOR) - expectSingleValueToHaveBackgroundColor(EXPECTED_BACKGROUND_COLOR_2) - expectSVTitleToHaveColor(EXPECTED_CONTRAST_TEXT_COLOR) - expectSVSubtitleToHaveColor(EXPECTED_CONTRAST_TEXT_COLOR) - }) - it(`changes title and subtitle colors`, () => { - openOptionsModal(OPTIONS_TAB_STYLE) - changeColor('option-chart-title', EXPECTED_CUSTOM_TITLE_COLOR) - changeColor('option-chart-subtitle', EXPECTED_CUSTOM_SUBTITLE_COLOR) - clickOptionsModalUpdateButton() - }) - // Legend on background, with contrast, with custom title colors - it('background color legend, contrast text color and custom title colors are applied', () => { - expectSingleValueToHaveTextColor(EXPECTED_CONTRAST_TEXT_COLOR) - expectSingleValueToHaveBackgroundColor(EXPECTED_BACKGROUND_COLOR_2) - expectSVTitleToHaveColor(EXPECTED_CUSTOM_TITLE_COLOR) - expectSVSubtitleToHaveColor(EXPECTED_CUSTOM_SUBTITLE_COLOR) - }) - it('changes legend display style to text color', () => { - openOptionsModal(OPTIONS_TAB_LEGEND) - expectLegendDisplayStrategyToBeFixed() - expectLegendDisplayStyleToBeFill() - changeDisplayStyleToText() - expectLegendDisplayStyleToBeText() - clickOptionsModalUpdateButton() - expectVisualizationToBeVisible(VIS_TYPE_SINGLE_VALUE) - }) - // Legend on text, with contrast, with custom title colors - it('text color legend and custom title colors are applied', () => { - expectSingleValueToHaveTextColor(EXPECTED_TEXT_COLOR_2) - expectSingleValueToNotHaveBackgroundColor() - expectSVTitleToHaveColor(EXPECTED_CUSTOM_TITLE_COLOR) - expectSVSubtitleToHaveColor(EXPECTED_CUSTOM_SUBTITLE_COLOR) - }) - it(`changes legend display strategy to by data item`, () => { - openOptionsModal(OPTIONS_TAB_LEGEND) - expectLegendDisplayStyleToBeText() - expectLegendDisplayStrategyToBeFixed() - changeDisplayStrategyToByDataItem() - expectLegendDisplayStrategyToBeByDataItem() - clickOptionsModalUpdateButton() - expectVisualizationToBeVisible(VIS_TYPE_SINGLE_VALUE) - }) - // Legend on text, no contrast, with custom title colors - it('text color legend and custom title colors are applied', () => { - expectSingleValueToHaveTextColor(EXPECTED_TEXT_COLOR_1) - expectSingleValueToNotHaveBackgroundColor() - expectSVTitleToHaveColor(EXPECTED_CUSTOM_TITLE_COLOR) - expectSVSubtitleToHaveColor(EXPECTED_CUSTOM_SUBTITLE_COLOR) - }) - it('changes legend display style to background color', () => { - openOptionsModal(OPTIONS_TAB_LEGEND) - changeDisplayStrategyToByDataItem() - expectLegendDisplayStyleToBeText() - changeDisplayStyleToFill() - expectLegendDisplayStyleToBeFill() - clickOptionsModalUpdateButton() - expectVisualizationToBeVisible(VIS_TYPE_SINGLE_VALUE) - }) + cy.log( + 'verifies background color legend and contrast text color is applied' + ) + expectSingleValueToHaveTextColor(EXPECTED_CONTRAST_TEXT_COLOR) + expectSingleValueToHaveBackgroundColor(EXPECTED_BACKGROUND_COLOR_2) + expectSVTitleToHaveColor(EXPECTED_CONTRAST_TEXT_COLOR) + expectSVSubtitleToHaveColor(EXPECTED_CONTRAST_TEXT_COLOR) + + cy.log('changes title and subtitle colors') + openOptionsModal(OPTIONS_TAB_STYLE) + changeColor('option-chart-title', EXPECTED_CUSTOM_TITLE_COLOR) + changeColor('option-chart-subtitle', EXPECTED_CUSTOM_SUBTITLE_COLOR) + clickOptionsModalUpdateButton() + + // Legend on background, with contrast, with custom title colo + cy.log( + 'verifies background color legend, contrast text color and custom title colors are applied' + ) + expectSingleValueToHaveTextColor(EXPECTED_CONTRAST_TEXT_COLOR) + expectSingleValueToHaveBackgroundColor(EXPECTED_BACKGROUND_COLOR_2) + expectSVTitleToHaveColor(EXPECTED_CUSTOM_TITLE_COLOR) + expectSVSubtitleToHaveColor(EXPECTED_CUSTOM_SUBTITLE_COLOR) + + cy.log('changes legend display style to text color') + openOptionsModal(OPTIONS_TAB_LEGEND) + expectLegendDisplayStrategyToBeFixed() + expectLegendDisplayStyleToBeFill() + changeDisplayStyleToText() + expectLegendDisplayStyleToBeText() + clickOptionsModalUpdateButton() + expectVisualizationToBeVisible(VIS_TYPE_SINGLE_VALUE) + + // Legend on text, with contrast, with custom title colo + cy.log('verifies text color legend and custom title colors are applied') + expectSingleValueToHaveTextColor(EXPECTED_TEXT_COLOR_2) + expectSingleValueToNotHaveBackgroundColor() + expectSVTitleToHaveColor(EXPECTED_CUSTOM_TITLE_COLOR) + expectSVSubtitleToHaveColor(EXPECTED_CUSTOM_SUBTITLE_COLOR) + + cy.log('changes legend display strategy to by data item') + openOptionsModal(OPTIONS_TAB_LEGEND) + expectLegendDisplayStyleToBeText() + expectLegendDisplayStrategyToBeFixed() + changeDisplayStrategyToByDataItem() + expectLegendDisplayStrategyToBeByDataItem() + clickOptionsModalUpdateButton() + expectVisualizationToBeVisible(VIS_TYPE_SINGLE_VALUE) + + // Legend on text, no contrast, with custom title colo + cy.log('verifies text color legend and custom title colors are applied') + expectSingleValueToHaveTextColor(EXPECTED_TEXT_COLOR_1) + expectSingleValueToNotHaveBackgroundColor() + expectSVTitleToHaveColor(EXPECTED_CUSTOM_TITLE_COLOR) + expectSVSubtitleToHaveColor(EXPECTED_CUSTOM_SUBTITLE_COLOR) + + cy.log('changes legend display style to background color') + openOptionsModal(OPTIONS_TAB_LEGEND) + changeDisplayStrategyToByDataItem() + expectLegendDisplayStyleToBeText() + changeDisplayStyleToFill() + expectLegendDisplayStyleToBeFill() + clickOptionsModalUpdateButton() + expectVisualizationToBeVisible(VIS_TYPE_SINGLE_VALUE) + // Legend on background, no contrast, with custom title colors - it('background color legend and custom title colors are applied', () => { - expectSingleValueToHaveTextColor(EXPECTED_STANDARD_TEXT_COLOR) - expectSingleValueToHaveBackgroundColor(EXPECTED_BACKGROUND_COLOR_1) - expectSVTitleToHaveColor(EXPECTED_CUSTOM_TITLE_COLOR) - expectSVSubtitleToHaveColor(EXPECTED_CUSTOM_SUBTITLE_COLOR) - }) - it('legend key is hidden', () => { - expectLegendKeyToBeHidden() - }) - it('enables legend key option', () => { - openOptionsModal(OPTIONS_TAB_LEGEND) - toggleLegendKeyOption() - expectLegendKeyOptionToBeEnabled() - clickOptionsModalUpdateButton() - expectVisualizationToBeVisible(VIS_TYPE_SINGLE_VALUE) - }) - it('legend key is shown with 1 item', () => { - expectLegendKeyToBeVisible() - expectLegedKeyItemAmountToBe(1) - }) + cy.log( + 'verifies background color legend and custom title colors are applied' + ) + expectSingleValueToHaveTextColor(EXPECTED_STANDARD_TEXT_COLOR) + expectSingleValueToHaveBackgroundColor(EXPECTED_BACKGROUND_COLOR_1) + expectSVTitleToHaveColor(EXPECTED_CUSTOM_TITLE_COLOR) + expectSVSubtitleToHaveColor(EXPECTED_CUSTOM_SUBTITLE_COLOR) + + cy.log('verifies legend key is hidden') + expectLegendKeyToBeHidden() + + cy.log('enables legend key option') + openOptionsModal(OPTIONS_TAB_LEGEND) + toggleLegendKeyOption() + expectLegendKeyOptionToBeEnabled() + clickOptionsModalUpdateButton() + expectVisualizationToBeVisible(VIS_TYPE_SINGLE_VALUE) + + cy.log('verifies legend key is shown with 1 item') + expectLegendKeyToBeVisible() + expectLegedKeyItemAmountToBe(1) }) - describe('Applying a legend: Gauge', () => { + + it('applies different styles of legend to a Gauge chart', () => { const TEST_ITEM = TEST_ITEMS[0] const EXPECTED_BY_DATA_COLOR = '#FFFFB2' const EXPECTED_FIXED_COLOR = '#c7e9c0' - it('navigates to the start page and adds data items', () => { - goToStartPage() - changeVisType(visTypeDisplayNames[VIS_TYPE_GAUGE]) - openDimension(DIMENSION_ID_DATA) - selectIndicators([TEST_ITEM.name]) - clickDimensionModalUpdateButton() - expectVisualizationToBeVisible(VIS_TYPE_GAUGE) - }) - it('enables legend', () => { - openOptionsModal(OPTIONS_TAB_LEGEND) - toggleLegend() - expectLegendToBeEnabled() - expectLegendDisplayStrategyToBeByDataItem() - expectLegendDisplayStyleToBeFill() - clickOptionsModalUpdateButton() - expectVisualizationToBeVisible(VIS_TYPE_GAUGE) - }) - it('legend by data item is applied', () => { - expectWindowConfigYAxisToHaveColor(EXPECTED_BY_DATA_COLOR) - }) - it(`changes legend display strategy to fixed (${TEST_LEGEND_SET})`, () => { - openOptionsModal(OPTIONS_TAB_LEGEND) - expectLegendDisplayStrategyToBeByDataItem() - expectLegendDisplayStyleToBeFill() - changeDisplayStrategyToFixed() - expectLegendDisplayStrategyToBeFixed() - changeFixedLegendSet(TEST_LEGEND_SET) - clickOptionsModalUpdateButton() - expectVisualizationToBeVisible(VIS_TYPE_GAUGE) - }) - it('fixed legend is applied', () => { - expectWindowConfigYAxisToHaveColor(EXPECTED_FIXED_COLOR) - }) - it('changes legend display style to text color', () => { - openOptionsModal(OPTIONS_TAB_LEGEND) - expectLegendDisplayStrategyToBeFixed() - expectFixedLegendSetToBe(TEST_LEGEND_SET) - expectLegendDisplayStyleToBeFill() - changeDisplayStyleToText() - expectLegendDisplayStyleToBeText() - clickOptionsModalUpdateButton() - expectVisualizationToBeVisible(VIS_TYPE_GAUGE) - }) - it('legend style is applied', () => { - expectWindowConfigSeriesDataLabelsToHaveColor( - 0, - EXPECTED_FIXED_COLOR - ) - }) - it('legend key is hidden', () => { - expectLegendKeyToBeHidden() - }) - it('verifies that options are persisted', () => { - openOptionsModal(OPTIONS_TAB_LEGEND) - expectLegendDisplayStrategyToBeFixed() - expectFixedLegendSetToBe(TEST_LEGEND_SET) - }) - it('enables legend key option', () => { - toggleLegendKeyOption() - expectLegendKeyOptionToBeEnabled() - clickOptionsModalUpdateButton() - expectVisualizationToBeVisible(VIS_TYPE_GAUGE) - }) - it('legend key is shown with 1 item', () => { - expectLegendKeyToBeVisible() - expectLegedKeyItemAmountToBe(1) - }) + + cy.log('navigates to the start page and adds data items') + goToStartPage() + changeVisType(visTypeDisplayNames[VIS_TYPE_GAUGE]) + openDimension(DIMENSION_ID_DATA) + selectIndicators([TEST_ITEM.name]) + clickDimensionModalUpdateButton() + expectVisualizationToBeVisible(VIS_TYPE_GAUGE) + + cy.log('enables legend') + openOptionsModal(OPTIONS_TAB_LEGEND) + toggleLegend() + expectLegendToBeEnabled() + expectLegendDisplayStrategyToBeByDataItem() + expectLegendDisplayStyleToBeFill() + clickOptionsModalUpdateButton() + expectVisualizationToBeVisible(VIS_TYPE_GAUGE) + + cy.log('legend by data item is applied') + expectWindowConfigYAxisToHaveColor(EXPECTED_BY_DATA_COLOR) + + cy.log(`changes legend display strategy to fixed (${TEST_LEGEND_SET})`) + openOptionsModal(OPTIONS_TAB_LEGEND) + expectLegendDisplayStrategyToBeByDataItem() + expectLegendDisplayStyleToBeFill() + changeDisplayStrategyToFixed() + expectLegendDisplayStrategyToBeFixed() + changeFixedLegendSet(TEST_LEGEND_SET) + clickOptionsModalUpdateButton() + expectVisualizationToBeVisible(VIS_TYPE_GAUGE) + + cy.log('fixed legend is applied') + expectWindowConfigYAxisToHaveColor(EXPECTED_FIXED_COLOR) + + cy.log('changes legend display style to text color') + openOptionsModal(OPTIONS_TAB_LEGEND) + expectLegendDisplayStrategyToBeFixed() + expectFixedLegendSetToBe(TEST_LEGEND_SET) + expectLegendDisplayStyleToBeFill() + changeDisplayStyleToText() + expectLegendDisplayStyleToBeText() + clickOptionsModalUpdateButton() + expectVisualizationToBeVisible(VIS_TYPE_GAUGE) + + cy.log('legend style is applied') + expectWindowConfigSeriesDataLabelsToHaveColor(0, EXPECTED_FIXED_COLOR) + + cy.log('legend key is hidden') + expectLegendKeyToBeHidden() + + cy.log('verifies that options are persisted') + openOptionsModal(OPTIONS_TAB_LEGEND) + expectLegendDisplayStrategyToBeFixed() + expectFixedLegendSetToBe(TEST_LEGEND_SET) + + cy.log('enables legend key option') + toggleLegendKeyOption() + expectLegendKeyOptionToBeEnabled() + clickOptionsModalUpdateButton() + expectVisualizationToBeVisible(VIS_TYPE_GAUGE) + + cy.log('legend key is shown with 1 item') + expectLegendKeyToBeVisible() + expectLegedKeyItemAmountToBe(1) }) - describe('Applying a legend: Stacked column', () => { - it('navigates to the start page and adds data items', () => { - goToStartPage() - changeVisType(visTypeDisplayNames[VIS_TYPE_STACKED_COLUMN]) - openDimension(DIMENSION_ID_DATA) - selectIndicators(TEST_ITEMS.map((item) => item.name)) - clickDimensionModalUpdateButton() - expectVisualizationToBeVisible(VIS_TYPE_STACKED_COLUMN) - }) - it('enables legend', () => { - openOptionsModal(OPTIONS_TAB_LEGEND) - toggleLegend() - expectLegendToBeEnabled() - expectLegendDisplayStrategyToBeByDataItem() - clickOptionsModalUpdateButton() - expectChartTitleToBeVisible() - }) - it('legend by data item is applied', () => { - TEST_ITEMS.forEach((item) => - expectWindowConfigSeriesItemToHaveLegendSet( - item.name, - item.legendSet - ) + + it('applies different styles of legend to a Stacked Column chart', () => { + cy.log('navigates to the start page and adds data items') + goToStartPage() + changeVisType(visTypeDisplayNames[VIS_TYPE_STACKED_COLUMN]) + openDimension(DIMENSION_ID_DATA) + selectIndicators(TEST_ITEMS.map((item) => item.name)) + clickDimensionModalUpdateButton() + expectVisualizationToBeVisible(VIS_TYPE_STACKED_COLUMN) + + cy.log('enables legend') + openOptionsModal(OPTIONS_TAB_LEGEND) + toggleLegend() + expectLegendToBeEnabled() + expectLegendDisplayStrategyToBeByDataItem() + clickOptionsModalUpdateButton() + expectChartTitleToBeVisible() + + cy.log('legend by data item is applied') + TEST_ITEMS.forEach((item) => + expectWindowConfigSeriesItemToHaveLegendSet( + item.name, + item.legendSet ) - }) - it(`changes legend display strategy to fixed (${TEST_LEGEND_SET})`, () => { - openOptionsModal(OPTIONS_TAB_LEGEND) - expectLegendDisplayStrategyToBeByDataItem() - changeDisplayStrategyToFixed() - expectLegendDisplayStrategyToBeFixed() - changeFixedLegendSet(TEST_LEGEND_SET) - clickOptionsModalUpdateButton() - expectChartTitleToBeVisible() - }) - it('fixed legend is applied', () => { - TEST_ITEMS.forEach((item) => - expectWindowConfigSeriesItemToHaveLegendSet( - item.name, - TEST_LEGEND_SET - ) + ) + + cy.log(`changes legend display strategy to fixed (${TEST_LEGEND_SET})`) + openOptionsModal(OPTIONS_TAB_LEGEND) + expectLegendDisplayStrategyToBeByDataItem() + changeDisplayStrategyToFixed() + expectLegendDisplayStrategyToBeFixed() + changeFixedLegendSet(TEST_LEGEND_SET) + clickOptionsModalUpdateButton() + expectChartTitleToBeVisible() + + cy.log('fixed legend is applied') + TEST_ITEMS.forEach((item) => + expectWindowConfigSeriesItemToHaveLegendSet( + item.name, + TEST_LEGEND_SET ) - }) - it('legend key is hidden', () => { - expectLegendKeyToBeHidden() - }) - it('verifies that options are persisted', () => { - openOptionsModal(OPTIONS_TAB_LEGEND) - expectLegendDisplayStrategyToBeFixed() - expectFixedLegendSetToBe(TEST_LEGEND_SET) - }) - it('enables legend key option', () => { - toggleLegendKeyOption() - expectLegendKeyOptionToBeEnabled() - clickOptionsModalUpdateButton() - expectVisualizationToBeVisible() - }) - it('legend key is shown with 1 item', () => { - expectLegendKeyToBeVisible() - expectLegedKeyItemAmountToBe(1) - }) + ) + + cy.log('legend key is hidden') + expectLegendKeyToBeHidden() + + cy.log('verifies that options are persisted') + openOptionsModal(OPTIONS_TAB_LEGEND) + expectLegendDisplayStrategyToBeFixed() + expectFixedLegendSetToBe(TEST_LEGEND_SET) + + cy.log('enables legend key option') + toggleLegendKeyOption() + expectLegendKeyOptionToBeEnabled() + clickOptionsModalUpdateButton() + expectVisualizationToBeVisible() + + cy.log('legend key is shown with 1 item') + expectLegendKeyToBeVisible() + expectLegedKeyItemAmountToBe(1) }) - describe('Applying a legend: Pivot table', () => { + + it('applies different styles of legend to a Pivot table', () => { const TEST_ITEM = TEST_ITEMS[0] const EXPECTED_STANDARD_TEXT_COLOR = 'color: rgb(33, 41, 52)' const valueCellEl = 'visualization-value-cell' - it('navigates to the start page and adds data items', () => { - goToStartPage() - changeVisType(visTypeDisplayNames[VIS_TYPE_PIVOT_TABLE]) - openDimension(DIMENSION_ID_DATA) - selectIndicators([TEST_ITEM.name]) - clickDimensionModalUpdateButton() - expectVisualizationToBeVisible(VIS_TYPE_PIVOT_TABLE) - }) - it('no legend is applied', () => { - cy.getBySel(valueCellEl).each(($el) => { - cy.wrap($el) - .invoke('attr', 'style') - .should('not.contain', 'color') - .and('not.contain', 'background-color') - }) - }) - it('enables legend', () => { - openOptionsModal(OPTIONS_TAB_LEGEND) - toggleLegend() - expectLegendToBeEnabled() - expectLegendDisplayStrategyToBeByDataItem() - expectLegendDisplayStyleToBeFill() - clickOptionsModalUpdateButton() - expectVisualizationToBeVisible(VIS_TYPE_PIVOT_TABLE) - }) - it('background color legend is applied', () => { - cy.getBySel(valueCellEl).each(($el) => { - cy.wrap($el) - .invoke('attr', 'style') - .should('contain', 'background-color') - .and('contain', EXPECTED_STANDARD_TEXT_COLOR) - }) - }) - it('changes legend display style to text color', () => { - openOptionsModal(OPTIONS_TAB_LEGEND) - expectLegendDisplayStrategyToBeByDataItem() - expectLegendDisplayStyleToBeFill() - changeDisplayStyleToText() - expectLegendDisplayStyleToBeText() - clickOptionsModalUpdateButton() - expectVisualizationToBeVisible(VIS_TYPE_PIVOT_TABLE) - }) - it('text color legend is applied', () => { - cy.getBySel(valueCellEl).each(($el) => { - cy.wrap($el) - .invoke('attr', 'style') - .should('not.contain', 'background-color') - .and('not.contain', EXPECTED_STANDARD_TEXT_COLOR) - }) - }) - it('legend key is hidden', () => { - expectLegendKeyToBeHidden() + + cy.log('navigates to the start page and adds data items') + goToStartPage() + changeVisType(visTypeDisplayNames[VIS_TYPE_PIVOT_TABLE]) + openDimension(DIMENSION_ID_DATA) + selectIndicators([TEST_ITEM.name]) + clickDimensionModalUpdateButton() + expectVisualizationToBeVisible(VIS_TYPE_PIVOT_TABLE) + + cy.log('no legend is applied') + cy.getBySel(valueCellEl).each(($el) => { + cy.wrap($el) + .invoke('attr', 'style') + .should('not.contain', 'color') + .and('not.contain', 'background-color') }) - it('verifies that options are persisted', () => { - openOptionsModal(OPTIONS_TAB_LEGEND) - expectLegendDisplayStrategyToBeByDataItem() + + cy.log('enables legend') + openOptionsModal(OPTIONS_TAB_LEGEND) + toggleLegend() + expectLegendToBeEnabled() + expectLegendDisplayStrategyToBeByDataItem() + expectLegendDisplayStyleToBeFill() + clickOptionsModalUpdateButton() + expectVisualizationToBeVisible(VIS_TYPE_PIVOT_TABLE) + + cy.log('background color legend is applied') + cy.getBySel(valueCellEl).each(($el) => { + cy.wrap($el) + .invoke('attr', 'style') + .should('contain', 'background-color') + .and('contain', EXPECTED_STANDARD_TEXT_COLOR) }) - it('enables legend key option', () => { - toggleLegendKeyOption() - expectLegendKeyOptionToBeEnabled() - clickOptionsModalUpdateButton() - expectVisualizationToBeVisible(VIS_TYPE_PIVOT_TABLE) + + cy.log('changes legend display style to text color') + openOptionsModal(OPTIONS_TAB_LEGEND) + expectLegendDisplayStrategyToBeByDataItem() + expectLegendDisplayStyleToBeFill() + changeDisplayStyleToText() + expectLegendDisplayStyleToBeText() + clickOptionsModalUpdateButton() + expectVisualizationToBeVisible(VIS_TYPE_PIVOT_TABLE) + + cy.log('text color legend is applied') + cy.getBySel(valueCellEl).each(($el) => { + cy.wrap($el) + .invoke('attr', 'style') + .should('not.contain', 'background-color') + .and('not.contain', EXPECTED_STANDARD_TEXT_COLOR) }) - it('legend key is shown with 1 item', () => { - expectLegendKeyToBeVisible() - expectLegedKeyItemAmountToBe(1) + + cy.log('legend key is hidden') + expectLegendKeyToBeHidden() + + cy.log('verifies that options are persisted') + openOptionsModal(OPTIONS_TAB_LEGEND) + expectLegendDisplayStrategyToBeByDataItem() + + cy.log('enables legend key option') + toggleLegendKeyOption() + expectLegendKeyOptionToBeEnabled() + clickOptionsModalUpdateButton() + expectVisualizationToBeVisible(VIS_TYPE_PIVOT_TABLE) + + cy.log('legend key is shown with 1 item') + expectLegendKeyToBeVisible() + expectLegedKeyItemAmountToBe(1) + + // legend is applied when data is in rows + cy.log('swap data and period') + openContextMenu(DIMENSION_ID_PERIOD) + clickContextMenuMove(DIMENSION_ID_PERIOD, AXIS_ID_COLUMNS) + openContextMenu(DIMENSION_ID_DATA) + clickContextMenuMove(DIMENSION_ID_DATA, AXIS_ID_ROWS) + clickMenuBarUpdateButton() + + cy.log('expect legend to still be applied') + expectVisualizationToBeVisible(VIS_TYPE_PIVOT_TABLE) + expectLegendKeyToBeVisible() + expectLegedKeyItemAmountToBe(1) + cy.getBySel(valueCellEl).each(($el) => { + cy.wrap($el) + .invoke('attr', 'style') + .should('not.contain', 'background-color') + .and('not.contain', EXPECTED_STANDARD_TEXT_COLOR) }) }) - describe('Transferring a legend: Pivot table -> Gauge', () => { + + it('applies the legend when vis type is changed from Pivot table to Gauge', () => { const TEST_ITEM = TEST_ITEMS[0] const EXPECTED_STANDARD_TEXT_COLOR = 'color: rgb(33, 41, 52)' const EXPECTED_FIXED_COLOR = '#c7e9c0' const valueCellEl = 'visualization-value-cell' - it('navigates to the start page and adds data items', () => { - goToStartPage() - changeVisType(visTypeDisplayNames[VIS_TYPE_PIVOT_TABLE]) - openDimension(DIMENSION_ID_DATA) - selectIndicators([TEST_ITEM.name]) - clickDimensionModalUpdateButton() - expectVisualizationToBeVisible(VIS_TYPE_PIVOT_TABLE) - }) - it('enables legend', () => { - openOptionsModal(OPTIONS_TAB_LEGEND) - toggleLegend() - expectLegendToBeEnabled() - expectLegendDisplayStrategyToBeByDataItem() - expectLegendDisplayStyleToBeFill() - changeDisplayStyleToText() - expectLegendDisplayStyleToBeText() - changeDisplayStrategyToFixed() - expectLegendDisplayStrategyToBeFixed() - changeFixedLegendSet(TEST_LEGEND_SET) - clickOptionsModalUpdateButton() - expectVisualizationToBeVisible(VIS_TYPE_PIVOT_TABLE) - }) - it(`text color fixed legend (${TEST_LEGEND_SET}) is applied`, () => { - cy.getBySel(valueCellEl).each(($el) => { - cy.wrap($el) - .invoke('attr', 'style') - .should('not.contain', 'background-color') - .and('not.contain', EXPECTED_STANDARD_TEXT_COLOR) - }) - }) - it('changes vis type to Gauge', () => { - changeVisType(visTypeDisplayNames[VIS_TYPE_GAUGE]) - clickMenuBarUpdateButton() - expectVisualizationToBeVisible(VIS_TYPE_GAUGE) - }) - it(`text color fixed legend (${TEST_LEGEND_SET}) is applied`, () => { - expectWindowConfigSeriesDataLabelsToHaveColor( - 0, - EXPECTED_FIXED_COLOR - ) - }) - it('verifies that options are persisted', () => { - openOptionsModal(OPTIONS_TAB_LEGEND) - expectLegendDisplayStyleToBeText() - expectLegendDisplayStrategyToBeFixed() + + cy.log( + 'navigates to the start page and adds data items and create Pivot' + ) + goToStartPage() + changeVisType(visTypeDisplayNames[VIS_TYPE_PIVOT_TABLE]) + openDimension(DIMENSION_ID_DATA) + selectIndicators([TEST_ITEM.name]) + clickDimensionModalUpdateButton() + expectVisualizationToBeVisible(VIS_TYPE_PIVOT_TABLE) + + cy.log('enables legend') + openOptionsModal(OPTIONS_TAB_LEGEND) + toggleLegend() + expectLegendToBeEnabled() + expectLegendDisplayStrategyToBeByDataItem() + expectLegendDisplayStyleToBeFill() + changeDisplayStyleToText() + expectLegendDisplayStyleToBeText() + changeDisplayStrategyToFixed() + expectLegendDisplayStrategyToBeFixed() + changeFixedLegendSet(TEST_LEGEND_SET) + clickOptionsModalUpdateButton() + expectVisualizationToBeVisible(VIS_TYPE_PIVOT_TABLE) + + cy.log(`text color fixed legend (${TEST_LEGEND_SET}) is applied`) + cy.getBySel(valueCellEl).each(($el) => { + cy.wrap($el) + .invoke('attr', 'style') + .should('not.contain', 'background-color') + .and('not.contain', EXPECTED_STANDARD_TEXT_COLOR) }) + + cy.log('changes vis type to Gauge') + changeVisType(visTypeDisplayNames[VIS_TYPE_GAUGE]) + clickMenuBarUpdateButton() + expectVisualizationToBeVisible(VIS_TYPE_GAUGE) + + cy.log(`text color fixed legend (${TEST_LEGEND_SET}) is applied`) + expectWindowConfigSeriesDataLabelsToHaveColor(0, EXPECTED_FIXED_COLOR) + + cy.log('verifies that options are persisted') + openOptionsModal(OPTIONS_TAB_LEGEND) + expectLegendDisplayStyleToBeText() + expectLegendDisplayStrategyToBeFixed() }) - describe('Transferring a legend: Pivot table -> Single value', () => { + it('applies the legend when vis type is changed from Pivot table to Single value', () => { const TEST_ITEM = TEST_ITEMS[0] const EXPECTED_FIXED_COLOR = '#c7e9c0' const valueCellEl = 'visualization-value-cell' const EXPECTED_SV_STANDARD_TEXT_COLOR = '#212934' const EXPECTED_PT_STANDARD_TEXT_COLOR = 'color: rgb(33, 41, 52)' - it('navigates to the start page and adds data items', () => { - goToStartPage() - changeVisType(visTypeDisplayNames[VIS_TYPE_PIVOT_TABLE]) - openDimension(DIMENSION_ID_DATA) - selectIndicators([TEST_ITEM.name]) - clickDimensionModalUpdateButton() - expectVisualizationToBeVisible(VIS_TYPE_PIVOT_TABLE) - }) - it('enables legend', () => { - openOptionsModal(OPTIONS_TAB_LEGEND) - toggleLegend() - expectLegendToBeEnabled() - expectLegendDisplayStrategyToBeByDataItem() - expectLegendDisplayStyleToBeFill() - changeDisplayStrategyToFixed() - expectLegendDisplayStrategyToBeFixed() - changeFixedLegendSet(TEST_LEGEND_SET) - clickOptionsModalUpdateButton() - expectVisualizationToBeVisible(VIS_TYPE_PIVOT_TABLE) - }) - it(`background color fixed legend (${TEST_LEGEND_SET}) is applied`, () => { - cy.getBySel(valueCellEl).each(($el) => { - cy.wrap($el) - .invoke('attr', 'style') - .should('contain', 'background-color') - .and('contain', EXPECTED_PT_STANDARD_TEXT_COLOR) - }) - }) - it('changes vis type to Single value', () => { - changeVisType(visTypeDisplayNames[VIS_TYPE_SINGLE_VALUE]) - clickMenuBarUpdateButton() - expectVisualizationToBeVisible(VIS_TYPE_SINGLE_VALUE) - }) - it('legend is applied to Single value', () => { - expectSingleValueToHaveTextColor(EXPECTED_SV_STANDARD_TEXT_COLOR) - expectSingleValueToHaveBackgroundColor(EXPECTED_FIXED_COLOR) - }) - it('verifies that options are persisted', () => { - openOptionsModal(OPTIONS_TAB_LEGEND) - expectLegendDisplayStyleToBeFill() - expectLegendDisplayStrategyToBeFixed() + + cy.log('navigates to the start page and adds data items') + goToStartPage() + changeVisType(visTypeDisplayNames[VIS_TYPE_PIVOT_TABLE]) + openDimension(DIMENSION_ID_DATA) + selectIndicators([TEST_ITEM.name]) + clickDimensionModalUpdateButton() + expectVisualizationToBeVisible(VIS_TYPE_PIVOT_TABLE) + + cy.log('enables legend') + openOptionsModal(OPTIONS_TAB_LEGEND) + toggleLegend() + expectLegendToBeEnabled() + expectLegendDisplayStrategyToBeByDataItem() + expectLegendDisplayStyleToBeFill() + changeDisplayStrategyToFixed() + expectLegendDisplayStrategyToBeFixed() + changeFixedLegendSet(TEST_LEGEND_SET) + clickOptionsModalUpdateButton() + expectVisualizationToBeVisible(VIS_TYPE_PIVOT_TABLE) + + cy.log(`background color fixed legend (${TEST_LEGEND_SET}) is applied`) + cy.getBySel(valueCellEl).each(($el) => { + cy.wrap($el) + .invoke('attr', 'style') + .should('contain', 'background-color') + .and('contain', EXPECTED_PT_STANDARD_TEXT_COLOR) }) + + cy.log('changes vis type to Single value') + changeVisType(visTypeDisplayNames[VIS_TYPE_SINGLE_VALUE]) + clickMenuBarUpdateButton() + expectVisualizationToBeVisible(VIS_TYPE_SINGLE_VALUE) + + cy.log('legend is applied to Single value') + expectSingleValueToHaveTextColor(EXPECTED_SV_STANDARD_TEXT_COLOR) + expectSingleValueToHaveBackgroundColor(EXPECTED_FIXED_COLOR) + + cy.log('verifies that options are persisted') + openOptionsModal(OPTIONS_TAB_LEGEND) + expectLegendDisplayStyleToBeFill() + expectLegendDisplayStrategyToBeFixed() }) - describe('Transferring the legend key: Column -> Pivot table -> Gauge -> Single value', () => { - it('navigates to the start page and adds data items', () => { - goToStartPage() - openDimension(DIMENSION_ID_DATA) - selectIndicators(TEST_ITEMS.map((item) => item.name)) - clickDimensionModalUpdateButton() - expectVisualizationToBeVisible() - }) - it('enables legend (Column)', () => { - openOptionsModal(OPTIONS_TAB_LEGEND) - toggleLegend() - expectLegendToBeEnabled() - clickOptionsModalUpdateButton() - expectVisualizationToBeVisible() - }) - it('legend key is hidden (Column)', () => { - expectLegendKeyToBeHidden() - }) - it('enables legend key option (Column)', () => { - openOptionsModal(OPTIONS_TAB_LEGEND) - toggleLegendKeyOption() - expectLegendKeyOptionToBeEnabled() - clickOptionsModalUpdateButton() - expectVisualizationToBeVisible() - }) - it(`legend key is shown (Column) with ${TEST_ITEMS.length} items`, () => { - expectLegendKeyToBeVisible() - expectLegedKeyItemAmountToBe(TEST_ITEMS.length) - }) - it('changes vis type to Pivot table', () => { - changeVisType(visTypeDisplayNames[VIS_TYPE_PIVOT_TABLE]) - clickMenuBarUpdateButton() - expectVisualizationToBeVisible(VIS_TYPE_PIVOT_TABLE) - }) - it(`legend key is shown (Pivot table) with ${TEST_ITEMS.length} items`, () => { - expectLegendKeyToBeVisible() - expectLegedKeyItemAmountToBe(TEST_ITEMS.length) - }) - it('disables legend key option (Pivot table)', () => { - openOptionsModal(OPTIONS_TAB_LEGEND) - toggleLegendKeyOption() - expectLegendKeyOptionToBeDisabled() - clickOptionsModalUpdateButton() - expectVisualizationToBeVisible(VIS_TYPE_PIVOT_TABLE) - }) - it('legend key is hidden (Pivot table)', () => { - expectLegendKeyToBeHidden() - }) - it('changes vis type to Gauge', () => { - changeVisType(visTypeDisplayNames[VIS_TYPE_GAUGE]) - clickMenuBarUpdateButton() - expectVisualizationToBeVisible(VIS_TYPE_GAUGE) - }) - it('legend key is hidden (Gauge)', () => { - expectLegendKeyToBeHidden() - }) - it('enables legend key option (Gauge)', () => { - openOptionsModal(OPTIONS_TAB_LEGEND) - toggleLegendKeyOption() - expectLegendKeyOptionToBeEnabled() - clickOptionsModalUpdateButton() - expectVisualizationToBeVisible(VIS_TYPE_GAUGE) - }) - it('legend key is shown (Gauge) with 1 item', () => { - expectLegendKeyToBeVisible() - expectLegedKeyItemAmountToBe(1) - }) - it('changes vis type to Single value', () => { - changeVisType(visTypeDisplayNames[VIS_TYPE_SINGLE_VALUE]) - clickMenuBarUpdateButton() - expectVisualizationToBeVisible(VIS_TYPE_SINGLE_VALUE) - }) - it('legend key is shown (Single value) with 1 item', () => { - expectLegendKeyToBeVisible() - expectLegedKeyItemAmountToBe(1) - }) - it('disables legend key option (Single value)', () => { - openOptionsModal(OPTIONS_TAB_LEGEND) - toggleLegendKeyOption() - expectLegendKeyOptionToBeDisabled() - clickOptionsModalUpdateButton() - expectVisualizationToBeVisible(VIS_TYPE_SINGLE_VALUE) - }) - it('legend key is hidden (Single value)', () => { - expectLegendKeyToBeHidden() - }) + + it('applies the legend key setttings when vis type changes: Column -> Pivot table -> Gauge -> Single value', () => { + cy.log('navigates to the start page and adds data items') + goToStartPage() + openDimension(DIMENSION_ID_DATA) + selectIndicators(TEST_ITEMS.map((item) => item.name)) + clickDimensionModalUpdateButton() + expectVisualizationToBeVisible() + + cy.log('enables legend (Column)') + openOptionsModal(OPTIONS_TAB_LEGEND) + toggleLegend() + expectLegendToBeEnabled() + clickOptionsModalUpdateButton() + expectVisualizationToBeVisible() + + cy.log('legend key is hidden (Column)') + expectLegendKeyToBeHidden() + + cy.log('enables legend key option (Column)') + openOptionsModal(OPTIONS_TAB_LEGEND) + toggleLegendKeyOption() + expectLegendKeyOptionToBeEnabled() + clickOptionsModalUpdateButton() + expectVisualizationToBeVisible() + + cy.log(`legend key is shown (Column) with ${TEST_ITEMS.length} items`) + expectLegendKeyToBeVisible() + expectLegedKeyItemAmountToBe(TEST_ITEMS.length) + + cy.log('changes vis type to Pivot table') + changeVisType(visTypeDisplayNames[VIS_TYPE_PIVOT_TABLE]) + clickMenuBarUpdateButton() + expectVisualizationToBeVisible(VIS_TYPE_PIVOT_TABLE) + + cy.log( + `legend key is shown (Pivot table) with ${TEST_ITEMS.length} items` + ) + expectLegendKeyToBeVisible() + expectLegedKeyItemAmountToBe(TEST_ITEMS.length) + + cy.log('disables legend key option (Pivot table)') + openOptionsModal(OPTIONS_TAB_LEGEND) + toggleLegendKeyOption() + expectLegendKeyOptionToBeDisabled() + clickOptionsModalUpdateButton() + expectVisualizationToBeVisible(VIS_TYPE_PIVOT_TABLE) + + cy.log('legend key is hidden (Pivot table)') + expectLegendKeyToBeHidden() + + cy.log('changes vis type to Gauge') + changeVisType(visTypeDisplayNames[VIS_TYPE_GAUGE]) + clickMenuBarUpdateButton() + expectVisualizationToBeVisible(VIS_TYPE_GAUGE) + + cy.log('legend key is hidden (Gauge)') + expectLegendKeyToBeHidden() + + cy.log('enables legend key option (Gauge)') + openOptionsModal(OPTIONS_TAB_LEGEND) + toggleLegendKeyOption() + expectLegendKeyOptionToBeEnabled() + clickOptionsModalUpdateButton() + expectVisualizationToBeVisible(VIS_TYPE_GAUGE) + + cy.log('legend key is shown (Gauge) with 1 item') + expectLegendKeyToBeVisible() + expectLegedKeyItemAmountToBe(1) + + cy.log('changes vis type to Single value') + changeVisType(visTypeDisplayNames[VIS_TYPE_SINGLE_VALUE]) + clickMenuBarUpdateButton() + expectVisualizationToBeVisible(VIS_TYPE_SINGLE_VALUE) + + cy.log('legend key is shown (Single value) with 1 item') + expectLegendKeyToBeVisible() + expectLegedKeyItemAmountToBe(1) + + cy.log('disables legend key option (Single value)') + openOptionsModal(OPTIONS_TAB_LEGEND) + toggleLegendKeyOption() + expectLegendKeyOptionToBeDisabled() + clickOptionsModalUpdateButton() + expectVisualizationToBeVisible(VIS_TYPE_SINGLE_VALUE) + + cy.log('legend key is hidden (Single value)') + expectLegendKeyToBeHidden() }) - describe('Preventing options bleed: Column -> Area', () => { - it('navigates to the start page and adds data items', () => { - goToStartPage() - openDimension(DIMENSION_ID_DATA) - selectIndicators(TEST_ITEMS.map((item) => item.name)) - clickDimensionModalUpdateButton() - expectVisualizationToBeVisible(VIS_TYPE_COLUMN) - }) - it('enables legend', () => { - openOptionsModal(OPTIONS_TAB_LEGEND) - toggleLegend() - expectLegendToBeEnabled() - expectLegendDisplayStrategyToBeByDataItem() - clickOptionsModalUpdateButton() - expectChartTitleToBeVisible() - }) - it('legend is applied to Column', () => { - TEST_ITEMS.forEach((item) => - expectWindowConfigSeriesItemToHaveLegendSet( - item.name, - item.legendSet - ) - ) - }) - it('changes vis type to Area', () => { - changeVisType(visTypeDisplayNames[VIS_TYPE_AREA]) - clickMenuBarUpdateButton() - expectVisualizationToBeVisible(VIS_TYPE_AREA) - }) - it('legend is not applied to Area', () => { - TEST_ITEMS.forEach((item) => - expectWindowConfigSeriesItemToNotHaveLegendSet(item.name) + it('does not apply non-applicable options when Column switched to Area', () => { + cy.log('navigates to the start page and adds data items') + goToStartPage() + openDimension(DIMENSION_ID_DATA) + selectIndicators(TEST_ITEMS.map((item) => item.name)) + clickDimensionModalUpdateButton() + expectVisualizationToBeVisible(VIS_TYPE_COLUMN) + + cy.log('enables legend') + openOptionsModal(OPTIONS_TAB_LEGEND) + toggleLegend() + expectLegendToBeEnabled() + expectLegendDisplayStrategyToBeByDataItem() + clickOptionsModalUpdateButton() + expectChartTitleToBeVisible() + + cy.log('legend is applied to Column') + TEST_ITEMS.forEach((item) => + expectWindowConfigSeriesItemToHaveLegendSet( + item.name, + item.legendSet ) - }) - it('legend options are not available', () => { - openOptionsModal() - expectOptionsTabToBeHidden(OPTIONS_TAB_LEGEND) - clickOptionsModalHideButton() - }) - it('legend key is hidden', () => { - expectLegendKeyToBeHidden() - }) - it(`series key displays the correct amount of items`, () => { - expectSeriesKeyToHaveSeriesKeyItems(2) - }) + ) + + cy.log('changes vis type to Area') + changeVisType(visTypeDisplayNames[VIS_TYPE_AREA]) + clickMenuBarUpdateButton() + expectVisualizationToBeVisible(VIS_TYPE_AREA) + + cy.log('legend is not applied to Area') + TEST_ITEMS.forEach((item) => + expectWindowConfigSeriesItemToNotHaveLegendSet(item.name) + ) + + cy.log('legend options are not available') + openOptionsModal() + expectOptionsTabToBeHidden(OPTIONS_TAB_LEGEND) + clickOptionsModalHideButton() + + cy.log('legend key is hidden') + expectLegendKeyToBeHidden() + + cy.log('series key displays the correct amount of items') + expectSeriesKeyToHaveSeriesKeyItems(2) }) - describe('Non-legend set type displays correctly: Line', () => { - it('navigates to the start page and adds data items', () => { - goToStartPage() - changeVisType(visTypeDisplayNames[VIS_TYPE_LINE]) - openDimension(DIMENSION_ID_DATA) - selectIndicators(TEST_ITEMS.map((item) => item.name)) - clickDimensionModalUpdateButton() - expectVisualizationToBeVisible(VIS_TYPE_LINE) - }) - it('legend is not applied to Line', () => { - TEST_ITEMS.forEach((item) => - expectWindowConfigSeriesItemToNotHaveLegendSet(item.name) - ) - }) - it('legend options are not available', () => { - openOptionsModal() - expectOptionsTabToBeHidden(OPTIONS_TAB_LEGEND) - }) - it('legend key is hidden', () => { - expectLegendKeyToBeHidden() - }) - it(`series key displays the correct amount of items`, () => { - expectSeriesKeyToHaveSeriesKeyItems(2) - }) + it('does not enable legend options for Line chart', () => { + cy.log('navigates to the start page and adds data items') + goToStartPage() + changeVisType(visTypeDisplayNames[VIS_TYPE_LINE]) + openDimension(DIMENSION_ID_DATA) + selectIndicators(TEST_ITEMS.map((item) => item.name)) + clickDimensionModalUpdateButton() + expectVisualizationToBeVisible(VIS_TYPE_LINE) + + cy.log('legend is not applied to Line') + TEST_ITEMS.forEach((item) => + expectWindowConfigSeriesItemToNotHaveLegendSet(item.name) + ) + + cy.log('legend options are not available') + openOptionsModal() + expectOptionsTabToBeHidden(OPTIONS_TAB_LEGEND) + + cy.log('legend key is hidden') + expectLegendKeyToBeHidden() + + cy.log('series key displays the correct number of items') + expectSeriesKeyToHaveSeriesKeyItems(2) }) - describe('The chart series key displaying legend colors', () => { - it('navigates to the start page and adds data items', () => { - goToStartPage() - openDimension(DIMENSION_ID_DATA) - selectIndicators(TEST_ITEMS.map((item) => item.name)) - clickDimensionModalUpdateButton() - expectVisualizationToBeVisible(VIS_TYPE_COLUMN) - }) - it(`series key displays the correct amount of items`, () => { - expectSeriesKeyToHaveSeriesKeyItems(2) - }) - it('enables legend', () => { - openOptionsModal(OPTIONS_TAB_LEGEND) - toggleLegend() - expectLegendToBeEnabled() - expectLegendDisplayStrategyToBeByDataItem() - clickOptionsModalUpdateButton() - expectChartTitleToBeVisible() - }) - it(`changes legend display strategy to fixed (${TEST_ITEMS[1].legendSet})`, () => { - openOptionsModal(OPTIONS_TAB_LEGEND) - expectLegendDisplayStrategyToBeByDataItem() - changeDisplayStrategyToFixed() - expectLegendDisplayStrategyToBeFixed() - changeFixedLegendSet(TEST_ITEMS[1].legendSet) - clickOptionsModalUpdateButton() - expectChartTitleToBeVisible() - }) + it('changes legend from per data item to fixed strategy for Column chart', () => { + cy.log('navigates to the start page and adds data items') + goToStartPage() + openDimension(DIMENSION_ID_DATA) + selectIndicators(TEST_ITEMS.map((item) => item.name)) + clickDimensionModalUpdateButton() + expectVisualizationToBeVisible(VIS_TYPE_COLUMN) + + cy.log('series key displays the correct number of items') + expectSeriesKeyToHaveSeriesKeyItems(2) + + cy.log('enables legend') + openOptionsModal(OPTIONS_TAB_LEGEND) + toggleLegend() + expectLegendToBeEnabled() + expectLegendDisplayStrategyToBeByDataItem() + clickOptionsModalUpdateButton() + expectChartTitleToBeVisible() + + cy.log( + `changes legend display strategy to fixed (${TEST_ITEMS[1].legendSet})` + ) + openOptionsModal(OPTIONS_TAB_LEGEND) + expectLegendDisplayStrategyToBeByDataItem() + changeDisplayStrategyToFixed() + expectLegendDisplayStrategyToBeFixed() + changeFixedLegendSet(TEST_ITEMS[1].legendSet) + clickOptionsModalUpdateButton() + expectChartTitleToBeVisible() }) - describe('When data is not on series, legend is only applied when strategy fixed is used', () => { + it('only applies legend for charts where data is not on series when legend display strategy is fixed', () => { const TEST_ITEM = TEST_ITEMS[0] - it('navigates to the start page and adds data items, legend and legend key', () => { - goToStartPage() - openDimension(DIMENSION_ID_DATA) - selectIndicators([TEST_ITEM.name]) - clickDimensionModalUpdateButton() - expectVisualizationToBeVisible(VIS_TYPE_COLUMN) - openOptionsModal(OPTIONS_TAB_LEGEND) - toggleLegend() - expectLegendToBeEnabled() - expectLegendDisplayStrategyToBeByDataItem() - toggleLegendKeyOption() - expectLegendKeyOptionToBeEnabled() - clickOptionsModalUpdateButton() - expectVisualizationToBeVisible() - }) - it("selects period 'Last 3 months'", () => { - openDimension(DIMENSION_ID_PERIOD) - unselectAllItemsByButton() - selectRelativePeriods(['Last 3 months'], 'Months') - clickDimensionModalUpdateButton() - }) - it('legend by data item is applied', () => { - expectWindowConfigSeriesItemToHaveLegendSet( - TEST_ITEM.name, - TEST_ITEM.legendSet - ) - }) - it('legend key is shown with 1 item', () => { - expectLegendKeyToBeVisible() - expectLegedKeyItemAmountToBe(1) - }) - it(`series key displays the correct amount of items`, () => { - expectSeriesKeyToHaveSeriesKeyItems(1) - }) - it('moves period dimension to series axis', () => { - openContextMenu(DIMENSION_ID_PERIOD) - clickContextMenuMove(DIMENSION_ID_PERIOD, AXIS_ID_COLUMNS) - clickMenuBarUpdateButton() - expectVisualizationToBeVisible() - expectAxisToHaveDimension(AXIS_ID_COLUMNS, DIMENSION_ID_PERIOD) - }) - it('no legend is applied', () => { - expectEachWindowConfigSeriesItemToNotHaveLegendSet() - }) - it('legend key is hidden', () => { - expectLegendKeyToBeHidden() - }) - it(`changes legend display strategy to fixed (${TEST_ITEMS[1].legendSet})`, () => { - openOptionsModal(OPTIONS_TAB_LEGEND) - expectLegendDisplayStrategyToBeByDataItem() - changeDisplayStrategyToFixed() - expectLegendDisplayStrategyToBeFixed() - changeFixedLegendSet(TEST_ITEMS[1].legendSet) - clickOptionsModalUpdateButton() - expectVisualizationToBeVisible() - }) - it('fixed legend is applied', () => { - expectEachWindowConfigSeriesItemToHaveLegendSet( - TEST_ITEMS[1].legendSet - ) - }) - it('legend key is shown with 1 item', () => { - expectLegendKeyToBeVisible() - expectLegedKeyItemAmountToBe(1) - }) - it(`series key displays the correct amount of items`, () => { - expectSeriesKeyToHaveSeriesKeyItems(3) - }) + + cy.log( + 'navigates to the start page and adds data items, legend and legend key' + ) + goToStartPage() + openDimension(DIMENSION_ID_DATA) + selectIndicators([TEST_ITEM.name]) + clickDimensionModalUpdateButton() + expectVisualizationToBeVisible(VIS_TYPE_COLUMN) + openOptionsModal(OPTIONS_TAB_LEGEND) + toggleLegend() + expectLegendToBeEnabled() + expectLegendDisplayStrategyToBeByDataItem() + toggleLegendKeyOption() + expectLegendKeyOptionToBeEnabled() + clickOptionsModalUpdateButton() + expectVisualizationToBeVisible() + + cy.log('selects period "Last 3 months"') + openDimension(DIMENSION_ID_PERIOD) + unselectAllItemsByButton() + selectRelativePeriods(['Last 3 months'], 'Months') + clickDimensionModalUpdateButton() + + cy.log('legend by data item is applied') + expectWindowConfigSeriesItemToHaveLegendSet( + TEST_ITEM.name, + TEST_ITEM.legendSet + ) + + cy.log('legend key is shown with 1 item') + expectLegendKeyToBeVisible() + expectLegedKeyItemAmountToBe(1) + + cy.log('series key displays the correct amount of items') + expectSeriesKeyToHaveSeriesKeyItems(1) + + cy.log('moves period dimension to series axis') + openContextMenu(DIMENSION_ID_PERIOD) + clickContextMenuMove(DIMENSION_ID_PERIOD, AXIS_ID_COLUMNS) + clickMenuBarUpdateButton() + expectVisualizationToBeVisible() + expectAxisToHaveDimension(AXIS_ID_COLUMNS, DIMENSION_ID_PERIOD) + + cy.log('no legend is applied') + expectEachWindowConfigSeriesItemToNotHaveLegendSet() + + cy.log('legend key is hidden') + expectLegendKeyToBeHidden() + + cy.log( + `change legend display strategy to fixed ${TEST_ITEMS[1].legendSet}` + ) + openOptionsModal(OPTIONS_TAB_LEGEND) + expectLegendDisplayStrategyToBeByDataItem() + changeDisplayStrategyToFixed() + expectLegendDisplayStrategyToBeFixed() + changeFixedLegendSet(TEST_ITEMS[1].legendSet) + clickOptionsModalUpdateButton() + expectVisualizationToBeVisible() + + cy.log('fixed legend is applied') + expectEachWindowConfigSeriesItemToHaveLegendSet(TEST_ITEMS[1].legendSet) + + cy.log('legend key is shown with 1 item') + expectLegendKeyToBeVisible() + expectLegedKeyItemAmountToBe(1) + + cy.log('series key displays the correct amount of items') + expectSeriesKeyToHaveSeriesKeyItems(3) }) - describe('Legend is not applied to column-as-line items', () => { - it('navigates to the start page and adds data items, legend and legend key', () => { - goToStartPage() - openDimension(DIMENSION_ID_DATA) - selectIndicators(TEST_ITEMS.map((item) => item.name)) - clickDimensionModalUpdateButton() - expectVisualizationToBeVisible(VIS_TYPE_COLUMN) - openOptionsModal(OPTIONS_TAB_LEGEND) - toggleLegend() - expectLegendToBeEnabled() - expectLegendDisplayStrategyToBeByDataItem() - toggleLegendKeyOption() - expectLegendKeyOptionToBeEnabled() - clickOptionsModalUpdateButton() - expectVisualizationToBeVisible() - }) - it('legend by data item is applied', () => { - TEST_ITEMS.forEach((item) => - expectWindowConfigSeriesItemToHaveLegendSet( - item.name, - item.legendSet - ) - ) - }) - it(`changes all items to type ${VIS_TYPE_LINE}`, () => { - openOptionsModal(OPTIONS_TAB_SERIES) - TEST_ITEMS.forEach((item, index) => - setItemToType(index, VIS_TYPE_LINE) - ) - clickOptionsModalUpdateButton() - expectVisualizationToBeVisible() - TEST_ITEMS.forEach((item, index) => - expectWindowConfigSeriesItemToBeType(index, 'line') - ) - }) - it('no legend is applied', () => { - expectEachWindowConfigSeriesItemToNotHaveLegendSet() - }) - it('legend key is hidden', () => { - expectLegendKeyToBeHidden() - }) - it(`series key displays the correct amount of items`, () => { - expectSeriesKeyToHaveSeriesKeyItems(2) - }) - it(`changes first item (${TEST_ITEMS[0].name}) to type ${VIS_TYPE_COLUMN}`, () => { - openOptionsModal(OPTIONS_TAB_SERIES) - setItemToType(0, VIS_TYPE_COLUMN) - clickOptionsModalUpdateButton() - expectVisualizationToBeVisible() - expectWindowConfigSeriesItemToNotHaveType(0) - }) - it('legend by data item is applied to the first item', () => { + it('does not apply a legend to column-as-line items', () => { + cy.log( + 'navigates to the start page and adds data items, legend and legend key' + ) + goToStartPage() + openDimension(DIMENSION_ID_DATA) + selectIndicators(TEST_ITEMS.map((item) => item.name)) + clickDimensionModalUpdateButton() + expectVisualizationToBeVisible(VIS_TYPE_COLUMN) + openOptionsModal(OPTIONS_TAB_LEGEND) + toggleLegend() + expectLegendToBeEnabled() + expectLegendDisplayStrategyToBeByDataItem() + toggleLegendKeyOption() + expectLegendKeyOptionToBeEnabled() + clickOptionsModalUpdateButton() + expectVisualizationToBeVisible() + + cy.log('legend by data item is applied') + TEST_ITEMS.forEach((item) => expectWindowConfigSeriesItemToHaveLegendSet( - TEST_ITEMS[0].name, - TEST_ITEMS[0].legendSet + item.name, + item.legendSet ) - expectWindowConfigSeriesItemToNotHaveLegendSet(TEST_ITEMS[1].name) - }) - it('legend key is shown with 1 item', () => { - expectLegendKeyToBeVisible() - expectLegedKeyItemAmountToBe(1) - }) - it(`series key displays the correct amount of items`, () => { - expectSeriesKeyToHaveSeriesKeyItems(2) - }) + ) + + cy.log(`changes all items to type ${VIS_TYPE_LINE}`) + openOptionsModal(OPTIONS_TAB_SERIES) + TEST_ITEMS.forEach((item, index) => setItemToType(index, VIS_TYPE_LINE)) + clickOptionsModalUpdateButton() + expectVisualizationToBeVisible() + TEST_ITEMS.forEach((item, index) => + expectWindowConfigSeriesItemToBeType(index, 'line') + ) + + cy.log('no legend is applied') + expectEachWindowConfigSeriesItemToNotHaveLegendSet() + + cy.log('legend key is hidden') + expectLegendKeyToBeHidden() + + cy.log('series key displays the correct amount of items') + expectSeriesKeyToHaveSeriesKeyItems(2) + + cy.log( + `changes first item (${TEST_ITEMS[0].name}) to type ${VIS_TYPE_COLUMN}` + ) + openOptionsModal(OPTIONS_TAB_SERIES) + setItemToType(0, VIS_TYPE_COLUMN) + clickOptionsModalUpdateButton() + expectVisualizationToBeVisible() + expectWindowConfigSeriesItemToNotHaveType(0) + + cy.log('legend by data item is applied to the first item') + expectWindowConfigSeriesItemToHaveLegendSet( + TEST_ITEMS[0].name, + TEST_ITEMS[0].legendSet + ) + expectWindowConfigSeriesItemToNotHaveLegendSet(TEST_ITEMS[1].name) + + cy.log('legend key is shown with 1 item') + expectLegendKeyToBeVisible() + expectLegedKeyItemAmountToBe(1) + + cy.log('series key displays the correct amount of items') + expectSeriesKeyToHaveSeriesKeyItems(2) + const TEST_ITEM = { name: 'ANC 2 Coverage', legendSet: 'ANC Coverage', legends: 7, } - it(`adds a third item (${TEST_ITEM.name} - same legendset as the first item) with type ${VIS_TYPE_LINE}`, () => { - openDimension(DIMENSION_ID_DATA) - selectIndicators([TEST_ITEM.name]) - clickDimensionModalUpdateButton() - expectVisualizationToBeVisible(VIS_TYPE_COLUMN) - openOptionsModal(OPTIONS_TAB_SERIES) - setItemToType(2, VIS_TYPE_LINE) - clickOptionsModalUpdateButton() - expectVisualizationToBeVisible() - expectWindowConfigSeriesItemToNotHaveType(0) - }) - it('legend key is shown with 1 item', () => { - expectLegendKeyToBeVisible() - expectLegedKeyItemAmountToBe(1) - }) - it('legend by data item is applied to the first item', () => { - expectWindowConfigSeriesItemToHaveLegendSet( - TEST_ITEMS[0].name, - TEST_ITEMS[0].legendSet - ) - expectWindowConfigSeriesItemToNotHaveLegendSet(TEST_ITEMS[1].name) - expectWindowConfigSeriesItemToNotHaveLegendSet(TEST_ITEM.name) - }) - it(`series key displays the correct amount of items`, () => { - expectSeriesKeyToHaveSeriesKeyItems(3) - }) + + cy.log( + `adds a third item (${TEST_ITEM.name} - same legendset as the first item) with type ${VIS_TYPE_LINE}` + ) + openDimension(DIMENSION_ID_DATA) + selectIndicators([TEST_ITEM.name]) + clickDimensionModalUpdateButton() + expectVisualizationToBeVisible(VIS_TYPE_COLUMN) + openOptionsModal(OPTIONS_TAB_SERIES) + setItemToType(2, VIS_TYPE_LINE) + clickOptionsModalUpdateButton() + expectVisualizationToBeVisible() + expectWindowConfigSeriesItemToNotHaveType(0) + + cy.log('legend key is shown with 1 item') + expectLegendKeyToBeVisible() + expectLegedKeyItemAmountToBe(1) + + cy.log('legend by data item is applied to the first item') + expectWindowConfigSeriesItemToHaveLegendSet( + TEST_ITEMS[0].name, + TEST_ITEMS[0].legendSet + ) + expectWindowConfigSeriesItemToNotHaveLegendSet(TEST_ITEMS[1].name) + expectWindowConfigSeriesItemToNotHaveLegendSet(TEST_ITEM.name) + + cy.log('series key displays the correct amount of items') + expectSeriesKeyToHaveSeriesKeyItems(3) }) }) diff --git a/cypress/integration/save.cy.js b/cypress/integration/save.cy.js index 44161302ab..70c983dd9a 100644 --- a/cypress/integration/save.cy.js +++ b/cypress/integration/save.cy.js @@ -61,160 +61,157 @@ const TEST_INDICATOR_NAMES = TEST_INDICATORS.slice(1, 4).map( // TODO: Add test to check that the description is saved and shown in the interpretations panel describe('saving an AO', () => { - describe('"save" and "save as" for a new AO', () => { - it('navigates to the start page', () => { - goToStartPage() - }) - it('checks that Save is disabled', () => { - clickMenuBarFileButton() - expectFileMenuButtonToBeDisabled(FILE_MENU_BUTTON_SAVE_EXISTING) - closeFileMenuWithClick() - }) - it(`changes vis type to ${TEST_VIS_TYPE_NAME}`, () => { - changeVisType(TEST_VIS_TYPE_NAME) - }) - it('adds Data dimension items', () => { - if (TEST_VIS_TYPE === VIS_TYPE_SCATTER) { - openDimension(DIMENSION_ID_DATA) - switchDataTab('Vertical') - selectIndicators([TEST_INDICATOR_NAMES[0]]) - clickDimensionModalUpdateButton() - openDimension(DIMENSION_ID_DATA) - switchDataTab('Horizontal') - selectIndicators([TEST_INDICATOR_NAMES[1]]) - clickDimensionModalUpdateButton() - } else { - openDimension(DIMENSION_ID_DATA) - selectDataElements( - TEST_DATA_ELEMENTS.slice(1, 2).map((item) => item.name) - ) - clickDimensionModalUpdateButton() - } - }) - it('displays an unsaved visualization', () => { - expectVisualizationToBeVisible(TEST_VIS_TYPE) - expectAOTitleToBeUnsaved() - expectRouteToBeEmpty() - }) - it('checks that Save is enabled', () => { - clickMenuBarFileButton() - expectFileMenuButtonToBeEnabled(FILE_MENU_BUTTON_SAVE_EXISTING) - closeFileMenuWithClick() - }) - it('checks that Save as is disabled', () => { - clickMenuBarFileButton() - expectFileMenuButtonToBeDisabled(FILE_MENU_BUTTON_SAVEAS) - closeFileMenuWithClick() - }) - it('saves new AO using "Save"', () => { - saveNewAO(TEST_VIS_NAME, TEST_VIS_DESCRIPTION) - expectAOTitleToBeValue(TEST_VIS_NAME) - expectVisualizationToBeVisible(TEST_VIS_TYPE) - }) - it('checks that the url was changed', () => { - expectRouteToBeAOId() - }) - it('all File menu buttons but Save are enabled', () => { - clickMenuBarFileButton() - const enabledButtons = [ - FILE_MENU_BUTTON_NEW, - FILE_MENU_BUTTON_OPEN, - FILE_MENU_BUTTON_SAVEAS, - FILE_MENU_BUTTON_RENAME, - FILE_MENU_BUTTON_TRANSLATE, - FILE_MENU_BUTTON_SHARE, - FILE_MENU_BUTTON_GETLINK, - FILE_MENU_BUTTON_DELETE, - ] - enabledButtons.forEach((button) => - expectFileMenuButtonToBeEnabled(button) + it('"save" and "save as" for a new AO', () => { + // navigates to the start page + goToStartPage() + + // checks that Save is disabled + clickMenuBarFileButton() + expectFileMenuButtonToBeDisabled(FILE_MENU_BUTTON_SAVE_EXISTING) + closeFileMenuWithClick() + + // changes vis type + cy.log(`changes vis type to ${TEST_VIS_TYPE_NAME}`) + changeVisType(TEST_VIS_TYPE_NAME) + + // adds Data dimension items + if (TEST_VIS_TYPE === VIS_TYPE_SCATTER) { + openDimension(DIMENSION_ID_DATA) + switchDataTab('Vertical') + selectIndicators([TEST_INDICATOR_NAMES[0]]) + clickDimensionModalUpdateButton() + openDimension(DIMENSION_ID_DATA) + switchDataTab('Horizontal') + selectIndicators([TEST_INDICATOR_NAMES[1]]) + clickDimensionModalUpdateButton() + } else { + openDimension(DIMENSION_ID_DATA) + selectDataElements( + TEST_DATA_ELEMENTS.slice(1, 2).map((item) => item.name) ) - closeFileMenuWithClick() - }) - it(`replaces the selected period`, () => { - replacePeriodItems(TEST_VIS_TYPE) - expectAOTitleToBeDirty() - expectVisualizationToBeVisible(TEST_VIS_TYPE) - }) - it('saves AO using "Save"', () => { - saveExistingAO() - expectAOTitleToNotBeDirty() - expectAOTitleToBeValue(TEST_VIS_NAME) - expectVisualizationToBeVisible(TEST_VIS_TYPE) - }) - it('saves AO using "Save As"', () => { - saveAOAs(TEST_VIS_NAME_UPDATED) - expectAOTitleToBeValue(TEST_VIS_NAME_UPDATED) - expectVisualizationToBeVisible(TEST_VIS_TYPE) - }) + clickDimensionModalUpdateButton() + } + + // displays an unsaved visualization + expectVisualizationToBeVisible(TEST_VIS_TYPE) + expectAOTitleToBeUnsaved() + expectRouteToBeEmpty() + + // checks that Save is enabled + clickMenuBarFileButton() + expectFileMenuButtonToBeEnabled(FILE_MENU_BUTTON_SAVE_EXISTING) + closeFileMenuWithClick() + + // checks that Save as is disabled + clickMenuBarFileButton() + expectFileMenuButtonToBeDisabled(FILE_MENU_BUTTON_SAVEAS) + closeFileMenuWithClick() + + // saves new AO using "Save" + saveNewAO(TEST_VIS_NAME, TEST_VIS_DESCRIPTION) + expectAOTitleToBeValue(TEST_VIS_NAME) + expectVisualizationToBeVisible(TEST_VIS_TYPE) + + // checks that the url was changed + expectRouteToBeAOId() + + // all File menu buttons but Save are enabled + clickMenuBarFileButton() + const enabledButtons = [ + FILE_MENU_BUTTON_NEW, + FILE_MENU_BUTTON_OPEN, + FILE_MENU_BUTTON_SAVEAS, + FILE_MENU_BUTTON_RENAME, + FILE_MENU_BUTTON_TRANSLATE, + FILE_MENU_BUTTON_SHARE, + FILE_MENU_BUTTON_GETLINK, + FILE_MENU_BUTTON_DELETE, + ] + enabledButtons.forEach((button) => + expectFileMenuButtonToBeEnabled(button) + ) + closeFileMenuWithClick() + + // replaces the selected period + replacePeriodItems(TEST_VIS_TYPE) + expectAOTitleToBeDirty() + expectVisualizationToBeVisible(TEST_VIS_TYPE) + + // saves AO using "Save" + saveExistingAO() + expectAOTitleToNotBeDirty() + expectAOTitleToBeValue(TEST_VIS_NAME) + expectVisualizationToBeVisible(TEST_VIS_TYPE) + + // saves AO using "Save As" + saveAOAs(TEST_VIS_NAME_UPDATED) + expectAOTitleToBeValue(TEST_VIS_NAME_UPDATED) + expectVisualizationToBeVisible(TEST_VIS_TYPE) }) - describe('"save" and "save as" for a saved AO created by you', () => { - it('navigates to the start page and opens a saved AO', () => { - cy.intercept( - /systemSettings(\S)*keyAnalysisRelativePeriod(\S)*/, - (req) => { - req.reply((res) => { - res.send({ - body: { - ...res.body, - keyHideMonthlyPeriods: false, - }, - }) + it('"save" and "save as" for a saved AO created by you', () => { + // navigates to the start page and opens a saved AO + cy.intercept( + /systemSettings(\S)*keyAnalysisRelativePeriod(\S)*/, + (req) => { + req.reply((res) => { + res.send({ + body: { + ...res.body, + keyHideMonthlyPeriods: false, + }, }) - } - ) - goToStartPage() - openAOByName(TEST_VIS_NAME_UPDATED) - expectAOTitleToBeValue(TEST_VIS_NAME_UPDATED) - }) - it(`replaces the selected period`, () => { - replacePeriodItems(TEST_VIS_TYPE, { useAltData: true }) - expectAOTitleToBeDirty() - }) - it('saves AO using "Save"', () => { - saveExistingAO() - expectAOTitleToNotBeDirty() - expectAOTitleToBeValue(TEST_VIS_NAME) - expectVisualizationToBeVisible(TEST_VIS_TYPE) - }) - it('deletes AO', () => { - deleteAO() - expectRouteToBeEmpty() - expectStartScreenToBeVisible() - }) + }) + } + ) + goToStartPage() + openAOByName(TEST_VIS_NAME_UPDATED) + expectAOTitleToBeValue(TEST_VIS_NAME_UPDATED) + + // replaces the selected period + replacePeriodItems(TEST_VIS_TYPE, { useAltData: true }) + expectAOTitleToBeDirty() + + // saves AO using "Save" + saveExistingAO() + expectAOTitleToNotBeDirty() + expectAOTitleToBeValue(TEST_VIS_NAME) + expectVisualizationToBeVisible(TEST_VIS_TYPE) + + // deletes AO + deleteAO() + expectRouteToBeEmpty() + expectStartScreenToBeVisible() }) - describe('"save" a copied AO created by others', () => { - it('works after editing', () => { - const TEST_VIS_BY_OTHERS_NAME = 'ANC: 1-3 dropout rate Yearly' - const TEST_VIS_BY_OTHERS_NAME_UPDATED = `${TEST_VIS_BY_OTHERS_NAME} - updated` + it('"save" a copied AO created by others works after editing', () => { + const TEST_VIS_BY_OTHERS_NAME = 'ANC: 1-3 dropout rate Yearly' + const TEST_VIS_BY_OTHERS_NAME_UPDATED = `${TEST_VIS_BY_OTHERS_NAME} - updated` - // navigates to the start page and opens an AO created by others - goToStartPage() - openAOByName(TEST_VIS_BY_OTHERS_NAME) - expectAOTitleToBeValue(TEST_VIS_BY_OTHERS_NAME) + // navigates to the start page and opens an AO created by others + goToStartPage() + openAOByName(TEST_VIS_BY_OTHERS_NAME) + expectAOTitleToBeValue(TEST_VIS_BY_OTHERS_NAME) - // saves AO using "Save As" - saveAOAs(TEST_VIS_BY_OTHERS_NAME_UPDATED) - expectAOTitleToBeValue(TEST_VIS_BY_OTHERS_NAME_UPDATED) - expectVisualizationToBeVisible() + // saves AO using "Save As" + saveAOAs(TEST_VIS_BY_OTHERS_NAME_UPDATED) + expectAOTitleToBeValue(TEST_VIS_BY_OTHERS_NAME_UPDATED) + expectVisualizationToBeVisible() - // edits the AO - openDimension(DIMENSION_ID_ORGUNIT) - deselectOrgUnitTreeItem('Western Area') - clickDimensionModalUpdateButton() + // edits the AO + openDimension(DIMENSION_ID_ORGUNIT) + deselectOrgUnitTreeItem('Western Area') + clickDimensionModalUpdateButton() + + // saves AO using "Save" + saveExistingAO() + expectAOTitleToNotBeDirty() + expectAOTitleToBeValue(TEST_VIS_BY_OTHERS_NAME_UPDATED) + expectVisualizationToBeVisible() - // saves AO using "Save" - saveExistingAO() - expectAOTitleToNotBeDirty() - expectAOTitleToBeValue(TEST_VIS_BY_OTHERS_NAME_UPDATED) - expectVisualizationToBeVisible() - - // deletes AO - deleteAO() - expectRouteToBeEmpty() - expectStartScreenToBeVisible() - }) + // deletes AO + deleteAO() + expectRouteToBeEmpty() + expectStartScreenToBeVisible() }) }) diff --git a/cypress/integration/start.cy.js b/cypress/integration/start.cy.js index 058ea1b97f..abbd2fee4b 100644 --- a/cypress/integration/start.cy.js +++ b/cypress/integration/start.cy.js @@ -35,52 +35,53 @@ import { expectVisTypeToBeDefault } from '../elements/visualizationTypeSelector. import { expectWindowTitleToBeDefault } from '../elements/window.js' import { expectStoreCurrentToBeEmpty } from '../utils/store.js' -describe('viewing the start screen', () => { - it('navigates to the start page', () => { +describe('Start screen', () => { + it('Start screen shows the correct initial state', () => { + // navigates to the start page goToStartPage() - }) - it('window has a title', () => { + + // window has a title expectWindowTitleToBeDefault() - }) - it('store is empty', () => { + + // store is empty expectStoreCurrentToBeEmpty() - }) - it('no chart is visible', () => { + + // no chart is visible expectVisualizationToNotBeVisible() - }) - it('displays most viewed section', () => { + + // displays most viewed section expectMostViewedToBeVisible() - }) - it('vis type is default', () => { + + // vis type is default expectVisTypeToBeDefault() - }) - it('axis series has data dimension', () => { + + // axis series has data dimension expectAxisToHaveDimension(AXIS_ID_COLUMNS, DIMENSION_ID_DATA) - }) - it('data dimension has no items', () => { + + // data dimension has no items expectDimensionToNotHaveItems(DIMENSION_ID_DATA) - }) - it('axis category has period dimension', () => { + + // axis category has period dimension expectAxisToHaveDimension(AXIS_ID_ROWS, DIMENSION_ID_PERIOD) - }) - it('period dimension has 1 item', () => { + + // period dimension has 1 item expectDimensionToHaveItemAmount(DIMENSION_ID_PERIOD, 1) - }) - it('axis filter has orgunit dimension', () => { + + // axis filter has orgunit dimension expectAxisToHaveDimension(AXIS_ID_FILTERS, DIMENSION_ID_ORGUNIT) - }) - it('orgunit dimension has 1 item', () => { + + // orgunit dimension has 1 item expectDimensionToHaveItemAmount(DIMENSION_ID_ORGUNIT, 1) - }) - it('primary File menu buttons are enabled and menu is closed with click', () => { + + // primary File menu buttons are enabled and menu is closed with click clickMenuBarFileButton() const enabledButtons = [FILE_MENU_BUTTON_NEW, FILE_MENU_BUTTON_OPEN] enabledButtons.forEach((button) => expectFileMenuButtonToBeEnabled(button) ) closeFileMenuWithClick() - }) - it('secondary File menu buttons are disabled and menu is closed with click', () => { + + // secondary File menu buttons are disabled and menu is closed with click clickMenuBarFileButton() const disabledButtons = [ FILE_MENU_BUTTON_SAVEAS, @@ -94,8 +95,8 @@ describe('viewing the start screen', () => { expectFileMenuButtonToBeDisabled(button) ) closeFileMenuWithClick() - }) - it('File menu is closed with Escape', () => { + + // File menu is closed with Escape clickMenuBarFileButton() closeFileMenuWithEsc() }) diff --git a/package.json b/package.json index b34ee226a0..7eb40b8953 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "@dhis2/cli-style": "^10.5.1", "@dhis2/cypress-commands": "^10.0.3", "@dhis2/cypress-plugins": "^10.0.2", - "@reportportal/agent-js-cypress": "^5.1.3", + "@reportportal/agent-js-cypress": "git+https://github.com/dhis2/agent-js-cypress.git#develop", "@reportportal/agent-js-jest": "^5.0.6", "cypress": "^12.16.0", "cypress-tags": "^1.1.2", @@ -41,7 +41,7 @@ "start-server-and-test": "^2.0.0" }, "dependencies": { - "@dhis2/analytics": "^26.1.2", + "@dhis2/analytics": "^26.1.6", "@dhis2/app-runtime": "^3.7.0", "@dhis2/app-runtime-adapter-d2": "^1.1.0", "@dhis2/app-service-datastore": "^1.0.0-beta.3", diff --git a/src/components/VisualizationPlugin/VisualizationPlugin.js b/src/components/VisualizationPlugin/VisualizationPlugin.js index 6883cec451..ec8d731b46 100644 --- a/src/components/VisualizationPlugin/VisualizationPlugin.js +++ b/src/components/VisualizationPlugin/VisualizationPlugin.js @@ -8,6 +8,7 @@ import { LEGEND_DISPLAY_STRATEGY_BY_DATA_ITEM, isLegendSetType, VIS_TYPE_LINE, + DIMENSION_ID_DATA, } from '@dhis2/analytics' import { useDataEngine } from '@dhis2/app-runtime' import { Button, IconLegend24, Layer } from '@dhis2/ui' @@ -260,8 +261,9 @@ export const VisualizationPlugin = ({ case LEGEND_DISPLAY_STRATEGY_BY_DATA_ITEM: { if ( + fetchResult.visualization.type !== VIS_TYPE_PIVOT_TABLE && !fetchResult.visualization.columns.some( - (item) => item.dimension === 'dx' + (item) => item.dimension === DIMENSION_ID_DATA ) ) { break diff --git a/yarn.lock b/yarn.lock index 2a87f4103e..943e3ca86f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2028,10 +2028,10 @@ classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2/analytics@^26.1.2": - version "26.1.2" - resolved "https://registry.yarnpkg.com/@dhis2/analytics/-/analytics-26.1.2.tgz#cc1a9feae34bea1d0fc61fd6f0fbe03badc5c3a4" - integrity sha512-xBjv/5Ey+PXoPZPtgpYhIgdNtJ3Ce2GtJKy/zU6fFhlm1Vaok5ipaoW6DxmaKdgeQm8VzNVnZdBSjV7+58rAPA== +"@dhis2/analytics@^26.1.6": + version "26.1.6" + resolved "https://registry.yarnpkg.com/@dhis2/analytics/-/analytics-26.1.6.tgz#d76d7aa40c4538fae6afbf7d8d5e7cfbad81efb5" + integrity sha512-XIoe2/mUjIlxzMrmA1iVeSH3zydZG7LC1LqZJQK8TBrneC7IrLhVFka+0zaGvTyA/2P35c5xFxSie7gKC8h8Og== dependencies: "@dhis2/d2-ui-rich-text" "^7.4.1" "@dhis2/multi-calendar-dates" "1.0.0" @@ -2967,12 +2967,11 @@ "@react-hook/passive-layout-effect" "^1.2.0" "@react-hook/resize-observer" "^1.2.1" -"@reportportal/agent-js-cypress@^5.1.3": - version "5.1.3" - resolved "https://registry.yarnpkg.com/@reportportal/agent-js-cypress/-/agent-js-cypress-5.1.3.tgz#596aa9657ad0e8fd7dc57f08304b73decf375d44" - integrity sha512-20UBwMR+EGJ0eNGK23kJxYkUp5+43G8wGmWaJCzozp7ihWK/I3mj+SkgjQ5F8FvExGi91ivAbpoXha8Ak5SZuQ== +"@reportportal/agent-js-cypress@git+https://github.com/dhis2/agent-js-cypress.git#develop": + version "5.1.4" + resolved "git+https://github.com/dhis2/agent-js-cypress.git#d3afea4e74abdbef39c1121f820f23deca2368f4" dependencies: - "@reportportal/client-javascript" "^5.0.12" + "@reportportal/client-javascript" "^5.0.14" glob "^7.2.3" minimatch "^3.1.2" mocha "^10.2.0" @@ -2998,6 +2997,18 @@ uniqid "^5.4.0" uuid "^9.0.0" +"@reportportal/client-javascript@^5.0.14": + version "5.0.14" + resolved "https://registry.yarnpkg.com/@reportportal/client-javascript/-/client-javascript-5.0.14.tgz#48a40f2f33129d74bb7e451aaf25d44742e26fcc" + integrity sha512-4ge9ddOB1rFlzqI6j43qCw0cyjQOloiPChA1EFyF3dcV2BXHzGbh8S3SNhwxibvlQtV6piU8e0W9CLN4UWXvSA== + dependencies: + axios "^0.27.2" + axios-retry "^3.4.0" + glob "^7.2.3" + ini "^2.0.0" + uniqid "^5.4.0" + uuid "^9.0.0" + "@rollup/plugin-babel@^5.2.0": version "5.3.0" resolved "https://registry.yarnpkg.com/@rollup/plugin-babel/-/plugin-babel-5.3.0.tgz#9cb1c5146ddd6a4968ad96f209c50c62f92f9879"