Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

feat: Add custom onboard module #3856

Merged
merged 7 commits into from
May 6, 2022

Conversation

yagopv
Copy link
Member

@yagopv yagopv commented May 5, 2022

⚠️ Experiment ⚠️

What it solves

It adds a custom module to onboard for Cypress testing

How this PR fixes it

This PR uses the truffle HDWallet Provider in order to allow Connected e2e tests in a more reliable way than using chrome extensions as metamask.

It includes a safe creation test suite

Using the cy.configWindow({ connected: true }) command we can tell the main web if we want to load it in a connected or disconnected status.

This instructs the web app to inject the custom module or the regular ones. It only works inside Cypress environment as we can check here

This is an experiment so please take a look and test it and feel free to accept, update or discard it as a valid approach

How to test it

Add 2 new env variables to your .env file

REACT_APP_E2E_MNEMONIC=12/24 words mnemonic
REACT_APP_E2E_PROVIDER_URL=https://rinkeby.infura.io/v3/{key}

The mnemonic of course should returns an account with some ETH for the test to work

Create Safe Video

create_safe.spec.js.mp4

@github-actions
Copy link

github-actions bot commented May 5, 2022

CLA Assistant Lite All Contributors have signed the CLA.

@github-actions
Copy link

github-actions bot commented May 5, 2022

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 1 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

@coveralls
Copy link

coveralls commented May 5, 2022

Pull Request Test Coverage Report for Build 2276063298

  • 5 of 10 (50.0%) changed or added relevant lines in 2 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.03%) to 35.429%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/logic/wallets/onboard.ts 3 8 37.5%
Files with Coverage Reduction New Missed Lines %
src/logic/wallets/onboard.ts 1 43.06%
Totals Coverage Status
Change from base Build 2268363536: 0.03%
Covered Lines: 3606
Relevant Lines: 9239

💛 - Coveralls

@github-actions
Copy link

github-actions bot commented May 5, 2022

Deployment links

🟠 Rinkeby Mainnet 🟣 Polygon 🟡 BSC Arbitrum 🟢 Gnosis Chain

package.json Outdated
@@ -90,6 +90,7 @@
"@openzeppelin/contracts": "4.4.2",
"@sentry/react": "^6.10.0",
"@sentry/tracing": "^6.10.0",
"@truffle/hdwallet-provider": "^2.0.8",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably go to devDependencies

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no doubt

@katspaugh
Copy link
Member

@yagopv since this doesn't break anything, I suggest we merge this to dev and wrote more tests that use the wallet on there.

I'll add a mnemonic to GitHub secrets.

@yagopv
Copy link
Member Author

yagopv commented May 6, 2022

ok, let's do that then. But need an approve :D

@yagopv yagopv requested a review from katspaugh May 6, 2022 08:08
@iamacook
Copy link
Member

iamacook commented May 6, 2022

ok, let's do that then. But need an approve :D

😘

@yagopv yagopv merged commit 75bbca9 into dev May 6, 2022
@yagopv yagopv deleted the feature/cypress-with-custom-onboard-module-poc branch May 6, 2022 08:16
@github-actions github-actions bot locked and limited conversation to collaborators May 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants