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

[E2E] Add Safe - qr code + ENS name + name validation #2820

Merged
merged 10 commits into from
Nov 24, 2023
Merged

Conversation

francovenica
Copy link
Contributor

What it solves

Resolves #
Adds name validation for negative case
Adds ENS name validation
Adds QR code with valid and invalid file upload

How this PR fixes it

Name validation: inputs a name with 51 characters and checks the error
ENS name: Enters an ENS name and checks that it is translated to a valid safe address
QR code: Uploads a valid QR code with a sepolia safe and checks it is translated correctly
QR code invalid file: It uploads a blank square PNG and checks the error "The QR could not be read"

Notes

I had to add a data test id for the QR code button, but I wasn't able to find how to do it only in the add safe form, so it is in all address inputs accross the site. If it is a way to make it so only is in the Add safe form I'd like a suggestion on how to do it.

Checklist

  • I've tested the branch on mobile 📱
  • I've documented how it affects the analytics (if at all) 📊
  • I've written a unit/e2e test for it (if applicable) 🧑‍💻

@francovenica francovenica self-assigned this Nov 20, 2023
Copy link

github-actions bot commented Nov 20, 2023

Branch preview

✅ Deploy successful!

https://load_test_fixes--walletweb.review-wallet-web.5afe.dev

safe.clickOnNextBtn()
})

it('Verify a valid QR code is accepted', () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I need some help here.
If I leave it commented this way then the ScanQRCode function runs just fine. But for some reason if I uncomment all those lines, the function ScanQRCode is ignored, the VerifyAddressInputValue function (that checks if the address in the input is valid) kicks in first and of course fails since the QR code was not uploaded. I don't know why this happens

Copy link
Contributor

Choose a reason for hiding this comment

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

The reason for it is that ETH_ENS_SAFE_ADDRESS_6 does not exist it throws the error as undefined. To fix it add ETH_ENS_SAFE_ADDRESS_6 to constants.js. After this fix everything should work as expected.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wrote the wrong name of the constant. Fixed. Thanks

Copy link

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 1 1
Warnings 0 0
Ignored 0 N/A
  • Result: ❌ failure

  • Annotations: 1 total


[failure] prettier/prettier


Report generated by eslint-plus-action

Copy link

github-actions bot commented Nov 20, 2023

📦 Next.js Bundle Analysis for safe-wallet-web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

🎉 Global Bundle Size Decreased

Page Size (compressed)
global 1.4 MB (🟢 -262 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Two Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load
/new-safe/load 7.3 KB (🟡 +10 B) 1.4 MB
/settings/appearance 8.19 KB (🟢 -349 B) 1.4 MB
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this.

Copy link

github-actions bot commented Nov 20, 2023

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 76.03% 10003/13156
🔴 Branches 50.04% 2029/4055
🔴 Functions 58.98% 1498/2540
🟡 Lines 77.56% 9034/11648

Test suite run success

1096 tests passing in 153 suites.

Report generated by 🧪jest coverage report action from 22cb3b6

cy.get(nameInput).parent().prev('label').contains(invalidAddressNameLengthErrorMsg)
}

export function ScanQRCode(image) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please move locators to top of the document to follow established practise and reuse them in the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved them at the top

@francovenica francovenica changed the title [E2E-WIP] Add Safe - qr code + ENS name + name validation [E2E] Add Safe - qr code + ENS name + name validation Nov 22, 2023
Copy link

github-actions bot commented Nov 23, 2023

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 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

@katspaugh katspaugh merged commit a72a980 into dev Nov 24, 2023
15 checks passed
@katspaugh katspaugh deleted the load-test-fixes branch November 24, 2023 12:41
@github-actions github-actions bot locked and limited conversation to collaborators Nov 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants