2022-11-15 16:00:02 +01:00
|
|
|
# End-to-end tests
|
|
|
|
|
|
|
|
This directory contains the fixture data used to bootstrap the individual e2e tests. Each sub-directory contains
|
|
|
|
one thing:
|
|
|
|
|
|
|
|
1. A `state.json` file that represents a the saved state for the extension (see _Generating fixture data_ below)
|
|
|
|
|
2019-12-11 18:26:20 +01:00
|
|
|
## Generating fixture data
|
|
|
|
|
2020-01-17 23:59:25 +01:00
|
|
|
Fixture data can be generated by following these steps:
|
2019-12-11 18:26:20 +01:00
|
|
|
|
2020-01-17 23:59:25 +01:00
|
|
|
1. Load the unpacked extension in development or test mode
|
|
|
|
2. Inspecting the background context of the extension
|
|
|
|
3. Call `metamaskGetState`, then call [`copy`][1] on the results
|
2019-12-11 18:26:20 +01:00
|
|
|
|
2020-01-17 23:59:25 +01:00
|
|
|
You can then paste the contents directly in your fixture file.
|
2019-12-11 18:26:20 +01:00
|
|
|
|
2020-01-17 23:59:25 +01:00
|
|
|
```js
|
|
|
|
copy(await metamaskGetState())
|
2019-12-11 18:26:20 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
[1]:https://developers.google.com/web/tools/chrome-devtools/console/utilities
|