Skip to content

Commit

Permalink
Merge pull request #752 from Synthetixio/dev
Browse files Browse the repository at this point in the history
promote dev to master
  • Loading branch information
r3kt-eth authored May 13, 2023
2 parents 086e99a + 655da44 commit 2a832e8
Show file tree
Hide file tree
Showing 12 changed files with 471 additions and 242 deletions.
53 changes: 35 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,23 @@ it directly. Check
[usage examples](https://github.com/Synthetixio/synpress/#usage-examples) for
more details.

## Install
# Table of content

- [🖥️ Install](#%EF%B8%8F-install)
- [⚙️ Supported frameworks](#%EF%B8%8F-supported-frameworks)
- [👝 Supported wallets](#-supported-wallets)
- [✍️ Usage examples](#%EF%B8%8F-usage-examples)
- [🌟 Features](#-features)
- [👷 Example setup for eslint and tsconfig](#-example-setup-for-eslint-and-tsconfig)
- [⚡ Important notes](#-important-notes)
- [🐳 Synpress + Docker](#-using-with-docker)
- [💁‍♂️ CI tips & tricks](#%EF%B8%8F-ci-tips--tricks)
- [🧪 CLI](#-usage--commands)
- [📃 Environmental variables](#-environmental-variables)
- [🚢 Release process](#-release-process)
- [📝 More resources](#-more-resources)

## 🖥️ Install

```bash
# with pnpm
Expand All @@ -72,20 +88,20 @@ npm install --save-dev @synthetixio/synpress
yarn add -D @synthetixio/synpress
```

## Supported frameworks
## ⚙️ Supported frameworks

- [Synpress](https://github.com/Synthetixio/synpress)
- [Playwright](https://playwright.dev/) (as a plugin)
- [Cypress](https://github.com/cypress-io/cypress) (as a plugin)

## Supported wallets
## 👝 Supported wallets

- [MetaMask](https://metamask.io/)

## Usage examples:
## ✍️ Usage examples:

- [synpress-examples](https://github.com/drptbl/synpress-examples/)
- [synpress](https://github.com/Synthetixio/synpress/tree/dev/tests/e2e)
- [⭐ Synpress examples](https://github.com/drptbl/synpress-examples/)
- [Synpress e2e tests](https://github.com/Synthetixio/synpress/tree/dev/tests/e2e)

---

Expand All @@ -95,15 +111,15 @@ For full Synpress commands and their examples,
To see in which direction Synpress is headed to, take a look at
[planning board](https://github.com/orgs/Synthetixio/projects/14).

## Features
## 🌟 Features

- Added support for metamask 🦊
- Supports headless mode 🤖 (`synpress run --headless`)
- Recommended for local development (but
[not for CI yet](https://developer.chrome.com/articles/new-headless/) as
it's new and experimental)
- Integrated with
[docker 🐳](https://github.com/Synthetixio/synpress#-using-with-docker)
[Docker 🐳](https://github.com/Synthetixio/synpress#-using-with-docker)
- Recommended for
[CI](https://github.com/Synthetixio/synpress#ci-tips--tricks)
- Includes VNC and [noVNC](https://novnc.com/info.html)
Expand All @@ -118,7 +134,7 @@ To see in which direction Synpress is headed to, take a look at
- Blazingly-fast ⚡
- Extensible ⚙️ (add own custom commands and plugins)
- Can be used in existing
[cypress setup](https://github.com/Synthetixio/synpress/issues/346#issuecomment-1060506096)
[Cypress setup](https://github.com/Synthetixio/synpress/issues/346#issuecomment-1060506096)
- Supports dotenv
- Loads all env vars from your `.env` file automatically (from project root
folder)
Expand Down Expand Up @@ -213,7 +229,7 @@ and then modify it for your needs. Then you can direct synpress to use it with

For example: `synpress run --configFile __tests__/e2e/customConfig.config.js`

## ⚡ Important
## ⚡ Important notes

Synpress doesn't seem to communicate with metamask properly if
`"chromeWebSecurity": false` flag is set. More about it
Expand All @@ -230,7 +246,7 @@ In the past, tests worked only in non-headless mode because extensions were not
supported in headless mode by
[playwright](https://playwright.dev/docs/chrome-extensions) and
[Cypress](https://docs.cypress.io/api/plugins/browser-launch-api.html#Add-browser-extensions).
As a workaround, we've provided docker 🐳 containers. They solved this issue and
As a workaround, we've provided Docker 🐳 containers. They solved this issue and
it's an alternative.

You have to setup `xvfb` and window manager (like `fluxbox` or `xfce4`) to run
Expand Down Expand Up @@ -306,8 +322,8 @@ introduce delay between every action, 50ms by default) / `SLOW_MODE=<value>`.
following features:

- improved logging
- [cypress debugger](https://docs.cypress.io/guides/guides/debugging)
- [playwright debugger](https://playwright.dev/docs/debug)
- [Cypress debugger](https://docs.cypress.io/guides/guides/debugging)
- [Playwright debugger](https://playwright.dev/docs/debug)
- slow down tests

You may encounter 403 errors (on shared IPs & CI) related to rate limiting while
Expand Down Expand Up @@ -335,7 +351,7 @@ Docker is awesome for CI. Give it a try.
- remote: https://<random>.ngrok.io/vnc.html?autoconnect=true (check logs for
url)

### How to use
### How to run e2e tests for Synpress using Docker

1. `git clone [email protected]:Synthetixio/synpress.git`
2. `cd synpress`
Expand All @@ -350,7 +366,7 @@ Docker is awesome for CI. Give it a try.

All examples of setup are present in this repository. Just take a look around.

## CI tips & tricks
## 💁‍♂️ CI tips & tricks

- check out many different
[examples in this repository](https://github.com/Synthetixio/synpress/tree/dev/.github/workflows):
Expand All @@ -367,7 +383,7 @@ All examples of setup are present in this repository. Just take a look around.
- use [docker-e2e](https://github.com/Synthetixio/docker-e2e)
- synpress is tested and should work on all resolutions, starting from 800x600

## 🧪 Usage
## 🧪 Usage & commands

- `synpress run` to run tests
- `synpress open` to open Cypress UI (may be bugged in some cases because it
Expand Down Expand Up @@ -409,7 +425,7 @@ Options:
-h, --help display help for command
```

## Environmental variables
## 📃 Environmental variables

| Variable | Description |
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
Expand Down Expand Up @@ -455,8 +471,9 @@ Above actions will lead to:
- New GitHub packages node module release
- New GitHub release (tagged) created with changelog from commit messages

## 📃 More resources
## 📝 More resources

- [End-to-end testing using Synpress](https://klaytn.foundation/synpress-setup-tutorial/)
- [Synpress - web3-enabled e2e testing tool](https://gitcoin.co/grants/5699/synpress-web3-enabled-e2e-testing-tool)
- [How to set up Synpress for Web3 dApp Frontend Test Automation with MetaMask](https://medium.com/andamp/how-to-setup-synpress-for-wen3-dapp-frontend-test-automation-with-metamask-73396896684a)
- [Extending Synpress with additional MetaMask commands](https://medium.com/andamp/extending-synpress-with-additional-metamask-commands-fdc6b35a2ffc)
Expand Down
4 changes: 2 additions & 2 deletions commands/etherscan.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ let retries = 0;

module.exports = {
async getTransactionStatus(txid) {
const { getNetwork } = require('../helpers');
const currentNetwork = getNetwork().networkName;
const { getCurrentNetwork } = require('../helpers');
const currentNetwork = getCurrentNetwork().name;
const etherscanApi = require('etherscan-api').init(
process.env.ETHERSCAN_KEY,
currentNetwork,
Expand Down
Loading

0 comments on commit 2a832e8

Please sign in to comment.