From 47f09fca8da99951917e53cbb11403f8cf1cd0e2 Mon Sep 17 00:00:00 2001 From: Sarah Zinger Date: Tue, 12 Oct 2021 15:48:36 -0400 Subject: [PATCH] E2E: Fix path for importDashboards (#40111) * Small e2e fix for importDashboards --- 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, }); });