chore: bump Cypress to 13.17.0 (#2646)

Co-authored-by: Nazim <nazim@openclaw.ai>
This commit is contained in:
al-munazzim 2026-08-11 19:14:45 +02:00 committed by GitHub
parent 8843e2f064
commit 6755046e4b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 615 additions and 642 deletions

40
cypress.config.js Normal file
View file

@ -0,0 +1,40 @@
const { defineConfig } = require('cypress')
const setupNodeEvents = require('./cypress/plugins')
const specPattern = [
'cypress/integration/spec_empty_specter_home.js',
'cypress/integration/spec_connections.js',
'cypress/integration/spec_devices.js',
'cypress/integration/spec_ghost_machine.js',
'cypress/integration/spec_fees.js',
'cypress/integration/spec_rescan.js',
'cypress/integration/spec_qr_signing.js',
'cypress/integration/spec_labeling.js',
'cypress/integration/spec_balances_amounts.js',
'cypress/integration/spec_wallet_send.js',
'cypress/integration/spec_wallet_utxo.js',
'cypress/integration/spec_plugins.js',
]
module.exports = defineConfig({
e2e: {
baseUrl: 'http://localhost:25444',
specPattern,
supportFile: 'cypress/support/index.js',
testIsolation: false,
setupNodeEvents,
},
env: {
broadcast_timeout: 8000,
},
includeShadowDom: false,
reporter: 'junit',
reporterOptions: {
mochaFile: 'cypresstest-output.xml',
toConsole: true,
},
retries: {
runMode: 1,
openMode: 0,
},
})

View file

@ -29,8 +29,15 @@ describe('Completely empty specter-home', () => {
}) })
it('Login with password and deactivate password protection again', () => { it('Login with password and deactivate password protection again', () => {
cy.get('[data-cy="admin-password"]').type('satoshi') cy.get('body').then(($body) => {
cy.get('[data-cy="login-btn"]').click() // Cypress 13 keeps browser context when testIsolation is disabled for this
// stateful suite. If the session cookie survived from the previous test,
// we are already logged in and can go straight to settings.
if ($body.find('[data-cy="admin-password"]').length) {
cy.get('[data-cy="admin-password"]').type('satoshi')
cy.get('[data-cy="login-btn"]').click()
}
})
cy.get('[data-cy="settings-btn"]').click() cy.get('[data-cy="settings-btn"]').click()
cy.contains('Authentication').click() cy.contains('Authentication').click()
cy.get('[data-cy="authentication-selection"]').select('None') cy.get('[data-cy="authentication-selection"]').select('None')

View file

@ -152,7 +152,7 @@ describe('Test the fee UI', () => {
cy.intercept('POST', '/wallets/wallet/ghost_wallet/estimate_fee', {fee: 0.00005944}) cy.intercept('POST', '/wallets/wallet/ghost_wallet/estimate_fee', {fee: 0.00005944})
cy.get('[data-cy="show-estimated-fee-btn"]').click() cy.get('[data-cy="show-estimated-fee-btn"]').click()
cy.contains('You provided no address') cy.contains('You provided no address')
cy.get('#recipient_0').find('#address').invoke('val', "bcrt1qvtdx75y4554ngrq6aff3xdqnvjhmct5wck95qs") cy.get('#recipient_0').find('#address').invoke('val', "bcrt1qvtdx75y4554ngrq6aff3xdqnvjhmct5wck95qs").trigger('input')
cy.get('[data-cy="sats-checkbox"]').click() cy.get('[data-cy="sats-checkbox"]').click()
cy.get('#recipient_0').find('[data-cy="amount-input"]').type(50000, { force: true }) cy.get('#recipient_0').find('[data-cy="amount-input"]').type(50000, { force: true })
cy.get('[data-cy="show-estimated-fee-btn"]').click() cy.get('[data-cy="show-estimated-fee-btn"]').click()

View file

@ -5,10 +5,8 @@ describe('Test the labeling of addresses and transactions', () => {
cy.visit('/') cy.visit('/')
}) })
// Keeps the session cookie alive, Cypress by default clears all cookies before each test
beforeEach(() => { beforeEach(() => {
cy.viewport('macbook-13') cy.viewport('macbook-13')
Cypress.Cookies.preserveOnce('session')
}) })
it('Labeling an address on the address overview', () => { it('Labeling an address on the address overview', () => {

View file

@ -26,9 +26,16 @@ describe('Test plugins', () => {
}) })
it('Deactivate password protection', () => { it('Deactivate password protection', () => {
// This flow only works if we don't keep the session alive! So, no Cypress.Cookies.preserveOnce('session') in beforeEach(). cy.get('body').then(($body) => {
cy.get('#password').type("mySecretPassword") // Cypress 13 keeps browser context when testIsolation is disabled for
cy.get('#login-btn').click() // this stateful suite. If the session cookie survived from the
// previous test, we are already logged in and can go straight to
// settings; otherwise log in first.
if ($body.find('#password').length) {
cy.get('#password').type("mySecretPassword")
cy.get('#login-btn').click()
}
})
cy.get('[data-cy="settings-btn"]').click() cy.get('[data-cy="settings-btn"]').click()
cy.get('[href="/settings/auth"]').click() cy.get('[href="/settings/auth"]').click()
cy.get('select').select("none") cy.get('select').select("none")

View file

@ -22,7 +22,6 @@ import './commands'
// Set the view port for each test // Set the view port for each test
beforeEach(() => { beforeEach(() => {
cy.viewport('macbook-13') cy.viewport('macbook-13')
cy.session('preserveSession', () => {}) // Keeps the session cookie alive, Cypress by default clears all cookies before each test
cy.visit('/') cy.visit('/')
}) })

577
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -13,7 +13,7 @@
"wait-on": "^9.0.5" "wait-on": "^9.0.5"
}, },
"devDependencies": { "devDependencies": {
"cypress": "^9.7.0", "cypress": "^13.17.0",
"cypress-wait-until": "^1.7.1", "cypress-wait-until": "^1.7.1",
"gulp": "^5.0.1", "gulp": "^5.0.1",
"tailwindcss": "^3.2.4" "tailwindcss": "^3.2.4"

View file

@ -20,7 +20,7 @@ logger = logging.getLogger(__name__)
@click.option("--delimiter", default=",", help="the delimiter") @click.option("--delimiter", default=",", help="the delimiter")
@click.argument("spec_file") @click.argument("spec_file")
def execute(debug, run, delimiter, spec_file): def execute(debug, run, delimiter, spec_file):
with open("cypress.json") as json_file: with open("cypress-tests.json") as json_file:
data = json.load(json_file) data = json.load(json_file)
spec_create_list = [] spec_create_list = []

View file

@ -240,7 +240,7 @@ function restore_snapshot {
# Checking whether spec-files exists # Checking whether spec-files exists
if ! [ -f ./cypress/integration/${spec_file} ]; then if ! [ -f ./cypress/integration/${spec_file} ]; then
echo "Spec-file $spec_file does not exist, these are the options:" echo "Spec-file $spec_file does not exist, these are the options:"
cat cypress.json | jq -r ".testFiles[]" cat cypress-tests.json | jq -r ".testFiles[]"
exit 1 exit 1
fi fi
snapshot_file=./cypress/fixtures/${spec_file}_btcdir.tar.gz snapshot_file=./cypress/fixtures/${spec_file}_btcdir.tar.gz
@ -341,7 +341,11 @@ function sub_run {
start_bitcoind --reset start_bitcoind --reset
start_elementsd --reset start_elementsd --reset
start_specter --reset start_specter --reset
npx cypress run # Cypress 10+ normalizes specs discovered from config (often alphabetically),
# but this suite is intentionally stateful and depends on the order in
# cypress-tests.json. Pass an explicit --spec list so a full run keeps the
# legacy order from cypress.json/testFiles.
npx cypress run --spec "$(./utils/calc_cypress_test_spec.py --run spec_empty_specter_home.js)"
fi fi
} }
@ -358,7 +362,7 @@ function sub_snapshot {
# We'll create a snapshot BEFORE this spec-file has been tested: # We'll create a snapshot BEFORE this spec-file has been tested:
if [ ! -f ./cypress/integration/$spec_file ]; then if [ ! -f ./cypress/integration/$spec_file ]; then
echo "ERROR: Use one of these arguments:" echo "ERROR: Use one of these arguments:"
cat cypress.json | jq -r ".testFiles[]" cat cypress-tests.json | jq -r ".testFiles[]"
exit 2 exit 2
fi fi
start_bitcoind --reset start_bitcoind --reset

597
yarn.lock

File diff suppressed because it is too large Load diff