@grafana/e2e: fixes (#24960)
* Resolve Cypress bin path ... instead of expecting it to be in a place that it may not be, depending on de-duping/flattening of nested dependencies * Remove dashboard before removing datasource ... it makes more sense and it fixes random issues, perhaps something to do with how the backend is implemented. * Updated lockfile
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
const execa = require('execa');
|
||||
const program = require('commander');
|
||||
const resolveBin = require('resolve-as-bin');
|
||||
const { resolve, sep } = require('path');
|
||||
|
||||
const cypress = commandName => {
|
||||
@@ -14,7 +15,7 @@ const cypress = commandName => {
|
||||
stdio: 'inherit',
|
||||
};
|
||||
|
||||
return execa(`${projectPath}/node_modules/.bin/cypress`, cypressOptions, execaOptions)
|
||||
return execa(resolveBin('cypress'), cypressOptions, execaOptions)
|
||||
.then(() => {}) // no return value
|
||||
.catch(error => {
|
||||
console.error(error.message);
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
"commander": "5.0.0",
|
||||
"cypress": "4.5.0",
|
||||
"execa": "4.0.0",
|
||||
"resolve-as-bin": "2.1.0",
|
||||
"ts-loader": "6.2.1",
|
||||
"typescript": "3.7.5",
|
||||
"yaml": "^1.8.3"
|
||||
|
||||
@@ -35,13 +35,13 @@ export const e2eScenario = ({
|
||||
|
||||
afterEach(() => {
|
||||
getScenarioContext().then(({ lastAddedDashboardUid, lastAddedDataSource }: any) => {
|
||||
if (lastAddedDataSource) {
|
||||
Flows.deleteDataSource(lastAddedDataSource);
|
||||
}
|
||||
|
||||
if (lastAddedDashboardUid) {
|
||||
Flows.deleteDashboard(lastAddedDashboardUid);
|
||||
}
|
||||
|
||||
if (lastAddedDataSource) {
|
||||
Flows.deleteDataSource(lastAddedDataSource);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user