From 82ef926e1b14ae57279c4b490564d082a6c9755d Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Wed, 13 Oct 2021 01:53:31 +0100 Subject: [PATCH] E2E: Fix path for importDashboards (#40111) (#40351) * Small e2e fix for importDashboards (cherry picked from commit 47f09fca8da99951917e53cbb11403f8cf1cd0e2) Co-authored-by: Sarah Zinger --- packages/grafana-e2e/cypress/support/commands.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/grafana-e2e/cypress/support/commands.ts b/packages/grafana-e2e/cypress/support/commands.ts index 8b44ce899ec..48e933bf34c 100644 --- a/packages/grafana-e2e/cypress/support/commands.ts +++ b/packages/grafana-e2e/cypress/support/commands.ts @@ -26,7 +26,8 @@ Cypress.Commands.add('readProvisions', (filePaths: string[]) => { Cypress.Commands.add('getJSONFilesFromDir', (dirPath: string) => { return cy.task('getJSONFilesFromDir', { - projectPath: Cypress.config().parentTestsFolder, + // CWD is set for plugins in the cli but not for the main grafana repo: https://github.com/grafana/grafana/blob/main/packages/grafana-e2e/cli.js#L12 + projectPath: Cypress.env('CWD') || Cypress.config().parentTestsFolder, relativePath: dirPath, }); });