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

ci: create ci workflow for multichain flow #12425

Merged
merged 40 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
d9c84f6
updated failing test for multichain on feature flag removal
NidhiKJha Nov 22, 2024
5d57f8d
remove multichain variables in code
cortisiko Nov 25, 2024
de59121
enable MC permission system
cortisiko Nov 25, 2024
d15f677
set correct env variable path
cortisiko Nov 25, 2024
1c2a335
run 1 e2e test against the new workflow for MC
cortisiko Nov 25, 2024
4f95e79
trigger new workflow
cortisiko Nov 25, 2024
6311660
fix path
cortisiko Nov 25, 2024
997ad50
these tests should fail because multichain is off and we are testing …
cortisiko Nov 26, 2024
83b3c3f
enable it again
cortisiko Nov 26, 2024
c9cecd1
comment out env variables
cortisiko Nov 26, 2024
dbbd864
Revert "comment out env variables"
cortisiko Nov 26, 2024
0b881f1
create qa builds with flag turned off
cortisiko Nov 26, 2024
2de5a8c
kick off builds
cortisiko Nov 26, 2024
8c21fb1
turn on flag now
cortisiko Nov 26, 2024
6839ed0
added e2e tests for chain permissions
NidhiKJha Nov 26, 2024
5cc6df3
run e2e
cortisiko Nov 26, 2024
beeb2fb
kick off new multichain tests
cortisiko Nov 26, 2024
4be13bb
update test to have SmokeCore tag for now
cortisiko Nov 26, 2024
64a81f3
use env variables correctly
cortisiko Nov 26, 2024
9163dc3
fix e2e and run on bitrise with variant on
cortisiko Nov 26, 2024
9159396
make turning on the mc flag for e2e better
cortisiko Nov 26, 2024
18cc015
test multichain flag off
cortisiko Nov 26, 2024
6672d5a
Merge branch 'test-multichain-e2e-ci-workflow' into test-multichain-e…
cortisiko Nov 26, 2024
2c8e606
Revert "test multichain flag off"
cortisiko Nov 26, 2024
7670dc4
test: update snapshots to match the new added test ids
EtherWizard33 Nov 27, 2024
f4fa456
Merge branch 'test-multichain-e2e-ci-workflow' into test-multichain-e…
EtherWizard33 Nov 27, 2024
80a3b13
feat: add e2e test to revoke one chain permission (wip)
EtherWizard33 Nov 27, 2024
d78df38
feat: Test multichain e2e ci workflow tests (#12441)
NidhiKJha Nov 27, 2024
0c27a0d
Merge branch 'main' into test-multichain-e2e-ci-workflow
cortisiko Nov 27, 2024
44c073c
test: add e2e test that revokes a network permission
EtherWizard33 Nov 28, 2024
062b329
Merge branch 'test-multichain-e2e-ci-workflow' into test-multichain-e…
EtherWizard33 Nov 28, 2024
928e58a
style: lint
EtherWizard33 Nov 28, 2024
eec8e97
test: update snapshot after updated test ID
EtherWizard33 Nov 28, 2024
96f46ca
chore: bitrise toggle chain permissions feature flag on in bitrise co…
EtherWizard33 Nov 28, 2024
9fec95c
Enable mc flag off regression (#12475)
cortisiko Nov 28, 2024
5e17919
test: update snapshots to take into consideration added test ids
EtherWizard33 Nov 28, 2024
d8e6c45
test: create new mc test (#12477)
cortisiko Nov 28, 2024
a2b3200
Merge branch 'main' into test-multichain-e2e-ci-workflow
cortisiko Nov 28, 2024
76ffa81
build regression, set mc flag to false
cortisiko Nov 28, 2024
6c51ab1
move portfolio test to quarantine for now. Will follow up with a PR A…
cortisiko Nov 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions app/util/networks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -584,13 +584,12 @@ export const deprecatedGetNetworkId = async () => {
});
};

export const isMultichainVersion1Enabled =
process.env.MM_MULTICHAIN_V1_ENABLED === 'true';
cortisiko marked this conversation as resolved.
Show resolved Hide resolved
export const isPortfolioViewEnabled = process.env.PORTFOLIO_VIEW === 'true';

export const isMultichainVersion1Enabled = process.env.MM_MULTICHAIN_V1_ENABLED;

export const isChainPermissionsFeatureEnabled =
process.env.MM_CHAIN_PERMISSIONS === 'true';
process.env.MM_CHAIN_PERMISSIONS;

export const isPermissionsSettingsV1Enabled =
process.env.MM_PERMISSIONS_SETTINGS_V1_ENABLED === 'true';

export const isPortfolioViewEnabled = process.env.PORTFOLIO_VIEW === 'true';
process.env.MM_PERMISSIONS_SETTINGS_V1_ENABLED;
44 changes: 37 additions & 7 deletions bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ pipelines:
stages:
- create_build_qa_android: {}
- app_upgrade_test_stage: {}
multichain_e2e_pipeline:
stages:
- build_multichain_e2e_ios_android_stage: {}
- run_multichain_e2e_ios_android_stage: {}
# Pipeline for Flask
create_flask_release_builds_pipeline:
stages:
Expand Down Expand Up @@ -130,6 +134,19 @@ stages:
workflows:
- ios_e2e_build: {}
- android_e2e_build: {}
build_multichain_e2e_ios_android_stage:
abort_on_fail: true
envs:
- MM_MULTICHAIN_V1_ENABLED: 'true'
- MM_CHAIN_PERMISSIONS: 'true'
- MM_PERMISSIONS_SETTINGS_V1_ENABLED: 'true'
workflows:
- ios_e2e_build: {}
- android_e2e_build: {}
run_multichain_e2e_ios_android_stage:
workflows:
- run_tag_multichain_ios: {}
- run_tag_multichain_android: {}
run_smoke_e2e_ios_android_stage:
workflows:
- run_ios_api_specs: {}
Expand Down Expand Up @@ -616,7 +633,7 @@ workflows:
- ios_api_specs
run_tag_smoke_core_ios:
envs:
- TEST_SUITE_FOLDER: './e2e/spec/*/**/*'
- TEST_SUITE_FOLDER: './e2e/specs/*/**/*'
- TEST_SUITE_TAG: '.*SmokeCore.*'
after_run:
- ios_e2e_test
Expand All @@ -626,7 +643,23 @@ workflows:
stack: linux-docker-android-22.04
machine_type_id: elite-xl
envs:
- TEST_SUITE_FOLDER: './e2e/spec/*/**/*'
- TEST_SUITE_FOLDER: './e2e/specs/*/**/*'
- TEST_SUITE_TAG: '.*SmokeCore.*'
after_run:
- android_e2e_test
run_tag_multichain_ios:
envs:
- TEST_SUITE_FOLDER: './e2e/specs/multichain/*'
- TEST_SUITE_TAG: '.*SmokeCore.*'
after_run:
- ios_e2e_test
run_tag_multichain_android:
meta:
bitrise.io:
stack: linux-docker-android-22.04
machine_type_id: elite-xl
envs:
- TEST_SUITE_FOLDER: './e2e/specs/multichain/*'
- TEST_SUITE_TAG: '.*SmokeCore.*'
after_run:
- android_e2e_test
Expand Down Expand Up @@ -927,11 +960,6 @@ workflows:
- content: |-
#!/usr/bin/env bash
./scripts/cache/setup-ccache.sh
if [ "$TEST_SUITE" = "Regression" ]; then
TEST_SUITE="Regression"
else
TEST_SUITE="Smoke"
fi
node -v
export METAMASK_ENVIRONMENT='local'
export METAMASK_BUILD_TYPE='main'
Expand Down Expand Up @@ -1674,3 +1702,5 @@ trigger_map:
pipeline: pr_smoke_e2e_pipeline
- tag: 'v*.*.*-RC-*'
pipeline: release_e2e_pipeline
- push_branch: test-multichain-e2e-ci-workflow
pipeline: multichain_e2e_pipeline
28 changes: 28 additions & 0 deletions e2e/pages/Browser/ConnectedAccountsModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
} from '../../selectors/Browser/ConnectedAccountModal.selectors';
import Matchers from '../../utils/Matchers';
import Gestures from '../../utils/Gestures';
import TestHelpers from '../../helpers';

class ConnectedAccountsModal {
get permissionsButton() {
Expand All @@ -23,12 +24,27 @@ class ConnectedAccountsModal {
ConnectedAccountModalSelectorsText.DISCONNECT_ALL,
);
}
get disconnectButton() {
return Matchers.getElementByText(
ConnectedAccountModalSelectorsText.DISCONNECT,
);
}
get disconnectAllAccountsAndNetworksButton() {
return Matchers.getElementByText(
ConnectedAccountModalSelectorsText.DISCONNECT_ALL_ACCOUNTS_NETWORKS,
);
}

get connectAccountsButton() {
return Matchers.getElementByID(
ConnectedAccountsSelectorsIDs.CONNECT_ACCOUNTS_BUTTON,
);
}
get managePermissionsButton() {
return Matchers.getElementByText(
ConnectedAccountModalSelectorsText.MANAGE_PERMISSIONS,
);
}

get title() {
return Matchers.getElementByText(ConnectedAccountModalSelectorsText.TITLE);
Expand All @@ -46,6 +62,18 @@ class ConnectedAccountsModal {
await Gestures.waitAndTap(this.disconnectAllButton);
}

async tapManagePermissionsButton() {
await TestHelpers.delay(3000);
await Gestures.waitAndTap(this.managePermissionsButton);
}

async tapDisconnectButton() {
await Gestures.waitAndTap(this.disconnectButton);
}
async tapDisconnectAllAccountsAndNetworksButton() {
await Gestures.waitAndTap(this.disconnectAllAccountsAndNetworksButton);
}

//async tapToSetAsPrimaryAccount() {
// }

Expand Down
3 changes: 3 additions & 0 deletions e2e/selectors/Browser/ConnectedAccountModal.selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ export const ConnectedAccountModalSelectorsText = {
DISCONNECT_ALL: enContent.accounts.disconnect_all_accounts,
IMPORTED: enContent.accounts.imported,
TITLE: enContent.accounts.connected_accounts_title,
MANAGE_PERMISSIONS: enContent.permissions.manage_permissions,
DISCONNECT: enContent.accounts.disconnect,
DISCONNECT_ALL_ACCOUNTS_NETWORKS: enContent.accounts.disconnect_all,
};

export const ConnectedAccountsSelectorsIDs = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,10 @@ describe(SmokeCore('Revoke Single Account after connecting to a dapp'), () => {
await Browser.navigateToTestDApp();
await Browser.tapNetworkAvatarButtonOnBrowser();

await ConnectedAccountsModal.tapPermissionsButton();
await TestHelpers.delay(5500); // this is because the toast is delayed.
await ConnectedAccountsModal.tapManagePermissionsButton();

await ConnectedAccountsModal.tapDisconnectAllButton();
await Assertions.checkIfNotVisible(ToastModal.notificationTitle);
await ConnectedAccountsModal.tapDisconnectAllAccountsAndNetworksButton();
await ConnectedAccountsModal.tapDisconnectButton();

await Browser.tapNetworkAvatarButtonOnBrowser();
await Assertions.checkIfNotVisible(ConnectedAccountsModal.title);
Expand Down
Loading