mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
E2e fixtures navigate transactions (#12101)
* add state with unapproved transactions * refactor navigate transactions test to use fixture
This commit is contained in:
parent
34f2d3e27f
commit
7f39a555e7
710
test/e2e/fixtures/navigate-transactions/state.json
Normal file
710
test/e2e/fixtures/navigate-transactions/state.json
Normal file
@ -0,0 +1,710 @@
|
||||
{
|
||||
"data": {
|
||||
"AppStateController": {
|
||||
"mkrMigrationReminderTimestamp": null
|
||||
},
|
||||
"CachedBalancesController": {
|
||||
"cachedBalances": {
|
||||
"4": {}
|
||||
}
|
||||
},
|
||||
"CurrencyController": {
|
||||
"conversionDate": 1575697244.188,
|
||||
"conversionRate": 149.61,
|
||||
"currentCurrency": "usd",
|
||||
"nativeCurrency": "ETH"
|
||||
},
|
||||
"IncomingTransactionsController": {
|
||||
"incomingTransactions": {},
|
||||
"incomingTxLastFetchedBlocksByNetwork": {
|
||||
"goerli": null,
|
||||
"kovan": null,
|
||||
"mainnet": null,
|
||||
"rinkeby": 5570536
|
||||
}
|
||||
},
|
||||
"KeyringController": {
|
||||
"vault": "{\"data\":\"s6TpYjlUNsn7ifhEFTkuDGBUM1GyOlPrim7JSjtfIxgTt8/6MiXgiR/CtFfR4dWW2xhq85/NGIBYEeWrZThGdKGarBzeIqBfLFhw9n509jprzJ0zc2Rf+9HVFGLw+xxC4xPxgCS0IIWeAJQ+XtGcHmn0UZXriXm8Ja4kdlow6SWinB7sr/WM3R0+frYs4WgllkwggDf2/Tv6VHygvLnhtzp6hIJFyTjh+l/KnyJTyZW1TkZhDaNDzX3SCOHT\",\"iv\":\"FbeHDAW5afeWNORfNJBR0Q==\",\"salt\":\"TxZ+WbCW6891C9LK/hbMAoUsSEW1E8pyGLVBU6x5KR8=\"}"
|
||||
},
|
||||
"NetworkController": {
|
||||
"network": "1337",
|
||||
"provider": {
|
||||
"nickname": "Localhost 8545",
|
||||
"rpcUrl": "http://localhost:8545",
|
||||
"chainId": "0x539",
|
||||
"ticker": "ETH",
|
||||
"type": "rpc"
|
||||
}
|
||||
},
|
||||
"NotificationController": {
|
||||
"notifications": {
|
||||
"1": {
|
||||
"isShown": true
|
||||
},
|
||||
"3": {
|
||||
"isShown": true
|
||||
},
|
||||
"5": {
|
||||
"isShown": true
|
||||
},
|
||||
"6": {
|
||||
"isShown": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"OnboardingController": {
|
||||
"onboardingTabs": {},
|
||||
"seedPhraseBackedUp": false
|
||||
},
|
||||
"PermissionsMetadata": {
|
||||
"domainMetadata": {
|
||||
"metamask.github.io": {
|
||||
"icon": null,
|
||||
"name": "M E T A M A S K M E S H T E S T"
|
||||
}
|
||||
},
|
||||
"permissionsHistory": {},
|
||||
"permissionsLog": [
|
||||
{
|
||||
"id": 746677923,
|
||||
"method": "eth_accounts",
|
||||
"methodType": "restricted",
|
||||
"origin": "metamask.github.io",
|
||||
"request": {
|
||||
"id": 746677923,
|
||||
"jsonrpc": "2.0",
|
||||
"method": "eth_accounts",
|
||||
"origin": "metamask.github.io",
|
||||
"params": []
|
||||
},
|
||||
"requestTime": 1575697241368,
|
||||
"response": {
|
||||
"id": 746677923,
|
||||
"jsonrpc": "2.0",
|
||||
"result": []
|
||||
},
|
||||
"responseTime": 1575697241370,
|
||||
"success": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"TokenListController": {
|
||||
"tokenList": {
|
||||
"0xbbbbca6a901c926f240b89eacb641d8aec7aeafd": {
|
||||
"address": "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd",
|
||||
"symbol": "LRC",
|
||||
"decimals": 18,
|
||||
"name": "Loopring",
|
||||
"iconUrl": "https://airswap-token-images.s3.amazonaws.com/LRC.png",
|
||||
"aggregators": [
|
||||
"airswapLight",
|
||||
"bancor",
|
||||
"cmc",
|
||||
"coinGecko",
|
||||
"kleros",
|
||||
"oneInch",
|
||||
"paraswap",
|
||||
"pmm",
|
||||
"totle",
|
||||
"zapper",
|
||||
"zerion",
|
||||
"zeroEx"
|
||||
],
|
||||
"occurrences": 12
|
||||
},
|
||||
"0x04fa0d235c4abf4bcf4787af4cf447de572ef828": {
|
||||
"address": "0x04fa0d235c4abf4bcf4787af4cf447de572ef828",
|
||||
"symbol": "UMA",
|
||||
"decimals": 18,
|
||||
"name": "UMA",
|
||||
"iconUrl": "https://assets.coingecko.com/coins/images/10951/thumb/UMA.png?1586307916",
|
||||
"aggregators": [
|
||||
"bancor",
|
||||
"cmc",
|
||||
"coinGecko",
|
||||
"kleros",
|
||||
"oneInch",
|
||||
"paraswap",
|
||||
"pmm",
|
||||
"totle",
|
||||
"zapper",
|
||||
"zerion",
|
||||
"zeroEx"
|
||||
],
|
||||
"occurrences": 11
|
||||
},
|
||||
"0x6b3595068778dd592e39a122f4f5a5cf09c90fe2": {
|
||||
"address": "0x6b3595068778dd592e39a122f4f5a5cf09c90fe2",
|
||||
"symbol": "SUSHI",
|
||||
"decimals": 18,
|
||||
"name": "SushiSwap",
|
||||
"iconUrl": "https://assets.coingecko.com/coins/images/12271/thumb/512x512_Logo_no_chop.png?1606986688",
|
||||
"aggregators": [
|
||||
"bancor",
|
||||
"cmc",
|
||||
"coinGecko",
|
||||
"kleros",
|
||||
"oneInch",
|
||||
"paraswap",
|
||||
"pmm",
|
||||
"totle",
|
||||
"zapper",
|
||||
"zerion",
|
||||
"zeroEx"
|
||||
],
|
||||
"occurrences": 11
|
||||
},
|
||||
"0xd533a949740bb3306d119cc777fa900ba034cd52": {
|
||||
"address": "0xd533a949740bb3306d119cc777fa900ba034cd52",
|
||||
"symbol": "CRV",
|
||||
"decimals": 18,
|
||||
"name": "Curve DAO Token",
|
||||
"iconUrl": "https://assets.coingecko.com/coins/images/12124/thumb/Curve.png?1597369484",
|
||||
"aggregators": [
|
||||
"bancor",
|
||||
"cmc",
|
||||
"coinGecko",
|
||||
"kleros",
|
||||
"oneInch",
|
||||
"paraswap",
|
||||
"pmm",
|
||||
"totle",
|
||||
"zapper",
|
||||
"zerion",
|
||||
"zeroEx"
|
||||
],
|
||||
"occurrences": 11
|
||||
},
|
||||
"0xc00e94cb662c3520282e6f5717214004a7f26888": {
|
||||
"address": "0xc00e94cb662c3520282e6f5717214004a7f26888",
|
||||
"symbol": "COMP",
|
||||
"decimals": 18,
|
||||
"name": "Compound",
|
||||
"iconUrl": "https://assets.coingecko.com/coins/images/10775/thumb/COMP.png?1592625425",
|
||||
"aggregators": [
|
||||
"bancor",
|
||||
"cmc",
|
||||
"coinGecko",
|
||||
"kleros",
|
||||
"oneInch",
|
||||
"paraswap",
|
||||
"pmm",
|
||||
"totle",
|
||||
"zapper",
|
||||
"zerion",
|
||||
"zeroEx"
|
||||
],
|
||||
"occurrences": 11
|
||||
},
|
||||
"0xba100000625a3754423978a60c9317c58a424e3d": {
|
||||
"address": "0xba100000625a3754423978a60c9317c58a424e3d",
|
||||
"symbol": "BAL",
|
||||
"decimals": 18,
|
||||
"name": "Balancer",
|
||||
"iconUrl": "https://assets.coingecko.com/coins/images/11683/thumb/Balancer.png?1592792958",
|
||||
"aggregators": [
|
||||
"bancor",
|
||||
"cmc",
|
||||
"coinGecko",
|
||||
"kleros",
|
||||
"oneInch",
|
||||
"paraswap",
|
||||
"pmm",
|
||||
"totle",
|
||||
"zapper",
|
||||
"zerion",
|
||||
"zeroEx"
|
||||
],
|
||||
"occurrences": 11
|
||||
},
|
||||
"0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0": {
|
||||
"address": "0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0",
|
||||
"symbol": "MATIC",
|
||||
"decimals": 18,
|
||||
"name": "Polygon",
|
||||
"iconUrl": "https://raw.githubusercontent.com/MetaMask/eth-contract-metadata/master/images/matic-network-logo.svg",
|
||||
"aggregators": [
|
||||
"airswapLight",
|
||||
"bancor",
|
||||
"coinGecko",
|
||||
"kleros",
|
||||
"oneInch",
|
||||
"paraswap",
|
||||
"pmm",
|
||||
"totle",
|
||||
"zapper",
|
||||
"zerion",
|
||||
"zeroEx"
|
||||
],
|
||||
"occurrences": 11
|
||||
},
|
||||
"0x0d8775f648430679a709e98d2b0cb6250d2887ef": {
|
||||
"address": "0x0d8775f648430679a709e98d2b0cb6250d2887ef",
|
||||
"symbol": "BAT",
|
||||
"decimals": 18,
|
||||
"name": "Basic Attention Tok",
|
||||
"iconUrl": "https://s3.amazonaws.com/airswap-token-images/BAT.png",
|
||||
"aggregators": [
|
||||
"airswapLight",
|
||||
"bancor",
|
||||
"coinGecko",
|
||||
"kleros",
|
||||
"oneInch",
|
||||
"paraswap",
|
||||
"pmm",
|
||||
"totle",
|
||||
"zapper",
|
||||
"zerion",
|
||||
"zeroEx"
|
||||
],
|
||||
"occurrences": 11
|
||||
}
|
||||
},
|
||||
"tokensChainsCache": {
|
||||
"1": {
|
||||
"timestamp": 1628769574961,
|
||||
"data": [
|
||||
{
|
||||
"address": "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd",
|
||||
"symbol": "LRC",
|
||||
"decimals": 18,
|
||||
"name": "Loopring",
|
||||
"iconUrl": "https://airswap-token-images.s3.amazonaws.com/LRC.png",
|
||||
"aggregators": [
|
||||
"airswapLight",
|
||||
"bancor",
|
||||
"cmc",
|
||||
"coinGecko",
|
||||
"kleros",
|
||||
"oneInch",
|
||||
"paraswap",
|
||||
"pmm",
|
||||
"totle",
|
||||
"zapper",
|
||||
"zerion",
|
||||
"zeroEx"
|
||||
],
|
||||
"occurrences": 12
|
||||
},
|
||||
{
|
||||
"address": "0x04fa0d235c4abf4bcf4787af4cf447de572ef828",
|
||||
"symbol": "UMA",
|
||||
"decimals": 18,
|
||||
"name": "UMA",
|
||||
"iconUrl": "https://assets.coingecko.com/coins/images/10951/thumb/UMA.png?1586307916",
|
||||
"aggregators": [
|
||||
"bancor",
|
||||
"cmc",
|
||||
"coinGecko",
|
||||
"kleros",
|
||||
"oneInch",
|
||||
"paraswap",
|
||||
"pmm",
|
||||
"totle",
|
||||
"zapper",
|
||||
"zerion",
|
||||
"zeroEx"
|
||||
],
|
||||
"occurrences": 11
|
||||
},
|
||||
{
|
||||
"address": "0x6b3595068778dd592e39a122f4f5a5cf09c90fe2",
|
||||
"symbol": "SUSHI",
|
||||
"decimals": 18,
|
||||
"name": "SushiSwap",
|
||||
"iconUrl": "https://assets.coingecko.com/coins/images/12271/thumb/512x512_Logo_no_chop.png?1606986688",
|
||||
"aggregators": [
|
||||
"bancor",
|
||||
"cmc",
|
||||
"coinGecko",
|
||||
"kleros",
|
||||
"oneInch",
|
||||
"paraswap",
|
||||
"pmm",
|
||||
"totle",
|
||||
"zapper",
|
||||
"zerion",
|
||||
"zeroEx"
|
||||
],
|
||||
"occurrences": 11
|
||||
},
|
||||
{
|
||||
"address": "0xd533a949740bb3306d119cc777fa900ba034cd52",
|
||||
"symbol": "CRV",
|
||||
"decimals": 18,
|
||||
"name": "Curve DAO Token",
|
||||
"iconUrl": "https://assets.coingecko.com/coins/images/12124/thumb/Curve.png?1597369484",
|
||||
"aggregators": [
|
||||
"bancor",
|
||||
"cmc",
|
||||
"coinGecko",
|
||||
"kleros",
|
||||
"oneInch",
|
||||
"paraswap",
|
||||
"pmm",
|
||||
"totle",
|
||||
"zapper",
|
||||
"zerion",
|
||||
"zeroEx"
|
||||
],
|
||||
"occurrences": 11
|
||||
},
|
||||
{
|
||||
"address": "0xc00e94cb662c3520282e6f5717214004a7f26888",
|
||||
"symbol": "COMP",
|
||||
"decimals": 18,
|
||||
"name": "Compound",
|
||||
"iconUrl": "https://assets.coingecko.com/coins/images/10775/thumb/COMP.png?1592625425",
|
||||
"aggregators": [
|
||||
"bancor",
|
||||
"cmc",
|
||||
"coinGecko",
|
||||
"kleros",
|
||||
"oneInch",
|
||||
"paraswap",
|
||||
"pmm",
|
||||
"totle",
|
||||
"zapper",
|
||||
"zerion",
|
||||
"zeroEx"
|
||||
],
|
||||
"occurrences": 11
|
||||
},
|
||||
{
|
||||
"address": "0xba100000625a3754423978a60c9317c58a424e3d",
|
||||
"symbol": "BAL",
|
||||
"decimals": 18,
|
||||
"name": "Balancer",
|
||||
"iconUrl": "https://assets.coingecko.com/coins/images/11683/thumb/Balancer.png?1592792958",
|
||||
"aggregators": [
|
||||
"bancor",
|
||||
"cmc",
|
||||
"coinGecko",
|
||||
"kleros",
|
||||
"oneInch",
|
||||
"paraswap",
|
||||
"pmm",
|
||||
"totle",
|
||||
"zapper",
|
||||
"zerion",
|
||||
"zeroEx"
|
||||
],
|
||||
"occurrences": 11
|
||||
},
|
||||
{
|
||||
"address": "0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0",
|
||||
"symbol": "MATIC",
|
||||
"decimals": 18,
|
||||
"name": "Polygon",
|
||||
"iconUrl": "https://raw.githubusercontent.com/MetaMask/eth-contract-metadata/master/images/matic-network-logo.svg",
|
||||
"aggregators": [
|
||||
"airswapLight",
|
||||
"bancor",
|
||||
"coinGecko",
|
||||
"kleros",
|
||||
"oneInch",
|
||||
"paraswap",
|
||||
"pmm",
|
||||
"totle",
|
||||
"zapper",
|
||||
"zerion",
|
||||
"zeroEx"
|
||||
],
|
||||
"occurrences": 11
|
||||
},
|
||||
{
|
||||
"address": "0x0d8775f648430679a709e98d2b0cb6250d2887ef",
|
||||
"symbol": "BAT",
|
||||
"decimals": 18,
|
||||
"name": "Basic Attention Tok",
|
||||
"iconUrl": "https://s3.amazonaws.com/airswap-token-images/BAT.png",
|
||||
"aggregators": [
|
||||
"airswapLight",
|
||||
"bancor",
|
||||
"coinGecko",
|
||||
"kleros",
|
||||
"oneInch",
|
||||
"paraswap",
|
||||
"pmm",
|
||||
"totle",
|
||||
"zapper",
|
||||
"zerion",
|
||||
"zeroEx"
|
||||
],
|
||||
"occurrences": 11
|
||||
}
|
||||
]
|
||||
},
|
||||
"3": {
|
||||
"timestamp": 1628769543620
|
||||
},
|
||||
"1337": {
|
||||
"timestamp": 1628769513476
|
||||
}
|
||||
}
|
||||
},
|
||||
"PreferencesController": {
|
||||
"accountTokens": {
|
||||
"0x5cfe73b6021e818b776b421b1c4db2474086a7e1": {
|
||||
"rinkeby": [],
|
||||
"ropsten": []
|
||||
}
|
||||
},
|
||||
"assetImages": {},
|
||||
"completedOnboarding": true,
|
||||
"dismissSeedBackUpReminder": true,
|
||||
"currentLocale": "en",
|
||||
"featureFlags": {
|
||||
"showIncomingTransactions": true,
|
||||
"transactionTime": false
|
||||
},
|
||||
"firstTimeFlowType": "create",
|
||||
"forgottenPassword": false,
|
||||
"frequentRpcListDetail": [],
|
||||
"identities": {
|
||||
"0x5cfe73b6021e818b776b421b1c4db2474086a7e1": {
|
||||
"address": "0x5cfe73b6021e818b776b421b1c4db2474086a7e1",
|
||||
"name": "Account 1"
|
||||
}
|
||||
},
|
||||
"knownMethodData": {},
|
||||
"lostIdentities": {},
|
||||
"metaMetricsId": null,
|
||||
"participateInMetaMetrics": false,
|
||||
"preferences": {
|
||||
"useNativeCurrencyAsPrimaryCurrency": true
|
||||
},
|
||||
"selectedAddress": "0x5cfe73b6021e818b776b421b1c4db2474086a7e1",
|
||||
"suggestedTokens": {},
|
||||
"tokens": [],
|
||||
"useBlockie": false,
|
||||
"useNonceField": false,
|
||||
"usePhishDetect": true,
|
||||
"useTokenDetection": true
|
||||
},
|
||||
"TransactionController": {
|
||||
"transactions": {
|
||||
"7911313280012623": {
|
||||
"chainId": "0x539",
|
||||
"dappSuggestedGasFees": {
|
||||
"gas": "0x5208",
|
||||
"gasPrice": "0x4a817c800"
|
||||
},
|
||||
"history": [
|
||||
{
|
||||
"chainId": "0x539",
|
||||
"dappSuggestedGasFees": {
|
||||
"gas": "0x5208",
|
||||
"gasPrice": "0x4a817c800"
|
||||
},
|
||||
"id": 7911313280012623,
|
||||
"loadingDefaults": true,
|
||||
"metamaskNetworkId": "1337",
|
||||
"origin": "https://metamask.github.io",
|
||||
"status": "unapproved",
|
||||
"time": 1631545991949,
|
||||
"txParams": {
|
||||
"from": "0x5cfe73b6021e818b776b421b1c4db2474086a7e1",
|
||||
"gas": "0x5208",
|
||||
"gasPrice": "0x4a817c800",
|
||||
"to": "0x2f318c334780961fb129d2a6c30d0763d9a5c970",
|
||||
"value": "0x29a2241af62c0000"
|
||||
},
|
||||
"type": "sentEther"
|
||||
},
|
||||
[
|
||||
{
|
||||
"note": "Added new unapproved transaction.",
|
||||
"op": "replace",
|
||||
"path": "/loadingDefaults",
|
||||
"timestamp": 1631545992244,
|
||||
"value": false
|
||||
}
|
||||
]
|
||||
],
|
||||
"id": 7911313280012623,
|
||||
"loadingDefaults": false,
|
||||
"metamaskNetworkId": "1337",
|
||||
"origin": "https://metamask.github.io",
|
||||
"status": "unapproved",
|
||||
"time": 1631545991949,
|
||||
"txParams": {
|
||||
"from": "0x5cfe73b6021e818b776b421b1c4db2474086a7e1",
|
||||
"gas": "0x5208",
|
||||
"gasPrice": "0x4a817c800",
|
||||
"to": "0x2f318c334780961fb129d2a6c30d0763d9a5c970",
|
||||
"value": "0x29a2241af62c0000"
|
||||
},
|
||||
"type": "sentEther"
|
||||
},
|
||||
"7911313280012624": {
|
||||
"chainId": "0x539",
|
||||
"dappSuggestedGasFees": {
|
||||
"gas": "0x5208",
|
||||
"gasPrice": "0x4a817c800"
|
||||
},
|
||||
"history": [
|
||||
{
|
||||
"chainId": "0x539",
|
||||
"dappSuggestedGasFees": {
|
||||
"gas": "0x5208",
|
||||
"gasPrice": "0x4a817c800"
|
||||
},
|
||||
"id": 7911313280012624,
|
||||
"loadingDefaults": true,
|
||||
"metamaskNetworkId": "1337",
|
||||
"origin": "https://metamask.github.io",
|
||||
"status": "unapproved",
|
||||
"time": 1631545994578,
|
||||
"txParams": {
|
||||
"from": "0x5cfe73b6021e818b776b421b1c4db2474086a7e1",
|
||||
"gas": "0x5208",
|
||||
"gasPrice": "0x4a817c800",
|
||||
"to": "0x2f318c334780961fb129d2a6c30d0763d9a5c970",
|
||||
"value": "0x29a2241af62c0000"
|
||||
},
|
||||
"type": "sentEther"
|
||||
},
|
||||
[
|
||||
{
|
||||
"note": "Added new unapproved transaction.",
|
||||
"op": "replace",
|
||||
"path": "/loadingDefaults",
|
||||
"timestamp": 1631545994695,
|
||||
"value": false
|
||||
}
|
||||
]
|
||||
],
|
||||
"id": 7911313280012624,
|
||||
"loadingDefaults": false,
|
||||
"metamaskNetworkId": "1337",
|
||||
"origin": "https://metamask.github.io",
|
||||
"status": "unapproved",
|
||||
"time": 1631545994578,
|
||||
"txParams": {
|
||||
"from": "0x5cfe73b6021e818b776b421b1c4db2474086a7e1",
|
||||
"gas": "0x5208",
|
||||
"gasPrice": "0x4a817c800",
|
||||
"to": "0x2f318c334780961fb129d2a6c30d0763d9a5c970",
|
||||
"value": "0x29a2241af62c0000"
|
||||
},
|
||||
"type": "sentEther"
|
||||
},
|
||||
"7911313280012625": {
|
||||
"chainId": "0x539",
|
||||
"dappSuggestedGasFees": {
|
||||
"gas": "0x5208",
|
||||
"gasPrice": "0x4a817c800"
|
||||
},
|
||||
"history": [
|
||||
{
|
||||
"chainId": "0x539",
|
||||
"dappSuggestedGasFees": {
|
||||
"gas": "0x5208",
|
||||
"gasPrice": "0x4a817c800"
|
||||
},
|
||||
"id": 7911313280012625,
|
||||
"loadingDefaults": true,
|
||||
"metamaskNetworkId": "1337",
|
||||
"origin": "https://metamask.github.io",
|
||||
"status": "unapproved",
|
||||
"time": 1631545996673,
|
||||
"txParams": {
|
||||
"from": "0x5cfe73b6021e818b776b421b1c4db2474086a7e1",
|
||||
"gas": "0x5208",
|
||||
"gasPrice": "0x4a817c800",
|
||||
"to": "0x2f318c334780961fb129d2a6c30d0763d9a5c970",
|
||||
"value": "0x29a2241af62c0000"
|
||||
},
|
||||
"type": "sentEther"
|
||||
},
|
||||
[
|
||||
{
|
||||
"note": "Added new unapproved transaction.",
|
||||
"op": "replace",
|
||||
"path": "/loadingDefaults",
|
||||
"timestamp": 1631545996678,
|
||||
"value": false
|
||||
}
|
||||
]
|
||||
],
|
||||
"id": 7911313280012625,
|
||||
"loadingDefaults": false,
|
||||
"metamaskNetworkId": "1337",
|
||||
"origin": "https://metamask.github.io",
|
||||
"status": "unapproved",
|
||||
"time": 1631545996673,
|
||||
"txParams": {
|
||||
"from": "0x5cfe73b6021e818b776b421b1c4db2474086a7e1",
|
||||
"gas": "0x5208",
|
||||
"gasPrice": "0x4a817c800",
|
||||
"to": "0x2f318c334780961fb129d2a6c30d0763d9a5c970",
|
||||
"value": "0x29a2241af62c0000"
|
||||
},
|
||||
"type": "sentEther"
|
||||
},
|
||||
"7911313280012626": {
|
||||
"chainId": "0x539",
|
||||
"dappSuggestedGasFees": {
|
||||
"gas": "0x5208",
|
||||
"gasPrice": "0x4a817c800"
|
||||
},
|
||||
"history": [
|
||||
{
|
||||
"chainId": "0x539",
|
||||
"dappSuggestedGasFees": {
|
||||
"gas": "0x5208",
|
||||
"gasPrice": "0x4a817c800"
|
||||
},
|
||||
"id": 7911313280012626,
|
||||
"loadingDefaults": true,
|
||||
"metamaskNetworkId": "1337",
|
||||
"origin": "https://metamask.github.io",
|
||||
"status": "unapproved",
|
||||
"time": 1631545998675,
|
||||
"txParams": {
|
||||
"from": "0x5cfe73b6021e818b776b421b1c4db2474086a7e1",
|
||||
"gas": "0x5208",
|
||||
"gasPrice": "0x4a817c800",
|
||||
"to": "0x2f318c334780961fb129d2a6c30d0763d9a5c970",
|
||||
"value": "0x29a2241af62c0000"
|
||||
},
|
||||
"type": "sentEther"
|
||||
},
|
||||
[
|
||||
{
|
||||
"note": "Added new unapproved transaction.",
|
||||
"op": "replace",
|
||||
"path": "/loadingDefaults",
|
||||
"timestamp": 1631545998677,
|
||||
"value": false
|
||||
}
|
||||
]
|
||||
],
|
||||
"id": 7911313280012626,
|
||||
"loadingDefaults": false,
|
||||
"metamaskNetworkId": "1337",
|
||||
"origin": "https://metamask.github.io",
|
||||
"status": "unapproved",
|
||||
"time": 1631545998675,
|
||||
"txParams": {
|
||||
"from": "0x5cfe73b6021e818b776b421b1c4db2474086a7e1",
|
||||
"gas": "0x5208",
|
||||
"gasPrice": "0x4a817c800",
|
||||
"to": "0x2f318c334780961fb129d2a6c30d0763d9a5c970",
|
||||
"value": "0x29a2241af62c0000"
|
||||
},
|
||||
"type": "sentEther"
|
||||
}
|
||||
}
|
||||
},
|
||||
"config": {},
|
||||
"firstTimeInfo": {
|
||||
"date": 1575697234195,
|
||||
"version": "7.7.0"
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"version": 40
|
||||
}
|
||||
}
|
@ -241,7 +241,7 @@ describe('MetaMask', function () {
|
||||
});
|
||||
});
|
||||
|
||||
describe('Navigate transactions', function () {
|
||||
describe('Add a custom token from a dapp', function () {
|
||||
let windowHandles;
|
||||
let extension;
|
||||
let popup;
|
||||
@ -278,201 +278,11 @@ describe('MetaMask', function () {
|
||||
await driver.delay(regularDelayMs);
|
||||
});
|
||||
|
||||
it('adds multiple transactions', async function () {
|
||||
const send3eth = await driver.findClickableElement({
|
||||
text: 'Send',
|
||||
tag: 'button',
|
||||
});
|
||||
await send3eth.click();
|
||||
await driver.delay(largeDelayMs);
|
||||
|
||||
const contractDeployment = await driver.findClickableElement({
|
||||
text: 'Deploy Contract',
|
||||
tag: 'button',
|
||||
});
|
||||
await contractDeployment.click();
|
||||
await driver.delay(largeDelayMs);
|
||||
|
||||
await send3eth.click();
|
||||
await driver.delay(largeDelayMs);
|
||||
await contractDeployment.click();
|
||||
await driver.delay(largeDelayMs);
|
||||
|
||||
await driver.switchToWindow(extension);
|
||||
await driver.delay(regularDelayMs);
|
||||
|
||||
await driver.clickElement('[data-testid="home__activity-tab"]');
|
||||
await driver.clickElement('.transaction-list-item');
|
||||
await driver.delay(largeDelayMs);
|
||||
});
|
||||
|
||||
it('navigates the transactions', async function () {
|
||||
await driver.clickElement('[data-testid="next-page"]');
|
||||
let navigationElement = await driver.findElement(
|
||||
'.confirm-page-container-navigation',
|
||||
);
|
||||
let navigationText = await navigationElement.getText();
|
||||
assert.equal(
|
||||
navigationText.includes('2'),
|
||||
true,
|
||||
'changed transaction right',
|
||||
);
|
||||
|
||||
await driver.clickElement('[data-testid="next-page"]');
|
||||
navigationElement = await driver.findElement(
|
||||
'.confirm-page-container-navigation',
|
||||
);
|
||||
navigationText = await navigationElement.getText();
|
||||
assert.equal(
|
||||
navigationText.includes('3'),
|
||||
true,
|
||||
'changed transaction right',
|
||||
);
|
||||
|
||||
await driver.clickElement('[data-testid="next-page"]');
|
||||
navigationElement = await driver.findElement(
|
||||
'.confirm-page-container-navigation',
|
||||
);
|
||||
navigationText = await navigationElement.getText();
|
||||
assert.equal(
|
||||
navigationText.includes('4'),
|
||||
true,
|
||||
'changed transaction right',
|
||||
);
|
||||
|
||||
await driver.clickElement('[data-testid="first-page"]');
|
||||
navigationElement = await driver.findElement(
|
||||
'.confirm-page-container-navigation',
|
||||
);
|
||||
navigationText = await navigationElement.getText();
|
||||
assert.equal(
|
||||
navigationText.includes('1'),
|
||||
true,
|
||||
'navigate to first transaction',
|
||||
);
|
||||
|
||||
await driver.clickElement('[data-testid="last-page"]');
|
||||
navigationElement = await driver.findElement(
|
||||
'.confirm-page-container-navigation',
|
||||
);
|
||||
navigationText = await navigationElement.getText();
|
||||
assert.equal(
|
||||
navigationText.split('4').length,
|
||||
3,
|
||||
'navigate to last transaction',
|
||||
);
|
||||
|
||||
await driver.clickElement('[data-testid="previous-page"]');
|
||||
navigationElement = await driver.findElement(
|
||||
'.confirm-page-container-navigation',
|
||||
);
|
||||
navigationText = await navigationElement.getText();
|
||||
assert.equal(
|
||||
navigationText.includes('3'),
|
||||
true,
|
||||
'changed transaction left',
|
||||
);
|
||||
|
||||
await driver.clickElement('[data-testid="previous-page"]');
|
||||
navigationElement = await driver.findElement(
|
||||
'.confirm-page-container-navigation',
|
||||
);
|
||||
navigationText = await navigationElement.getText();
|
||||
assert.equal(
|
||||
navigationText.includes('2'),
|
||||
true,
|
||||
'changed transaction left',
|
||||
);
|
||||
});
|
||||
|
||||
it('adds a transaction while confirm screen is in focus', async function () {
|
||||
let navigationElement = await driver.findElement(
|
||||
'.confirm-page-container-navigation',
|
||||
);
|
||||
let navigationText = await navigationElement.getText();
|
||||
assert.equal(
|
||||
navigationText.includes('2'),
|
||||
true,
|
||||
'second transaction in focus',
|
||||
);
|
||||
|
||||
await driver.switchToWindow(dapp);
|
||||
await driver.delay(regularDelayMs);
|
||||
|
||||
await driver.clickElement({ text: 'Send', tag: 'button' });
|
||||
await driver.delay(regularDelayMs);
|
||||
|
||||
await driver.switchToWindow(extension);
|
||||
await driver.delay(regularDelayMs);
|
||||
|
||||
navigationElement = await driver.findElement(
|
||||
'.confirm-page-container-navigation',
|
||||
);
|
||||
navigationText = await navigationElement.getText();
|
||||
assert.equal(
|
||||
navigationText.includes('2'),
|
||||
true,
|
||||
'correct (same) transaction in focus',
|
||||
);
|
||||
});
|
||||
|
||||
it('rejects a transaction', async function () {
|
||||
await driver.delay(tinyDelayMs);
|
||||
await driver.clickElement({ text: 'Reject', tag: 'button' });
|
||||
await driver.delay(largeDelayMs * 2);
|
||||
|
||||
const navigationElement = await driver.findElement(
|
||||
'.confirm-page-container-navigation',
|
||||
);
|
||||
await driver.delay(tinyDelayMs);
|
||||
const navigationText = await navigationElement.getText();
|
||||
assert.equal(navigationText.includes('4'), true, 'transaction rejected');
|
||||
});
|
||||
|
||||
it('confirms a transaction', async function () {
|
||||
await driver.delay(tinyDelayMs / 2);
|
||||
await driver.clickElement({ text: 'Confirm', tag: 'button' });
|
||||
await driver.delay(regularDelayMs);
|
||||
|
||||
const navigationElement = await driver.findElement(
|
||||
'.confirm-page-container-navigation',
|
||||
);
|
||||
await driver.delay(tinyDelayMs / 2);
|
||||
const navigationText = await navigationElement.getText();
|
||||
await driver.delay(tinyDelayMs / 2);
|
||||
assert.equal(navigationText.includes('3'), true, 'transaction confirmed');
|
||||
});
|
||||
|
||||
it('rejects the rest of the transactions', async function () {
|
||||
await driver.clickElement({ text: 'Reject 3', tag: 'a' });
|
||||
await driver.delay(regularDelayMs);
|
||||
|
||||
await driver.clickElement({ text: 'Reject All', tag: 'button' });
|
||||
await driver.delay(largeDelayMs * 2);
|
||||
|
||||
await driver.wait(async () => {
|
||||
const confirmedTxes = await driver.findElements(
|
||||
'.transaction-list__completed-transactions .transaction-list-item',
|
||||
);
|
||||
return confirmedTxes.length === 1;
|
||||
}, 10000);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Add a custom token from a dapp', function () {
|
||||
it('creates a new token', async function () {
|
||||
let windowHandles = await driver.getAllWindowHandles();
|
||||
const extension = windowHandles[0];
|
||||
const dapp = windowHandles[1];
|
||||
await driver.delay(regularDelayMs * 2);
|
||||
|
||||
await driver.switchToWindow(dapp);
|
||||
await driver.delay(regularDelayMs * 2);
|
||||
|
||||
await driver.clickElement({ text: 'Create Token', tag: 'button' });
|
||||
windowHandles = await driver.waitUntilXWindowHandles(3);
|
||||
|
||||
const popup = windowHandles[2];
|
||||
popup = windowHandles[2];
|
||||
await driver.switchToWindow(popup);
|
||||
await driver.delay(regularDelayMs);
|
||||
await driver.clickElement({ text: 'Edit', tag: 'button' }, 10000);
|
||||
|
251
test/e2e/tests/navigate-transactions.spec.js
Normal file
251
test/e2e/tests/navigate-transactions.spec.js
Normal file
@ -0,0 +1,251 @@
|
||||
const { strict: assert } = require('assert');
|
||||
const { withFixtures } = require('../helpers');
|
||||
|
||||
describe('Navigate transactions', function () {
|
||||
const ganacheOptions = {
|
||||
accounts: [
|
||||
{
|
||||
secretKey:
|
||||
'0x7C9529A67102755B7E6102D6D950AC5D5863C98713805CEC576B945B15B71EAC',
|
||||
balance: 25000000000000000000,
|
||||
},
|
||||
],
|
||||
};
|
||||
it('should navigate the unapproved transactions', async function () {
|
||||
await withFixtures(
|
||||
{
|
||||
dapp: true,
|
||||
fixtures: 'navigate-transactions',
|
||||
ganacheOptions,
|
||||
title: this.test.title,
|
||||
},
|
||||
async ({ driver }) => {
|
||||
await driver.navigate();
|
||||
await driver.fill('#password', 'correct horse battery staple');
|
||||
await driver.press('#password', driver.Key.ENTER);
|
||||
|
||||
// navigate transactions
|
||||
await driver.clickElement('[data-testid="next-page"]');
|
||||
let navigationElement = await driver.findElement(
|
||||
'.confirm-page-container-navigation',
|
||||
);
|
||||
let navigationText = await navigationElement.getText();
|
||||
assert.equal(
|
||||
navigationText.includes('2 of 4'),
|
||||
true,
|
||||
'changed transaction right',
|
||||
);
|
||||
await driver.clickElement('[data-testid="next-page"]');
|
||||
navigationElement = await driver.findElement(
|
||||
'.confirm-page-container-navigation',
|
||||
);
|
||||
navigationText = await navigationElement.getText();
|
||||
assert.equal(
|
||||
navigationText.includes('3 of 4'),
|
||||
true,
|
||||
'changed transaction right',
|
||||
);
|
||||
await driver.clickElement('[data-testid="next-page"]');
|
||||
navigationElement = await driver.findElement(
|
||||
'.confirm-page-container-navigation',
|
||||
);
|
||||
navigationText = await navigationElement.getText();
|
||||
assert.equal(
|
||||
navigationText.includes('4 of 4'),
|
||||
true,
|
||||
'changed transaction right',
|
||||
);
|
||||
await driver.clickElement('[data-testid="first-page"]');
|
||||
navigationElement = await driver.findElement(
|
||||
'.confirm-page-container-navigation',
|
||||
);
|
||||
navigationText = await navigationElement.getText();
|
||||
assert.equal(
|
||||
navigationText.includes('1 of 4'),
|
||||
true,
|
||||
'navigate to first transaction',
|
||||
);
|
||||
await driver.clickElement('[data-testid="last-page"]');
|
||||
navigationElement = await driver.findElement(
|
||||
'.confirm-page-container-navigation',
|
||||
);
|
||||
navigationText = await navigationElement.getText();
|
||||
assert.equal(
|
||||
navigationText.includes('4 of 4'),
|
||||
true,
|
||||
'navigate to last transaction',
|
||||
);
|
||||
await driver.clickElement('[data-testid="previous-page"]');
|
||||
navigationElement = await driver.findElement(
|
||||
'.confirm-page-container-navigation',
|
||||
);
|
||||
navigationText = await navigationElement.getText();
|
||||
assert.equal(
|
||||
navigationText.includes('3 of 4'),
|
||||
true,
|
||||
'changed transaction left',
|
||||
);
|
||||
await driver.clickElement('[data-testid="previous-page"]');
|
||||
navigationElement = await driver.findElement(
|
||||
'.confirm-page-container-navigation',
|
||||
);
|
||||
navigationText = await navigationElement.getText();
|
||||
assert.equal(
|
||||
navigationText.includes('2 of 4'),
|
||||
true,
|
||||
'changed transaction left',
|
||||
);
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
it('should add a transaction while the confirm page is in focus', async function () {
|
||||
await withFixtures(
|
||||
{
|
||||
dapp: true,
|
||||
fixtures: 'navigate-transactions',
|
||||
ganacheOptions,
|
||||
title: this.test.title,
|
||||
},
|
||||
async ({ driver }) => {
|
||||
await driver.navigate();
|
||||
await driver.fill('#password', 'correct horse battery staple');
|
||||
await driver.press('#password', driver.Key.ENTER);
|
||||
|
||||
await driver.clickElement('[data-testid="next-page"]');
|
||||
let navigationElement = await driver.findElement(
|
||||
'.confirm-page-container-navigation',
|
||||
);
|
||||
let navigationText = await navigationElement.getText();
|
||||
assert.equal(
|
||||
navigationText.includes('2 of 4'),
|
||||
true,
|
||||
'second transaction in focus',
|
||||
);
|
||||
|
||||
// connects the dapp
|
||||
await driver.openNewPage('http://127.0.0.1:8080/');
|
||||
await driver.clickElement({ text: 'Connect', tag: 'button' });
|
||||
await driver.waitUntilXWindowHandles(3);
|
||||
const windowHandles = await driver.getAllWindowHandles();
|
||||
const extension = windowHandles[0];
|
||||
const dapp = await driver.switchToWindowWithTitle(
|
||||
'E2E Test Dapp',
|
||||
windowHandles,
|
||||
);
|
||||
const popup = windowHandles.find(
|
||||
(handle) => handle !== extension && handle !== dapp,
|
||||
);
|
||||
await driver.switchToWindow(popup);
|
||||
await driver.clickElement({ text: 'Next', tag: 'button' });
|
||||
await driver.clickElement({ text: 'Connect', tag: 'button' });
|
||||
|
||||
// add transaction
|
||||
await driver.switchToWindow(dapp);
|
||||
await driver.clickElement({ text: 'Send', tag: 'button' });
|
||||
await driver.switchToWindow(extension);
|
||||
navigationElement = await driver.waitForSelector(
|
||||
{
|
||||
css: '.confirm-page-container-navigation',
|
||||
text: '2 of 5',
|
||||
},
|
||||
{ timeout: 10000 },
|
||||
);
|
||||
navigationText = await navigationElement.getText();
|
||||
assert.equal(
|
||||
navigationText.includes('2 of 5'),
|
||||
true,
|
||||
'correct (same) transaction in focus',
|
||||
);
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
it('should reject and remove an unapproved transaction', async function () {
|
||||
await withFixtures(
|
||||
{
|
||||
dapp: true,
|
||||
fixtures: 'navigate-transactions',
|
||||
ganacheOptions,
|
||||
title: this.test.title,
|
||||
},
|
||||
async ({ driver }) => {
|
||||
await driver.navigate();
|
||||
await driver.fill('#password', 'correct horse battery staple');
|
||||
await driver.press('#password', driver.Key.ENTER);
|
||||
|
||||
// reject transaction
|
||||
await driver.clickElement({ text: 'Reject', tag: 'button' });
|
||||
const navigationElement = await driver.waitForSelector(
|
||||
{
|
||||
css: '.confirm-page-container-navigation',
|
||||
text: '1 of 3',
|
||||
},
|
||||
{ timeout: 10000 },
|
||||
);
|
||||
const navigationText = await navigationElement.getText();
|
||||
assert.equal(
|
||||
navigationText.includes('1 of 3'),
|
||||
true,
|
||||
'transaction rejected',
|
||||
);
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
it('should confirm and remove an unapproved transaction', async function () {
|
||||
await withFixtures(
|
||||
{
|
||||
dapp: true,
|
||||
fixtures: 'navigate-transactions',
|
||||
ganacheOptions,
|
||||
title: this.test.title,
|
||||
},
|
||||
async ({ driver }) => {
|
||||
await driver.navigate();
|
||||
await driver.fill('#password', 'correct horse battery staple');
|
||||
await driver.press('#password', driver.Key.ENTER);
|
||||
|
||||
// confirm transaction
|
||||
await driver.clickElement({ text: 'Confirm', tag: 'button' });
|
||||
const navigationElement = await driver.waitForSelector(
|
||||
{
|
||||
css: '.confirm-page-container-navigation',
|
||||
text: '1 of 3',
|
||||
},
|
||||
{ timeout: 10000 },
|
||||
);
|
||||
const navigationText = await navigationElement.getText();
|
||||
assert.equal(
|
||||
navigationText.includes('1 of 3'),
|
||||
true,
|
||||
'transaction confirmed',
|
||||
);
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
it('should reject and remove all unapproved transactions', async function () {
|
||||
await withFixtures(
|
||||
{
|
||||
dapp: true,
|
||||
fixtures: 'navigate-transactions',
|
||||
ganacheOptions,
|
||||
title: this.test.title,
|
||||
},
|
||||
async ({ driver }) => {
|
||||
await driver.navigate();
|
||||
await driver.fill('#password', 'correct horse battery staple');
|
||||
await driver.press('#password', driver.Key.ENTER);
|
||||
|
||||
// reject transactions
|
||||
await driver.clickElement({ text: 'Reject 4', tag: 'a' });
|
||||
await driver.clickElement({ text: 'Reject All', tag: 'button' });
|
||||
const balance = await driver.findElement(
|
||||
'[data-testid="eth-overview__primary-currency"]',
|
||||
);
|
||||
assert.ok(/^25\sETH$/u.test(await balance.getText()));
|
||||
},
|
||||
);
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user