diff --git a/apps/remix-ide-e2e/nightwatch.ts b/apps/remix-ide-e2e/nightwatch.ts index f9e11695e8..2bc20e8274 100644 --- a/apps/remix-ide-e2e/nightwatch.ts +++ b/apps/remix-ide-e2e/nightwatch.ts @@ -64,6 +64,14 @@ module.exports = { } }, + firefoxDesktop: { + desiredCapabilities: { + browserName: 'firefox', + javascriptEnabled: true, + acceptSslCerts: true + } + }, + firefox: { desiredCapabilities: { browserName: 'firefox', diff --git a/apps/remix-ide-e2e/src/runtests.sh b/apps/remix-ide-e2e/src/runtests.sh index 3f7826e470..1a3886f1f2 100644 --- a/apps/remix-ide-e2e/src/runtests.sh +++ b/apps/remix-ide-e2e/src/runtests.sh @@ -2,10 +2,33 @@ #!/bin/bash # Bash Menu Script Example -PS3='Please enter your choice: ' +PS3='Select a browser: ' +BROWSERS=( "chrome" "firefox" "exit" ) +select opt in "${BROWSERS[@]}" +do + case $opt in + "chrome") + echo "Chrome selected" + BROWSER="chromeDesktop" + break + ;; + "firefox") + echo "Firefox selected" + BROWSER="firefoxDesktop" + break + ;; + "exit") + echo "Exiting" + exit 0 + ;; + *) echo "invalid option $REPLY";; + esac +done + +PS3='Select a test or command: ' TESTFILES=( $(grep -IRiL "disabled" "dist/apps/remix-ide-e2e/src/tests" | grep "\.spec\|\.test" | sort ) ) -declare -p TESTFILES +# declare -p TESTFILES TESTFILES+=("list") TESTFILES+=("exit") select opt in "${TESTFILES[@]}" @@ -19,6 +42,6 @@ do done else # run the selected test - npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js $opt --env=chromeDesktop + npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js $opt --env=$BROWSER fi done \ No newline at end of file diff --git a/package.json b/package.json index 7615c5983e..295e51d5f0 100644 --- a/package.json +++ b/package.json @@ -59,6 +59,7 @@ "minify": "uglifyjs --in-source-map inline --source-map-inline -c warnings=false", "build:production": "NODE_ENV=production nx build remix-ide --skip-nx-cache", "serve:production": "npx http-server ./dist/apps/remix-ide", + "select_test": "sh apps/remix-ide-e2e/src/runtests.sh", "group_test": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/${npm_config_test}_group${npm_config_group}.test.js --env=${npm_config_env}", "nightwatch_parallel": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js --env=chrome,firefox", "nightwatch_local_firefox": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js --env=firefox",