cypress-io / cypress-fiddle

Quickly generates Cypress tests from HTML and JS code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow lists of tests

bahmutov opened this issue ยท comments

Right now to create several tests we can use name as key in an object, which is weird

import { source } from 'common-tags'

export default {
  'cy.wrap()': {
    'detects when property gets added to an object': {
      test: source`
        // an object without a property
        const o = {}
        // property "id" gets added after a delay
        setTimeout(() => {
          o.id = 'abc123'
        }, 500)
        // detects when property "id" get added to the object "o"
        cy.wrap(o).should('have.property', 'id')
      `
    },

I would like to list tests in an array, and use name property

import { source } from 'common-tags'

export default {
  'cy.wrap()': [{
      name: 'detects when property gets added to an object',
      test: source`
        // an object without a property
        const o = {}
        // property "id" gets added after a delay
        setTimeout(() => {
          o.id = 'abc123'
        }, 500)
        // detects when property "id" get added to the object "o"
        cy.wrap(o).should('have.property', 'id')
      `
    },
    // second test

๐ŸŽ‰ This issue has been resolved in version 1.0.0 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€