-
-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1,066 changed files
with
338,821 additions
and
29 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { configureSynpressForEthereumWalletMock } from '@synthetixio/synpress/cypress' | ||
import { defineConfig } from 'cypress' | ||
|
||
export default defineConfig({ | ||
chromeWebSecurity: false, | ||
e2e: { | ||
baseUrl: 'http://localhost:9999', | ||
specPattern: 'test/cypress/**/*.cy.{js,jsx,ts,tsx}', | ||
supportFile: 'src/cypress/support/e2e.{js,jsx,ts,tsx}', | ||
testIsolation: false, | ||
async setupNodeEvents(on, config) { | ||
return configureSynpressForEthereumWalletMock(on, config) | ||
} | ||
} | ||
}) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"name": "@examples/ethereum-wallet-mock", | ||
"version": "0.0.1-alpha.9", | ||
"private": true, | ||
"type": "module", | ||
"scripts": { | ||
"build:cache": "synpress", | ||
"build:cache:force": "synpress --force", | ||
"build:cache:headless": "synpress --headless", | ||
"serve:test-dapp": "serve node_modules/@metamask/test-dapp/dist -p 9999", | ||
"test:cypress:headful": "cypress run --browser chrome --headed" | ||
}, | ||
"dependencies": { | ||
"@synthetixio/synpress": "workspace:*", | ||
"dotenv": "16.4.2" | ||
}, | ||
"devDependencies": { | ||
"@metamask/test-dapp": "8.1.0", | ||
"@synthetixio/synpress-tsconfig": "0.0.1-alpha.9", | ||
"@types/node": "20.11.17", | ||
"cypress": "13.13.0", | ||
"serve": "14.2.1", | ||
"typescript": "5.3.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
SEED_PHRASE="test test test test test test test test test test test junk" | ||
WALLET_PASSWORD="SynpressIsAwesomeNow!!!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# example-new-dawn | ||
|
||
## 0.0.1-alpha.9 | ||
|
||
### Patch Changes | ||
|
||
- Alpha Release | ||
- Updated dependencies | ||
- @synthetixio/synpress@4.0.0-alpha.9 | ||
|
||
## 0.0.1-alpha.8 | ||
|
||
### Patch Changes | ||
|
||
- Alpha Release | ||
- Updated dependencies | ||
- @synthetixio/synpress@4.0.0-alpha.8 | ||
|
||
## 0.0.1-alpha.7 | ||
|
||
### Patch Changes | ||
|
||
- Alpha Release | ||
- Updated dependencies | ||
- @synthetixio/synpress@4.0.0-alpha.7 | ||
|
||
## 0.0.1-alpha.6 | ||
|
||
### Patch Changes | ||
|
||
- Alpha Release | ||
- Updated dependencies | ||
- @synthetixio/synpress@4.0.0-alpha.6 | ||
|
||
## 0.0.1-alpha.5 | ||
|
||
### Patch Changes | ||
|
||
- Alpha Release | ||
- Updated dependencies | ||
- @synthetixio/synpress@4.0.0-alpha.5 | ||
|
||
## 0.0.1-alpha.4 | ||
|
||
### Patch Changes | ||
|
||
- Alpha Release | ||
- Updated dependencies | ||
- @synthetixio/synpress@4.0.0-alpha.4 | ||
|
||
## 0.0.1-alpha.2 | ||
|
||
### Patch Changes | ||
|
||
- Updated dependencies | ||
- @synthetixio/synpress@4.0.0-alpha.3 | ||
|
||
## 0.0.1-alpha.1 | ||
|
||
### Patch Changes | ||
|
||
- Updated dependencies | ||
- @synthetixio/synpress@4.0.0-alpha.2 | ||
|
||
## 0.0.1-alpha.0 | ||
|
||
### Patch Changes | ||
|
||
- Updated dependencies | ||
- @synthetixio/synpress@4.0.0-alpha.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
<h1 align="center"> | ||
Synpress: New Dawn | ||
<br> | ||
<small>⭐ Example Project ⭐</small> | ||
</h1> | ||
|
||
# 📖 Intro | ||
|
||
The New Dawn version of Synpress differs in one major way from all previous versions and all other similar Web3 tools: | ||
|
||
- We set up the browser only once, and we cache it. Thanks to this, tests not only run faster, but it also allows to use | ||
**ALL FEATURES** of [Playwright](https://playwright.dev/), such as parallel testing 🚀 | ||
|
||
You can define how a browser should be set up yourself. You can find setup file examples [here](test/wallet-setup). | ||
All setup files must have the following naming structure: `*.setup.{js,ts}`. | ||
|
||
Once you define a setup file, you can build a cache with our CLI. By default, the cache is built in a headed mode and | ||
utilizes the setup files from `test/wallet-setup` directory. | ||
Try running it with the `--help` flag to see all available configuration options. | ||
|
||
Here's how to use it: | ||
|
||
```bash | ||
# Build cache in a headed mode: | ||
synpress | ||
|
||
# Build cache in a headless mode: | ||
synpress --headless | ||
``` | ||
|
||
# 🧑💻 Usage | ||
|
||
1. Install dependencies: | ||
|
||
```bash | ||
pnpm install | ||
``` | ||
|
||
2. Start MetaMask Test Dapp: | ||
|
||
```bash | ||
pnpm run serve:test-dapp | ||
``` | ||
|
||
3. Install Playwright: | ||
|
||
```bash | ||
pnpm exec playwright install | ||
``` | ||
|
||
*3a. If you do not have Anvil installed, go to | ||
the [Foundry installation guide](https://book.getfoundry.sh/getting-started/installation#installation)* and follow the | ||
instructions. | ||
|
||
4. Build cache with our CLI by using a script: | ||
|
||
```bash | ||
# You can either build cache in a headed mode: | ||
pnpm run build:cache | ||
|
||
# Or in a headless mode: | ||
pnpm run build:cache:headless | ||
``` | ||
|
||
5. Run Playwright tests as you would normally do: | ||
|
||
```bash | ||
# Use one of our scripts: | ||
pnpm run test:playwright:headful | ||
pnpm run test:playwright:headless | ||
pnpm run test:playwright:headless:ui | ||
|
||
# Or use Playwright directly: | ||
playwright test | ||
HEADLESS=true playwright test | ||
HEADLESS=true playwright test --ui | ||
``` | ||
|
||
### ⚠️ Important note ⚠️ | ||
|
||
Currently, tests are triggered in a headed mode by default. Add `HEADLESS=true` to run them in a headless mode. | ||
|
||
This behavior will change soon! 🫡 | ||
|
||
# 🤔 Still want more? | ||
|
||
If you need more than this example project, check out our tests for MetaMask [here](../../wallets/metamask/test/e2e). |
6 changes: 3 additions & 3 deletions
6
examples/new-dawn/cypress.config.ts → examples/metamask/cypress.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
import { configureSynpress } from '@synthetixio/synpress/cypress' | ||
import { configureSynpressForMetaMask } from '@synthetixio/synpress/cypress' | ||
import { defineConfig } from 'cypress' | ||
|
||
export default defineConfig({ | ||
chromeWebSecurity: false, | ||
e2e: { | ||
baseUrl: 'http://localhost:9999', | ||
specPattern: 'test/cypress/**/*.cy.{js,jsx,ts,tsx}', | ||
supportFile: 'test/cypress/support/e2e.{js,jsx,ts,tsx}', | ||
supportFile: 'src/cypress/support/e2e.{js,jsx,ts,tsx}', | ||
testIsolation: false, | ||
async setupNodeEvents(on, config) { | ||
return configureSynpress(on, config) | ||
return configureSynpressForMetaMask(on, config) | ||
} | ||
} | ||
}) |
Binary file not shown.
Oops, something went wrong.