Skip to content

Commit ae97725

Browse files
committed
Initial commit
0 parents  commit ae97725

File tree

18 files changed

+6707
-0
lines changed

18 files changed

+6707
-0
lines changed

.editorconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
root = true
2+
3+
[*.{js,mjs,cjs,ts,json,html,yaml,yml}]
4+
indent_style = space
5+
indent_size = 4
6+
insert_final_newline = true
7+
charset = utf-8
8+
trim_trailing_whitespace = true

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
/dist

.eslintrc.cjs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
module.exports = {
2+
extends: [
3+
"eslint:recommended",
4+
"plugin:@typescript-eslint/recommended",
5+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
6+
"plugin:@typescript-eslint/strict",
7+
"prettier",
8+
],
9+
rules: {
10+
"@typescript-eslint/no-unused-vars": [
11+
"warn",
12+
{ argsIgnorePattern: "^_" },
13+
],
14+
},
15+
parser: "@typescript-eslint/parser",
16+
plugins: ["@typescript-eslint"],
17+
root: true,
18+
parserOptions: {
19+
project: true,
20+
},
21+
22+
overrides: [
23+
{
24+
files: ["Build.js"],
25+
rules: {
26+
"@typescript-eslint/no-unsafe-assignment": ["off"],
27+
"@typescript-eslint/no-unsafe-call": ["off"],
28+
"@typescript-eslint/no-unsafe-member-access": ["off"],
29+
},
30+
},
31+
],
32+
};

.github/workflows/ci.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: "Continuous Integration"
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- "master"
8+
pull_request:
9+
10+
jobs:
11+
tests:
12+
name: "Tests"
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
- uses: actions/setup-node@v3
17+
with:
18+
node-version: 18
19+
- run: npm ci
20+
- run: npm test

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
/dist

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/dist
2+
node_modules

.prettierrc.cjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
plugins: ["@trivago/prettier-plugin-sort-imports"],
3+
importOrderSeparation: true,
4+
importOrderSortSpecifiers: true,
5+
};

Build.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { typecheckPlugin } from "@jgoz/esbuild-plugin-typecheck";
2+
import * as esbuild from "esbuild";
3+
import process from "node:process";
4+
import { URL, fileURLToPath, pathToFileURL } from "node:url";
5+
6+
const options = {
7+
plugins: [typecheckPlugin()],
8+
9+
absWorkingDir: fileURLToPath(new URL(".", import.meta.url)),
10+
11+
entryPoints: [
12+
"src/index.ts",
13+
"src/cli.ts",
14+
"src/glue.ts",
15+
"src/units.ts",
16+
"src/logger.ts",
17+
],
18+
19+
bundle: false,
20+
outbase: "src",
21+
outdir: "./dist",
22+
target: "es2020",
23+
format: "esm",
24+
platform: "node",
25+
minify: false,
26+
sourcemap: true,
27+
};
28+
29+
if (import.meta.url === pathToFileURL(process.argv[1]).href) {
30+
await esbuild.build(options);
31+
}
32+
33+
export { options as default };

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Copyright © 2023 Binary Cake Ltd. & Contributors
2+
3+
Permission is hereby granted, free of charge, to any person
4+
obtaining a copy of this software and associated documentation
5+
files (the “Software”), to deal in the Software without
6+
restriction, including without limitation the rights to use,
7+
copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
copies of the Software, and to permit persons to whom the
9+
Software is furnished to do so, subject to the following
10+
conditions:
11+
12+
The above copyright notice and this permission notice shall be
13+
included in all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
16+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22+
OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
## Wallet Test Framework: MetaMask (Android)
2+
3+
A tool to automate the MetaMask wallet on android for use with Wallet Test Framework.
4+
5+
## Installation
6+
7+
### Node
8+
9+
This project requires Nodejs version 20.6 or later.
10+
11+
### Dependencies
12+
13+
```bash
14+
npm install
15+
```
16+
17+
### Android Application
18+
19+
The glue requires the MetaMask app installed on a real device. The app can be installed from the [Play Store](https://play.google.com/store/apps/details?id=io.metamask).
20+
21+
Note that running the tests will wipe your private keys off of the device.
22+
23+
## Building
24+
25+
```bash
26+
npm run build
27+
```
28+
29+
### Tests & Linting (Optional)
30+
31+
```bash
32+
npm test
33+
```
34+
35+
## Running
36+
37+
Running these tests requires launching two executables: an appium server, and the glue.
38+
39+
### Appium
40+
41+
Getting appium to launch properly can be difficult. Follow their guides for more information.
42+
43+
```bash
44+
npx appium
45+
```
46+
47+
<!-- TODO: mention installing uiautomator2 -->
48+
49+
### Tests
50+
51+
```bash
52+
npx glue-metamask-android
53+
```

0 commit comments

Comments
 (0)