test-frameworks
Testing frameworks for web, mobile, API, and unit testing
What this skill does
# Testing Frameworks
## Web Testing Frameworks
### Selenium
**Best for**: Cross-browser testing, legacy applications
- Supports multiple languages (Java, Python, JavaScript, C#)
- Wide browser support including legacy browsers
- Large community and extensive documentation
- Steeper learning curve
- Slower execution compared to modern frameworks
```java
// Java Selenium example
WebDriver driver = new ChromeDriver();
driver.get("https://example.com");
WebElement element = driver.findElement(By.id("username"));
element.sendKeys("testuser");
driver.quit();
```
### Cypress
**Best for**: Modern web applications, fast feedback
- JavaScript/TypeScript native
- Real-time reloads and debugging
- Automatic waiting and retries
- Network traffic control and stubbing
- Excellent developer experience
- Limited to JavaScript-based applications
```javascript
// Cypress example
describe('Login', () => {
it('should login successfully', () => {
cy.visit('/login');
cy.get('#username').type('testuser');
cy.get('#password').type('password');
cy.get('#login').click();
cy.url().should('include', '/dashboard');
});
});
```
### Playwright
**Best for**: Modern web applications, cross-browser testing
- Multi-language support (JavaScript, Python, Java, .NET)
- Fast, reliable, and cross-browser
- Auto-waiting for elements
- Network interception and mocking
- Parallel test execution
- Headless and headed execution
```javascript
// Playwright JavaScript example
const { chromium } = require('playwright');
(async () => {
const browser = await chromium.launch();
const page = await browser.newPage();
await page.goto('https://example.com');
await page.fill('#username', 'testuser');
await page.click('#login');
await browser.close();
})();
```
### Puppeteer
**Best for**: Chrome/Chromium testing, scraping
- Chrome DevTools Protocol integration
- Headless browser automation
- Fast execution
- JavaScript/TypeScript native
- Chrome/Chromium only
```javascript
// Puppeteer example
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://example.com');
await page.type('#username', 'testuser');
await page.click('#login');
await browser.close();
})();
```
## JavaScript Testing Frameworks
### Jest
**Best for**: React, Node.js, general JavaScript testing
- Zero configuration setup
- Built-in assertions and mocking
- Snapshot testing
- Parallel test execution
- Code coverage reporting
```javascript
// Jest example
describe('Calculator', () => {
test('adds 1 + 2 to equal 3', () => {
expect(add(1, 2)).toBe(3);
});
test('async operation', async () => {
const result = await fetchData();
expect(result).toEqual({ data: 'test' });
});
});
```
### Mocha
**Best for**: Flexible testing needs, Node.js
- Flexible and extensible
- Async testing support
- Rich ecosystem of plugins
- Requires assertion library (Chai, Expect)
- Requires mocking library (Sinon)
```javascript
// Mocha example with Chai
const { expect } = require('chai');
const sinon = require('sinon');
describe('UserService', () => {
it('should return user data', async () => {
const user = await userService.getUser(1);
expect(user).to.have.property('id', 1);
});
});
```
### Vitest
**Best for**: Vite projects, fast modern testing
- Vite-native, extremely fast
- Jest-compatible API
- ESM support out of the box
- TypeScript support
- Watch mode with HMR
```javascript
// Vitest example
import { describe, it, expect } from 'vitest';
describe('Math', () => {
it('should add numbers', () => {
expect(add(1, 2)).toBe(3);
});
});
```
### Jasmine
**Best for**: Traditional JavaScript testing
- Behavior-driven development
- No external dependencies
- Simple syntax
- Good for legacy projects
```javascript
// Jasmine example
describe('Calculator', () => {
it('should add numbers', () => {
const result = add(1, 2);
expect(result).toBe(3);
});
});
```
## Python Testing Frameworks
### pytest
**Best for**: Python applications, flexible testing
- Simple and intuitive syntax
- Powerful fixtures
- Plugin ecosystem
- Parallel test execution
- Code coverage integration
```python
# pytest example
def test_addition():
assert add(1, 2) == 3
@pytest.fixture
def user_data():
return {'id': 1, 'name': 'Test User'}
def test_user(user_data):
assert user_data['name'] == 'Test User'
```
### unittest
**Best for**: Standard library, traditional testing
- Built into Python
- xUnit-style testing
- Test discovery
- Mock library included
```python
# unittest example
import unittest
class TestCalculator(unittest.TestCase):
def test_addition(self):
result = add(1, 2)
self.assertEqual(result, 3)
```
### nose2
**Best for**: Extending unittest
- Extends unittest
- Plugin system
- Test discovery
- Parallel execution
## Java Testing Frameworks
### JUnit
**Best for**: Java applications, standard testing
- Industry standard
- Annotations-based
- Test runners
- Parameterized tests
- Integration with build tools
```java
// JUnit 5 example
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
class CalculatorTest {
@Test
void testAddition() {
assertEquals(3, add(1, 2));
}
}
```
### TestNG
**Best for**: Advanced testing needs
- More features than JUnit
- Parallel execution
- Data-driven testing
- XML configuration
- Integration with Selenium
```java
// TestNG example
import org.testng.annotations.Test;
import static org.testng.Assert.*;
public class CalculatorTest {
@Test
public void testAddition() {
assertEquals(add(1, 2), 3);
}
}
```
### Mockito
**Best for**: Mocking in Java
- Clean mocking API
- Verification of interactions
- Stubbing behavior
- Integration with JUnit/TestNG
```java
// Mockito example
import static org.mockito.Mockito.*;
List<String> mockList = mock(List.class);
when(mockList.get(0)).thenReturn("first");
assertEquals("first", mockList.get(0));
verify(mockList).get(0);
```
## Mobile Testing Frameworks
### Appium
**Best for**: Cross-platform mobile testing
- Supports iOS and Android
- Uses WebDriver protocol
- Multiple language support
- Native, hybrid, and mobile web apps
```java
// Appium Java example
AppiumDriver driver = new AndroidDriver(new URL("http://localhost:4723/wd/hub"), capabilities);
driver.findElement(By.id("username")).sendKeys("testuser");
driver.quit();
```
### Espresso
**Best for**: Android native testing
- Android native
- Fast and reliable
- Synchronized with UI thread
- Google-supported
```java
// Espresso example
onView(withId(R.id.username))
.perform(typeText("testuser"))
.check(matches(withText("testuser")));
```
### XCUITest
**Best for**: iOS native testing
- Apple native
- Swift/Objective-C
- Fast execution
- Xcode integration
```swift
// XCUITest example
let app = XCUIApplication()
app.textFields["username"].tap()
app.textFields["username"].typeText("testuser")
```
## API Testing Frameworks
### Postman
**Best for**: Manual and automated API testing
- User-friendly interface
- Collections and environments
- Test scripts
- CI/CD integration
- Mock servers
```javascript
// Postman test script
pm.test("Status code is 200", function () {
pm.response.to.have.status(200);
});
pm.test("Response has data", function () {
var jsonData = pm.response.json();
pm.expect(jsonData.data).to.exist;
});
```
### REST Assured
**Best for**: Java API testing
- Fluent API
- JSON/XML support
- Authentication support
- Integration with JUnit/TestNG
```java
// REST Assured example
given()
.header("Content-Type", "application/json")
.body("{\"name\":\"test\"}")
.when()
.post("/api/users")
.then()
.statusCode(201)
.body("name", equalTo("test"));
```
### Supertest
**Best for**: Node.js API testing
- Express integration
- Chai assertions
- Easy to use
- Good for testing Express apps
```javascRelated in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.