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, }); });