-
Notifications
You must be signed in to change notification settings - Fork 344
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
test: E2E create queued transactions #948
Conversation
ESLint Summary View Full Report
Report generated by eslint-plus-action |
Deploying with Cloudflare Pages
|
5ab6c97
to
fc31f69
Compare
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.
Is it not possible to target these elements via the UI, e.g. find text and traverse? Targetting via classes is on par with test IDs. I would suggest we only do so as a final option.
I didn't find an easy way for the check box for instance. |
Ok, I think I've figured it out. Thanks for the feedback @iamacook |
cypress/e2e/smoke/create_tx.cy.js
Outdated
const SAFE = 'gor:0x04f8b1EA3cBB315b87ced0E32deb5a43cC151a91' | ||
const EOA = '0xE297437d6b53890cbf004e401F3acc67c8b39665' | ||
|
||
describe('Queue a transaction on N/1', () => { |
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.
N/1
means N owners out of 1? Why not just 1/1 then?
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.
I meant 1/N
.parent('span') | ||
.should(($div) => { | ||
// Turn the classList into a string | ||
const classListString = Array.from($div[0].classList).join() |
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.
Why this instead of just checking that the input itself is checked=true?
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.
I tried to rely on input's checked attribute first but the HTML input is always checked
. The only thing that changes on toggle is the MUICheckbox class list.
cypress/e2e/smoke/create_tx.cy.js
Outdated
cy.contains('This Safe has no queued transactions').should('not.exist') | ||
|
||
// Created transaction should be queued | ||
cy.contains(`a[href="/transactions/queue?safe=${SAFE}"]`, '3' + 'Send' + '-' + '0.00003 GOR' + '1/1').should( |
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 check doesn't make sense if you constantly create the same transaction. 0.00003 GOR
will always match a tx from previous test runs. You need to check something unique, like the nonce, or send a unique amount each time.
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.
I agree, then I will change the sent amount. Reason being we show the first 3 queued transactions so anything queued past 3 transactions won't be displayed in the Dashboard and if we would to verify in the Transaction List, we would also have to deal with the pagination limit.
// Alias for New transaction modal | ||
cy.contains('h2', 'Review transaction').parents('div').as('modal') | ||
|
||
cy.contains('Signing the transaction with nonce 4').click() |
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.
4
will be 5, 6, 7, etc in the next test runs.
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.
The test keeps queuing with nonce 3 for the reason I explained in the previous comment.
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.
I don't understand how your other comment is related. The dashboard displays the oldest txns, I get that. How does the nonce of a new tx depend on that?
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.
Because all the test is doing is rewriting the tx with the nonce 3.
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.
I see, thanks.
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.
I mean, I've taken this approach of not increasing the queued nonce so the test could keep veryfying the Pending queued on the Dashboard
// Alias for New transaction modal | ||
cy.contains('h2', 'Review transaction').parents('div').as('modal') | ||
|
||
cy.contains('Signing the transaction with nonce 4').click() |
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.
I see, thanks.
f5b98d0
to
154f216
Compare
Congrats, your important contribution to this open-source project has earned you a GitPOAP! GitPOAP: 2022 Safe Web Core Contributor: Head to gitpoap.io & connect your GitHub account to mint! Learn more about GitPOAPs here. |
* create queued tx 1/n threshold * verify the created transaction is queued * move create tx test to the ci folder * add more resilient navigation * wait for wallet loaded on CI * queue a new transaction * parse bette the string * fix comments * do not target elements by class * randomize queued transaction value
Creates a transaction and verifies it is queued