0.2.1 • Published 2 months ago

@saninn/cypress-ionic v0.2.1

Weekly downloads
-
License
ISC
Repository
github
Last release
2 months ago

👨‍💻💻

A set of helper functions to tests your Ionic apps with Cypress

Build Status Known Vulnerabilities Maintainability

The Problem

To be able to get a hold of Ionic's web components and with Cypress one has to inspect their ShadowDom and create cypress helper commands to change them for each project, which is time consuming.

With this library you can just give the css selector of the Ionic Element, or the element itself and you can interact with it in an easy way.

Install

npm install @saninn/cypress-ionic --save-dev.

Then enable ShadowDom access on your Cypress Project:

{
  "$schema": "https://on.cypress.io/cypress.schema.json",
  "includeShadowDom": true,
  ...
}

** Although it is not needed, it is recommended to disable Ionic animations when possible. That said, this library let the animations active so timing issues are handled.

Basic usage

Each helper function returns an Cypress.Chainable<JQuery<IonComponent>> object with the component that was changed. So an example of usage could be

import { ionRangeCypress } from '@saninn/cypress';

it('can be changed by set value', () => {
  ionRangeCypress.setValue('ion-range.my-ion-range', 42);

  cy.get('my-view-item').should('eq', '42');
});

API and Documentation

See the generated documentation here

License

AGPLv3

Development

Each exported function is directly tested on Cypress. Call npm run develop to start a simple server and open cypress. You can see the served host on http://localhost:3999 with:

TODO.

  • Dev Guidelines
  • More components

Pull requests are welcome

Find me 🏃‍

0.2.1

2 months ago

0.2.0

2 months ago

0.1.2

2 years ago

0.1.0

2 years ago

0.1.1

2 years ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.4-0

2 years ago

0.0.3-0

2 years ago