Skip to content

Commit

Permalink
Update cypress tests
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianBouron committed Jul 8, 2024
1 parent 5475b7d commit 6c6fd65
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions packages/extension/cypress/e2e/wallet_management.cy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/// <reference types="cypress" />

import { XRPLNetwork } from '@gemwallet/constants';

const PASSWORD = Cypress.env('PASSWORD');
const SEED = Cypress.env('SEED');
const SEED_SECP256K1 = Cypress.env('SEED_SECP256K1');
Expand Down Expand Up @@ -154,24 +152,8 @@ describe('Setup the initial wallet (no previous wallet)', () => {
cy.get('input[name="password"]').type(PASSWORD);
cy.contains('button', 'Unlock').click();

// Mainnet should be the default network
cy.get('div[data-testid="network-indicator"]').should('have.text', XRPLNetwork.MAINNET);

// Open the change network window
cy.get('div[data-testid="network-indicator"]').click();
cy.get('div[data-testid="network-indicator-dialog"]', { timeout: 1500 })
.find('header')
.should('have.text', 'Change Network');

// Select the testnet network
cy.contains('button', XRPLNetwork.TESTNET).click();

// Make sure that the network is switched to Testnet
cy.get('div[data-testid="loading"]').should('be.visible');
cy.get('div[data-testid="network-indicator"]').should('have.text', XRPLNetwork.TESTNET);

// Make sure that the right wallet is online
cy.contains('14.999988 XRP').should('be.visible');
cy.contains('r9M7...4g5C').should('be.visible');
});

it('Import a wallet - Mnemonic', () => {
Expand Down Expand Up @@ -360,6 +342,24 @@ describe('Add an additional wallet (with previous wallet)', () => {
});
});

it('Import a wallet - Family Seed - secp256k1', () => {
// Go to the import a new wallet page
cy.contains('button', 'Import a new wallet').click();

// Select import by family seed
cy.contains('button', 'Family Seed').click();

// Add the seed to the import
cy.get('input[name="seed"]').type(SEED_SECP256K1);
cy.get('.PrivateSwitchBase-input').click();
cy.contains('button', 'Add Seed').click();

// Redirection to the wallets page
cy.contains('Your wallets').should('be.visible');
cy.get('div[data-testid="wallet-container"]').children().should('have.length', 2);
cy.get('div[data-testid="wallet-container"]').first().contains('r9M7...4g5C');
});

it('Add a new wallet - Mnemonic', () => {
// Go to the import a new wallet page
cy.contains('button', 'Import a new wallet').click();
Expand Down

0 comments on commit 6c6fd65

Please sign in to comment.