1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00
metamask-extension/test/e2e/contract-test/index.html
Mark Stacey 812c546acd
Contract test dapp improvements (#7587)
* Add Get Accounts button

This button calls `eth_accounts`. This button is always enabled, even
when not connected.

* Disable account buttons by default

The buttons that require you to have first connected have been disabled
by default. Previously they would be enabled until the JavaScript
finished initializing the page, at which point they'd be disabled. This
resulted in a distracting flash as the page loaded and the buttons
changed.

The `signTypedData` button was added to the accounts button set as
well, rather than being left enabled regardless of connected status.

* Allow connect button to become re-enabled

The Connect button was broken previously in that after being disabled,
it would stay disabled even if the dapp lost access to MetaMask. The
button will now be enabled whenever not connected.

* Stringify signTypedData results

* Defer metamask onboarding bundle to speed up page load
2019-12-09 14:31:47 -04:00

70 lines
2.0 KiB
HTML

<html>
<head>
<meta charset="UTF-8">
<title>E2E Test Dapp</title>
<script src="node_modules/@metamask/onboarding/dist/metamask-onboarding.bundle.js" defer></script>
<script src="contract.js" defer></script>
</head>
<body>
<header>
<h1>E2E Test Dapp</h1>
</header>
<main>
<section>
<h2>Connect</h2>
<button id="connectButton" disabled></button>
</section>
<section>
<h2>Contract</h2>
<div>
<button id="deployButton" disabled>Deploy Contract</button>
<button id="depositButton" disabled>Deposit</button>
<button id="withdrawButton" disabled>Withdraw</button>
</div>
<div>
Contract Status: <span id="contractStatus">Not clicked</span>
</div>
</section>
<section>
<h2>Send Eth</h2>
<button id="sendButton" disabled>Send</button>
</section>
<section>
<h2>Send Tokens</h2>
<div>
Token: <span id="tokenAddress"></span>
</div>
<div>
<button id="createToken" disabled>Create Token</button>
<button id="transferTokens" disabled>Transfer Tokens</button>
<button id="approveTokens" disabled>Approve Tokens</button>
<button id="transferTokensWithoutGas" disabled>Transfer Tokens Without Gas</button>
<button id="approveTokensWithoutGas" disabled>Approve Tokens Without Gas</button>
</div>
</section>
<section>
<h2>Get Accounts</h2>
<button id="getAccounts">eth_accounts</button>
<div id="getAccountsResult"></div>
</section>
<section>
<h2>Status</h2>
<div>
Network: <span id="network"></span>
</div>
<div>
ChainId: <span id="chainId"></span>
</div>
<div>
Accounts: <span id="accounts"></span>
</div>
</section>
<section>
<h2>Sign Typed Data</h2>
<button id="signTypedData" disabled>Sign</button>
<div>Sign Typed Data Result: <span id="signTypedDataResult"></span></div>
</section>
</main>
</body>
</html>