
Research
/Security News
Popular Tinycolor npm Package Compromised in Supply Chain Attack Affecting 40+ Packages
Malicious update to @ctrl/tinycolor on npm is part of a supply-chain attack hitting 40+ packages across maintainers
@tonconnect/qa
Advanced tools
This guide provides a quick setup process for Playwright to automate tests for TON Dapps, note that this is a basic configuration
This guide provides a quick setup process for Playwright to automate tests for TON Dapps, note that this is a basic configuration
npm init playwright@latest
Follow the prompts to complete the installation
npm install --save-dev @tonconnect/qa
playwright.config.ts
):import 'dotenv/config'
import { defineConfig, devices } from '@playwright/test'
// Define Playwright configuration
export default defineConfig({
testDir: './test',
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: 'html',
use: {
// Set base URL for tests
baseURL: 'http://localhost:3000',
trace: 'on-first-retry',
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
})
tests/example.spec.ts
):// Import necessary modules and setup
import { TonConnectWidget, testWith, tonkeeperFixture } from '@tonconnect/qa'
// Create a test instance Tonkeeper fixtures
const test = testWith(tonkeeperFixture(process.env.WALLET_MNEMONIC!))
// Extract expect function from test
const { expect } = test
// Define a basic test case
test('lab', async ({ context, wallet }) => {
// Navigate to the homepage
const app = await context.newPage()
await app.goto('https://ton-connect.github.io/demo-dapp-with-react-ui/')
// Click the connect button
const connectButton = app.getByRole('button', { name: 'Connect wallet to send the transaction' })
// Connect Tonkeeper to the dapp
const tonConnect = new TonConnectWidget(app, connectButton)
await tonConnect.connectWallet('Tonkeeper')
await wallet.connect()
// Verify the connected account address
const accountSelector = app.locator('div[data-tc-text]')
await expect(accountSelector).toHaveText('0QAy…WfyR')
// Sending transactions
await app.getByRole('button', { name: 'Send transaction' }).click()
await wallet.accept()
})
To run your Playwright tests with Tonkeeper:
Start your local development server (if testing against a local app).
Run the tests:
npx playwright test --config playwright-test.config.ts
This will execute your tests using Playwright with Tonkeeper integration
Write scenarios in folder features see Gherkin Reference and Cucumber Anti-Patterns
Describe step in folder steps
pnpm install
pnpm lint
pnpm format
pnpm playwright install
pnpm test # simple bdd test from features/*.feature
# for test with tonkeeper setup WALLET_MNEMONIC=".." in file .env
pnpm tonkeeper
pnpm release [--dry-run]
FAQs
This guide provides a quick setup process for Playwright to automate tests for TON Dapps, note that this is a basic configuration
We found that @tonconnect/qa demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Malicious update to @ctrl/tinycolor on npm is part of a supply-chain attack hitting 40+ packages across maintainers
Security News
pnpm's new minimumReleaseAge setting delays package updates to prevent supply chain attacks, with other tools like Taze and NCU following suit.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.