Chore: Better test of device name validity (#2187)

* improvement of devices test
* try to fix flaky cypress test with cy.wait
This commit is contained in:
Manolis Mandrapilias 2023-02-10 21:09:37 +01:00 committed by GitHub
parent a75aee9c22
commit da5a50d643
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 11 deletions

View file

@ -4,19 +4,15 @@ describe('Test adding different devices', () => {
Cypress.config('includeShadowDom', true)
})
it('Should be a valid device name', () => {
it('Validity of device name', () => {
cy.get('#toggle_devices_list').click()
cy.get('#btn_new_device').click()
cy.get('#bitcoincore_device_card').click()
cy.get('#submit-mnemonic').click()
cy.get("#device_name").type("'invalid");
cy.get('#submit-keys').click();
cy.contains('Upload Keys')
cy.get("#device_name").clear().type("valid");
cy.get('#submit-keys').click();
cy.contains('valid was added successfully!');
cy.get('[data-cy="new-device-added-screen-close-btn"]').click()
cy.get('#forget_device').click()
cy.get('#trezor_device_card').click()
cy.get("#device_name").type("'invalid")
cy.get('#submit-keys').click()
cy.get('#device_name').invoke('prop', 'validity').its('patternMismatch').should('be.true')
cy.get("#device_name").clear().type("valid")
cy.get('#device_name').invoke('prop', 'validity').its('patternMismatch').should('be.false')
});
it('Filter devices', () => {

View file

@ -96,6 +96,7 @@ describe('Test the actions in UTXO list', () => {
cy.get('#btn_transactions').click()
cy.wait(1000)
cy.get('[data-cy="utxo-list-btn"]').click()
cy.wait(500)
cy.get('@unsignedTxRow').should('have.attr', 'data-cy', 'unsigned-tx-row')
// Check that only the checkbox of the unsigned UTXO are visible if it is selected
cy.get('@unsignedTxRow').find('.select-tx-img').click( {position: 'top'} )