Skip to content

Testing

xpyctumo edited this page Mar 12, 2025 · 6 revisions

This document describes the key functionalities and behaviors that need to be tested to ensure reliable and usable operation. Each section details specific features and presents a structured approach to testing them.

Our goal is to provide a seamless and intuitive web interface for developers to efficiently build, test, and deploy smart contracts.

Test Domains

This document describes a process for automatically deploying an application to a test domain using GitHub Actions and Kubernetes. This process applies to branches starting with the prefix td-. Available td- domains at the moment:

  • td-art
  • td-book
  • td-nature

Deployment Trigger

The deploy process is started by pushing to one of the following branches:

  • main
  • canary
  • staging
  • Branches starting with the prefix td- (e.g. td-nature, td-book, td-art)

Domain

Once the test domain is built, it will be available at a special address. Currently, the URL can be taken from the development team, as well as network access to the addresses.

Deploy branch to test

To deploy the branch for testing, you can duplicate the code into the td- branch, thus triggering the build.

Make sure that the td branch is free and not currently being tested by anyone else.

  1. git fetch
  2. git checkout <target-branch>
  3. git checkout -b td-art
  4. git push origin td-art

Delete test branch

  1. git branch -d td-art
  2. git push origin --delete td-art

You can also remove the branch from the GitHub interface

Section "Projects"

In order to make sure that the projects in Web IDE work correctly it is necessary to validate next behaviours:

  • Create project
    • "Create a new project" button will be present if user has no projects in Web IDE
    • There is no limits in projects
    • No limits in title length
      • Duplicating names will be renamed automatically by adding postfix '(x)'
      • Title is required
    • Language selection is working propertly, user can choose
    • User can select template for create new project
    • Project is created and added to projects list
    • Project automatically selected after his creation
    • User can delete created project recently
    • User can export project
      • via "Download all projects" button
      • via "Download %projectName%" button
    • User can create files and folders
    • User can select any file in the project and start writing code in the IDE
  • Search projects
    • User can search projects in dropdown select by adding part of names his project
    • User can select found project
    • After selection, the project opens
    • "No projects found" placeholder if no search results
  • Delete project
    • User MUST be warned via alert
      • User may change his mind about deleting the project - button Cancel is required
    • The project is deleted, it is removed from the project list, all files are cleaned up
  • Download all projects
    • User can export his code into .zip file
      • Zip file will contain all projects from Web IDE (no exceptions, all paths must be saved)
      • Zip must be passwordless and must not be corrupted
  • Creating folders and files
    • Folder is created and the user can type the name immediately
    • File is created and the user can type the name immediately
    • The name must support spaces and basic extensions
      • .tact
      • .ts
      • .js
      • .tsx
      • User can share the contents of the file (only supported types)
        • Link started with "https://ide.ton.org/?code=" will be generated and copied to clipboard automatically
        • Link must opens with "temp" project
        • File and the name and contents of the file must be identical to the one you shared
        • User can "Save" shared project with custom name
          • Project saves and automatically selects
          • Temp project may be removed from workspace after save (?)
    • User can create folders and files in subfolders
    • User can edit file or folder names
  • Import from GitHub
    • Title, language, Github Repository URL for new project are required fields
    • Only links to github.com must be supported
    • The project should be copied identically to the contents of the project on github
    • User can delete created project recently
    • User can export project
      • via "Download all projects" button
      • via "Download %projectName%" button
    • User can create files and folders
    • User can select any file in the project and start writing code in the IDE
  • Import from local
    • User can import his .zip file into Web IDE
      • Project must be imported with user provided in title project
      • The project should import quickly and without problems
      • After import, the project is automatically selected
      • User can delete created project recently
      • User can export project
        • via "Download all projects" button
        • via "Download %projectName%" button
      • User can create files and folders
      • User can select any file in the project and start writing code in the IDE
  • Import via URL
    • Only GitHub links allowed
    • Link format: https://ide.ton.org/?importURL= + LINK to GitHub repo
    • When user open the Web IDE with this link, a pop-up window should appear with a suggestion to save the project
      • The modal asks for project name, project language
      • The save button is active only if the project name field is filled in
      • After clicking the button, a project completely identical to the GitHub one is saved

Section "Build & Deploy"

Also to verify that the user can build his project and deploy it is necessary to check the following

  • User can select Environment
    • Sandbox
      • User will immediately have a contract address
    • Testnet
      • User will be prompted to connect a wallet in the Testnet network (TON Connect will be shown)
      • After connecting the wallet (e.g. via Tonkeeper) the addresses must be identical (Web IDE will show bounced of connected wallet address)
      • The "Disconnect Wallet" button appears
        • Wallet can be disconnected from Web IDE
    • Mainnet
      • User will be prompted to connect a wallet in the Testnet network (TON Connect will be shown)
      • After connecting the wallet (e.g. via Tonkeeper) the addresses must be identical (Web IDE will show bounced of connected wallet address)
      • The "Disconnect Wallet" button appears
        • Wallet can be disconnected from Web IDE
  • User must select in dropdown the contract file to deposit
    • Only .tact files supported (?)
    • If the files are missing, there should be a label "Required files not found"
    • After building the file, the user can select which contract to deploy
      • The list of contracts must be identical to the contract names from the builded file
    • Deploy must working
      • In the sandbox, this should happen almost instantly, without confirming in any wallets and using TON Connect
      • In Mainnet/Testnet env user should confirm his action in connected wallet via TON Connect
        • There should be a corresponding error in the log when the user cancels the confirmation
        • After confirmation, the contract should be deployed in the selected user environment
          • There should be a message in the log with contract address about success deploy
      • After the deployment the corresponding getters, receivers should appear according to the contract code
        • The “View Deployed Contract” button should appear
      • User can call any getter contract in the selected environment
        • Calling getter in the environment of which contract is not deployed should be error (?)
          • Buttons (getters/receivers) should't be available
      • Any receiver in Testnet/Mainnet env must be called using TON Connect
      • Calling any receiver in the Sandbox env should work immediately
      • Receiver with name “empty” must be present if there is an empty receive in the contract code
      • If the receiver in the contract code has arguments, they must also be in the form
        • Arguments must be locally validated in the Web IDE form before being sent
        • Cannot use characters in the uint* field type
      • If user change the contract code: add new receiver, getter and redeploy, the form should display the new changes
      • Slice types:
        • rawSlice
        • base64

Section "Unit tests"

The user should be able to run Unit tests of their contracts directly in the Web IDE.

In order to do this, it is necessary to check:

  • The Unit Test tab is available and opens without problems
  • User can select files in dropdown that match the *.spec.ts filter in the file name
    • "Run" button becomes available when a file is selected
      • Tests in a jest-based file will be run
      • When user save the file and have the Unit test tab is active, the tests should automatically run
      • There should be information in the log about running tests
  • If no suitable files are found in the project, there should be a “Required file not found” label in the dropdown
  • When user add a new *.spec.ts file, it should also appear in the Unit test tab
  • If user delete any *.spec.ts file, it should also disappear from the Unit test tab

Section "Git"

Web IDE supports Git

  • User should see a Git button in the left side menu
    • Button should be active and open Git Version Control
  • Only "Initialize Git" button should be visible in Git Version Control if user project does not .git folder in project
    • Clicking the button should create a .git folder in the project
      • Should appear 4 panels
        • Changes
        • Remote
        • Sync
        • Setting
  • Panel Changes
    • Should updating (D - delete / U - update / M - modify) while User create/edit/delete files/folders in project
    • Should contain "+" button "Stage all" in top right corner of panel if project have any updates
      • All changes must be successful
      • Changes panel should minimize and the Staged panel appears
        • Contents of the Staged pane should be supplemented by the contents of the Changes pane
      • Input should appear with a field for commit message ("Commit" button also appears)
        • User can type/paste text into the commit field
        • User cannot use the "Commit" button until they have filled in the input
          • Should be a corresponding error in the Log
    • User can separately Stage a file
      • File should move to the Staged panel and disappear from Changes panel
      • Input should appear with a field for commit message ("Commit" button also appears)
        • User can type/paste text into the commit field
        • User cannot use the "Commit" button until they have filled in the input
          • Should be a corresponding error in the Log
  • Panel Remote
    • Should contain input field "GitHub Repository URL" and "Save" button
      • User can type/paste url to repo
      • Save button should save the link to the repository
        • If the user inserts a non-GitHub link, an error should be displayed
        • If user will reload page (Web IDE) - user should see the saved link in the input
        • If the user returned to a Git tab from another tab, the saved link should return to the input
  • Panel Sync
    • Should contain toggle "Force push" and 2 buttons "Pull" && "Push"
    • Pull button
      • Should be an error in the log if the user has not filled in the Username, Email, access token fields in Setting pane
      • Commit history must be identical to the remote repository
      • Information about a successful Pull should be displayed in the Log
      • Other errors when interacting with git should also be displayed in Log
        • Network errors
        • Access rights error
    • Push button
      • Should be an error in the log if the user has not filled in the Username, Email, access token fields in Setting pane
      • User can make a standard Push
      • User can make a standard Force Push
        • Commit history of the remote repository should be overwritten by local history
      • Information about a successful Push should be displayed in the Log
      • Other errors when interacting with git should also be displayed in Log
        • Network errors
        • Access rights error
  • Panel Staged
    • Panel should only be visible if there are any Stage files available
    • Should be a button "Unstage All" in the upper right corner of panel
      • All files from Staged panel are returned to the Changes panel
      • Staged panel disappears
  • Panel Setting
    • Username, Email, Access Token fields must be present
    • Save button must be available and active
      • Validation of all fields before saving, errors for each field
      • Should be a link to the documentation for generating the access token
      • The link should open in a new browser tab
  • User can click on the file in the Staged / Changes panel and a new tab will open in the Web IDE with diff changes
  • All panels must be collapsible and expandable
  • Settings should be stored globally (localStorage?)
    • When the page refreshes, they should be loaded between projects

Section "Misti - Static Analyzer"

Detect security issues in TON smart contracts before they reach production.

  • The “Misti” tab should be visible on the left side of the overall tab list, contain an icon and be clickable
  • The content of the tab contains the current version of Misti
  • User can select the contract file in dropdown
    • If the file is a single file, it should select automatically when the tab is opened
  • User can select the minimum level in the dropdown “Minimum Severity Level”
  • There should also be an “All Detectors” selector
    • Turning the switch off makes the "Enabled detectors" dropdown appear
      • In dropdown, the user can select multiple Misti detectors at once
      • In dropdown, the user can find Detector by word part by typing the text in the text boxё
      • In dropdown user cannot find and enable unavailable detectors such as:
        • DivideBeforeMultiply
        • ReadOnlyVariables
        • UnboundLoop
  • "Contract File" dropdown
    • Only files with the extension “.tact” should be located
    • When changing the project, the files must be communicated
    • When adding / removing files from the project, the list should also be updated
    • Mandatory field
  • "Minimum Severity Level" dropdown
    • User can select a single value from the suggested values
    • Mandatory field
  • "Analyze" button
    • Available only when all mandatory fields are filled in
    • After clicking, the selected file is analyzed
      • The information will appear in the log
      • The code construct “let id: Int = 1; id = 1; id = id + 1;” should cause an INFO warning to log
  • Other
    • Misti settings should be individualized for each project, all fields: detectors, warning level, etc.
    • The settings should be automatically saved, after refreshing the Web IDE page the settings should remain the same

Section "Verifier"

Users can also submit their smart contracts to the TON Verifier -- https://verifier.ton.org/

  • The “Verifier” tab should be visible on the left side of the overall tab list, contain an icon and be clickable
  • The tab allows the user to submit their contract to Verifier
  • Tact of the latest version should be supported in Verifier
    • If the language version is not yet supported, the user should be warned and the button should not be active
  • Once a smart contract has been sent to the Verifier - it can be viewed at the contract address on the TON Verifier and should be displayed