# cy-view

> A utility function to run Cypress tests on multiple viewports

Latest version **1.0.11** (published 2021-07-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install cy-view
pnpm add cy-view
yarn add cy-view
bun add cy-view
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.11 |
| Published | 2021-07-01 |
| First published | 2018-12-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Andy Coupe |
| Maintainers | andycoupe |
| Keywords | cypress, device, viewport, utility, testing, end to end |

## Links

- npm: https://www.npmjs.com/package/cy-view
- Homepage: https://github.com/andrewmcoupe/cy-view
- npm.io page: https://npm.io/package/cy-view

## Alternatives

- [@snazzah/davey](https://npm.io/package/@snazzah/davey.md) — 1.5M weekly downloads
- [@vendure/testing](https://npm.io/package/@vendure/testing.md) — 8.3K weekly downloads
- [vue-simple-context-menu](https://npm.io/package/vue-simple-context-menu.md) — 6.6K weekly downloads
- [cypress-webpack-preprocessor-v5](https://npm.io/package/cypress-webpack-preprocessor-v5.md) — 2.1K weekly downloads
- [@backstage/plugin-catalog-backend-module-puppetdb](https://npm.io/package/@backstage/plugin-catalog-backend-module-puppetdb.md) — 1.3K weekly downloads

## Recent versions

- 1.0.11 (latest) — 2021-07-01
- 1.0.10 — 2021-07-01
- 1.0.9 — 2019-11-08
- 1.0.8 — 2019-11-07
- 1.0.7 — 2019-04-12
- 1.1.0 — 2019-03-21
- 1.0.6 — 2019-01-23
- 1.0.4 — 2018-12-19
- 1.0.5 — 2018-12-19
- 1.0.1 — 2018-12-14
- 1.0.0 — 2018-12-14

## README

<a href="https://www.npmjs.com/package/cy-view">
<img src="https://img.shields.io/npm/dt/cy-view" />
</a>

# cy-view

### Run tests suite across multiple viewports

#### Installation

```sh
$ npm i --save-dev cy-view
```

#### Usage - CYPRESS MUST BE INSTALLED

| Parameter | Type  |
| --------- | ----- |
| devices   | Array |
| urls      | Array |

```javascript
const cyView = require("cy-view");

const devices = [
	{
		model: "macbook-15",
		width: 1440,
		height: 900
	},
	{
		model: "ipad-2",
		width: 768,
		height: 1024
	},
	{
		model: "iphone-6+",
		width: 414,
		height: 736
	}
];

// Add urls to test against
const urls = [
	"https://ao.com/product/idc8t3b-indesit-eco-time-condenser-tumble-dryer-white-38191-18.aspx",
	"https://ao.com/product/zwf01483wr-zanussi-lindo300-washing-machine-white-29672-1.aspx"
];

// Pass cy-view an array of devices structured like the devices constant above
const washingMachinePageTests = cyView(devices);

// Pass your urls constant in and your good to go!
washingMachinePageTests(urls, () => {
	describe("My tests running on all viewports across various URLs", () => {
		it("should test something...", () => {
			//...do yo' thang
		});
	});
});
```

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