Kwenta Documentation
DiscordKwentaTwitterBlog
  • 🥂Welcome to Kwenta
  • Getting Started
    • How to start using Kwenta
    • Introduction
    • Getting started on Optimism
    • How to get sUSD
    • Access Kwenta
      • Installing the IPFS Companion to Access Kwenta
      • Backup RPCs
      • Withdrawing from v2 Isolated Margin using Optimistic Etherscan
  • Using Kwenta
    • Futures on Kwenta
    • Jargon
    • Synthetix Isolated Margin
      • Funding
        • Technical Details
      • Delayed Orders
      • Maker/Takers on Kwenta
      • Leverage
      • Liquidations
      • Initial/Maintenance Margin
      • One-Click Trading
        • Onboarding to 1CT
        • FAQ
      • Smart Margin
        • Dashboard Overview
        • Futures UI Overview
        • Get Started with Smart Margin
          • Withdrawing sUSD & ETH
          • Opening/Closing Positions
          • Conditional Orders
            • Limit Orders
            • Stop-Loss Orders
          • FAQ
      • Delegated Trading
        • Getting started
        • Managing Delegates
        • Accessing Accounts Delegate to You
      • Fees
      • Referral Program
        • The Traders Tab
        • The Affiliates Tab
        • Incentive Tiers and Rewards
      • FAQ
    • Perennial Isolated Margin
      • Perennial Intro
        • Market Design
        • Oracles
        • Payoff & Positions
        • Trading Fees and Price Impact
        • Funding Rate
        • Interest Rate
        • Leverage & Liquidations
        • Collateral
        • CodeBase
      • Bridging to Arbitrum
      • Trading on Perennial
        • Dashboard Overview
        • Futures UI Overview
        • Opening/Closing Positions
        • Advanced Orders
          • Limit Orders
          • Stop-Loss Orders
      • Gasless Trading
        • Onboarding to 1-Click-Trading
        • FAQ
  • Kwenta Token
    • Staking KWENTA
      • How to stake KWENTA
      • Escrow and Vesting
      • Transferring Escrow Entries
    • Claiming Rewards
    • Trading Rewards
  • DAO
    • Kwenta Token
    • Governance
    • MarketingDAO
    • devDAO
      • Contributing to the Kwenta Frontend
        • Troubleshooting
        • Testing
  • Developers
    • Deployed Contracts
      • V2 Futures Market Proxy Contracts
    • Verify Kwenta
    • Kwenta SDK
  • Resources
    • Audits
    • Development progress Epoch 1 2024
    • GitHub
Powered by GitBook
On this page
  • Introduction
  • Current Status
  • How-to: End-2-end testing guidance

Was this helpful?

  1. DAO
  2. devDAO
  3. Contributing to the Kwenta Frontend

Testing

devDAO guide to set up automated e2e testing with Kwenta

PreviousTroubleshootingNextDeployed Contracts

Last updated 3 years ago

Was this helpful?

Introduction

Automated end-2-end (e2e) testing for functional scenarios of the Kwenta dApp is essential for detecting regressions in functionality after updates. To reduce technical debt, the devDAO is assisting the Core Contributors in developing an e2e testing framework for the Kwenta dApp.

Current Status

At the moment, two e2e test for UI features are available:

  • Wallet login: login-spec.js

  • Exchange: trade-spec.js

Bounty hunters of the devDAO are currently working on improving and adding additional e2e tests for all other major UI features. If you're interested in helping out, don't be shy to drop a line in the #community-dev channel on our !

How-to: End-2-end testing guidance

In order to run fully automated end-2-end (e2e) tests Kwenta uses (a wrapper around ).

Contact the community PM on Discord if you're working on a ticket and are looking for kETH and Kovan sUSD for testing purposes.

Constraints

The current e2e tests are written to be run on Optimistic Kovan using Chrome as the browser.

Setup

  • Download and install Google Chrome

  • Setup a test wallet on Optimistic Kovan and fund it with plenty of ETH (to pay for gas) and sUSD

  • Prior to running the tests you must set the environment variables below in the shell from which npm is started. Unfortunately, at this time other methods to set said environment variables (eg. through .env.local) don't work in conjunction with Synpress.

PRIVATE_KEY=<INSERTPRIVATEKEY>
NETWORK_NAME=OptimisticKovan
RPC_URL=https://kovan.optimism.io
CHAIN_ID=69
BLOCK_EXPLORER=https://kovan-optimistic.etherscan.io
IS_TESTNET=true

Bash convenience script for setting up the environment

  • Open bash

  • Copy the private key of the test wallet into the file SYNPRESS_PRIVATEKEY into the same folder location as the script. While using this method, please don't forget to update your .gitignore file to prevent your private key to be leaked.

  • Run the following command source ./synpress-envsetter.sh

Run the tests

npm run build
npm start
npm run test:e2e:only:tests

A Bash convenience script .

Discord
Synpress
Cynpress
has been made available here