E2E: Fix path for importDashboards (#40111) (#40351)

* Small e2e fix for importDashboards

(cherry picked from commit 47f09fca8d)

Co-authored-by: Sarah Zinger <sarahzinger@users.noreply.github.com>
This commit is contained in:
Grot (@grafanabot)
2021-10-12 20:53:31 -04:00
committed by GitHub
co-authored by Sarah Zinger
parent 7bbc0e8684
commit 82ef926e1b
@@ -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,
});
});