-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
88 additions
and
61 deletions.
There are no files selected for viewing
61 changes: 0 additions & 61 deletions
61
e2e/specs/confirmations/signatures-redesigned/personal-sign.spec.js
This file was deleted.
Oops, something went wrong.
88 changes: 88 additions & 0 deletions
88
e2e/specs/confirmations/signatures-redesigned/signatures.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
'use strict'; | ||
import Assertions from '../../../utils/Assertions.js'; | ||
import Browser from '../../../pages/Browser/BrowserView.js'; | ||
import FooterActions from '../../../pages/Browser/Confirmations/FooterActions.js'; | ||
import FixtureBuilder from '../../../fixtures/fixture-builder.js'; | ||
import PageSections from '../../../pages/Browser/Confirmations/PageSections.js'; | ||
import RequestTypes from '../../../pages/Browser/Confirmations/RequestTypes.js'; | ||
import TabBarComponent from '../../../pages/wallet/TabBarComponent.js'; | ||
import TestDApp from '../../../pages/Browser/TestDApp.js'; | ||
import TestHelpers from '../../../helpers.js'; | ||
import { loginToApp } from '../../../viewHelper.js'; | ||
import { | ||
withFixtures, | ||
defaultGanacheOptions, | ||
} from '../../../fixtures/fixture-helper.js'; | ||
import { SmokeConfirmations } from '../../../tags.js'; | ||
|
||
const SIGNATURE_LIST = [ | ||
{ | ||
specName: 'Personal Sign', | ||
testDappBtn: TestDApp.tapPersonalSignButton.bind(TestDApp), | ||
requestType: RequestTypes.PersonalSignRequest, | ||
}, | ||
{ | ||
specName: 'Typed V1 Sign', | ||
testDappBtn: TestDApp.tapTypedSignButton.bind(TestDApp), | ||
requestType: RequestTypes.TypedSignRequest, | ||
}, | ||
{ | ||
specName: 'Typed V3 Sign', | ||
testDappBtn: TestDApp.tapTypedV3SignButton.bind(TestDApp), | ||
requestType: RequestTypes.TypedSignRequest, | ||
}, | ||
{ | ||
specName: 'Typed V3 Sign', | ||
testDappBtn: TestDApp.tapTypedV4SignButton.bind(TestDApp), | ||
requestType: RequestTypes.TypedSignRequest, | ||
}, | ||
]; | ||
|
||
describe(SmokeConfirmations('Personal Sign'), () => { | ||
beforeAll(async () => { | ||
jest.setTimeout(2500000); | ||
await TestHelpers.reverseServerPort(); | ||
}); | ||
|
||
// using for loop here to ensure synchronous execution | ||
for (let index = 0; index < SIGNATURE_LIST.length; index++) { | ||
const { specName, testDappBtn, requestType } = SIGNATURE_LIST[index]; | ||
it(`should sign ${specName} message`, async () => { | ||
await withFixtures( | ||
{ | ||
dapp: true, | ||
fixture: new FixtureBuilder() | ||
.withGanacheNetwork() | ||
.withPermissionControllerConnectedToTestDapp() | ||
.build(), | ||
restartDevice: true, | ||
ganacheOptions: defaultGanacheOptions, | ||
}, | ||
async () => { | ||
await loginToApp(); | ||
|
||
await TabBarComponent.tapBrowser(); | ||
await Browser.navigateToTestDApp(); | ||
|
||
// cancel request | ||
await testDappBtn(); | ||
await Assertions.checkIfVisible(requestType); | ||
await FooterActions.tapCancelButton(); | ||
await Assertions.checkIfNotVisible(requestType); | ||
|
||
await testDappBtn(); | ||
await Assertions.checkIfVisible(requestType); | ||
|
||
// check different sections are visible | ||
await Assertions.checkIfVisible(PageSections.AccountNetworkSection); | ||
await Assertions.checkIfVisible(PageSections.OriginInfoSection); | ||
await Assertions.checkIfVisible(PageSections.MessageSection); | ||
|
||
// confirm request | ||
await FooterActions.tapConfirmButton(); | ||
await Assertions.checkIfNotVisible(requestType); | ||
}, | ||
); | ||
}); | ||
} | ||
}); |