Skip to content

Commit

Permalink
fix: required parameters
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Mucha <[email protected]>
  • Loading branch information
drptbl committed Oct 18, 2022
1 parent 96a1779 commit 6b6ba28
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions plugins/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,9 @@ module.exports = (on, config) => {
},
setupMetamask: async ({
secretWordsOrPrivateKey,
network = 'goerli',
network,
password,
enableAdvancedSettings = true,
enableAdvancedSettings,
}) => {
if (process.env.NETWORK_NAME) {
network = process.env.NETWORK_NAME;
Expand Down
8 changes: 7 additions & 1 deletion support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,17 @@ Cypress.Commands.add('fetchMetamaskWalletAddress', () => {

Cypress.Commands.add(
'setupMetamask',
(secretWordsOrPrivateKey, network, password = 'Tester@1234') => {
(
secretWordsOrPrivateKey = 'test test test test test test test test test test test junk',
network = 'goerli',
password = 'Tester@1234',
enableAdvancedSettings = true,
) => {
return cy.task('setupMetamask', {
secretWordsOrPrivateKey,
network,
password,
enableAdvancedSettings,
});
},
);
Expand Down
7 changes: 3 additions & 4 deletions support/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,15 +298,14 @@ declare namespace Cypress {
* Run the flow for metamask setup
* @example
* cy.setupMetamask('secret, words, ...', 'goerli', 'password for metamask')
* cy.setupMetamask('secret, words, ...', 'goerli', 'password for metamask', true) // enables advanced settings
* cy.setupMetamask('secret, words, ...', {networkName: 'name', rpcUrl: 'https://url', chainId: 1, symbol: 'ETH', blockExplorer: 'https://url', isTestnet: true}, 'password for metamask')
* cy.setupMetamask('private_key', 'goerli', 'password for metamask')
* cy.setupMetamask('private_key', {networkName: 'name', rpcUrl: 'https://url', chainId: 1, symbol: 'ETH', blockExplorer: 'https://url', isTestnet: true}, 'password for metamask')
*/
setupMetamask(
secretWordsOrPrivateKey: string,
network: string | object,
password: string,
secretWordsOrPrivateKey?: string,
network?: string | object,
password?: string,
enableAdvancedSettings?: boolean,
): Chainable<Subject>;
/**
Expand Down

0 comments on commit 6b6ba28

Please sign in to comment.