From d5d38347218a3b308c7a8bc33cbc4da580c3d16d Mon Sep 17 00:00:00 2001 From: Rafal2228 Date: Tue, 17 Oct 2023 14:21:40 +0200 Subject: [PATCH] Fix typo in Permission word --- commands/metamask.js | 4 ++-- docs/synpress-commands.md | 30 ++++++++++++++++++------------ plugins/index.js | 5 +++-- support/commands.js | 8 ++++---- support/index.d.ts | 22 +++++++++++----------- tests/e2e/specs/metamask-spec.js | 8 ++++---- 6 files changed, 42 insertions(+), 35 deletions(-) diff --git a/commands/metamask.js b/commands/metamask.js index 3b796c48f..c6ac6c517 100644 --- a/commands/metamask.js +++ b/commands/metamask.js @@ -1348,7 +1348,7 @@ const metamask = { ); return true; }, - async confirmPermisionToApproveAll() { + async confirmPermissionToApproveAll() { const notificationPage = await playwright.switchToMetamaskNotification(); await playwright.waitAndClick( notificationPageElements.allowToSpendButton, @@ -1361,7 +1361,7 @@ const metamask = { ); return true; }, - async rejectPermisionToApproveAll() { + async rejectPermissionToApproveAll() { const notificationPage = await playwright.switchToMetamaskNotification(); await playwright.waitAndClick( notificationPageElements.allowToSpendButton, diff --git a/docs/synpress-commands.md b/docs/synpress-commands.md index 408d800aa..b96878732 100644 --- a/docs/synpress-commands.md +++ b/docs/synpress-commands.md @@ -132,7 +132,8 @@ getMetamaskWalletAddress(): Chainable; #### `cy.activateAdvancedGasControlInMetamask()` -Activate ability (in metamask settings) to specify custom gas price and limit while doing transactions in metamask. +Activate ability (in metamask settings) to specify custom gas price and limit +while doing transactions in metamask. ```ts activateAdvancedGasControlInMetamask( @@ -142,7 +143,8 @@ activateAdvancedGasControlInMetamask( #### `cy.activateShowHexDataInMetamask()` -Activate ability (in metamask settings) to show hex data while doing transaction in metamask. +Activate ability (in metamask settings) to show hex data while doing transaction +in metamask. ```ts activateShowHexDataInMetamask(skipSetup?: boolean): Chainable; @@ -150,7 +152,8 @@ activateShowHexDataInMetamask(skipSetup?: boolean): Chainable; #### `cy.activateTestnetConversionInMetamask()` -Activate ability (in metamask settings) to show fiat conversions on testnets in metamask. +Activate ability (in metamask settings) to show fiat conversions on testnets in +metamask. ```ts activateTestnetConversionInMetamask( @@ -170,7 +173,8 @@ activateShowTestnetNetworksInMetamask( #### `cy.activateCustomNonceInMetamask()` -Activate ability (in metamask settings) to specify custom nonce while doing transactions in metamask. +Activate ability (in metamask settings) to specify custom nonce while doing +transactions in metamask. ```ts activateCustomNonceInMetamask(skipSetup?: boolean): Chainable; @@ -178,7 +182,8 @@ activateCustomNonceInMetamask(skipSetup?: boolean): Chainable; #### `cy.activateDismissBackupReminderInMetamask()` -Activate ability (in metamask settings) to dismiss secret recovery phrase reminder in metamask. +Activate ability (in metamask settings) to dismiss secret recovery phrase +reminder in metamask. ```ts activateDismissBackupReminderInMetamask( @@ -324,20 +329,20 @@ Confirm metamask permission to spend asset. confirmMetamaskPermissionToSpend(spendLimit?: string): Chainable; ``` -#### `cy.confirmMetamaskPermisionToApproveAll()` +#### `cy.confirmMetamaskPermissionToApproveAll()` Confirm metamask permission to access all elements (example: collectibles). ```ts -confirmMetamaskPermisionToApproveAll(): Chainable; +confirmMetamaskPermissionToApproveAll(): Chainable; ``` -#### `cy.rejectMetamaskPermisionToApproveAll()` +#### `cy.rejectMetamaskPermissionToApproveAll()` Reject metamask permission to access all elements (example: collectibles). ```ts -rejectMetamaskPermisionToApproveAll(): Chainable; +rejectMetamaskPermissionToApproveAll(): Chainable; ``` #### `cy.rejectMetamaskPermissionToSpend()` @@ -370,7 +375,8 @@ confirmMetamaskTransaction(gasConfig?: object | string): Chainable; #### `cy.confirmMetamaskTransactionAndWaitForMining()` -Confirm metamask transaction (auto-detects eip-1559 and legacy transactions) and wait for ALL pending transactions to be mined. +Confirm metamask transaction (auto-detects eip-1559 and legacy transactions) and +wait for ALL pending transactions to be mined. ```ts confirmMetamaskTransactionAndWaitForMining(gasConfig?: object | string): Chainable; @@ -386,7 +392,8 @@ rejectMetamaskTransaction(): Chainable; #### `cy.openMetamaskTransactionDetails()` -Open metamask transaction details based on the index of the transaction in the list on the activity tab. +Open metamask transaction details based on the index of the transaction in the +list on the activity tab. ```ts openMetamaskTransactionDetails(txIndex: number): Chainable; @@ -514,4 +521,3 @@ isWithinViewport( viewportHeight: number, ): Chainable; ``` - diff --git a/plugins/index.js b/plugins/index.js index 51fe4965b..6d24f0dd3 100644 --- a/plugins/index.js +++ b/plugins/index.js @@ -103,8 +103,9 @@ module.exports = (on, config) => { rejectMetamaskAddToken: metamask.rejectAddToken, confirmMetamaskPermissionToSpend: metamask.confirmPermissionToSpend, rejectMetamaskPermissionToSpend: metamask.rejectPermissionToSpend, - confirmMetamaskPermisionToApproveAll: metamask.confirmPermisionToApproveAll, - rejectMetamaskPermisionToApproveAll: metamask.rejectPermisionToApproveAll, + confirmMetamaskPermissionToApproveAll: + metamask.confirmPermissionToApproveAll, + rejectMetamaskPermissionToApproveAll: metamask.rejectPermissionToApproveAll, acceptMetamaskAccess: metamask.acceptAccess, rejectMetamaskAccess: metamask.rejectAccess, confirmMetamaskTransaction: metamask.confirmTransaction, diff --git a/support/commands.js b/support/commands.js index 73869e3fc..8c3fc8590 100644 --- a/support/commands.js +++ b/support/commands.js @@ -215,12 +215,12 @@ Cypress.Commands.add('closeMetamaskTransactionDetailsPopup', () => { return cy.task('closeMetamaskTransactionDetailsPopup'); }); -Cypress.Commands.add('rejectMetamaskPermisionToApproveAll', () => { - return cy.task('rejectMetamaskPermisionToApproveAll'); +Cypress.Commands.add('rejectMetamaskPermissionToApproveAll', () => { + return cy.task('rejectMetamaskPermissionToApproveAll'); }); -Cypress.Commands.add('confirmMetamaskPermisionToApproveAll', () => { - return cy.task('confirmMetamaskPermisionToApproveAll'); +Cypress.Commands.add('confirmMetamaskPermissionToApproveAll', () => { + return cy.task('confirmMetamaskPermissionToApproveAll'); }); Cypress.Commands.add('allowMetamaskToAddNetwork', waitForEvent => { diff --git a/support/index.d.ts b/support/index.d.ts index 804e32d54..c699e4e54 100644 --- a/support/index.d.ts +++ b/support/index.d.ts @@ -278,15 +278,15 @@ declare namespace Cypress { /** * Confirm metamask permission to access all elements (example: collectibles) * @example - * cy.confirmMetamaskPermisionToApproveAll() + * cy.confirmMetamaskPermissionToApproveAll() */ - confirmMetamaskPermisionToApproveAll(): Chainable; + confirmMetamaskPermissionToApproveAll(): Chainable; /** * Reject metamask permission to access all elements (example: collectibles) * @example - * cy.rejectMetamaskPermisionToApproveAll() + * cy.rejectMetamaskPermissionToApproveAll() */ - rejectMetamaskPermisionToApproveAll(): Chainable; + rejectMetamaskPermissionToApproveAll(): Chainable; /** * Reject metamask permission to spend asset * @example @@ -345,14 +345,14 @@ declare namespace Cypress { confirmMetamaskTransactionAndWaitForMining( gasConfig?: | { - gasLimit?: number; - baseFee?: number; - priorityFee?: number; - } + gasLimit?: number; + baseFee?: number; + priorityFee?: number; + } | { - gasLimit?: number; - gasPrice?: number; - } + gasLimit?: number; + gasPrice?: number; + } | 'low' | 'market' | 'aggressive' diff --git a/tests/e2e/specs/metamask-spec.js b/tests/e2e/specs/metamask-spec.js index 3b00ae2a2..5e11ab0d7 100644 --- a/tests/e2e/specs/metamask-spec.js +++ b/tests/e2e/specs/metamask-spec.js @@ -128,19 +128,19 @@ describe('Metamask', () => { cy.changeMetamaskNetwork('sepolia'); } }); - it(`rejectMetamaskPermisionToApproveAll should reject permission to approve all NFTs upon warning`, () => { + it(`rejectMetamaskPermissionToApproveAll should reject permission to approve all NFTs upon warning`, () => { cy.get('#deployNFTsButton').click(); cy.confirmMetamaskTransaction(); cy.get('#mintButton').click(); cy.confirmMetamaskTransaction(); cy.get('#setApprovalForAllButton').click(); - cy.rejectMetamaskPermisionToApproveAll().then(rejected => { + cy.rejectMetamaskPermissionToApproveAll().then(rejected => { expect(rejected).to.be.true; }); }); - it(`confirmMetamaskPermisionToApproveAll should confirm permission to approve all NFTs`, () => { + it(`confirmMetamaskPermissionToApproveAll should confirm permission to approve all NFTs`, () => { cy.get('#setApprovalForAllButton').click(); - cy.confirmMetamaskPermisionToApproveAll().then(confirmed => { + cy.confirmMetamaskPermissionToApproveAll().then(confirmed => { expect(confirmed).to.be.true; }); });