
Security News
/Research
Fake Corepack Site Distributes Infostealer and Proxyware to Developers
A fake corepack.org site is impersonating the Node.js tool and delivers an infostealer and proxyware to developers who download it.
@cerios/playwright-expectly
Advanced tools
Comprehensive Playwright test matchers for strings, numbers, dates, arrays, objects, and locators. Simplify your E2E tests with intuitive assertions like toBeAlphanumeric, toHaveAscendingOrder, toBeInTheFuture, and 50+ more matchers.
Comprehensive Playwright test matchers for strings, numbers, dates, arrays, objects, and locators. Simplify your E2E tests with intuitive assertions.
npm install @cerios/playwright-expectly --save-dev
import { expectly } from '@cerios/playwright-expectly';
// String validation
expectly('user@example.com').toBeValidEmail();
// Number array validation
expectly([1, 2, 3, 4, 5]).toHaveAscendingOrder();
// Date validation
expectly(new Date()).toBeInTheFuture(new Date('2020-01-01'));
// Locator validation
await expectly(page.locator('.username')).toBeAlphanumeric();
toBeValidEmail() - Validate email formattoBeValidUrl() - Validate URL formattoBeUUID(version?) - Validate UUID (optionally specific version)toBeAlphanumeric() - Only letters and numberstoBeNumericString() - Only digitstoStartWith(prefix) / toEndWith(suffix) - String boundariestoMatchPattern(regex) - Regular expression matchingtoHaveAscendingOrder() / toHaveDescendingOrder() - Sort validationtoHaveAverage(value) / toHaveMedian(value) - Statistical validationtoHaveMin(value) / toHaveMax(value) - Boundary validationtoBeAllPositive() / toBeAllNegative() - Sign validationtoBeMonotonic() - Consistent directiontoHaveConsecutiveIntegers() - Sequential validation📖 View all number array matchers →
toBeCloseTo(date, deviation) - Within time deviationtoBeInTheFuture(refDate?) / toBeInThePast(refDate?) - Temporal validationtoBeSameDay(date) / toBeSameMonth(date) / toBeSameYear(date) - Date comparisontoBeInQuarter(quarter) - Quarter validationtoBeLeapYear() - Leap year checktoHaveConsecutiveDates(unit) - Sequential datestoBeAlphanumeric() - Alphanumeric texttoBeNumericString() - Numeric texttoBeUUID(version?) - UUID formattoBeUpperCase() / toBeLowerCase() - Case validationtoBeTitleCase() - Title case formattoHaveSrc(value) / toHaveHref(value) / toHaveAlt(value) - Attribute validationtoHaveObjectsInAscendingOrderBy(property) - Sort by propertytoHaveObjectsInDescendingOrderBy(property) - Reverse sort by propertytoHaveOnlyUniqueObjects() - Uniqueness validation📖 View all object array matchers →
toHaveAscendingOrder() / toHaveDescendingOrder() - Alphabetical ordertoHaveStrictlyAscendingOrder() - No duplicates ascendingtoBeMonotonic() - Consistent directiontoHaveUniqueValues() - No duplicates📖 View all string array matchers →
toBeInteger() / toBeFloat() - Number type validationtoBeAnyOf(...values) - Multiple value matchingtoEqualPartially(expected) - Partial object matchingtoBeNullish() - Null or undefined checktoBePrimitive() / toBeArray() / toBeObject() - Type checkingimport { expectly } from '@cerios/playwright-expectly';
test('validate user input', async () => {
expectly('john.doe@example.com').toBeValidEmail();
expectly('https://example.com').toBeValidUrl();
expectly('550e8400-e29b-41d4-a716-446655440000').toBeUUID(4);
});
test('validate sorted data', async () => {
const scores = [85, 90, 92, 95];
expectly(scores).toHaveAscendingOrder();
expectly(scores).toHaveAverage(90.5);
expectly(scores).toBeAllPositive();
});
test('validate dates', async () => {
const now = new Date();
const tomorrow = new Date(now.getTime() + 86400000);
expectly(tomorrow).toBeInTheFuture(now);
expectly(tomorrow).toBeCloseTo(now, { hours: 24 });
});
test('validate form elements', async ({ page }) => {
await expectly(page.locator('.email')).toBeValidEmail();
await expectly(page.locator('.username')).toBeAlphanumeric();
await expectly(page.locator('img')).toHaveAlt('Company Logo');
});
For tree-shaking optimization, import only what you need:
import { expectlyString } from '@cerios/playwright-expectly';
import { expectlyNumberArray } from '@cerios/playwright-expectly';
import { expectlyDate } from '@cerios/playwright-expectly';
expectlyString('test@example.com').toBeValidEmail();
expectlyNumberArray([1, 2, 3]).toHaveAscendingOrder();
expectlyDate(new Date()).toBeInTheFuture(new Date('2020-01-01'));
All matchers support .not for inverse assertions:
expectly('not-an-email').not.toBeValidEmail();
expectly([5, 3, 1]).not.toHaveAscendingOrder();
await expectly(page.locator('.text')).not.toBeNumericString();
Contributions are welcome! Please read our Contributing Guide for details.
MIT © Cerios
Built with ❤️ by Cerios
FAQs
Comprehensive Playwright test matchers for strings, numbers, dates, arrays, objects, and locators. Simplify your E2E tests with intuitive assertions like toBeAlphanumeric, toHaveAscendingOrder, toBeInTheFuture, and 50+ more matchers.
The npm package @cerios/playwright-expectly receives a total of 30 weekly downloads. As such, @cerios/playwright-expectly popularity was classified as not popular.
We found that @cerios/playwright-expectly demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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.

Security News
/Research
A fake corepack.org site is impersonating the Node.js tool and delivers an infostealer and proxyware to developers who download it.

Research
/Security News
A large-scale campaign abused GitHub Actions in compromised repositories to exploit CVE-2026-41940 in cPanel and WHM and steal server credentials.

Security News
Five frontier LLMs generated the same nonexistent package names, leaving 53 available for potential slopsquatting across PyPI and npm.