From 293f25df193235a1612d4f26e037ee8a5684420c Mon Sep 17 00:00:00 2001 From: John Hill Date: Tue, 11 Jul 2023 14:31:23 -0700 Subject: [PATCH 1/3] [CI] Update Github Actions to combine deploysentinel PR reports and driveby (#6784) * include git hash * skip a test --- .github/workflows/e2e-couchdb.yml | 1 + e2e/tests/framework/baseFixtures.e2e.spec.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e-couchdb.yml b/.github/workflows/e2e-couchdb.yml index 264cae4528..286190f755 100644 --- a/.github/workflows/e2e-couchdb.yml +++ b/.github/workflows/e2e-couchdb.yml @@ -49,6 +49,7 @@ jobs: - name: Run CouchDB Tests and publish to deploysentinel env: DEPLOYSENTINEL_API_KEY: ${{ secrets.DEPLOYSENTINEL_API_KEY }} + COMMIT_INFO_SHA: ${{github.event.pull_request.head.sha }} run: npm run test:e2e:couchdb - name: Publish Results to Codecov.io diff --git a/e2e/tests/framework/baseFixtures.e2e.spec.js b/e2e/tests/framework/baseFixtures.e2e.spec.js index 81b1697538..ee8dc5a893 100644 --- a/e2e/tests/framework/baseFixtures.e2e.spec.js +++ b/e2e/tests/framework/baseFixtures.e2e.spec.js @@ -29,7 +29,8 @@ relates to how we've extended it (i.e. ./e2e/baseFixtures.js) and assumptions ma const { test } = require('../../baseFixtures.js'); test.describe('baseFixtures tests', () => { - test('Verify that tests fail if console.error is thrown', async ({ page }) => { + //Skip this test for now https://github.com/nasa/openmct/issues/6785 + test.fixme('Verify that tests fail if console.error is thrown', async ({ page }) => { test.fail(); //Go to baseURL await page.goto('./', { waitUntil: 'domcontentloaded' }); From d08ea62932b3c107ff0137b24d9cca07afd10662 Mon Sep 17 00:00:00 2001 From: Shefali Joshi Date: Tue, 11 Jul 2023 16:16:46 -0700 Subject: [PATCH 2/3] Toggle between showing aggregate stacked plot legend or per-plot legend (#6758) * New option to show/hide stacked plot aggregate legend - defaulted to not show. Use the Plot component in the StackedPlotItem component for simplicity and show/hide sub-legends as needed. * Fix position and expanded classes when children are showing their legends * Fix broken tests and ensure gridlines and cursorguides work. * Adds e2e test for new legend configuration for stacked plot * Address review comments - Remove commented out code, optimize property lookup, fix bug with staleness * Remove the isStale icon in the legend when a plot is inside a stacked plot. --------- Co-authored-by: Jamie V --- .../plugins/plot/stackedPlot.e2e.spec.js | 47 ++++++++++- src/plugins/plot/MctPlot.vue | 3 +- src/plugins/plot/Plot.vue | 82 +++++++++++++++++-- src/plugins/plot/chart/MctChart.vue | 4 +- src/plugins/plot/configuration/LegendModel.js | 3 +- .../plot/inspector/PlotOptionsBrowse.vue | 8 ++ .../plot/inspector/PlotOptionsEdit.vue | 6 +- .../plot/inspector/forms/LegendForm.vue | 27 +++++- .../plot/legend/PlotLegendItemCollapsed.vue | 11 ++- src/plugins/plot/stackedPlot/StackedPlot.vue | 37 +++++++-- .../plot/stackedPlot/StackedPlotItem.vue | 64 +++++++-------- src/plugins/plot/stackedPlot/pluginSpec.js | 15 ++-- src/styles/_legacy-plots.scss | 4 - 13 files changed, 243 insertions(+), 68 deletions(-) diff --git a/e2e/tests/functional/plugins/plot/stackedPlot.e2e.spec.js b/e2e/tests/functional/plugins/plot/stackedPlot.e2e.spec.js index c2e46566d4..8d83e62c39 100644 --- a/e2e/tests/functional/plugins/plot/stackedPlot.e2e.spec.js +++ b/e2e/tests/functional/plugins/plot/stackedPlot.e2e.spec.js @@ -26,7 +26,11 @@ necessarily be used for reference when writing new tests in this area. */ const { test, expect } = require('../../../../pluginFixtures'); -const { createDomainObjectWithDefaults, selectInspectorTab } = require('../../../../appActions'); +const { + createDomainObjectWithDefaults, + selectInspectorTab, + waitForPlotsToRender +} = require('../../../../appActions'); test.describe('Stacked Plot', () => { let stackedPlot; @@ -227,4 +231,45 @@ test.describe('Stacked Plot', () => { page.locator('[aria-label="Plot Series Properties"] .c-object-label') ).toContainText(swgC.name); }); + + test('the legend toggles between aggregate and per child', async ({ page }) => { + await page.goto(stackedPlot.url); + + // Go into edit mode + await page.click('button[title="Edit"]'); + + await selectInspectorTab(page, 'Config'); + + let legendProperties = await page.locator('[aria-label="Legend Properties"]'); + await legendProperties.locator('[title="Display legends per sub plot."]~div input').uncheck(); + + await assertAggregateLegendIsVisible(page); + + // Save (exit edit mode) + await page.locator('button[title="Save"]').click(); + await page.locator('li[title="Save and Finish Editing"]').click(); + + await assertAggregateLegendIsVisible(page); + + await page.reload(); + + await assertAggregateLegendIsVisible(page); + }); }); + +/** + * Asserts that aggregate stacked plot legend is visible + * @param {import('@playwright/test').Page} page + */ +async function assertAggregateLegendIsVisible(page) { + // Wait for plot series data to load + await waitForPlotsToRender(page); + // Wait for plot legend to be shown + await page.waitForSelector('.js-stacked-plot-legend', { state: 'attached' }); + // There should be 3 legend items + expect( + await page + .locator('.js-stacked-plot-legend .c-plot-legend__wrapper div.plot-legend-item') + .count() + ).toBe(3); +} diff --git a/src/plugins/plot/MctPlot.vue b/src/plugins/plot/MctPlot.vue index 899af22c72..cb23e0c505 100644 --- a/src/plugins/plot/MctPlot.vue +++ b/src/plugins/plot/MctPlot.vue @@ -77,6 +77,7 @@

    Legend

    +
  • +
    + Show legend per plot +
    +
    {{ showLegendsForChildren ? 'Yes' : 'No' }}
    +
  • -
      +

        Legend

      diff --git a/src/plugins/plot/inspector/forms/LegendForm.vue b/src/plugins/plot/inspector/forms/LegendForm.vue index 5c72b1a382..d30a501832 100644 --- a/src/plugins/plot/inspector/forms/LegendForm.vue +++ b/src/plugins/plot/inspector/forms/LegendForm.vue @@ -21,6 +21,16 @@ -->