diff --git a/bin/cds-add-cucumber.js b/bin/cds-add-cucumber.js index a75d1d8..59a03b3 100755 --- a/bin/cds-add-cucumber.js +++ b/bin/cds-add-cucumber.js @@ -40,7 +40,7 @@ function createTestFeaturesDir() { } function createVSCodePluginConfig() { - const content = `{ + const settingsJson = `{ // Cucumber for Visual Studio Code (CucumberOpen) https://open-vsx.org/extension/CucumberOpen/cucumber-official "cucumber.features": [ "test/features/**/*.feature" @@ -57,11 +57,17 @@ function createVSCodePluginConfig() { "cucumberautocomplete.strictGherkinCompletion": true } ` - mkdir('./.vscode'); - const file = './.vscode/settings.json'; + const extensionsJson = `{ + "recommendations": [ + "cucumberopen.cucumber-official", + ] +} +` + mkdir('./.vscode'); - createFileIfMissing(file, content); + createFileIfMissing('./.vscode/settings.json', settingsJson); + createFileIfMissing('./.vscode/extensions.json', extensionsJson); } diff --git a/test/bin/testGettingStartedLocallyWithLocalUI5tgz.sh b/test/bin/testGettingStartedLocallyWithLocalUI5tgz.sh new file mode 100755 index 0000000..49813bd --- /dev/null +++ b/test/bin/testGettingStartedLocallyWithLocalUI5tgz.sh @@ -0,0 +1,41 @@ +#!/bin/bash +set -e +set -x + +ROOT_DIR=`pwd` +DIR=tmp/getting-started-locally-with-local-ui5-tgz +test -d $DIR && rm -r -f $DIR +mkdir -p $DIR +cd $DIR +npm init -y + +npm init -w dk -y +npm add -w dk @sap/cds-dk + +npm init -w service -y +cd service +rm package.json + +npx cds init --add sample +npm add ../../.. || true +test -f ./.vscode/extensions.json && rm ./.vscode/extensions.json +npx cds-add-cucumber +# requireModule does not work with links -> require the steps directly +cat <cucumber.yml +default: + require: + - ../../../lib/index.js +EOF + +. ${ROOT_DIR}/test/bin/.sapui5.version.sh +. ${ROOT_DIR}/test/bin/.sapui5.tgz.sh +if [ -f ${SAPUI5_ARCHIVE_FILE} ]; then + echo "Found UI5 local archive: ${SAPUI5_ARCHIVE_FILE}" +else + echo "Could not find UI5 local archive" + exit 1 +fi + +npx cds-add-cucumber-plugin -p local-ui5-tgz -f ./app/index.html + +npx cucumber-js test