specter-desktop/cypress/integration/spec_connections.js
OTK ddcafe0bd3
UIUX: Cleanups and fixes (#2261)
* center popups & add style to paste xpub popup

* Improve node overlays, settings and sidebar spacings

* limit usage of devices while broken

* revert hiding devices as bug fix incoming

* allow overlays to specify their justification

* set location of large popup overlays

* improve toggling in sidebar

* improve refresh wallets button

* fix tests

* fix mistake in connections test

* improve copy

* fix message signing screen

* fix cypress test

* fix styling: msg sign + associate with service btn

* fix plugins test

* style sign message with QR

* fix button

* fix qr code signing test
---------
Co-authored-by: moneymanolis <moneymanolis@protonmail.com>
2023-03-02 17:04:33 +01:00

65 lines
2.2 KiB
JavaScript

describe('Connecting nodes', () => {
before(() => {
Cypress.config('includeShadowDom', true)
})
it('Connect with Bitcoin Core node', () => {
// Starting from the welcome page
cy.get('[data-cy="core-connection-btn"]').click()
// Using a wrong RPC password
cy.get('#name').type('Bitcoin Core')
cy.get('#username').clear()
cy.get('#username').type('bitcoin')
cy.get('#password').clear()
cy.get('#password').type("wrong")
cy.get('#host').clear()
cy.get('#host').type('http://localhost')
cy.get('#port').clear()
cy.get('#port').type(15443)
cy.get('[data-cy="connect-btn"]').click()
cy.contains('Connection attempt failed')
cy.contains('Credentials')
cy.get('#cancel-icon').click()
// Now connect with the correct password
cy.get('#password').clear()
cy.get('#password').type("secret")
cy.get('[data-cy="connect-btn"]').click()
cy.contains('New connection saved')
})
it('Connect with Liquid node', () => {
cy.isElementsRunning().then((isRunning) => {
if (isRunning) {
cy.get('#node-switch-icon').click()
cy.get('[data-cy="new-connection-btn"]').click()
cy.get('#name').clear()
cy.get('#name').type("Liquid")
cy.get('#username').clear()
cy.get('#username').type('liquid')
cy.get('#password').clear()
cy.get('#password').type('secret')
cy.get('#host').clear()
cy.get('#host').type('http://localhost')
cy.get('#port').clear()
cy.get('#port').type(8040)
cy.get('[data-cy="connect-btn"]').click()
}
else {
cy.log('Test was skipped: Elementsd was not started by the test script.')
}
})
})
it('Select Bitcoin Core connection', () => {
cy.get('#node-switch-icon').click()
cy.contains('Bitcoin Core').click()
cy.contains('Switched to use Bitcoin Core as connection')
})
it('Check sync status of Bitcoin Core node', () => {
cy.intercept("GET", "/nodes/sync_status/", {'fullySynced': false});
cy.visit('/')
cy.get('[data-cy="unfinished-sync-indicator"]').should('be.visible')
})
})