Skip to content

Commit

Permalink
Merge branch 'main' into refactor/3615-reorganize-mutlichain-e2e-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
EtherWizard33 authored Dec 18, 2024
2 parents 0afdb0f + 9054f70 commit b41f226
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 1 deletion.
11 changes: 11 additions & 0 deletions e2e/pages/Browser/TestDApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ class TestDApp {
TestDappSelectorsWebIDs.SIGN_TYPE_DATA_V4,
);
}
get ethereumSignButton() {
return Matchers.getElementByWebID(
BrowserViewSelectorsIDs.BROWSER_WEBVIEW_ID,
TestDappSelectorsWebIDs.ETHEREUM_SIGN,
);
}
// This taps on the transfer tokens button under the "SEND TOKENS section"
get nftTransferFromTokensButton() {
return Matchers.getElementByWebID(
Expand Down Expand Up @@ -124,6 +130,11 @@ class TestDApp {
async tapTypedV4SignButton() {
await this.tapButton(this.signTypedDataV4Button);
}

async tapEthereumSignButton() {
await this.tapButton(this.ethereumSignButton);
}

async tapERC20TransferButton() {
await this.tapButton(this.erc20TransferTokensButton);
}
Expand Down
2 changes: 1 addition & 1 deletion e2e/selectors/Browser/TestDapp.selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ export const TestDappSelectorsWebIDs = {
SIGN_TYPE_DATA: 'signTypedData',
SIGN_TYPE_DATA_V3: 'signTypedDataV3',
SIGN_TYPE_DATA_V4: 'signTypedDataV4',
SIWE: 'siwe',
ETHEREUM_SIGN: 'siwe',
ADD_TOKENS_TO_WALLET_BUTTON: 'watchAssets',
};
51 changes: 51 additions & 0 deletions e2e/specs/confirmations/signatures/ethereum-sign.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
'use strict';
import Browser from '../../../pages/Browser/BrowserView';
import TabBarComponent from '../../../pages/wallet/TabBarComponent';
import { loginToApp } from '../../../viewHelper';
import SigningBottomSheet from '../../../pages/Browser/SigningBottomSheet';
import TestDApp from '../../../pages/Browser/TestDApp';
import FixtureBuilder from '../../../fixtures/fixture-builder';
import {
withFixtures,
defaultGanacheOptions,
} from '../../../fixtures/fixture-helper';
import { SmokeConfirmations } from '../../../tags';
import TestHelpers from '../../../helpers';
import Assertions from '../../../utils/Assertions';

describe(SmokeConfirmations('Ethereum Sign'), () => {
beforeAll(async () => {
jest.setTimeout(2500000);
await TestHelpers.reverseServerPort();
});

it('Sign in with Ethereum', async () => {
await withFixtures(
{
dapp: true,
fixture: new FixtureBuilder()
.withGanacheNetwork()
.withPermissionControllerConnectedToTestDapp()
.build(),
restartDevice: true,
ganacheOptions: defaultGanacheOptions,
},
async () => {
await loginToApp();

await TabBarComponent.tapBrowser();
await Browser.navigateToTestDApp();

await TestDApp.tapEthereumSignButton();
await Assertions.checkIfVisible(SigningBottomSheet.personalRequest);
await SigningBottomSheet.tapCancelButton();
await Assertions.checkIfNotVisible(SigningBottomSheet.personalRequest);

await TestDApp.tapEthereumSignButton();
await Assertions.checkIfVisible(SigningBottomSheet.personalRequest);
await SigningBottomSheet.tapSignButton();
await Assertions.checkIfNotVisible(SigningBottomSheet.personalRequest);
},
);
});
});

0 comments on commit b41f226

Please sign in to comment.