Skip to content

wormhole-foundation/wormhole-connect-automation-tests

Repository files navigation

Setup (MacOS)

  1. Download Chrome for Testing from here: https://googlechromelabs.github.io/chrome-for-testing/#stable
  2. Unzip chrome-mac-arm64.zip
  3. Remove "downloaded from internet" attribute:
cd <path to unzipped chrome-mac-arm64>
sudo xattr -cr 'Google Chrome for Testing.app'
  1. Copy 'Google Chrome for Testing.app' to Applications
  2. Install IntelliJ IDEA CE
  3. Install Rosetta (only applies to M1+ processors):
/usr/sbin/softwareupdate --install-rosetta --agree-to-license
  1. Make sure "Require password after screen saver begins or displayed is turned off" setting is set to 1 hour or more

Setup project

brew install --cask git-credential-manager
git clone https://github.com/tsadovska/wormhole-connect-automation-tests

Copy .env.example to .env file and enter missing values.

Setup Google Chrome for Testing

  1. Metamask extension
    • Open project in IntelliJ IDEA
    • Open Maven toolbar -> Click "Reload All Maven Projects" button
    • Right click "src/test/java/support/Browser" -> "Run Browser.main()"
    • Open chrome://extensions/
    • Enable Developer mode
    • Drag and drop metamask-chrome-***.crx from IntelliJ IDEA root directory into Chrome
    • Enable Test networks in MetaMask
    • Add wallet unlock password to .env file
    • NOTE: When tests are run for the first time, MetaMask wallet needs to be manually connected to website. Click "Connect source wallet" button and then select MetaMask in sidebar, choose testnet or mainnet account and confirm.
  2. Setup Phantom wallet (only if needed):
  1. Setup Leap wallet (only if needed):
  1. Setup Sui wallet (only if needed):

For mainnet testing, setup the same wallet extensions in BrowserMainnet. To start mainnet browser: right click "src/test/java/support/BrowserMainnet" -> "Run BrowserMainnet.main()".

Run Tests

  1. Install "Cucumber for Java" plugin in IntelliJ IDEA
  2. Right click on any ".feature" file -> Run

Special case: How to update MetaMask extension to latest version

git clone https://github.com/MetaMask/metamask-extension.git
git checkout master

Follow MetaMask Building on your local machine guide:

brew install corepack
corepack enable
cp .metamaskrc{.dist,}
# create an account on https://app.infura.io/register
# make sure all networks are enabled for the new Infura API Key
# Update .metmaskrc file: replace the INFURA_PROJECT_ID value with your own personal Infura API Key. 
yarn install
node ./development/build/index.js dist --apply-lavamoat=false

Open chrome://extensions/, click "Pack extension" Set Extension root directory to "dist/chrome" directory inside metamask-extension directory. Click Pack extension.

Generated "chrome.crx" can now be added to this repository and can be installed in Google Chrome for Testing.

Setup Google Spreadsheets

  1. Create a Google Spreadsheet, update .env file.
  2. Follow this guide to create credentials.json file.
  3. Save credentials.json file to src/test/resources directory.
  4. Follow this guide to enable Google Drive API.
  5. Follow this guide to enable People API.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published