open-index/open-npm huggingface dataset:
npm package: @mmisty/cypress-tags
Description: Parses tags from test/suite title or/and from cypress configuration object into test .tags object
Author: Taisia Pitko
Latest version: 1.1.0

# Cypress-tags

This plugin helps to parse tags to add them 
into Mocha Test object, so you can access
tags within hooks and within a test.

Example: 
```javascript
    it('test with tags @test', { tags: ['@abc'] }, function () {
      // this.test?.tags object has all tags
      expect(this.test?.tags).to.deep.eq([
        { tag: '@abc', info: [], isOwnTag: true },
        { tag: '@test', info: [], isOwnTag: true },
      ]);
    });
```

- `isOwnTag` indicates whether tag is for test, when it is undefined this means it is set to parent suites of the test

## Installation / setup

1. install with npm:
   ```shell
   npm i -D @mmisty/cypress-tags
   ```

   or with yarn:

   ```shell
   yarn add @mmisty/cypress-tags -D
   ```

2. configure project:

   Put into your support.ts (or e2e.ts) file
   ```javascript
   import '@mmisty/cypress-tags'
   ```
3. That's it! Types should be added automatically if you use typescript.


## Adding tags
There are several ways to add tags: 
 1. inline tags - just add them into test or suite title (ex `@simple`, `@tag("info")`)
   ```javascript
   it('test with tags @simple @tag("withInfo")', function () { 
      // ...
   });
   ```
 2. cypress configuration object:
   ```javascript
   it('test with tags', { tags: ['@abc'] }, function () { 
      // ...
   });
   ```
 3. cypress configuration object may also have a string type and also parsed tag type: 
   ```javascript
   it('test with tags', { tags: '@abc' }, function () {
      // ...
   });
   ```
   ```javascript
   it('test with tags', { tags: [{ tag: '@abc', info: ['my info'] }] }, function () {
      // ...
   });
   ```

## Using tags

When tags are added to a test you can use them within hooks.
This may be helpful when you want to do some action depending on tags: 

Example (will skip tests with `@skip` tag):

```javascript
// my.test.ts
it('test to skip @skip', function () {
   // ...
});

// e2e.ts / setup.ts
beforeEach(function() {
  const test = this.currentTest;
  if(test){
    if(test.tags?.map(t => t.tag).includes('@skip')){
      this.skip();
    }
  }
})

```

## Env

To see tags in test / suite title set env variable `cyTagsShowTagsInTitle` to `true`

If you want to keep titles as they are set variable to `undefined`

 - [ ] todo: when var is `true` show only own tags
npm package: @mmisty/eslint-plugin-cypress
Description: additional rules for cypress tests
Author: Taisia Pitko
Latest version: 0.0.5

# @mmisty/eslint-plugin-cypress

Additional linter rules for cypress tests


## Table of Contents

1. [Installation](#installation)
1. [Recommended settings](#recommended-settings)
2. [Setup](#setup)
3. [Rules](#rules)
    - [disallow-get-get-chain](#disallow-get-get-chain)
    - [test-title-pattern](#test-title-pattern)
    - [disallow-only](#disallow-only)
   
### Installation

````shell script
yarn add -D @mmisty/eslint-plugin-cypress
````

````shell script
npm i --save-dev @mmisty/eslint-plugin-cypress
````

### Recommended settings
You can use recommended settings for cypress or jest.

Just add the following into .eslintrc.js

```
// .eslintrc.js
extends: ['plugin:@mmisty/cypress/recommended'],
```

### Setup

To enable rules add the following to plugins section in your .eslintrc.js:
```
plugins: ['@mmisty/cypress'],
```

and add rules you want: 

```
rules: {
  "@mmisty/cypress/test-title-pattern": 'error'
}
```


## Rules

### disallow-get-get-chain

Disallows chaining specified commands (default `['get']`).

Will warn when user tries to do chains like `cy.get('id').get('id2');`

```
rules: {
  '@mmisty/cypress/disallow-get-get-chain': ['error', { methods: ['qaId', 'get'] }],
}
```

### test-title-pattern

The rule will check whether test has title matched with pattern - default pattern not allows '.' at the end of test title

Available options: 

| Option      | Description                      |
|-------------|----------------------------------|
| pattern     | regexp                           |
| message     | string, error message            |
| identifiers | test identifiers. ex `it`/`xit`  |


To configure the rule with options: 
```
rules: {
  "@mmisty/cypress/test-title-pattern": ["error", {
     pattern: /^ID\d+\w+should/i,
     message: "Test should have ID",
     identifiers: ['it']
  }],
},
```

### disallow-only

Disallows `.only` in tests
To configure the rule:

```
rules: {
  "@mmisty/cypress/disallow-only": "error",
},
```