Skip to content

Commit

Permalink
Fix typo in Permission word
Browse files Browse the repository at this point in the history
  • Loading branch information
rafal2228 authored and duckception committed Oct 18, 2023
1 parent 5ecfd64 commit d5d3834
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 35 deletions.
4 changes: 2 additions & 2 deletions commands/metamask.js
Original file line number Diff line number Diff line change
Expand Up @@ -1348,7 +1348,7 @@ const metamask = {
);
return true;
},
async confirmPermisionToApproveAll() {
async confirmPermissionToApproveAll() {
const notificationPage = await playwright.switchToMetamaskNotification();
await playwright.waitAndClick(
notificationPageElements.allowToSpendButton,
Expand All @@ -1361,7 +1361,7 @@ const metamask = {
);
return true;
},
async rejectPermisionToApproveAll() {
async rejectPermissionToApproveAll() {
const notificationPage = await playwright.switchToMetamaskNotification();
await playwright.waitAndClick(
notificationPageElements.allowToSpendButton,
Expand Down
30 changes: 18 additions & 12 deletions docs/synpress-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ getMetamaskWalletAddress(): Chainable<Subject>;

#### `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(
Expand All @@ -142,15 +143,17 @@ 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<Subject>;
```

#### `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(
Expand All @@ -170,15 +173,17 @@ 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<Subject>;
```

#### `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(
Expand Down Expand Up @@ -324,20 +329,20 @@ Confirm metamask permission to spend asset.
confirmMetamaskPermissionToSpend(spendLimit?: string): Chainable<Subject>;
```

#### `cy.confirmMetamaskPermisionToApproveAll()`
#### `cy.confirmMetamaskPermissionToApproveAll()`

Confirm metamask permission to access all elements (example: collectibles).

```ts
confirmMetamaskPermisionToApproveAll(): Chainable<Subject>;
confirmMetamaskPermissionToApproveAll(): Chainable<Subject>;
```

#### `cy.rejectMetamaskPermisionToApproveAll()`
#### `cy.rejectMetamaskPermissionToApproveAll()`

Reject metamask permission to access all elements (example: collectibles).

```ts
rejectMetamaskPermisionToApproveAll(): Chainable<Subject>;
rejectMetamaskPermissionToApproveAll(): Chainable<Subject>;
```

#### `cy.rejectMetamaskPermissionToSpend()`
Expand Down Expand Up @@ -370,7 +375,8 @@ confirmMetamaskTransaction(gasConfig?: object | string): Chainable<Subject>;

#### `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<Subject>;
Expand All @@ -386,7 +392,8 @@ rejectMetamaskTransaction(): Chainable<Subject>;

#### `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<Subject>;
Expand Down Expand Up @@ -514,4 +521,3 @@ isWithinViewport(
viewportHeight: number,
): Chainable<Subject>;
```

5 changes: 3 additions & 2 deletions plugins/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down
22 changes: 11 additions & 11 deletions support/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,15 +278,15 @@ declare namespace Cypress {
/**
* Confirm metamask permission to access all elements (example: collectibles)
* @example
* cy.confirmMetamaskPermisionToApproveAll()
* cy.confirmMetamaskPermissionToApproveAll()
*/
confirmMetamaskPermisionToApproveAll(): Chainable<boolean>;
confirmMetamaskPermissionToApproveAll(): Chainable<boolean>;
/**
* Reject metamask permission to access all elements (example: collectibles)
* @example
* cy.rejectMetamaskPermisionToApproveAll()
* cy.rejectMetamaskPermissionToApproveAll()
*/
rejectMetamaskPermisionToApproveAll(): Chainable<boolean>;
rejectMetamaskPermissionToApproveAll(): Chainable<boolean>;
/**
* Reject metamask permission to spend asset
* @example
Expand Down Expand Up @@ -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'
Expand Down
8 changes: 4 additions & 4 deletions tests/e2e/specs/metamask-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
});
Expand Down

0 comments on commit d5d3834

Please sign in to comment.