-
Notifications
You must be signed in to change notification settings - Fork 5.2k
test: fix stx opt-in opt-out fixture #33264
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
base: main
Are you sure you want to change the base?
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
@@ -845,20 +845,14 @@ class FixtureBuilder { | |||
}); | |||
} | |||
|
|||
withPreferencesControllerSmartTransactionsOptedIn() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need this method as the opt in status is already in the default fixture, or it is set to true by default in the onboarding case
/** | ||
* @deprecated this method should not be used, as the `smartTransactionsOptInStatus` value is overridden by the migration 135 | ||
* Use the step by step flow to disable this setting. | ||
*/ | ||
withPreferencesControllerSmartTransactionsOptedOut() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ leaving the method with the @deprecated
info, so this is not used.
I could have deleted it, but I'm afraid this can be re-introduced again, so leaving this here for a while before removing it completely.
Side: removed the tokenNetworkFilter
as it's irrelevant here
@@ -26,7 +26,6 @@ describe('Gas Fee Tokens - Smart Transactions', function (this: Suite) { | |||
dapp: true, | |||
fixtures: new FixtureBuilder({ inputChainId: CHAIN_IDS.MAINNET }) | |||
.withPermissionControllerConnectedToTestDapp() | |||
.withPreferencesControllerSmartTransactionsOptedIn() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is already true by default
@@ -84,7 +83,6 @@ describe('Gas Fee Tokens - Smart Transactions', function (this: Suite) { | |||
dapp: true, | |||
fixtures: new FixtureBuilder({ inputChainId: CHAIN_IDS.MAINNET }) | |||
.withPermissionControllerConnectedToTestDapp() | |||
.withPreferencesControllerSmartTransactionsOptedIn() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is already true by default
@@ -27,7 +27,6 @@ async function withFixturesForSmartTransactions( | |||
{ | |||
fixtures: new FixtureBuilder() | |||
.withPermissionControllerConnectedToTestDapp() | |||
.withPreferencesControllerSmartTransactionsOptedIn() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is already true by default
Builds ready [1e55823]
UI Startup Metrics (1199 ± 60 ms)
Benchmark value 46 exceeds gate value 32 for chrome webpack home mean setupStore Benchmark value 2501 exceeds gate value 2454 for chrome webpack home p95 uiStartup Benchmark value 310 exceeds gate value 65 for chrome webpack home p95 setupStore Benchmark value 1635 exceeds gate value 1615 for firefox webpack home mean uiStartup Benchmark value 1402 exceeds gate value 1380 for firefox webpack home mean load Benchmark value 1402 exceeds gate value 1380 for firefox webpack home mean domContentLoaded Benchmark value 45 exceeds gate value 38 for firefox webpack home mean firstReactRender Benchmark value 1381 exceeds gate value 1360 for firefox webpack home mean loadScripts Benchmark value 2096 exceeds gate value 1935 for firefox webpack home p95 uiStartup Benchmark value 1693 exceeds gate value 1660 for firefox webpack home p95 load Benchmark value 1693 exceeds gate value 1660 for firefox webpack home p95 domContentLoaded Benchmark value 53 exceeds gate value 50 for firefox webpack home p95 firstReactRender Benchmark value 1672 exceeds gate value 1630 for firefox webpack home p95 loadScripts Sum of mean exceeds: 106ms | Sum of p95 exceeds: 570ms Sum of all benchmark exceeds: 676ms Bundle size diffs [🚀 Bundle size reduced!]
|
Builds ready [196b546]
UI Startup Metrics (1193 ± 54 ms)
Benchmark value 39 exceeds gate value 32 for chrome webpack home mean setupStore Benchmark value 302 exceeds gate value 65 for chrome webpack home p95 setupStore Benchmark value 43 exceeds gate value 38 for firefox webpack home mean firstReactRender Sum of mean exceeds: 12ms | Sum of p95 exceeds: 242ms Sum of all benchmark exceeds: 254ms Bundle size diffs [🚀 Bundle size reduced!]
|
@@ -116,6 +116,21 @@ describe('Switch Ethereum Chain for two dapps', function () { | |||
async ({ driver }) => { | |||
await unlockWallet(driver); | |||
|
|||
// disable smart transactions step by step | |||
// we cannot use fixtures because migration 135 overrides the opt in value to true | |||
await driver.clickElement( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe nice to use the toggleSmartTransactions
function from the already existing page test/e2e/page-objects/pages/settings/advanced-settings.ts
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch. I haven't used any page object related methods in this spec, because this test is not migrated yet and we have a weak validation for "knowing" which tests are using page objects, by checking imports.
If I added this method, it would "seem" as we are using page objects here, but that won't be accurate.
That's why I continued the legacy approach from the test, and once this is migrated altogether, the validation will accurately show that's a migrated test.
We could improve the logic for that validation in a separate PR, to handle cases where "mixed-approaches" are made
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ Adding the flow for the spec using page objects only (eip7702 one), and we can use this flow to this specific legacy test once that is migrated
Builds ready [7425610]
UI Startup Metrics (1216 ± 71 ms)
Benchmark value 37 exceeds gate value 32 for chrome webpack home mean setupStore Benchmark value 2460 exceeds gate value 2454 for chrome webpack home p95 uiStartup Benchmark value 259 exceeds gate value 65 for chrome webpack home p95 setupStore Benchmark value 40 exceeds gate value 38 for firefox webpack home mean firstReactRender Sum of mean exceeds: 7ms | Sum of p95 exceeds: 207ms Sum of all benchmark exceeds: 214ms Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Description
This PR does 2 things:
withPreferencesControllerSmartTransactionsOptedIn
from fixtures, as this value is always true by default (check the value default fixture, and for the onboarding fixture, there is logic in the app which sets this to true)withPreferencesControllerSmartTransactionsOptedOut
from fixtures, as this value is always overridden by the migration 135 which will set it totrue
if the value isfalse
.After that, I've updated the e2e accordingly.
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/MMQA-605?atlOrigin=eyJpIjoiNDEyNWNjY2I4ZmJhNDhjNDhhMDRiYjk1NmJlYWJlMGEiLCJwIjoiaiJ9
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist