0.1.12 • Published 10 months ago

@smartesting/gravity-cypress-plugin v0.1.12

Weekly downloads
-
License
-
Repository
-
Last release
10 months ago

gravity-cypress-plugin

Node.js CI

Setting up the plugin

Your first have to install the plugin in your project:

npm i --save-dev @smartesting/gravity-cypress-plugin

You then need to hook the plugin in Cypress, this is typically done in cypress.config.ts:

import { gravityCypressPlugin } from "@smartesting/gravity-cypress-plugin";

module.exports = defineConfig({
  e2e: {
    setupNodeEvents(on, config) {
      gravityCypressPlugin(on, config, {
        authKey: "Your test collection auth key",
      });
    },
  },
});

Note: do not use conditions when calling gravityCypressPlugin, otherwise the before and after hooks will fail. If you want to disable tracking (for example while running the test locally), you can simply set the value of authKeyto undefined).

You will then need to set up some before/after each hook. This can be done in cypress/support/e2e.ts:

import {
  setupGravity,
  teardownGravity,
} from "@smartesting/gravity-cypress-plugin";

beforeEach(() => {
  setupGravity();
});

afterEach(() => {
  teardownGravity();
});
0.1.10

10 months ago

0.1.11

10 months ago

0.1.12

10 months ago

0.1.8

1 year ago

0.1.9

1 year ago

0.1.3

1 year ago

0.1.5

1 year ago

0.1.2

1 year ago