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

Chore: Cypress test for address labeling #2021

Merged
merged 36 commits into from
Dec 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
ce0d1cf
feat:(label) improved address label ux
otkstudio Nov 17, 2022
33ecc24
Merge branch 'master' into improved-address-labels
moneymanolis Nov 23, 2022
cd0eb5f
service icon alignment
moneymanolis Nov 23, 2022
c74e155
Merge branch 'improved-address-labels' of github.com:cryptoadvance/sp…
moneymanolis Nov 23, 2022
2b77b1e
Merge branch 'master' into improved-address-labels
moneymanolis Nov 23, 2022
d5a0c16
make it work on firefox
moneymanolis Nov 23, 2022
4488033
Merge branch 'improved-address-labels' of github.com:cryptoadvance/sp…
moneymanolis Nov 23, 2022
05171c4
fix:(label) fix spacing of the service logo on tx table
otkstudio Nov 24, 2022
4649727
fix:(label) fix sizing of service icon within label
otkstudio Nov 24, 2022
6cd2f2e
fix:(label) fix table not scaling to label width
otkstudio Nov 24, 2022
c323949
Merge branch 'master' into improved-address-labels
moneymanolis Nov 30, 2022
e689e8c
add / change titles
moneymanolis Dec 1, 2022
3b60fe7
draft - copy button in address list
moneymanolis Dec 1, 2022
03f32b0
Merge branch 'master' into improved-address-labels
moneymanolis Dec 2, 2022
428dbab
Merge branch 'master' into improved-address-labels
moneymanolis Dec 11, 2022
96b9b7b
Merge branch 'improved-address-labels' of github.com:cryptoadvance/sp…
moneymanolis Dec 11, 2022
91c903a
click away from edit section cancels editing
moneymanolis Dec 11, 2022
eb5f68f
check whether addressesTableComponent is available
moneymanolis Dec 12, 2022
9204952
solution for spacebar bug in firefox
moneymanolis Dec 12, 2022
7f36482
address data and tx table listeneres
moneymanolis Dec 13, 2022
5eaae52
make pressing ENTER work
moneymanolis Dec 13, 2022
1ff8fb3
Merge branch 'master' into improved-address-labels
moneymanolis Dec 13, 2022
27d44e3
add address to tx info
moneymanolis Dec 13, 2022
8dc794c
typo
moneymanolis Dec 14, 2022
fbd7d95
firefox fixes
moneymanolis Dec 14, 2022
1607e03
prevent bubbling
moneymanolis Dec 14, 2022
0f48852
check whether there is an address-label for txlist
moneymanolis Dec 14, 2022
b4f1abf
select all only at edit start
moneymanolis Dec 15, 2022
809cec7
revert copy address button
moneymanolis Dec 15, 2022
d6e08db
add editable attribute
moneymanolis Dec 15, 2022
acb4829
disable editing for receive page
moneymanolis Dec 15, 2022
fd0eb4d
change cursor to default in non-editable mode
moneymanolis Dec 15, 2022
eb61708
disable bubbling for update & cancel btns
moneymanolis Dec 16, 2022
ce20e87
no need to check for specific event targets anymore
moneymanolis Dec 16, 2022
ca6d13c
cypress test for address labeling
moneymanolis Dec 16, 2022
cfc864d
Merge branch 'master' into cypress-test-labeling
moneymanolis Dec 16, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions cypress.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"spec_fees.js",
"spec_rescan.js",
"spec_qr_signing.js",
"spec_labeling.js",
"spec_balances_amounts.js",
"spec_wallet_send.js",
"spec_wallet_utxo.js",
Expand Down
35 changes: 35 additions & 0 deletions cypress/integration/spec_labeling.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Note: Currently we only have address labels
describe('Test the labeling of addresses and transactions', () => {
before(() => {
Cypress.config('includeShadowDom', true)
cy.visit('/')
})

// Keeps the session cookie alive, Cypress by default clears all cookies before each test
beforeEach(() => {
cy.viewport(1200,660)
Cypress.Cookies.preserveOnce('session')
})

it('Labeling an address on the address overview', () => {
// Using the ghost wallet
cy.get('.side').contains('Ghost wallet').click()
cy.get('main').contains('Addresses').click()
// Checking the correct titles since those are the only orientation for the user right now
cy.get('[data-cy="edit-label-btn"]').last().should('have.attr', 'title', 'Edit label') // The last element in the array is the first one on the screen ...
cy.get('[data-cy="label"]').last().should('have.attr', 'title', 'Edit label')
// Edit the label of the first address
cy.get('[data-cy="edit-label-btn"]').last().click().type('{selectall}{backspace}').type('Swan withdrawal address') // Not sure why backspace alone is not enough
cy.get('[data-cy="update-label-btn"]').last().click()
cy.contains('Swan withdrawal address')
// Check that the canceling works as expected
cy.get('[data-cy="edit-label-btn"]').last().click().type('{backspace}'.repeat(6))
cy.get('[data-cy="cancel-edit-btn"]').last().click()
cy.contains('Swan withdrawal address')
// Clicking somewhere should cancel the editing
cy.get('[data-cy="edit-label-btn"]').last().click().type('{backspace}'.repeat(6))
cy.get('[data-cy="cancel-edit-btn"]').last().click()
cy.get('main').click()
cy.contains('Swan withdrawal address')
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
</style>

<form class="address-label-form">
<button type="button" class="btn edit" title="Edit label">
<button type="button" class="btn edit" title="Edit label" data-cy="edit-label-btn">
<img
src="{{ url_for('static', filename='img/tag.svg') }}"
style="width: 22px; margin-top: -2px"
Expand All @@ -82,18 +82,18 @@
value="{{ csrf_token() }}"
/>
<img class="service-icon" />
<span class="label" tabindex="-1" autocomplete="off" spellcheck="false" title="Edit label">
<span class="label" tabindex="-1" autocomplete="off" spellcheck="false" title="Edit label" data-cy="label">
{{ _("Fetching address label...") }}
</span>
</button>
<button type="button" class="btn update hidden" title="Update">
<button type="button" class="btn update hidden" title="Update" data-cy="update-label-btn">
<img
src="{{ url_for('static', filename='img/check_thick.svg') }}"
style="width: 18px"
class="svg-white"
/>
</button>
<button type="button" class="btn cancel hidden" title="Cancel">
<button type="button" class="btn cancel hidden" title="Cancel" data-cy="cancel-edit-btn">
<img
src="{{ url_for('static', filename='img/cross_thick.svg') }}"
style="width: 18px"
Expand Down