Dashboards: Enable scenes by default (#93818)

* Mark Scenes feature toggles as GA

* Move old arch e2e to a new folder

* Run E2E on scenes by default

* Upgrade e2e-selectors to ensure the tests in Playwright works
pull/93993/head
Ivan Ortega Alba 9 months ago committed by GitHub
parent 42f1fcaf2c
commit 7bca69849f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      .betterer.results
  2. 34
      .drone.yml
  3. 1
      .github/CODEOWNERS
  4. 47
      .github/workflows/run-scenes-e2e.yml
  5. 8
      docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md
  6. 6
      e2e/cypress/support/e2e.js
  7. 8
      e2e/dashboards-suite/Repeating_a_panel_horizontally.spec.ts
  8. 8
      e2e/dashboards-suite/Repeating_a_panel_vertically.spec.ts
  9. 9
      e2e/dashboards-suite/Repeating_an_empty_row.spec.ts
  10. 4
      e2e/dashboards-suite/dashboard-browse.spec.ts
  11. 2
      e2e/dashboards-suite/dashboard-export-json.spec.ts
  12. 0
      e2e/dashboards-suite/dashboard-keybindings.spec.ts
  13. 3
      e2e/dashboards-suite/dashboard-live-streaming.spec.ts
  14. 10
      e2e/dashboards-suite/dashboard-public-create.spec.ts
  15. 4
      e2e/dashboards-suite/dashboard-public-templating.spec.ts
  16. 4
      e2e/dashboards-suite/dashboard-share-externally-create.spec.ts
  17. 4
      e2e/dashboards-suite/dashboard-share-internally.spec.ts
  18. 6
      e2e/dashboards-suite/dashboard-share-snapshot-create.spec.ts
  19. 2
      e2e/dashboards-suite/dashboard-templating.spec.ts
  20. 4
      e2e/dashboards-suite/dashboard-time-zone.spec.ts
  21. 4
      e2e/dashboards-suite/general-dashboards.spec.ts
  22. 79
      e2e/dashboards-suite/load-options-from-url.spec.ts
  23. 8
      e2e/dashboards-suite/new-constant-variable.spec.ts
  24. 19
      e2e/dashboards-suite/new-custom-variable.spec.ts
  25. 30
      e2e/dashboards-suite/new-datasource-variable.spec.ts
  26. 11
      e2e/dashboards-suite/new-interval-variable.spec.ts
  27. 55
      e2e/dashboards-suite/new-query-variable.spec.ts
  28. 15
      e2e/dashboards-suite/new-text-box-variable.spec.ts
  29. 97
      e2e/dashboards-suite/set-options-from-ui.spec.ts
  30. 0
      e2e/dashboards-suite/snapshot-create.spec.ts
  31. 16
      e2e/dashboards-suite/templating-dashboard-links-and-variables.spec.ts
  32. 8
      e2e/old-arch/dashboards-suite/Repeating_a_panel_horizontally.spec.ts
  33. 8
      e2e/old-arch/dashboards-suite/Repeating_a_panel_vertically.spec.ts
  34. 9
      e2e/old-arch/dashboards-suite/Repeating_an_empty_row.spec.ts
  35. 0
      e2e/old-arch/dashboards-suite/dashboard-browse-nested.spec.ts
  36. 4
      e2e/old-arch/dashboards-suite/dashboard-browse.spec.ts
  37. 3
      e2e/old-arch/dashboards-suite/dashboard-live-streaming.spec.ts
  38. 0
      e2e/old-arch/dashboards-suite/dashboard-panel-attention.spec.ts
  39. 10
      e2e/old-arch/dashboards-suite/dashboard-public-create.spec.ts
  40. 4
      e2e/old-arch/dashboards-suite/dashboard-public-templating.spec.ts
  41. 2
      e2e/old-arch/dashboards-suite/dashboard-templating.spec.ts
  42. 4
      e2e/old-arch/dashboards-suite/dashboard-time-zone.spec.ts
  43. 0
      e2e/old-arch/dashboards-suite/dashboard-timepicker.spec.ts
  44. 0
      e2e/old-arch/dashboards-suite/embedded-dashboard.spec.ts
  45. 4
      e2e/old-arch/dashboards-suite/general-dashboards.spec.ts
  46. 0
      e2e/old-arch/dashboards-suite/import-dashboard.spec.ts
  47. 79
      e2e/old-arch/dashboards-suite/load-options-from-url.spec.ts
  48. 8
      e2e/old-arch/dashboards-suite/new-constant-variable.spec.ts
  49. 19
      e2e/old-arch/dashboards-suite/new-custom-variable.spec.ts
  50. 30
      e2e/old-arch/dashboards-suite/new-datasource-variable.spec.ts
  51. 11
      e2e/old-arch/dashboards-suite/new-interval-variable.spec.ts
  52. 55
      e2e/old-arch/dashboards-suite/new-query-variable.spec.ts
  53. 15
      e2e/old-arch/dashboards-suite/new-text-box-variable.spec.ts
  54. 97
      e2e/old-arch/dashboards-suite/set-options-from-ui.spec.ts
  55. 16
      e2e/old-arch/dashboards-suite/templating-dashboard-links-and-variables.spec.ts
  56. 0
      e2e/old-arch/dashboards-suite/textbox-variables.spec.ts
  57. 0
      e2e/old-arch/dashboards-suite/utils/makeDashboard.ts
  58. 0
      e2e/old-arch/dashboards/DashboardLiveTest.json
  59. 0
      e2e/old-arch/dashboards/DashboardSearchTest.json
  60. 0
      e2e/old-arch/dashboards/PanelSandboxDashboard.json
  61. 0
      e2e/old-arch/dashboards/TestDashboard.json
  62. 8
      e2e/old-arch/panels-suite/dashlist.spec.ts
  63. 2
      e2e/old-arch/panels-suite/datagrid-data-change.spec.ts
  64. 2
      e2e/old-arch/panels-suite/datagrid-editing-features.spec.ts
  65. 8
      e2e/old-arch/panels-suite/frontend-sandbox-panel.spec.ts
  66. 14
      e2e/old-arch/panels-suite/geomap-layer-types.spec.ts
  67. 2
      e2e/old-arch/panels-suite/geomap-map-controls.spec.ts
  68. 10
      e2e/old-arch/panels-suite/geomap-spatial-operations-transform.spec.ts
  69. 39
      e2e/old-arch/panels-suite/panelEdit_base.spec.ts
  70. 2
      e2e/old-arch/panels-suite/panelEdit_queries.spec.ts
  71. 6
      e2e/old-arch/panels-suite/panelEdit_transforms.spec.ts
  72. 19
      e2e/old-arch/shared/smokeTestScenario.ts
  73. 0
      e2e/old-arch/smoke-tests-suite/1-smoketests.spec.ts
  74. 16
      e2e/old-arch/smoke-tests-suite/panels_smokescreen.spec.ts
  75. 6
      e2e/old-arch/utils/flows/addDashboard.ts
  76. 0
      e2e/old-arch/utils/flows/addDataSource.ts
  77. 0
      e2e/old-arch/utils/flows/addPanel.ts
  78. 0
      e2e/old-arch/utils/flows/assertSuccessNotification.ts
  79. 10
      e2e/old-arch/utils/flows/configurePanel.ts
  80. 0
      e2e/old-arch/utils/flows/confirmModal.ts
  81. 0
      e2e/old-arch/utils/flows/deleteDashboard.ts
  82. 0
      e2e/old-arch/utils/flows/deleteDataSource.ts
  83. 0
      e2e/old-arch/utils/flows/editPanel.ts
  84. 4
      e2e/old-arch/utils/flows/importDashboard.ts
  85. 0
      e2e/old-arch/utils/flows/importDashboards.ts
  86. 0
      e2e/old-arch/utils/flows/index.ts
  87. 0
      e2e/old-arch/utils/flows/login.ts
  88. 0
      e2e/old-arch/utils/flows/openDashboard.ts
  89. 0
      e2e/old-arch/utils/flows/openPanelMenuItem.ts
  90. 0
      e2e/old-arch/utils/flows/revertAllChanges.ts
  91. 0
      e2e/old-arch/utils/flows/saveDashboard.ts
  92. 0
      e2e/old-arch/utils/flows/selectOption.ts
  93. 0
      e2e/old-arch/utils/flows/setDashboardTimeRange.ts
  94. 0
      e2e/old-arch/utils/flows/setTimeRange.ts
  95. 0
      e2e/old-arch/utils/flows/userPreferences.ts
  96. 0
      e2e/old-arch/utils/index.ts
  97. 0
      e2e/old-arch/utils/support/benchmark.ts
  98. 29
      e2e/old-arch/utils/support/clipboard.ts
  99. 0
      e2e/old-arch/utils/support/index.ts
  100. 0
      e2e/old-arch/utils/support/localStorage.ts
  101. Some files were not shown because too many files have changed in this diff Show More

@ -5,7 +5,7 @@
//
exports[`better eslint`] = {
value: `{
"e2e/scenes/utils/support/types.ts:5381": [
"e2e/old-arch/utils/support/types.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"]
],
"e2e/utils/support/types.ts:5381": [
@ -7230,7 +7230,7 @@ exports[`no undocumented stories`] = {
exports[`no gf-form usage`] = {
value: `{
"e2e/scenes/utils/flows/addDataSource.ts:5381": [
"e2e/old-arch/utils/flows/addDataSource.ts:5381": [
[0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"]
],
"e2e/utils/flows/addDataSource.ts:5381": [

@ -660,14 +660,14 @@ steps:
image: cypress/included:13.10.0
name: end-to-end-tests-dashboards-suite
- commands:
- ./bin/build e2e-tests --port 3001 --suite scenes/dashboards-suite
- ./bin/build e2e-tests --port 3001 --suite old-arch/dashboards-suite
depends_on:
- grafana-server
- build-test-plugins
environment:
HOST: grafana-server
image: cypress/included:13.10.0
name: end-to-end-tests-scenes/dashboards-suite
name: end-to-end-tests-old-arch/dashboards-suite
- commands:
- ./bin/build e2e-tests --port 3001 --suite smoke-tests-suite
depends_on:
@ -678,14 +678,14 @@ steps:
image: cypress/included:13.10.0
name: end-to-end-tests-smoke-tests-suite
- commands:
- ./bin/build e2e-tests --port 3001 --suite scenes/smoke-tests-suite
- ./bin/build e2e-tests --port 3001 --suite old-arch/smoke-tests-suite
depends_on:
- grafana-server
- build-test-plugins
environment:
HOST: grafana-server
image: cypress/included:13.10.0
name: end-to-end-tests-scenes/smoke-tests-suite
name: end-to-end-tests-old-arch/smoke-tests-suite
- commands:
- ./bin/build e2e-tests --port 3001 --suite panels-suite
depends_on:
@ -696,14 +696,14 @@ steps:
image: cypress/included:13.10.0
name: end-to-end-tests-panels-suite
- commands:
- ./bin/build e2e-tests --port 3001 --suite scenes/panels-suite
- ./bin/build e2e-tests --port 3001 --suite old-arch/panels-suite
depends_on:
- grafana-server
- build-test-plugins
environment:
HOST: grafana-server
image: cypress/included:13.10.0
name: end-to-end-tests-scenes/panels-suite
name: end-to-end-tests-old-arch/panels-suite
- commands:
- ./bin/build e2e-tests --port 3001 --suite various-suite
depends_on:
@ -714,14 +714,14 @@ steps:
image: cypress/included:13.10.0
name: end-to-end-tests-various-suite
- commands:
- ./bin/build e2e-tests --port 3001 --suite scenes/various-suite
- ./bin/build e2e-tests --port 3001 --suite old-arch/various-suite
depends_on:
- grafana-server
- build-test-plugins
environment:
HOST: grafana-server
image: cypress/included:13.10.0
name: end-to-end-tests-scenes/various-suite
name: end-to-end-tests-old-arch/various-suite
- commands:
- cd /
- ./cpp-e2e/scripts/ci-run.sh azure ${DRONE_SOURCE_BRANCH}
@ -2084,14 +2084,14 @@ steps:
image: cypress/included:13.10.0
name: end-to-end-tests-dashboards-suite
- commands:
- ./bin/build e2e-tests --port 3001 --suite scenes/dashboards-suite
- ./bin/build e2e-tests --port 3001 --suite old-arch/dashboards-suite
depends_on:
- grafana-server
- build-test-plugins
environment:
HOST: grafana-server
image: cypress/included:13.10.0
name: end-to-end-tests-scenes/dashboards-suite
name: end-to-end-tests-old-arch/dashboards-suite
- commands:
- ./bin/build e2e-tests --port 3001 --suite smoke-tests-suite
depends_on:
@ -2102,14 +2102,14 @@ steps:
image: cypress/included:13.10.0
name: end-to-end-tests-smoke-tests-suite
- commands:
- ./bin/build e2e-tests --port 3001 --suite scenes/smoke-tests-suite
- ./bin/build e2e-tests --port 3001 --suite old-arch/smoke-tests-suite
depends_on:
- grafana-server
- build-test-plugins
environment:
HOST: grafana-server
image: cypress/included:13.10.0
name: end-to-end-tests-scenes/smoke-tests-suite
name: end-to-end-tests-old-arch/smoke-tests-suite
- commands:
- ./bin/build e2e-tests --port 3001 --suite panels-suite
depends_on:
@ -2120,14 +2120,14 @@ steps:
image: cypress/included:13.10.0
name: end-to-end-tests-panels-suite
- commands:
- ./bin/build e2e-tests --port 3001 --suite scenes/panels-suite
- ./bin/build e2e-tests --port 3001 --suite old-arch/panels-suite
depends_on:
- grafana-server
- build-test-plugins
environment:
HOST: grafana-server
image: cypress/included:13.10.0
name: end-to-end-tests-scenes/panels-suite
name: end-to-end-tests-old-arch/panels-suite
- commands:
- ./bin/build e2e-tests --port 3001 --suite various-suite
depends_on:
@ -2138,14 +2138,14 @@ steps:
image: cypress/included:13.10.0
name: end-to-end-tests-various-suite
- commands:
- ./bin/build e2e-tests --port 3001 --suite scenes/various-suite
- ./bin/build e2e-tests --port 3001 --suite old-arch/various-suite
depends_on:
- grafana-server
- build-test-plugins
environment:
HOST: grafana-server
image: cypress/included:13.10.0
name: end-to-end-tests-scenes/various-suite
name: end-to-end-tests-old-arch/various-suite
- commands:
- cd /
- ./cpp-e2e/scripts/ci-run.sh azure ${DRONE_SOURCE_BRANCH}
@ -6151,6 +6151,6 @@ kind: secret
name: gcr_credentials
---
kind: signature
hmac: 495b2466a038f0e208edc8cf65c78edc4795a380d2f1c1ff31d10259e4338431
hmac: e35ebf7a31abb198c576ca8f623b63fb2bd9d84de2a6111e28b2415587d5377b
...

@ -736,7 +736,6 @@ embed.go @grafana/grafana-as-code
/.github/workflows/i18n-crowdin-download.yml @grafana/grafana-frontend-platform
/.github/workflows/pr-go-workspace-check.yml @grafana/grafana-app-platform-squad
/.github/workflows/pr-k8s-codegen-check.yml @grafana/grafana-app-platform-squad
/.github/workflows/run-scenes-e2e.yml @grafana/dashboards-squad
/.github/workflows/go_lint.yml @grafana/grafana-backend-services-squad
/.github/workflows/trivy-scan.yml @grafana/grafana-backend-services-squad
/.github/workflows/changelog.yml @zserge

@ -1,47 +0,0 @@
name: Run dashboard scenes e2e
on:
schedule:
- cron: "0 8 * * 1-5" # every day at 08:00UTC on weekdays
# push # uncomment for test run during PR
env:
ARCH: linux-amd64
jobs:
dashboard-scenes-e2e:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Pin Go version to mod file
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- run: go version
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: yarn install --immutable
- name: Build grafana
run: make build
- name: Install Cypress dependencies
uses: cypress-io/github-action@v6
with:
runTests: false
- name: Run dashboard scenes e2e
run: yarn e2e:scenes
- name: "Send Slack notification"
if: ${{ failure() }}
uses: slackapi/slack-github-action@v1.26.0
with:
payload: >
{
"icon_emoji": ":this-is-fine-fire:",
"username": "Dashboard scenes e2e tests failed",
"text": "Link to run: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}",
"channel": "#grafana-dashboards-squad"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

@ -25,6 +25,7 @@ Most [generally available](https://grafana.com/docs/release-life-cycle/#general-
| -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ |
| `disableEnvelopeEncryption` | Disable envelope encryption (emergency only) | |
| `publicDashboards` | [Deprecated] Public dashboards are now enabled by default; to disable them, use the configuration setting. This feature toggle will be removed in the next major version. | Yes |
| `publicDashboardsScene` | Enables public dashboard rendering using scenes | Yes |
| `featureHighlights` | Highlight Grafana Enterprise features | |
| `correlations` | Correlations page | Yes |
| `autoMigrateXYChartPanel` | Migrate old XYChart panel to new XYChart2 model | Yes |
@ -56,6 +57,9 @@ Most [generally available](https://grafana.com/docs/release-life-cycle/#general-
| `managedPluginsInstall` | Install managed plugins directly from plugins catalog | Yes |
| `addFieldFromCalculationStatFunctions` | Add cumulative and window functions to the add field from calculation transformation | Yes |
| `annotationPermissionUpdate` | Change the way annotation permissions work by scoping them to folders and dashboards. | Yes |
| `dashboardSceneForViewers` | Enables dashboard rendering using Scenes for viewer roles | Yes |
| `dashboardSceneSolo` | Enables rendering dashboards using scenes for solo panels | Yes |
| `dashboardScene` | Enables dashboard rendering using scenes for all roles | Yes |
| `ssoSettingsApi` | Enables the SSO settings API and the OAuth configuration UIs in Grafana | Yes |
| `logsInfiniteScrolling` | Enables infinite scrolling for the Logs panel in Explore and Dashboards | Yes |
| `exploreMetrics` | Enables the new Explore Metrics core app | Yes |
@ -117,7 +121,6 @@ Experimental features might be changed or removed without prior notice.
| ------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `live-service-web-worker` | This will use a webworker thread to processes events rather than the main thread |
| `queryOverLive` | Use Grafana Live WebSocket to execute backend queries |
| `publicDashboardsScene` | Enables public dashboard rendering using scenes |
| `lokiExperimentalStreaming` | Support new streaming approach for loki (prototype, needs special loki build) |
| `storage` | Configurable storage for dashboards, datasources, and resources |
| `canvasPanelNesting` | Allow elements nesting |
@ -171,9 +174,6 @@ Experimental features might be changed or removed without prior notice.
| `alertmanagerRemotePrimary` | Enable Grafana to have a remote Alertmanager instance as the primary Alertmanager. |
| `alertmanagerRemoteOnly` | Disable the internal Alertmanager and only use the external one defined. |
| `extractFieldsNameDeduplication` | Make sure extracted field names are unique in the dataframe |
| `dashboardSceneForViewers` | Enables dashboard rendering using Scenes for viewer roles |
| `dashboardSceneSolo` | Enables rendering dashboards using scenes for solo panels |
| `dashboardScene` | Enables dashboard rendering using scenes for all roles |
| `pluginsSkipHostEnvVars` | Disables passing host environment variable to plugin processes |
| `tableSharedCrosshair` | Enables shared crosshair in table panel |
| `kubernetesFeatureToggles` | Use the kubernetes API for feature toggle management in the frontend |

@ -46,8 +46,8 @@ Cypress.on('uncaught:exception', (err) => {
//
beforeEach(() => {
if (Cypress.env('SCENES')) {
cy.logToConsole('enabling dashboardScene feature toggle in localstorage');
cy.setLocalStorage('grafana.featureToggles', 'dashboardScene=true');
if (Cypress.env('DISABLE_SCENES')) {
cy.logToConsole('disabling dashboardScene feature toggle in localstorage');
cy.setLocalStorage('grafana.featureToggles', 'dashboardScene=false');
}
});

@ -37,9 +37,15 @@ describe('Repeating a panel horizontally', () => {
});
// Change to only show panels 1 + 3
e2e.pages.Dashboard.SubMenu.submenuItemLabels('horizontal').click();
e2e.pages.Dashboard.SubMenu.submenuItemLabels('horizontal')
.parent()
.within(() => {
cy.get('input').click();
});
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('1').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('3').click();
// blur the dropdown
cy.get('body').click();

@ -38,9 +38,15 @@ describe('Repeating a panel vertically', () => {
});
// Change to only show panels 1 + 3
e2e.pages.Dashboard.SubMenu.submenuItemLabels('vertical').click();
e2e.pages.Dashboard.SubMenu.submenuItemLabels('vertical')
.parent()
.within(() => {
cy.get('input').click();
});
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('1').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('3').click();
// blur the dropdown
cy.get('body').click();

@ -32,10 +32,15 @@ describe('Repeating empty rows', () => {
e2e.components.DashboardRow.title(title).should('be.visible');
});
// Change to only show rows 1 + 3
e2e.pages.Dashboard.SubMenu.submenuItemLabels('row').click();
e2e.pages.Dashboard.SubMenu.submenuItemLabels('row')
.parent()
.within(() => {
cy.get('input').click();
});
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('1').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('3').click();
// blur the dropdown
cy.get('body').click();

@ -1,7 +1,7 @@
import testDashboard from '../dashboards/TestDashboard.json';
import { e2e } from '../utils';
describe('Dashboard browse', () => {
// Skipping due to race conditions with same old arch test e2e/dashboards-suite/dashboard-browse.spec.ts
describe.skip('Dashboard browse', () => {
beforeEach(() => {
e2e.flows.login(Cypress.env('USERNAME'), Cypress.env('PASSWORD'));
});

@ -1,5 +1,5 @@
import { e2e } from '../utils';
import '../../utils/support/clipboard';
import '../utils/support/clipboard';
describe('Export as JSON', () => {
beforeEach(() => {

@ -1,7 +1,8 @@
import testDashboard from '../dashboards/DashboardLiveTest.json';
import { e2e } from '../utils';
describe('Dashboard Live streaming support', () => {
// Skipping due to flakiness/race conditions with same old arch test e2e/dashboards-suite/dashboard-live-streaming.spec.ts
describe.skip('Dashboard Live streaming support', () => {
beforeEach(() => {
e2e.flows.login(Cypress.env('USERNAME'), Cypress.env('PASSWORD'));
e2e.flows.importDashboard(testDashboard, 1000);

@ -1,6 +1,6 @@
import { e2e } from '../utils';
describe('Public dashboards', () => {
// Skipping due to race conditions with same old arch test e2e/dashboards-suite/dashboard-public-create.spec.ts
describe.skip('Public dashboards', () => {
beforeEach(() => {
e2e.flows.login(Cypress.env('USERNAME'), Cypress.env('PASSWORD'));
});
@ -14,7 +14,7 @@ describe('Public dashboards', () => {
cy.wait('@query');
// Open sharing modal
e2e.pages.Dashboard.DashNav.shareButton().click();
e2e.components.NavToolbar.shareDashboard().click();
// Select public dashboards tab
e2e.components.Tab.title('Public dashboard').click();
@ -74,7 +74,7 @@ describe('Public dashboards', () => {
e2e.pages.Dashboard.DashNav.publicDashboardTag().should('exist');
// Open sharing modal
e2e.pages.Dashboard.DashNav.shareButton().click();
e2e.components.NavToolbar.shareDashboard().click();
// Select public dashboards tab
cy.intercept('GET', '/api/dashboards/uid/ZqZnVvFZz/public-dashboards').as('query-public-dashboard');
@ -114,7 +114,7 @@ describe('Public dashboards', () => {
cy.wait('@query');
// Open sharing modal
e2e.pages.Dashboard.DashNav.shareButton().click();
e2e.components.NavToolbar.shareDashboard().click();
// Select public dashboards tab
cy.intercept('GET', '/api/dashboards/uid/ZqZnVvFZz/public-dashboards').as('query-public-dashboard');

@ -10,10 +10,10 @@ describe('Create a public dashboard with template variables shows a template var
e2e.flows.openDashboard({ uid: 'HYaGDGIMk' });
// Open sharing modal
e2e.pages.Dashboard.DashNav.shareButton().click();
e2e.components.NavToolbar.shareDashboard().click();
// Select public dashboards tab
e2e.components.Tab.title('Public dashboard').click();
e2e.components.Tab.title('Public Dashboard').click();
// Warning Alert dashboard cannot be made public because it has template variables
e2e.pages.ShareDashboardModal.PublicDashboard.TemplateVariablesWarningAlert().should('be.visible');

@ -1,6 +1,6 @@
import { PublicDashboard } from '../../../public/app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboardUtils';
import { PublicDashboard } from '../../public/app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboardUtils';
import { e2e } from '../utils';
import '../../utils/support/clipboard';
import '../utils/support/clipboard';
describe('Shared dashboards', () => {
beforeEach(() => {

@ -1,6 +1,6 @@
import { ShareLinkConfiguration } from '../../../public/app/features/dashboard-scene/sharing/ShareButton/utils';
import { ShareLinkConfiguration } from '../../public/app/features/dashboard-scene/sharing/ShareButton/utils';
import { e2e } from '../utils';
import '../../utils/support/clipboard';
import '../utils/support/clipboard';
describe('Share internally', () => {
beforeEach(() => {

@ -1,7 +1,7 @@
import { SnapshotCreateResponse } from '../../../public/app/features/dashboard/services/SnapshotSrv';
import { fromBaseUrl } from '../../utils/support/url';
import { SnapshotCreateResponse } from '../../public/app/features/dashboard/services/SnapshotSrv';
import { e2e } from '../utils';
import '../../utils/support/clipboard';
import { fromBaseUrl } from '../utils/support/url';
import '../utils/support/clipboard';
describe('Snapshots', () => {
beforeEach(() => {

@ -34,7 +34,7 @@ describe('Dashboard templating', () => {
`Server:sqlstring = 'A''A\\"A','BB\\\B','CCC'`,
`Server:date = NaN`,
`Server:text = All`,
`Server:queryparam = var-Server=All`,
`Server:queryparam = var-Server=A%27A%22A&var-Server=BB%5CB&var-Server=CCC`,
`1 < 2`,
`Example: from=now-6h&to=now`,
];

@ -81,7 +81,8 @@ describe('Dashboard time zone support', () => {
}
});
it('Tests relative timezone support and overrides', () => {
// TODO: remove skip once https://github.com/grafana/grafana/issues/86420 is done
it.skip('Tests relative timezone support and overrides', () => {
// Open dashboard
e2e.flows.openDashboard({
uid: 'd41dbaa2-a39e-4536-ab2b-caca52f1a9c8',
@ -123,7 +124,6 @@ describe('Dashboard time zone support', () => {
.within(() => {
cy.contains('[role="row"]', '00:00:00').should('be.visible');
});
// Test UTC timezone
e2e.flows.setTimeRange({
from: 'now-6h',

@ -22,9 +22,9 @@ describe('Dashboards', () => {
// Then we open and close the panel editor
e2e.components.Panels.Panel.menu('Panel #50').click({ force: true }); // it only shows on hover
e2e.components.Panels.Panel.menuItems('Edit').click();
e2e.components.PanelEditor.applyButton().click();
e2e.components.NavToolbar.editDashboard.backToDashboardButton().click();
// And the last panel should still be visible!
// The last panel should still be visible!
e2e.components.Panels.Panel.title('Panel #50').should('be.visible');
});
});

@ -16,40 +16,50 @@ describe('Variables - Load options from Url', () => {
cy.wait('@query');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('A').should('be.visible').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('A')
.should('be.visible')
.within(() => {
e2e.components.Variables.variableOption().should('have.length', 9);
cy.get('input').click();
});
e2e.components.Select.option().parent().should('have.length', 10);
e2e.components.Select.toggleAllOptions().should('have.text', 'Selected (1)');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('All').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('A').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('B').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('C').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('AA').should('be.visible').click();
cy.get('body').click(0, 0);
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('AA')
.should('be.visible')
.within(() => {
e2e.components.Variables.variableOption().should('have.length', 9);
cy.get('input').click();
});
e2e.components.Select.option().parent().should('have.length', 10);
e2e.components.Select.toggleAllOptions().should('have.text', 'Selected (1)');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('All').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('AA').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('AB').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('AC').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('All').should('be.visible').click();
cy.get('body').click(0, 0);
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('$__all')
.should('be.visible')
.within(() => {
e2e.components.Variables.variableOption().should('have.length', 9);
cy.get('input').click();
});
e2e.components.Select.option().parent().should('have.length', 10);
e2e.components.Select.toggleAllOptions().should('have.text', 'Selected (1)');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('All').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('AAA').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('AAB').should('be.visible');
@ -65,40 +75,50 @@ describe('Variables - Load options from Url', () => {
cy.wait('@query');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('B').should('be.visible').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('B')
.should('be.visible')
.within(() => {
e2e.components.Variables.variableOption().should('have.length', 9);
cy.get('input').click();
});
e2e.components.Select.option().parent().should('have.length', 10);
e2e.components.Select.toggleAllOptions().should('have.text', 'Selected (1)');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('All').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('A').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('B').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('C').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('BB').should('be.visible').click();
cy.get('body').click(0, 0);
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('BB')
.should('be.visible')
.within(() => {
e2e.components.Variables.variableOption().should('have.length', 9);
cy.get('input').click();
});
e2e.components.Select.option().parent().should('have.length', 10);
e2e.components.Select.toggleAllOptions().should('have.text', 'Selected (1)');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('All').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BA').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BB').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BC').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('BBB').should('be.visible').click();
cy.get('body').click(0, 0);
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('BBB')
.should('be.visible')
.within(() => {
e2e.components.Variables.variableOption().should('have.length', 9);
cy.get('input').click();
});
e2e.components.Select.option().parent().should('have.length', 10);
e2e.components.Select.toggleAllOptions().should('have.text', 'Selected (1)');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('All').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BBA').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BBB').should('be.visible');
@ -125,24 +145,25 @@ describe('Variables - Load options from Url', () => {
cy.wait('@query');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('X').should('be.visible').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('X')
.should('be.visible')
.within(() => {
e2e.components.Variables.variableOption().should('have.length', 9);
cy.get('input').click();
});
e2e.components.Select.option().parent().should('have.length', 10);
e2e.components.Select.toggleAllOptions().should('have.text', 'Selected (1)');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('All').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('A').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('B').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('C').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('AA').should('be.visible').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
cy.get('body').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('$__all')
.should('be.visible')
.within(() => {
e2e.components.Variables.variableOption().should('have.length', 65);
});
.should('have.length', 2);
});
});

@ -9,7 +9,7 @@ describe('Variables - Constant', () => {
});
it('can add a new constant variable', () => {
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=templating` });
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=variables` });
cy.contains(DASHBOARD_NAME).should('be.visible');
// Create a new "Constant" variable
@ -22,11 +22,11 @@ describe('Variables - Constant', () => {
e2e.pages.Dashboard.Settings.Variables.Edit.ConstantVariable.constantOptionsQueryInputV2().type('pesto').blur();
e2e.pages.Dashboard.Settings.Variables.Edit.General.generalLabelInputV2().type('Variable under test').blur();
e2e.pages.Dashboard.Settings.Variables.Edit.General.previewOfValuesOption().eq(0).should('have.text', 'pesto');
// e2e.pages.Dashboard.Settings.Variables.Edit.General.previewOfValuesOption().eq(0).should('have.text', 'pesto');
// Navigate back to the homepage and change the selected variable value
e2e.pages.Dashboard.Settings.Variables.Edit.General.submitButton().click();
e2e.pages.Dashboard.Settings.Actions.close().click();
e2e.pages.Dashboard.Settings.Variables.Edit.General.applyButton().click();
e2e.components.NavToolbar.editDashboard.backToDashboardButton().click();
e2e.components.RefreshPicker.runButtonV2().click();
// Assert it was rendered

@ -25,7 +25,7 @@ describe('Variables - Custom', () => {
});
it('can add a custom template variable', () => {
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=templating` });
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=variables` });
cy.contains(DASHBOARD_NAME).should('be.visible');
// Create a new "Custom" variable
@ -34,17 +34,16 @@ describe('Variables - Custom', () => {
assertPreviewValues(['one', 'two', 'three']);
// Navigate back to the homepage and change the selected variable value
e2e.pages.Dashboard.Settings.Variables.Edit.General.submitButton().click();
e2e.pages.Dashboard.Settings.Actions.close().click();
e2e.pages.Dashboard.Settings.Variables.Edit.General.applyButton().click();
e2e.components.NavToolbar.editDashboard.backToDashboardButton().click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('one').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('two').click();
e2e.components.Select.option().contains('two').click();
// Assert it was rendered
cy.get('.markdown-html').should('include.text', 'VariableUnderTest: two');
});
it('can add a custom template variable with labels', () => {
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=templating` });
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=variables` });
cy.contains(DASHBOARD_NAME).should('be.visible');
// Create a new "Custom" variable
@ -58,10 +57,10 @@ describe('Variables - Custom', () => {
assertPreviewValues(['One', 'Two', 'Three']);
// Navigate back to the homepage and change the selected variable value
e2e.pages.Dashboard.Settings.Variables.Edit.General.submitButton().click();
e2e.pages.Dashboard.Settings.Actions.close().click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('One').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('Two').click();
e2e.pages.Dashboard.Settings.Variables.Edit.General.applyButton().click();
e2e.components.NavToolbar.editDashboard.backToDashboardButton().click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('1').click();
e2e.components.Select.option().contains('Two').click();
// Assert it was rendered
cy.get('.markdown-html').should('include.text', 'VariableUnderTest: 2');

@ -3,16 +3,14 @@ import { e2e } from '../utils';
const PAGE_UNDER_TEST = 'kVi2Gex7z/test-variable-output';
const DASHBOARD_NAME = 'Test variable output';
const gdev_mysql = 'gdev-mysql';
const gdev_mysql_ds_tests = 'gdev-mysql-ds-tests';
describe('Variables - Datasource', () => {
// Skipping due to flakiness/race conditions with same old arch test e2e/dashboards-suite/new-datasource-variable.spec.ts
describe.skip('Variables - Datasource', () => {
beforeEach(() => {
e2e.flows.login(Cypress.env('USERNAME'), Cypress.env('PASSWORD'));
});
it('can add a new datasource variable', () => {
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=templating` });
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=variables` });
cy.contains(DASHBOARD_NAME).should('be.visible');
// Create a new "Datasource" variable
@ -23,26 +21,30 @@ describe('Variables - Datasource', () => {
e2e.pages.Dashboard.Settings.Variables.Edit.General.generalNameInputV2().clear().type('VariableUnderTest').blur();
e2e.pages.Dashboard.Settings.Variables.Edit.General.generalLabelInputV2().type('Variable under test').blur();
// If this is failing, but sure to check there are MySQL datasources named "gdev-mysql" and "gdev-mysql-ds-tests"
// If this is failing, but sure to check there are Prometheus datasources named "gdev-prometheus" and "gdev-slow-prometheus"
// Or, just update is to match some gdev datasources to test with :)
e2e.pages.Dashboard.Settings.Variables.Edit.DatasourceVariable.datasourceSelect().within(() => {
cy.get('input').type('MySQL{enter}');
cy.get('input').type('Prometheus{enter}');
});
e2e.pages.Dashboard.Settings.Variables.Edit.General.previewOfValuesOption().should('contain.text', gdev_mysql);
e2e.pages.Dashboard.Settings.Variables.Edit.General.previewOfValuesOption().should(
'contain.text',
gdev_mysql_ds_tests
'gdev-prometheus'
);
e2e.pages.Dashboard.Settings.Variables.Edit.General.previewOfValuesOption().should(
'contain.text',
'gdev-slow-prometheus'
);
// Navigate back to the homepage and change the selected variable value
e2e.pages.Dashboard.Settings.Variables.Edit.General.submitButton().click();
e2e.pages.Dashboard.Settings.Actions.close().click();
e2e.pages.Dashboard.Settings.Variables.Edit.General.applyButton().click();
e2e.components.NavToolbar.editDashboard.backToDashboardButton().click();
e2e.components.RefreshPicker.runButtonV2().click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts(gdev_mysql).click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts(gdev_mysql_ds_tests).click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('gdev-prometheus').click();
e2e.components.Select.option().contains('gdev-slow-prometheus').click();
// Assert it was rendered
cy.get('.markdown-html').should('include.text', `VariableUnderTestText: ${gdev_mysql_ds_tests}`);
cy.get('.markdown-html').should('include.text', 'VariableUnderTest: gdev-slow-prometheus-uid');
cy.get('.markdown-html').should('include.text', 'VariableUnderTestText: gdev-slow-prometheus');
});
});

@ -16,7 +16,7 @@ describe('Variables - Interval', () => {
});
it('can add a new interval variable', () => {
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=templating` });
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=variables` });
cy.contains(DASHBOARD_NAME).should('be.visible');
// Create a new "Interval" variable
@ -35,12 +35,13 @@ describe('Variables - Interval', () => {
assertPreviewValues(['10s', '10m', '60m', '90m', '1h30m']);
// Navigate back to the homepage and change the selected variable value
e2e.pages.Dashboard.Settings.Variables.Edit.General.submitButton().click();
e2e.pages.Dashboard.Settings.Actions.close().click();
e2e.pages.Dashboard.Settings.Variables.Edit.General.applyButton().click();
e2e.components.NavToolbar.editDashboard.backToDashboardButton().click();
e2e.components.RefreshPicker.runButtonV2().click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('10s').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('1h30m').click();
e2e.pages.Dashboard.SubMenu.submenuItemLabels('Variable under test').next().should('have.text', `10s`).click();
e2e.components.Select.option().contains('1h30m').click();
// Assert it was rendered
cy.get('.markdown-html').should('include.text', 'VariableUnderTest: 1h30m');

@ -1,3 +1,5 @@
import { selectors } from '@grafana/e2e-selectors';
import { e2e } from '../utils';
const PAGE_UNDER_TEST = '-Y-tnEDWk/templating-nested-template-variables';
@ -9,10 +11,12 @@ describe('Variables - Query - Add variable', () => {
});
it('query variable should be default and default fields should be correct', () => {
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=templating` });
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=variables` });
cy.contains(DASHBOARD_NAME).should('be.visible');
e2e.pages.Dashboard.Settings.Variables.List.newButton().should('be.visible').click();
cy.get(`[data-testid="${selectors.pages.Dashboard.Settings.Variables.List.newButton}"]`)
.should('be.visible')
.click();
e2e.pages.Dashboard.Settings.Variables.Edit.General.generalNameInputV2()
.should('be.visible')
@ -68,15 +72,17 @@ describe('Variables - Query - Add variable', () => {
cy.get('input[type="checkbox"]').should('not.be.checked');
});
e2e.pages.Dashboard.Settings.Variables.Edit.General.previewOfValuesOption().should('not.exist');
e2e.pages.Dashboard.Settings.Variables.Edit.General.previewOfValuesOption().should('not.have.text');
e2e.pages.Dashboard.Settings.Variables.Edit.General.selectionOptionsCustomAllInput().should('not.exist');
});
it('adding a single value query variable', () => {
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=templating` });
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=variables` });
cy.contains(DASHBOARD_NAME).should('be.visible');
e2e.pages.Dashboard.Settings.Variables.List.newButton().should('be.visible').click();
cy.get(`[data-testid="${selectors.pages.Dashboard.Settings.Variables.List.newButton}"]`)
.should('be.visible')
.click();
e2e.pages.Dashboard.Settings.Variables.Edit.General.generalLabelInputV2()
.should('be.visible')
@ -101,29 +107,27 @@ describe('Variables - Query - Add variable', () => {
e2e.pages.Dashboard.Settings.Variables.Edit.General.submitButton().scrollIntoView().should('be.visible').click();
e2e.pages.Dashboard.Settings.Actions.close().click();
e2e.components.NavToolbar.editDashboard.backToDashboardButton().click();
e2e.pages.Dashboard.SubMenu.submenuItemLabels('a label').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItem()
.should('have.length', 4)
.eq(3)
.within(() => {
e2e.components.Variables.variableLinkWrapper().should('be.visible').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
.should('be.visible')
.within(() => {
e2e.components.Variables.variableOption().should('have.length', 1);
});
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('C').should('be.visible');
cy.get('input').click();
});
e2e.components.Select.option().should('have.length', 1);
e2e.components.Select.option().contains('C');
});
it('adding a multi value query variable', () => {
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=templating` });
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=variables` });
cy.contains(DASHBOARD_NAME).should('be.visible');
e2e.pages.Dashboard.Settings.Variables.List.newButton().should('be.visible').click();
cy.get(`[data-testid="${selectors.pages.Dashboard.Settings.Variables.List.newButton}"]`)
.should('be.visible')
.click();
e2e.pages.Dashboard.Settings.Variables.Edit.General.generalLabelInputV2()
.should('be.visible')
@ -161,22 +165,21 @@ describe('Variables - Query - Add variable', () => {
e2e.pages.Dashboard.Settings.Variables.Edit.General.submitButton().scrollIntoView().should('be.visible').click();
e2e.pages.Dashboard.Settings.Actions.close().click();
e2e.components.NavToolbar.editDashboard.backToDashboardButton().click();
e2e.pages.Dashboard.SubMenu.submenuItemLabels('a label').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItem()
.should('have.length', 4)
.eq(3)
.within(() => {
e2e.components.Variables.variableLinkWrapper().should('be.visible').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
.should('be.visible')
.within(() => {
e2e.components.Variables.variableOption().should('have.length', 2);
});
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('All').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('C').should('be.visible');
cy.get('input').click();
});
e2e.components.Select.option().should('have.length', 3);
e2e.components.Select.toggleAllOptions().should('have.text', 'Selected (1)');
e2e.components.Select.option().contains('All');
e2e.components.Select.option().contains('C');
});
});

@ -9,26 +9,25 @@ describe('Variables - Text box', () => {
});
it('can add a new text box variable', () => {
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=templating` });
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=variables` });
cy.contains(DASHBOARD_NAME).should('be.visible');
// Create a new "text box" variable
e2e.components.CallToActionCard.buttonV2('Add variable').click();
e2e.pages.Dashboard.Settings.Variables.Edit.General.generalTypeSelectV2().within(() => {
cy.get('input').type('Text box{enter}');
cy.get('input').type('Textbox{enter}');
});
e2e.pages.Dashboard.Settings.Variables.Edit.General.generalNameInputV2().clear().type('VariableUnderTest').blur();
e2e.pages.Dashboard.Settings.Variables.Edit.General.generalLabelInputV2().type('Variable under test').blur();
e2e.pages.Dashboard.Settings.Variables.Edit.TextBoxVariable.textBoxOptionsQueryInputV2().type('cat-dog').blur();
e2e.pages.Dashboard.Settings.Variables.Edit.General.previewOfValuesOption().eq(0).should('have.text', 'cat-dog');
// Navigate back to the homepage and change the selected variable value
e2e.pages.Dashboard.Settings.Variables.Edit.General.submitButton().click();
e2e.pages.Dashboard.Settings.Actions.close().click();
cy.get('#var-VariableUnderTest').clear().type('dog-cat').blur();
e2e.pages.Dashboard.Settings.Variables.Edit.General.applyButton().click();
e2e.components.NavToolbar.editDashboard.backToDashboardButton().click();
e2e.pages.Dashboard.SubMenu.submenuItem().within(() => {
cy.get('input').clear().type('dog-cat').blur();
});
// Assert it was rendered
cy.get('.markdown-html').should('include.text', 'VariableUnderTest: dog-cat');
});

@ -1,3 +1,5 @@
import { selectors } from '@grafana/e2e-selectors';
import { e2e } from '../utils';
const PAGE_UNDER_TEST = '-Y-tnEDWk/templating-nested-template-variables';
@ -10,39 +12,46 @@ describe('Variables - Set options from ui', () => {
it('clicking a value that is not part of dependents options should change these to All', () => {
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&var-datacenter=A&var-server=AA&var-pod=AAA` });
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('A').should('be.visible').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('A')
.should('be.visible')
.within(() => {
cy.get('input').click();
});
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('A').should('be.visible').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('B').should('be.visible').click();
e2e.components.NavToolbar.container().click();
cy.get('body').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('B').scrollIntoView().should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('All')
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('$__all')
.should('have.length', 2)
.eq(0)
.should('be.visible')
.click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
.should('be.visible')
.within(() => {
e2e.components.Variables.variableOption().should('have.length', 9);
cy.get('input').click();
});
e2e.components.Select.option().parent().should('have.length', 10);
e2e.components.Select.toggleAllOptions().should('have.text', 'Selected (1)');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('All').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BA').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BB').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BC').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('All').should('be.visible').click();
cy.get('body').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
.should('be.visible')
e2e.pages.Dashboard.SubMenu.submenuItemLabels('pod')
.parent()
.within(() => {
e2e.components.Variables.variableOption().should('have.length', 65);
cy.get('input').click();
});
// length is 11 because of virtualized select options
e2e.components.Select.option().parent().should('have.length', 11);
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('All').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BAA').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BAB').should('be.visible');
@ -60,41 +69,47 @@ describe('Variables - Set options from ui', () => {
cy.wait('@query');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('A').should('be.visible').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('A')
.should('be.visible')
.within(() => {
cy.get('input').click();
});
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('B').should('be.visible').click();
e2e.components.NavToolbar.container().click();
e2e.components.Select.toggleAllOptions().should('have.text', 'Selected (2)');
cy.wait('@query');
cy.get('body').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('A + B').scrollIntoView().should('be.visible');
cy.wait('@query');
e2e.components.LoadingIndicator.icon().should('have.length', 0);
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('A,B').scrollIntoView().should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('AA').should('be.visible').click();
cy.get(`[aria-label="${selectors.components.LoadingIndicator.icon}"]`).should('not.exist');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('AA')
.should('be.visible')
.within(() => {
e2e.components.Variables.variableOption().should('have.length', 17);
cy.get('input').click();
});
e2e.components.Select.option().should('have.length', 11);
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('All').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('AA').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('AB').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('AC').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BA').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BB').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BC').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('AD').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('AAA').should('be.visible').click();
cy.get('body').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('AAA')
.should('be.visible')
.within(() => {
e2e.components.Variables.variableOption().should('have.length', 9);
cy.get('input').click();
});
e2e.components.Select.option().should('have.length', 10);
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('All').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('AAA').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('AAB').should('be.visible');
@ -108,38 +123,46 @@ describe('Variables - Set options from ui', () => {
cy.intercept({ pathname: '/api/ds/query' }).as('query');
cy.wait('@query');
cy.get(`[aria-label="${selectors.components.LoadingIndicator.icon}"]`).should('not.exist');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('A,B')
.should('be.visible')
.within(() => {
cy.get('input').click();
});
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('A + B').should('be.visible').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('A').should('be.visible').click();
e2e.components.NavToolbar.container().click();
cy.get('body').click();
cy.wait('@query');
cy.get(`[aria-label="${selectors.components.LoadingIndicator.icon}"]`).should('not.exist');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('B').scrollIntoView().should('be.visible');
e2e.components.LoadingIndicator.icon().should('have.length', 0);
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('B').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('BB').should('be.visible').click();
cy.get(`[aria-label="${selectors.components.LoadingIndicator.icon}"]`).should('not.exist');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('BB')
.should('be.visible')
.within(() => {
e2e.components.Variables.variableOption().should('have.length', 9);
cy.get('input').click();
});
e2e.components.Select.option().should('have.length', 10);
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('All').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BA').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BB').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BC').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('BBB').should('be.visible').click();
cy.get('body').click(0, 0);
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('BBB')
.should('be.visible')
.within(() => {
e2e.components.Variables.variableOption().should('have.length', 9);
cy.get('input').click();
});
e2e.components.Select.option().should('have.length', 10);
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BBA').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BBB').should('be.visible');

@ -27,21 +27,27 @@ describe('Templating', () => {
expect(links).to.have.length.greaterThan(13);
for (let index = 0; index < links.length; index++) {
expect(Cypress.$(links[index]).attr('href')).contains(`var-custom=${variableValue}`);
expect(Cypress.$(links[index]).attr('href')).contains(variableValue);
}
});
};
e2e.components.DashboardLinks.dropDown().should('be.visible').click().wait('@tagsTemplatingSearch');
// verify all links, should have All value
verifyLinks('All');
verifyLinks('var-custom=p1&var-custom=p2&var-custom=p3');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('All').should('be.visible').click();
cy.get('body').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('$__all')
.should('be.visible')
.within(() => {
cy.get('input').click();
});
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('p2').should('be.visible').click();
e2e.components.NavToolbar.container().click();
cy.get('body').click();
e2e.components.DashboardLinks.dropDown()
.scrollIntoView()
.should('be.visible')

@ -37,15 +37,9 @@ describe('Repeating a panel horizontally', () => {
});
// Change to only show panels 1 + 3
e2e.pages.Dashboard.SubMenu.submenuItemLabels('horizontal')
.parent()
.within(() => {
cy.get('input').click();
});
e2e.pages.Dashboard.SubMenu.submenuItemLabels('horizontal').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('1').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('3').click();
// blur the dropdown
cy.get('body').click();

@ -38,15 +38,9 @@ describe('Repeating a panel vertically', () => {
});
// Change to only show panels 1 + 3
e2e.pages.Dashboard.SubMenu.submenuItemLabels('vertical')
.parent()
.within(() => {
cy.get('input').click();
});
e2e.pages.Dashboard.SubMenu.submenuItemLabels('vertical').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('1').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('3').click();
// blur the dropdown
cy.get('body').click();

@ -32,15 +32,10 @@ describe('Repeating empty rows', () => {
e2e.components.DashboardRow.title(title).should('be.visible');
});
e2e.pages.Dashboard.SubMenu.submenuItemLabels('row')
.parent()
.within(() => {
cy.get('input').click();
});
// Change to only show rows 1 + 3
e2e.pages.Dashboard.SubMenu.submenuItemLabels('row').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('1').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('3').click();
// blur the dropdown
cy.get('body').click();

@ -1,7 +1,7 @@
import testDashboard from '../dashboards/TestDashboard.json';
import { e2e } from '../utils';
// Skipping due to race conditions with same old arch test e2e/dashboards-suite/dashboard-browse.spec.ts
describe.skip('Dashboard browse', () => {
describe('Dashboard browse', () => {
beforeEach(() => {
e2e.flows.login(Cypress.env('USERNAME'), Cypress.env('PASSWORD'));
});

@ -1,8 +1,7 @@
import testDashboard from '../dashboards/DashboardLiveTest.json';
import { e2e } from '../utils';
// Skipping due to flakiness/race conditions with same old arch test e2e/dashboards-suite/dashboard-live-streaming.spec.ts
describe.skip('Dashboard Live streaming support', () => {
describe('Dashboard Live streaming support', () => {
beforeEach(() => {
e2e.flows.login(Cypress.env('USERNAME'), Cypress.env('PASSWORD'));
e2e.flows.importDashboard(testDashboard, 1000);

@ -1,6 +1,6 @@
import { e2e } from '../utils';
// Skipping due to race conditions with same old arch test e2e/dashboards-suite/dashboard-public-create.spec.ts
describe.skip('Public dashboards', () => {
describe('Public dashboards', () => {
beforeEach(() => {
e2e.flows.login(Cypress.env('USERNAME'), Cypress.env('PASSWORD'));
});
@ -14,7 +14,7 @@ describe.skip('Public dashboards', () => {
cy.wait('@query');
// Open sharing modal
e2e.components.NavToolbar.shareDashboard().click();
e2e.pages.Dashboard.DashNav.shareButton().click();
// Select public dashboards tab
e2e.components.Tab.title('Public dashboard').click();
@ -74,7 +74,7 @@ describe.skip('Public dashboards', () => {
e2e.pages.Dashboard.DashNav.publicDashboardTag().should('exist');
// Open sharing modal
e2e.components.NavToolbar.shareDashboard().click();
e2e.pages.Dashboard.DashNav.shareButton().click();
// Select public dashboards tab
cy.intercept('GET', '/api/dashboards/uid/ZqZnVvFZz/public-dashboards').as('query-public-dashboard');
@ -114,7 +114,7 @@ describe.skip('Public dashboards', () => {
cy.wait('@query');
// Open sharing modal
e2e.components.NavToolbar.shareDashboard().click();
e2e.pages.Dashboard.DashNav.shareButton().click();
// Select public dashboards tab
cy.intercept('GET', '/api/dashboards/uid/ZqZnVvFZz/public-dashboards').as('query-public-dashboard');

@ -10,10 +10,10 @@ describe('Create a public dashboard with template variables shows a template var
e2e.flows.openDashboard({ uid: 'HYaGDGIMk' });
// Open sharing modal
e2e.components.NavToolbar.shareDashboard().click();
e2e.pages.Dashboard.DashNav.shareButton().click();
// Select public dashboards tab
e2e.components.Tab.title('Public Dashboard').click();
e2e.components.Tab.title('Public dashboard').click();
// Warning Alert dashboard cannot be made public because it has template variables
e2e.pages.ShareDashboardModal.PublicDashboard.TemplateVariablesWarningAlert().should('be.visible');

@ -34,7 +34,7 @@ describe('Dashboard templating', () => {
`Server:sqlstring = 'A''A\\"A','BB\\\B','CCC'`,
`Server:date = NaN`,
`Server:text = All`,
`Server:queryparam = var-Server=A%27A%22A&var-Server=BB%5CB&var-Server=CCC`,
`Server:queryparam = var-Server=All`,
`1 < 2`,
`Example: from=now-6h&to=now`,
];

@ -81,8 +81,7 @@ describe('Dashboard time zone support', () => {
}
});
// TODO: remove skip once https://github.com/grafana/grafana/issues/86420 is done
it.skip('Tests relative timezone support and overrides', () => {
it('Tests relative timezone support and overrides', () => {
// Open dashboard
e2e.flows.openDashboard({
uid: 'd41dbaa2-a39e-4536-ab2b-caca52f1a9c8',
@ -124,6 +123,7 @@ describe('Dashboard time zone support', () => {
.within(() => {
cy.contains('[role="row"]', '00:00:00').should('be.visible');
});
// Test UTC timezone
e2e.flows.setTimeRange({
from: 'now-6h',

@ -22,9 +22,9 @@ describe('Dashboards', () => {
// Then we open and close the panel editor
e2e.components.Panels.Panel.menu('Panel #50').click({ force: true }); // it only shows on hover
e2e.components.Panels.Panel.menuItems('Edit').click();
e2e.components.NavToolbar.editDashboard.backToDashboardButton().click();
e2e.components.PanelEditor.applyButton().click();
// The last panel should still be visible!
// And the last panel should still be visible!
e2e.components.Panels.Panel.title('Panel #50').should('be.visible');
});
});

@ -16,50 +16,40 @@ describe('Variables - Load options from Url', () => {
cy.wait('@query');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('A')
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('A').should('be.visible').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
.should('be.visible')
.within(() => {
cy.get('input').click();
e2e.components.Variables.variableOption().should('have.length', 9);
});
e2e.components.Select.option().parent().should('have.length', 10);
e2e.components.Select.toggleAllOptions().should('have.text', 'Selected (1)');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('All').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('A').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('B').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('C').should('be.visible');
cy.get('body').click(0, 0);
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('AA').should('be.visible').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('AA')
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
.should('be.visible')
.within(() => {
cy.get('input').click();
e2e.components.Variables.variableOption().should('have.length', 9);
});
e2e.components.Select.option().parent().should('have.length', 10);
e2e.components.Select.toggleAllOptions().should('have.text', 'Selected (1)');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('All').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('AA').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('AB').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('AC').should('be.visible');
cy.get('body').click(0, 0);
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('All').should('be.visible').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('$__all')
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
.should('be.visible')
.within(() => {
cy.get('input').click();
e2e.components.Variables.variableOption().should('have.length', 9);
});
e2e.components.Select.option().parent().should('have.length', 10);
e2e.components.Select.toggleAllOptions().should('have.text', 'Selected (1)');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('All').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('AAA').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('AAB').should('be.visible');
@ -75,50 +65,40 @@ describe('Variables - Load options from Url', () => {
cy.wait('@query');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('B')
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('B').should('be.visible').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
.should('be.visible')
.within(() => {
cy.get('input').click();
e2e.components.Variables.variableOption().should('have.length', 9);
});
e2e.components.Select.option().parent().should('have.length', 10);
e2e.components.Select.toggleAllOptions().should('have.text', 'Selected (1)');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('All').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('A').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('B').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('C').should('be.visible');
cy.get('body').click(0, 0);
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('BB').should('be.visible').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('BB')
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
.should('be.visible')
.within(() => {
cy.get('input').click();
e2e.components.Variables.variableOption().should('have.length', 9);
});
e2e.components.Select.option().parent().should('have.length', 10);
e2e.components.Select.toggleAllOptions().should('have.text', 'Selected (1)');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('All').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BA').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BB').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BC').should('be.visible');
cy.get('body').click(0, 0);
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('BBB').should('be.visible').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('BBB')
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
.should('be.visible')
.within(() => {
cy.get('input').click();
e2e.components.Variables.variableOption().should('have.length', 9);
});
e2e.components.Select.option().parent().should('have.length', 10);
e2e.components.Select.toggleAllOptions().should('have.text', 'Selected (1)');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('All').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BBA').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BBB').should('be.visible');
@ -145,25 +125,24 @@ describe('Variables - Load options from Url', () => {
cy.wait('@query');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('X')
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('X').should('be.visible').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
.should('be.visible')
.within(() => {
cy.get('input').click();
e2e.components.Variables.variableOption().should('have.length', 9);
});
e2e.components.Select.option().parent().should('have.length', 10);
e2e.components.Select.toggleAllOptions().should('have.text', 'Selected (1)');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('All').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('A').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('B').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('C').should('be.visible');
cy.get('body').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('$__all')
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('AA').should('be.visible').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
.should('be.visible')
.should('have.length', 2);
.within(() => {
e2e.components.Variables.variableOption().should('have.length', 65);
});
});
});

@ -9,7 +9,7 @@ describe('Variables - Constant', () => {
});
it('can add a new constant variable', () => {
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=variables` });
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=templating` });
cy.contains(DASHBOARD_NAME).should('be.visible');
// Create a new "Constant" variable
@ -22,11 +22,11 @@ describe('Variables - Constant', () => {
e2e.pages.Dashboard.Settings.Variables.Edit.ConstantVariable.constantOptionsQueryInputV2().type('pesto').blur();
e2e.pages.Dashboard.Settings.Variables.Edit.General.generalLabelInputV2().type('Variable under test').blur();
// e2e.pages.Dashboard.Settings.Variables.Edit.General.previewOfValuesOption().eq(0).should('have.text', 'pesto');
e2e.pages.Dashboard.Settings.Variables.Edit.General.previewOfValuesOption().eq(0).should('have.text', 'pesto');
// Navigate back to the homepage and change the selected variable value
e2e.pages.Dashboard.Settings.Variables.Edit.General.applyButton().click();
e2e.components.NavToolbar.editDashboard.backToDashboardButton().click();
e2e.pages.Dashboard.Settings.Variables.Edit.General.submitButton().click();
e2e.pages.Dashboard.Settings.Actions.close().click();
e2e.components.RefreshPicker.runButtonV2().click();
// Assert it was rendered

@ -25,7 +25,7 @@ describe('Variables - Custom', () => {
});
it('can add a custom template variable', () => {
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=variables` });
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=templating` });
cy.contains(DASHBOARD_NAME).should('be.visible');
// Create a new "Custom" variable
@ -34,16 +34,17 @@ describe('Variables - Custom', () => {
assertPreviewValues(['one', 'two', 'three']);
// Navigate back to the homepage and change the selected variable value
e2e.pages.Dashboard.Settings.Variables.Edit.General.applyButton().click();
e2e.components.NavToolbar.editDashboard.backToDashboardButton().click();
e2e.pages.Dashboard.Settings.Variables.Edit.General.submitButton().click();
e2e.pages.Dashboard.Settings.Actions.close().click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('one').click();
e2e.components.Select.option().contains('two').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('two').click();
// Assert it was rendered
cy.get('.markdown-html').should('include.text', 'VariableUnderTest: two');
});
it('can add a custom template variable with labels', () => {
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=variables` });
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=templating` });
cy.contains(DASHBOARD_NAME).should('be.visible');
// Create a new "Custom" variable
@ -57,10 +58,10 @@ describe('Variables - Custom', () => {
assertPreviewValues(['One', 'Two', 'Three']);
// Navigate back to the homepage and change the selected variable value
e2e.pages.Dashboard.Settings.Variables.Edit.General.applyButton().click();
e2e.components.NavToolbar.editDashboard.backToDashboardButton().click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('1').click();
e2e.components.Select.option().contains('Two').click();
e2e.pages.Dashboard.Settings.Variables.Edit.General.submitButton().click();
e2e.pages.Dashboard.Settings.Actions.close().click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('One').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('Two').click();
// Assert it was rendered
cy.get('.markdown-html').should('include.text', 'VariableUnderTest: 2');

@ -3,14 +3,16 @@ import { e2e } from '../utils';
const PAGE_UNDER_TEST = 'kVi2Gex7z/test-variable-output';
const DASHBOARD_NAME = 'Test variable output';
// Skipping due to flakiness/race conditions with same old arch test e2e/dashboards-suite/new-datasource-variable.spec.ts
describe.skip('Variables - Datasource', () => {
const gdev_mysql = 'gdev-mysql';
const gdev_mysql_ds_tests = 'gdev-mysql-ds-tests';
describe('Variables - Datasource', () => {
beforeEach(() => {
e2e.flows.login(Cypress.env('USERNAME'), Cypress.env('PASSWORD'));
});
it('can add a new datasource variable', () => {
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=variables` });
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=templating` });
cy.contains(DASHBOARD_NAME).should('be.visible');
// Create a new "Datasource" variable
@ -21,30 +23,26 @@ describe.skip('Variables - Datasource', () => {
e2e.pages.Dashboard.Settings.Variables.Edit.General.generalNameInputV2().clear().type('VariableUnderTest').blur();
e2e.pages.Dashboard.Settings.Variables.Edit.General.generalLabelInputV2().type('Variable under test').blur();
// If this is failing, but sure to check there are Prometheus datasources named "gdev-prometheus" and "gdev-slow-prometheus"
// If this is failing, but sure to check there are MySQL datasources named "gdev-mysql" and "gdev-mysql-ds-tests"
// Or, just update is to match some gdev datasources to test with :)
e2e.pages.Dashboard.Settings.Variables.Edit.DatasourceVariable.datasourceSelect().within(() => {
cy.get('input').type('Prometheus{enter}');
cy.get('input').type('MySQL{enter}');
});
e2e.pages.Dashboard.Settings.Variables.Edit.General.previewOfValuesOption().should('contain.text', gdev_mysql);
e2e.pages.Dashboard.Settings.Variables.Edit.General.previewOfValuesOption().should(
'contain.text',
'gdev-prometheus'
);
e2e.pages.Dashboard.Settings.Variables.Edit.General.previewOfValuesOption().should(
'contain.text',
'gdev-slow-prometheus'
gdev_mysql_ds_tests
);
// Navigate back to the homepage and change the selected variable value
e2e.pages.Dashboard.Settings.Variables.Edit.General.applyButton().click();
e2e.components.NavToolbar.editDashboard.backToDashboardButton().click();
e2e.pages.Dashboard.Settings.Variables.Edit.General.submitButton().click();
e2e.pages.Dashboard.Settings.Actions.close().click();
e2e.components.RefreshPicker.runButtonV2().click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('gdev-prometheus').click();
e2e.components.Select.option().contains('gdev-slow-prometheus').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts(gdev_mysql).click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts(gdev_mysql_ds_tests).click();
// Assert it was rendered
cy.get('.markdown-html').should('include.text', 'VariableUnderTest: gdev-slow-prometheus-uid');
cy.get('.markdown-html').should('include.text', 'VariableUnderTestText: gdev-slow-prometheus');
cy.get('.markdown-html').should('include.text', `VariableUnderTestText: ${gdev_mysql_ds_tests}`);
});
});

@ -16,7 +16,7 @@ describe('Variables - Interval', () => {
});
it('can add a new interval variable', () => {
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=variables` });
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=templating` });
cy.contains(DASHBOARD_NAME).should('be.visible');
// Create a new "Interval" variable
@ -35,13 +35,12 @@ describe('Variables - Interval', () => {
assertPreviewValues(['10s', '10m', '60m', '90m', '1h30m']);
// Navigate back to the homepage and change the selected variable value
e2e.pages.Dashboard.Settings.Variables.Edit.General.applyButton().click();
e2e.components.NavToolbar.editDashboard.backToDashboardButton().click();
e2e.pages.Dashboard.Settings.Variables.Edit.General.submitButton().click();
e2e.pages.Dashboard.Settings.Actions.close().click();
e2e.components.RefreshPicker.runButtonV2().click();
e2e.pages.Dashboard.SubMenu.submenuItemLabels('Variable under test').next().should('have.text', `10s`).click();
e2e.components.Select.option().contains('1h30m').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('10s').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('1h30m').click();
// Assert it was rendered
cy.get('.markdown-html').should('include.text', 'VariableUnderTest: 1h30m');

@ -1,5 +1,3 @@
import { selectors } from '@grafana/e2e-selectors';
import { e2e } from '../utils';
const PAGE_UNDER_TEST = '-Y-tnEDWk/templating-nested-template-variables';
@ -11,12 +9,10 @@ describe('Variables - Query - Add variable', () => {
});
it('query variable should be default and default fields should be correct', () => {
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=variables` });
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=templating` });
cy.contains(DASHBOARD_NAME).should('be.visible');
cy.get(`[data-testid="${selectors.pages.Dashboard.Settings.Variables.List.newButton}"]`)
.should('be.visible')
.click();
e2e.pages.Dashboard.Settings.Variables.List.newButton().should('be.visible').click();
e2e.pages.Dashboard.Settings.Variables.Edit.General.generalNameInputV2()
.should('be.visible')
@ -72,17 +68,15 @@ describe('Variables - Query - Add variable', () => {
cy.get('input[type="checkbox"]').should('not.be.checked');
});
e2e.pages.Dashboard.Settings.Variables.Edit.General.previewOfValuesOption().should('not.have.text');
e2e.pages.Dashboard.Settings.Variables.Edit.General.previewOfValuesOption().should('not.exist');
e2e.pages.Dashboard.Settings.Variables.Edit.General.selectionOptionsCustomAllInput().should('not.exist');
});
it('adding a single value query variable', () => {
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=variables` });
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=templating` });
cy.contains(DASHBOARD_NAME).should('be.visible');
cy.get(`[data-testid="${selectors.pages.Dashboard.Settings.Variables.List.newButton}"]`)
.should('be.visible')
.click();
e2e.pages.Dashboard.Settings.Variables.List.newButton().should('be.visible').click();
e2e.pages.Dashboard.Settings.Variables.Edit.General.generalLabelInputV2()
.should('be.visible')
@ -107,27 +101,29 @@ describe('Variables - Query - Add variable', () => {
e2e.pages.Dashboard.Settings.Variables.Edit.General.submitButton().scrollIntoView().should('be.visible').click();
e2e.components.NavToolbar.editDashboard.backToDashboardButton().click();
e2e.pages.Dashboard.Settings.Actions.close().click();
e2e.pages.Dashboard.SubMenu.submenuItemLabels('a label').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItem()
.should('have.length', 4)
.eq(3)
.within(() => {
cy.get('input').click();
e2e.components.Variables.variableLinkWrapper().should('be.visible').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
.should('be.visible')
.within(() => {
e2e.components.Variables.variableOption().should('have.length', 1);
});
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('C').should('be.visible');
});
e2e.components.Select.option().should('have.length', 1);
e2e.components.Select.option().contains('C');
});
it('adding a multi value query variable', () => {
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=variables` });
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=templating` });
cy.contains(DASHBOARD_NAME).should('be.visible');
cy.get(`[data-testid="${selectors.pages.Dashboard.Settings.Variables.List.newButton}"]`)
.should('be.visible')
.click();
e2e.pages.Dashboard.Settings.Variables.List.newButton().should('be.visible').click();
e2e.pages.Dashboard.Settings.Variables.Edit.General.generalLabelInputV2()
.should('be.visible')
@ -165,21 +161,22 @@ describe('Variables - Query - Add variable', () => {
e2e.pages.Dashboard.Settings.Variables.Edit.General.submitButton().scrollIntoView().should('be.visible').click();
e2e.components.NavToolbar.editDashboard.backToDashboardButton().click();
e2e.pages.Dashboard.Settings.Actions.close().click();
e2e.pages.Dashboard.SubMenu.submenuItemLabels('a label').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItem()
.should('have.length', 4)
.eq(3)
.within(() => {
cy.get('input').click();
e2e.components.Variables.variableLinkWrapper().should('be.visible').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
.should('be.visible')
.within(() => {
e2e.components.Variables.variableOption().should('have.length', 2);
});
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('All').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('C').should('be.visible');
});
e2e.components.Select.option().should('have.length', 3);
e2e.components.Select.toggleAllOptions().should('have.text', 'Selected (1)');
e2e.components.Select.option().contains('All');
e2e.components.Select.option().contains('C');
});
});

@ -9,25 +9,26 @@ describe('Variables - Text box', () => {
});
it('can add a new text box variable', () => {
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=variables` });
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=templating` });
cy.contains(DASHBOARD_NAME).should('be.visible');
// Create a new "text box" variable
e2e.components.CallToActionCard.buttonV2('Add variable').click();
e2e.pages.Dashboard.Settings.Variables.Edit.General.generalTypeSelectV2().within(() => {
cy.get('input').type('Textbox{enter}');
cy.get('input').type('Text box{enter}');
});
e2e.pages.Dashboard.Settings.Variables.Edit.General.generalNameInputV2().clear().type('VariableUnderTest').blur();
e2e.pages.Dashboard.Settings.Variables.Edit.General.generalLabelInputV2().type('Variable under test').blur();
e2e.pages.Dashboard.Settings.Variables.Edit.TextBoxVariable.textBoxOptionsQueryInputV2().type('cat-dog').blur();
e2e.pages.Dashboard.Settings.Variables.Edit.General.previewOfValuesOption().eq(0).should('have.text', 'cat-dog');
// Navigate back to the homepage and change the selected variable value
e2e.pages.Dashboard.Settings.Variables.Edit.General.applyButton().click();
e2e.components.NavToolbar.editDashboard.backToDashboardButton().click();
e2e.pages.Dashboard.SubMenu.submenuItem().within(() => {
cy.get('input').clear().type('dog-cat').blur();
});
e2e.pages.Dashboard.Settings.Variables.Edit.General.submitButton().click();
e2e.pages.Dashboard.Settings.Actions.close().click();
cy.get('#var-VariableUnderTest').clear().type('dog-cat').blur();
// Assert it was rendered
cy.get('.markdown-html').should('include.text', 'VariableUnderTest: dog-cat');
});

@ -1,5 +1,3 @@
import { selectors } from '@grafana/e2e-selectors';
import { e2e } from '../utils';
const PAGE_UNDER_TEST = '-Y-tnEDWk/templating-nested-template-variables';
@ -12,46 +10,39 @@ describe('Variables - Set options from ui', () => {
it('clicking a value that is not part of dependents options should change these to All', () => {
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&var-datacenter=A&var-server=AA&var-pod=AAA` });
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('A')
.should('be.visible')
.within(() => {
cy.get('input').click();
});
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('A').should('be.visible').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('A').should('be.visible').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('B').should('be.visible').click();
cy.get('body').click();
e2e.components.NavToolbar.container().click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('B').scrollIntoView().should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('$__all')
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('All')
.should('have.length', 2)
.eq(0)
.should('be.visible')
.click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
.should('be.visible')
.within(() => {
cy.get('input').click();
e2e.components.Variables.variableOption().should('have.length', 9);
});
e2e.components.Select.option().parent().should('have.length', 10);
e2e.components.Select.toggleAllOptions().should('have.text', 'Selected (1)');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('All').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BA').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BB').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BC').should('be.visible');
cy.get('body').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('All').should('be.visible').click();
e2e.pages.Dashboard.SubMenu.submenuItemLabels('pod')
.parent()
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
.should('be.visible')
.within(() => {
cy.get('input').click();
e2e.components.Variables.variableOption().should('have.length', 65);
});
// length is 11 because of virtualized select options
e2e.components.Select.option().parent().should('have.length', 11);
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('All').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BAA').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BAB').should('be.visible');
@ -69,47 +60,41 @@ describe('Variables - Set options from ui', () => {
cy.wait('@query');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('A')
.should('be.visible')
.within(() => {
cy.get('input').click();
});
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('A').should('be.visible').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('B').should('be.visible').click();
e2e.components.Select.toggleAllOptions().should('have.text', 'Selected (2)');
cy.get('body').click();
e2e.components.NavToolbar.container().click();
cy.wait('@query');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('A,B').scrollIntoView().should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('A + B').scrollIntoView().should('be.visible');
cy.get(`[aria-label="${selectors.components.LoadingIndicator.icon}"]`).should('not.exist');
e2e.components.LoadingIndicator.icon().should('have.length', 0);
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('AA')
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('AA').should('be.visible').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
.should('be.visible')
.within(() => {
cy.get('input').click();
e2e.components.Variables.variableOption().should('have.length', 17);
});
e2e.components.Select.option().should('have.length', 11);
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('All').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('AA').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('AB').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('AC').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('AD').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BA').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BB').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BC').should('be.visible');
cy.get('body').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('AAA').should('be.visible').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('AAA')
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
.should('be.visible')
.within(() => {
cy.get('input').click();
e2e.components.Variables.variableOption().should('have.length', 9);
});
e2e.components.Select.option().should('have.length', 10);
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('All').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('AAA').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('AAB').should('be.visible');
@ -123,46 +108,38 @@ describe('Variables - Set options from ui', () => {
cy.intercept({ pathname: '/api/ds/query' }).as('query');
cy.wait('@query');
cy.get(`[aria-label="${selectors.components.LoadingIndicator.icon}"]`).should('not.exist');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('A,B')
.should('be.visible')
.within(() => {
cy.get('input').click();
});
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('A + B').should('be.visible').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('A').should('be.visible').click();
cy.get('body').click();
e2e.components.NavToolbar.container().click();
cy.wait('@query');
cy.get(`[aria-label="${selectors.components.LoadingIndicator.icon}"]`).should('not.exist');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('B').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('B').scrollIntoView().should('be.visible');
e2e.components.LoadingIndicator.icon().should('have.length', 0);
cy.get(`[aria-label="${selectors.components.LoadingIndicator.icon}"]`).should('not.exist');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('BB').should('be.visible').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('BB')
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
.should('be.visible')
.within(() => {
cy.get('input').click();
e2e.components.Variables.variableOption().should('have.length', 9);
});
e2e.components.Select.option().should('have.length', 10);
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('All').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BA').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BB').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BC').should('be.visible');
cy.get('body').click(0, 0);
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('BBB').should('be.visible').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('BBB')
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownDropDown()
.should('be.visible')
.within(() => {
cy.get('input').click();
e2e.components.Variables.variableOption().should('have.length', 9);
});
e2e.components.Select.option().should('have.length', 10);
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BBA').should('be.visible');
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('BBB').should('be.visible');

@ -27,27 +27,21 @@ describe('Templating', () => {
expect(links).to.have.length.greaterThan(13);
for (let index = 0; index < links.length; index++) {
expect(Cypress.$(links[index]).attr('href')).contains(variableValue);
expect(Cypress.$(links[index]).attr('href')).contains(`var-custom=${variableValue}`);
}
});
};
e2e.components.DashboardLinks.dropDown().should('be.visible').click().wait('@tagsTemplatingSearch');
verifyLinks('var-custom=p1&var-custom=p2&var-custom=p3');
// verify all links, should have All value
verifyLinks('All');
cy.get('body').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('$__all')
.should('be.visible')
.within(() => {
cy.get('input').click();
});
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts('All').should('be.visible').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('p2').should('be.visible').click();
cy.get('body').click();
e2e.components.NavToolbar.container().click();
e2e.components.DashboardLinks.dropDown()
.scrollIntoView()
.should('be.visible')

@ -1,4 +1,4 @@
import { e2e } from '../../utils';
import { e2e } from '../utils';
const PAGE_UNDER_TEST = 'a6801696-cc53-4196-b1f9-2403e3909185/panel-tests-dashlist-variables';
describe('DashList panel', () => {
@ -20,11 +20,7 @@ describe('DashList panel', () => {
});
// update variable to b
e2e.pages.Dashboard.SubMenu.submenuItemLabels('server')
.parent()
.within(() => {
cy.get('input').click();
});
e2e.pages.Dashboard.SubMenu.submenuItemLabels('server').click();
e2e.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts('B').click();
// blur the dropdown
cy.get('body').click();

@ -1,4 +1,4 @@
import { e2e } from '../../utils';
import { e2e } from '../utils';
const DASHBOARD_ID = 'c01bf42b-b783-4447-a304-8554cee1843b';
const DATAGRID_SELECT_SERIES = 'Datagrid Select series';

@ -1,4 +1,4 @@
import { e2e } from '../../utils';
import { e2e } from '../utils';
const DASHBOARD_ID = 'c01bf42b-b783-4447-a304-8554cee1843b';
const DATAGRID_CANVAS = 'data-grid-canvas';

@ -1,9 +1,9 @@
import panelSandboxDashboard from '../../dashboards/PanelSandboxDashboard.json';
import { e2e } from '../../utils';
import panelSandboxDashboard from '../dashboards/PanelSandboxDashboard.json';
import { e2e } from '../utils';
const DASHBOARD_ID = 'c46b2460-16b7-42a5-82d1-b07fbf431950';
// Skipping due to race conditions with same old arch test e2e/panels-suite/frontend-sandbox-panel.spec.ts
describe.skip('Panel sandbox', () => {
describe('Panel sandbox', () => {
beforeEach(() => {
e2e.flows.login(Cypress.env('USERNAME'), Cypress.env('PASSWORD'), true);
return e2e.flows.importDashboard(panelSandboxDashboard, 1000, true);

@ -1,4 +1,4 @@
import { e2e } from '../../utils';
import { e2e } from '../utils';
const DASHBOARD_ID = 'P2jR04WVk';
@ -21,41 +21,41 @@ describe('Geomap layer types', () => {
e2e.components.PanelEditor.OptionsPane.fieldLabel(MAP_LAYERS_TYPE).type('Heatmap{enter}');
cy.get('[data-testid="layer-drag-drop-list"]').contains('heatmap');
e2e.components.PanelEditor.OptionsPane.fieldLabel(MAP_LAYERS_DATA).should('be.visible');
// e2e.components.PanelEditor.General.content().should('be.visible');
e2e.components.PanelEditor.General.content().should('be.visible');
// GeoJSON
e2e.components.PanelEditor.OptionsPane.fieldLabel(MAP_LAYERS_TYPE).type('GeoJSON{enter}');
cy.get('[data-testid="layer-drag-drop-list"]').contains('geojson');
e2e.components.PanelEditor.OptionsPane.fieldLabel(MAP_LAYERS_DATA).should('not.exist');
e2e.components.PanelEditor.OptionsPane.fieldLabel(MAP_LAYERS_GEOJSON).should('be.visible');
// e2e.components.PanelEditor.General.content().should('be.visible');
e2e.components.PanelEditor.General.content().should('be.visible');
// Open Street Map
e2e.components.PanelEditor.OptionsPane.fieldLabel(MAP_LAYERS_TYPE).type('Open Street Map{enter}');
cy.get('[data-testid="layer-drag-drop-list"]').contains('osm-standard');
e2e.components.PanelEditor.OptionsPane.fieldLabel(MAP_LAYERS_DATA).should('not.exist');
e2e.components.PanelEditor.OptionsPane.fieldLabel(MAP_LAYERS_GEOJSON).should('not.exist');
// e2e.components.PanelEditor.General.content().should('be.visible');
e2e.components.PanelEditor.General.content().should('be.visible');
// CARTO basemap
e2e.components.PanelEditor.OptionsPane.fieldLabel(MAP_LAYERS_TYPE).type('CARTO basemap{enter}');
cy.get('[data-testid="layer-drag-drop-list"]').contains('carto');
e2e.components.PanelEditor.OptionsPane.fieldLabel('Map layers Show labels').should('be.visible');
e2e.components.PanelEditor.OptionsPane.fieldLabel('Map layers Theme').should('be.visible');
// e2e.components.PanelEditor.General.content().should('be.visible');
e2e.components.PanelEditor.General.content().should('be.visible');
// ArcGIS MapServer
e2e.components.PanelEditor.OptionsPane.fieldLabel(MAP_LAYERS_TYPE).type('ArcGIS MapServer{enter}');
cy.get('[data-testid="layer-drag-drop-list"]').contains('esri-xyz');
e2e.components.PanelEditor.OptionsPane.fieldLabel('Map layers Server instance').should('be.visible');
// e2e.components.PanelEditor.General.content().should('be.visible');
e2e.components.PanelEditor.General.content().should('be.visible');
// XYZ Tile layer
e2e.components.PanelEditor.OptionsPane.fieldLabel(MAP_LAYERS_TYPE).type('XYZ Tile layer{enter}');
cy.get('[data-testid="layer-drag-drop-list"]').contains('xyz');
e2e.components.PanelEditor.OptionsPane.fieldLabel('Map layers URL template').should('be.visible');
e2e.components.PanelEditor.OptionsPane.fieldLabel('Map layers Attribution').should('be.visible');
// e2e.components.PanelEditor.General.content().should('be.visible');
e2e.components.PanelEditor.General.content().should('be.visible');
});
it.skip('Tests changing the layer type (alpha)', () => {

@ -1,4 +1,4 @@
import { e2e } from '../../utils';
import { e2e } from '../utils';
const DASHBOARD_ID = 'P2jR04WVk';
describe('Geomap layer controls options', () => {

@ -1,4 +1,4 @@
import { e2e } from '../../utils';
import { e2e } from '../utils';
const DASHBOARD_ID = 'P2jR04WVk';
@ -9,7 +9,7 @@ describe('Geomap spatial operations', () => {
it('Tests location auto option', () => {
e2e.flows.openDashboard({ uid: DASHBOARD_ID, queryParams: { editPanel: 1 } });
e2e.components.Tab.title('Transformations').should('be.visible').click();
e2e.components.Tab.title('Transform data').should('be.visible').click();
e2e.components.Transforms.addTransformationButton().scrollIntoView().should('be.visible').click();
e2e.components.TransformTab.newTransform('Spatial operations').scrollIntoView().should('be.visible').click();
@ -27,7 +27,7 @@ describe('Geomap spatial operations', () => {
it('Tests location coords option', () => {
e2e.flows.openDashboard({ uid: DASHBOARD_ID, queryParams: { editPanel: 1 } });
e2e.components.Tab.title('Transformations').should('be.visible').click();
e2e.components.Tab.title('Transform data').should('be.visible').click();
e2e.components.Transforms.addTransformationButton().scrollIntoView().should('be.visible').click();
e2e.components.TransformTab.newTransform('Spatial operations').scrollIntoView().should('be.visible').click();
@ -51,7 +51,7 @@ describe('Geomap spatial operations', () => {
it('Tests geoshash field column appears in table view', () => {
e2e.flows.openDashboard({ uid: DASHBOARD_ID, queryParams: { editPanel: 1 } });
e2e.components.Tab.title('Transformations').should('be.visible').click();
e2e.components.Tab.title('Transform data').should('be.visible').click();
e2e.components.Transforms.addTransformationButton().scrollIntoView().should('be.visible').click();
e2e.components.TransformTab.newTransform('Spatial operations').scrollIntoView().should('be.visible').click();
@ -74,7 +74,7 @@ describe('Geomap spatial operations', () => {
it('Tests location lookup option', () => {
e2e.flows.openDashboard({ uid: DASHBOARD_ID, queryParams: { editPanel: 1 } });
e2e.components.Tab.title('Transformations').should('be.visible').click();
e2e.components.Tab.title('Transform data').should('be.visible').click();
e2e.components.Transforms.addTransformationButton().scrollIntoView().should('be.visible').click();
e2e.components.TransformTab.newTransform('Spatial operations').scrollIntoView().should('be.visible').click();

@ -1,6 +1,4 @@
import { selectors } from '@grafana/e2e-selectors';
import { e2e } from '../../utils';
import { e2e } from '../utils';
const PANEL_UNDER_TEST = 'Lines 500 data points';
@ -18,53 +16,62 @@ describe('Panel edit tests', () => {
e2e.flows.openPanelMenuItem(e2e.flows.PanelMenuItems.Edit, PANEL_UNDER_TEST);
// // New panel editor opens when navigating from Panel menu
// New panel editor opens when navigating from Panel menu
e2e.components.PanelEditor.General.content().should('be.visible');
// Queries tab is rendered and open by default
e2e.components.PanelEditor.DataPane.content()
.scrollIntoView()
.should('be.visible')
.within(() => {
e2e.components.Tab.title('Queries').should('be.visible');
e2e.components.Tab.title('Query').should('be.visible');
// data should be the active tab
e2e.components.Tab.active().within((li: JQuery<HTMLLIElement>) => {
expect(li.text()).equals('Queries1'); // there's already a query so therefore Query + 1
expect(li.text()).equals('Query1'); // there's already a query so therefore Query + 1
});
// cy.get('[data-testid]="query-editor-rows"').should('be.visible');
cy.get(`[data-testid="${selectors.components.QueryTab.content}"]`).should('be.visible');
e2e.components.QueryTab.content().should('be.visible');
e2e.components.TransformTab.content().should('not.exist');
e2e.components.AlertTab.content().should('not.exist');
e2e.components.PanelAlertTabContent.content().should('not.exist');
// Bottom pane tabs
// Can change to Transform tab
e2e.components.Tab.title('Transformations').should('be.visible').click();
e2e.components.Tab.title('Transform data').should('be.visible').click();
e2e.components.Tab.active().within((li: JQuery<HTMLLIElement>) => {
expect(li.text()).equals('Transformations0'); // there's no transform so therefore Transform + 0
expect(li.text()).equals('Transform data0'); // there's no transform so therefore Transform + 0
});
e2e.components.Transforms.addTransformationButton().scrollIntoView().should('be.visible');
cy.get(`[data-testid="${selectors.components.QueryTab.content}"]`).should('not.exist');
e2e.components.QueryTab.content().should('not.exist');
e2e.components.AlertTab.content().should('not.exist');
e2e.components.PanelAlertTabContent.content().should('not.exist');
// Can change to Alerts tab (graph panel is the default vis so the alerts tab should be rendered)
e2e.components.Tab.title('Alert').scrollIntoView().should('be.visible').click();
e2e.components.Tab.title('Alert').should('be.visible').click();
e2e.components.Tab.active().should('have.text', 'Alert0'); // there's no alert so therefore Alert + 0
// Needs to be disabled until Grafana EE turns unified alerting on by default
// e2e.components.AlertTab.content().should('not.exist');
cy.get(`[data-testid="${selectors.components.QueryTab.content}"]`).should('not.exist');
e2e.components.QueryTab.content().should('not.exist');
e2e.components.TransformTab.content().should('not.exist');
// Needs to be disabled until Grafana EE turns unified alerting on by default
// e2e.components.PanelAlertTabContent.content().should('exist');
// e2e.components.PanelAlertTabContent.content().should('be.visible');
e2e.components.Tab.title('Queries').should('be.visible').click();
e2e.components.Tab.title('Query').should('be.visible').click();
});
// Panel sidebar is rendered open by default
e2e.components.PanelEditor.OptionsPane.content().should('be.visible');
// close options pane
e2e.components.PanelEditor.toggleVizOptions().click();
e2e.components.PanelEditor.OptionsPane.content().should('not.exist');
// open options pane
e2e.components.PanelEditor.toggleVizOptions().should('be.visible').click();
e2e.components.PanelEditor.OptionsPane.content().should('be.visible');
// Check that Time series is chosen
e2e.components.PanelEditor.toggleVizPicker().click();
e2e.components.PluginVisualization.item('Time series').should('be.visible');
@ -95,8 +102,6 @@ describe('Panel edit tests', () => {
e2e.components.PanelEditor.DataPane.content().should('be.visible');
// Field & Overrides tabs (need to switch to React based vis, i.e. Table)
e2e.components.PanelEditor.toggleTableView().click({ force: true }).click({ force: true });
e2e.components.PanelEditor.OptionsPane.fieldLabel('Table Show table header').should('be.visible');
e2e.components.PanelEditor.OptionsPane.fieldLabel('Table Column width').should('be.visible');
});

@ -1,4 +1,4 @@
import { e2e } from '../../utils';
import { e2e } from '../utils';
const flakyTimeout = 10000;

@ -1,4 +1,4 @@
import { e2e } from '../../utils';
import { e2e } from '../utils';
describe('Panel edit tests - transformations', () => {
beforeEach(() => {
@ -8,7 +8,7 @@ describe('Panel edit tests - transformations', () => {
it('Tests transformations editor', () => {
e2e.flows.openDashboard({ uid: 'TkZXxlNG3', queryParams: { editPanel: 47 } });
e2e.components.Tab.title('Transformations').should('be.visible').click();
e2e.components.Tab.title('Transform data').should('be.visible').click();
e2e.components.Transforms.addTransformationButton().scrollIntoView().should('be.visible').click();
e2e.components.TransformTab.newTransform('Reduce').scrollIntoView().should('be.visible').click();
e2e.components.Transforms.Reduce.calculationsLabel().scrollIntoView().should('be.visible');
@ -18,7 +18,7 @@ describe('Panel edit tests - transformations', () => {
it('Tests case where transformations can be disabled and not clear out panel data', () => {
e2e.flows.openDashboard({ uid: 'TkZXxlNG3', queryParams: { editPanel: 47 } });
e2e.components.Tab.title('Transformations').should('be.visible').click();
e2e.components.Tab.title('Transform data').should('be.visible').click();
e2e.components.Transforms.addTransformationButton().scrollIntoView().should('be.visible').click();
e2e.components.TransformTab.newTransform('Reduce').scrollIntoView().should('be.visible').click();
e2e.components.Transforms.disableTransformationButton().should('be.visible').click();

@ -3,17 +3,12 @@ import { e2e } from '../utils';
export const smokeTestScenario = () =>
describe('Smoke tests', () => {
before(() => {
e2e.flows.login(Cypress.env('USERNAME'), Cypress.env('PASSWORD'), false);
cy.logToConsole('enabling dashboardScene feature toggle in localstorage');
cy.setLocalStorage('grafana.featureToggles', 'dashboardScene=true');
cy.logToConsole('disabling dashboardScene feature toggle in localstorage');
cy.setLocalStorage('grafana.featureToggles', 'dashboardScene=false');
cy.reload();
e2e.flows.login(Cypress.env('USERNAME'), Cypress.env('PASSWORD'), false);
e2e.flows.addDataSource();
e2e.flows.addDashboard();
e2e.flows.addPanel({
dataSourceName: 'gdev-testdata',
visitDashboardAtStart: false,
timeout: 10000,
});
});
after(() => {
@ -21,6 +16,11 @@ export const smokeTestScenario = () =>
});
it('Login scenario, create test data source, dashboard, panel, and export scenario', () => {
// wait for time to be set to account for any layout shift
cy.contains('2020-01-01 00:00:00 to 2020-01-01 06:00:00').should('be.visible');
e2e.components.PageToolbar.itemButton('Add button').click();
e2e.components.PageToolbar.itemButton('Add new visualization menu item').click();
e2e.components.DataSource.TestData.QueryTab.scenarioSelectContainer()
.should('be.visible')
.within(() => {
@ -32,7 +32,8 @@ export const smokeTestScenario = () =>
// Make sure the graph renders via checking legend
e2e.components.VizLegend.seriesName('A-series').should('be.visible');
e2e.components.NavToolbar.editDashboard.backToDashboardButton().click();
// Expand options section
e2e.components.PanelEditor.applyButton();
// Make sure panel is & visualization is added to dashboard
e2e.components.VizLegend.seriesName('A-series').should('be.visible');

@ -14,11 +14,17 @@ describe('Panels smokescreen', () => {
it('Tests each panel type in the panel edit view to ensure no crash', () => {
e2e.flows.addDashboard();
e2e.flows.addPanel({
dataSourceName: 'gdev-testdata',
timeout: 10000,
visitDashboardAtStart: false,
});
// TODO: Try and use e2e.flows.addPanel() instead of block below
try {
e2e.components.PageToolbar.itemButton('Add button').should('be.visible');
e2e.components.PageToolbar.itemButton('Add button').click();
} catch (e) {
// Depending on the screen size, the "Add panel" button might be hidden
e2e.components.PageToolbar.item('Show more items').click();
e2e.components.PageToolbar.item('Add button').last().click();
}
e2e.pages.AddDashboard.itemButton('Add new visualization menu item').should('be.visible');
e2e.pages.AddDashboard.itemButton('Add new visualization menu item').click();
cy.window().then((win: Cypress.AUTWindow & { grafanaBootData: GrafanaBootConfig['bootData'] }) => {
// Loop through every panel type and ensure no crash

@ -139,9 +139,9 @@ export const addDashboard = (config?: Partial<AddDashboardConfig>) => {
setDashboardTimeRange(timeRange);
e2e.components.NavToolbar.editDashboard.saveButton().click();
e2e.components.Drawer.DashboardSaveDrawer.saveAsTitleInput().clear().type(title, { force: true });
e2e.components.Drawer.DashboardSaveDrawer.saveButton().click();
e2e.components.PageToolbar.item('Save dashboard').click();
e2e.pages.SaveDashboardAsModal.newName().clear().type(title, { force: true });
e2e.pages.SaveDashboardAsModal.save().click();
e2e.flows.assertSuccessNotification();
e2e.pages.AddDashboard.itemButton('Create new panel button').should('be.visible');

@ -85,17 +85,15 @@ export const configurePanel = (config: PartialAddPanelConfig | PartialEditPanelC
e2e.components.Panels.Panel.headerItems('Edit').click();
} else {
try {
//Enter edit mode
e2e.components.NavToolbar.editDashboard.editButton().should('be.visible').click();
e2e.components.PageToolbar.itemButton('Add button').should('be.visible').click();
e2e.components.NavToolbar.editDashboard.addVisualizationButton().should('be.visible').click();
e2e.components.PageToolbar.itemButton('Add button').should('be.visible');
e2e.components.PageToolbar.itemButton('Add button').click();
} catch (e) {
// Depending on the screen size, the "Add" button might be hidden
e2e.components.PageToolbar.item('Show more items').click();
e2e.components.PageToolbar.item('Add button').last().click();
}
// e2e.pages.AddDashboard.itemButton('Add new visualization menu item').should('be.visible');
// e2e.pages.AddDashboard.itemButton('Add new visualization menu item').click();
e2e.pages.AddDashboard.itemButton('Add new visualization menu item').should('be.visible');
e2e.pages.AddDashboard.itemButton('Add new visualization menu item').click();
}
if (timeRange) {

@ -51,9 +51,7 @@ export const importDashboard = (dashboardToImport: Dashboard, queryTimeout?: num
e2e.components.Panels.Panel.menu(panel.title).click({ force: true }); // force click because menu is hidden and show on hover
e2e.components.Panels.Panel.menuItems('Inspect').should('be.visible').click();
e2e.components.Tab.title('JSON').should('be.visible').click();
e2e.components.PanelInspector.Json.content().should('be.visible');
e2e.components.ReactMonacoEditor.editorLazy().should('be.visible');
cy.contains('Panel JSON').click({ force: true });
e2e.components.PanelInspector.Json.content().should('be.visible').contains('Panel JSON').click({ force: true });
e2e.components.Select.option().should('be.visible').contains('Panel data').click();
// ensures that panel has loaded without knowingly hitting an error

@ -0,0 +1,29 @@
declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace Cypress {
interface Chainable {
copyToClipboard(): Chainable;
copyFromClipboard(): Chainable;
}
}
}
Cypress.Commands.add('copyFromClipboard', () => {
return cy.window().then((win) => {
return cy.wrap(win.navigator.clipboard.readText());
});
});
Cypress.Commands.add(
'copyToClipboard',
{
prevSubject: [],
},
(subject: string) => {
return cy.window().then((win) => {
return cy.wrap(win.navigator.clipboard.writeText(subject));
});
}
);
export {};

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save