diff --git a/.circleci/config.yml b/.circleci/config.yml index bccbf0146a..2095b373fe 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -310,6 +310,50 @@ jobs: path: ./reports/tests - store_artifacts: path: ./reports/screenshots + + remix-ide-etherscan-plugin: + docker: + # specify the version you desire here + - image: cimg/node:14.17.6-browsers + + # Specify service dependencies here if necessary + # CircleCI maintains a library of pre-built images + # documented at https://circleci.com/docs/2.0/circleci-images/ + resource_class: xlarge + # - image: circleci/mongo:3.4.4 + environment: + - COMMIT_AUTHOR_EMAIL: "yann@ethereum.org" + - COMMIT_AUTHOR: "Circle CI" + working_directory: ~/remix-project + parallelism: 10 + steps: + - browser-tools/install-chrome + - browser-tools/install-chromedriver + - run: + command: | + google-chrome --version + chromedriver --version + java -jar /usr/local/bin/selenium.jar --version + name: Check install + - checkout + - checkout + - attach_workspace: + at: . + - run: unzip ./persist/dist.zip + - restore_cache: + keys: + - v1-deps-{{ checksum "yarn.lock" }} + - run: yarn install + - run: + name: Start Selenium + command: java -jar /usr/local/bin/selenium.jar + background: true + - run: npx nx build etherscan + - run: ./apps/remix-ide/ci/browser_tests_etherscan_plugin.sh + - store_test_results: + path: ./reports/tests + - store_artifacts: + path: ./reports/screenshots remix-ide-plugin-api: docker: @@ -467,6 +511,9 @@ workflows: - remix-ide-vyper-plugin: requires: - build + - remix-ide-etherscan-plugin: + requires: + - build - remix-ide-chrome: requires: - build @@ -481,6 +528,7 @@ workflows: - remix-ide-firefox - remix-ide-plugin-api - remix-ide-vyper-plugin + - remix-ide-etherscan-plugin filters: branches: only: remix_live @@ -492,6 +540,7 @@ workflows: - remix-ide-firefox - remix-ide-plugin-api - remix-ide-vyper-plugin + - remix-ide-etherscan-plugin filters: branches: only: master @@ -503,6 +552,7 @@ workflows: - remix-ide-firefox - remix-ide-plugin-api - remix-ide-vyper-plugin + - remix-ide-etherscan-plugin filters: branches: only: remix_beta diff --git a/apps/remix-ide-e2e/src/tests/etherscan_api.ts b/apps/remix-ide-e2e/src/tests/etherscan_api.ts new file mode 100644 index 0000000000..719db61972 --- /dev/null +++ b/apps/remix-ide-e2e/src/tests/etherscan_api.ts @@ -0,0 +1,24 @@ +'use strict' +import { NightwatchBrowser } from 'nightwatch' +import init from '../helpers/init' + +declare global { + interface Window { testplugin: { name: string, url: string }; } +} + +module.exports = { + '@disabled': true, + before: function (browser: NightwatchBrowser, done: VoidFunction) { + init(browser, done, null, true, { name: 'etherscan', url: 'http://127.0.0.1:5003'}) + }, + + 'Should load etherscan plugin #group1': function (browser: NightwatchBrowser) { + browser.clickLaunchIcon('pluginManager') + .scrollAndClick('[data-id="pluginManagerComponentActivateButtonetherscan"]') + .clickLaunchIcon('etherscan') + .pause(5000) + // @ts-ignore + .frame(0) + .waitForElementNotVisible('input[name="apiKey"]') + } +} diff --git a/apps/remix-ide/ci/browser_tests_etherscan_plugin.sh b/apps/remix-ide/ci/browser_tests_etherscan_plugin.sh new file mode 100755 index 0000000000..fdb420fc69 --- /dev/null +++ b/apps/remix-ide/ci/browser_tests_etherscan_plugin.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +set -e + +BUILD_ID=${CIRCLE_BUILD_NUM:-${TRAVIS_JOB_NUMBER}} +echo "$BUILD_ID" +TEST_EXITCODE=0 + +yarn run serve:production & +npx nx serve etherscan & + +sleep 5 + +yarn run build:e2e + +TESTFILES=$(grep -IRiL "\'@disabled\': \?true" "dist/apps/remix-ide-e2e/src/tests" | grep "etherscan_api" | sort | circleci tests split ) +for TESTFILE in $TESTFILES; do + npx nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js $TESTFILE --env=chrome || TEST_EXITCODE=1 +done + +echo "$TEST_EXITCODE" +if [ "$TEST_EXITCODE" -eq 1 ] +then + exit 1 +fi