Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Improve test for signatures #27532

Merged
merged 9 commits into from
Nov 14, 2024
11 changes: 6 additions & 5 deletions test/e2e/tests/confirmations/signatures/personal-sign.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,18 @@ describe('Confirmation Signature - Personal Sign @no-mmi', function (this: Suite

await copyAddressAndPasteWalletAddress(driver);
await assertPastedAddress(driver);
await assertAccountDetailsMetrics(
driver,
mockedEndpoints as MockedEndpoint[],
'personal_sign',
);
await driver.switchToWindowWithTitle(WINDOW_TITLES.Dialog);
await assertInfoValues(driver);

await driver.clickElement('[data-testid="confirm-footer-button"]');

await assertVerifiedPersonalMessage(driver, publicAddress);

await assertAccountDetailsMetrics(
driver,
mockedEndpoints as MockedEndpoint[],
'personal_sign',
);
await assertSignatureConfirmedMetrics({
driver,
mockedEndpoints: mockedEndpoints as MockedEndpoint[],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,17 @@ describe('Confirmation Signature - Sign Typed Data V3 @no-mmi', function (this:

await copyAddressAndPasteWalletAddress(driver);
await assertPastedAddress(driver);
await driver.switchToWindowWithTitle(WINDOW_TITLES.Dialog);
await driver.delay(1000);

await assertInfoValues(driver);
await scrollAndConfirmAndAssertConfirm(driver);

await assertAccountDetailsMetrics(
driver,
mockedEndpoints as MockedEndpoint[],
'eth_signTypedData_v3',
);
await driver.switchToWindowWithTitle(WINDOW_TITLES.Dialog);

await assertInfoValues(driver);
await scrollAndConfirmAndAssertConfirm(driver);
await assertSignatureConfirmedMetrics({
driver,
mockedEndpoints: mockedEndpoints as MockedEndpoint[],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,16 @@ describe('Confirmation Signature - Sign Typed Data @no-mmi', function (this: Sui

await copyAddressAndPasteWalletAddress(driver);
await assertPastedAddress(driver);
await assertAccountDetailsMetrics(
driver,
mockedEndpoints as MockedEndpoint[],
'eth_signTypedData',
);

await assertInfoValues(driver);

await driver.clickElement('[data-testid="confirm-footer-button"]');
await driver.delay(1000);

await assertAccountDetailsMetrics(
driver,
mockedEndpoints as MockedEndpoint[],
'eth_signTypedData',
);
await assertSignatureConfirmedMetrics({
driver,
mockedEndpoints: mockedEndpoints as MockedEndpoint[],
Expand Down
11 changes: 6 additions & 5 deletions test/e2e/tests/confirmations/signatures/siwe.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ describe('Confirmation Signature - SIWE @no-mmi', function (this: Suite) {

await copyAddressAndPasteWalletAddress(driver);
await assertPastedAddress(driver);
await assertAccountDetailsMetrics(
driver,
mockedEndpoints as MockedEndpoint[],
'personal_sign',
);
await driver.switchToWindowWithTitle(WINDOW_TITLES.Dialog);
await assertInfoValues(driver);
await scrollAndConfirmAndAssertConfirm(driver);
Expand All @@ -52,6 +47,12 @@ describe('Confirmation Signature - SIWE @no-mmi', function (this: Suite) {
driver,
'0xef8674a92d62a1876624547bdccaef6c67014ae821de18fa910fbff56577a65830f68848585b33d1f4b9ea1c3da1c1b11553b6aabe8446717daf7cd1e38a68271c',
);

await assertAccountDetailsMetrics(
driver,
mockedEndpoints as MockedEndpoint[],
'personal_sign',
);
await assertSignatureConfirmedMetrics({
driver,
mockedEndpoints: mockedEndpoints as MockedEndpoint[],
Expand Down