# cypress-sortacontains

> For testing close enough contains and ideally less flakey tests

Latest version **1.0.0** (published 2023-03-15) · ISC license · 0 weekly downloads

## Install

```sh
npm install cypress-sortacontains
pnpm add cypress-sortacontains
yarn add cypress-sortacontains
bun add cypress-sortacontains
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2023-03-15 |
| First published | 2023-03-15 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | ghostbackwards |

## Links

- npm: https://www.npmjs.com/package/cypress-sortacontains
- Repository: https://github.com/TylorMayfieldLoanStreet/cypress-sortacontains
- Homepage: https://github.com/TylorMayfieldLoanStreet/cypress-sortacontains#readme
- Issues: https://github.com/TylorMayfieldLoanStreet/cypress-sortacontains/issues
- npm.io page: https://npm.io/package/cypress-sortacontains

## Dependencies (1)

- [string-similarity](https://npm.io/package/string-similarity.md) ^4.0.4

## Recent versions

- 1.0.0 (latest) — 2023-03-15

## README

# cypress-sortacontains

## Example 1: Similarity threshold

Find elements with at least 90% text similarity to 'Sign up now for free':

```
cy.sortacontains('Sign up now for free', 0.9);
```

## Example 2: Specifying a parent element

Find elements with at least 75% text similarity to 'New user? Register here' within a '.login-form' element:

```
cy.get('.login-form').sortacontains('New user? Register here', 0.75);
```

## Example 3: Using options for the wrapped elements

Find elements with at least 85% text similarity to 'Add to cart', and click the first one:

```
cy.sortacontains('Add to cart', 0.85).first().click();
```

---
_Source: https://npm.io/package/cypress-sortacontains · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
