{
  "doc": {
    "id": "app/references/assertions",
    "title": "Assertions in Cypress: A Guide",
    "description": "Assertions available in Cypress with Chai, Chai-jQuery, and Sinon-Chai assertions",
    "section": "app",
    "source_path": "/llm/markdown/app/references/assertions.md",
    "version": "ce02913654e2655ee63448bdc92bb92c7b46a619",
    "updated_at": "2026-04-22T19:37:51.587Z",
    "headings": [
      {
        "id": "app/references/assertions#assertions",
        "text": "Assertions",
        "level": 1
      },
      {
        "id": "app/references/assertions#what-youll-learn",
        "text": " What you'll learn",
        "level": 5
      },
      {
        "id": "app/references/assertions#chai",
        "text": "Chai",
        "level": 2
      },
      {
        "id": "app/references/assertions#chai-jquery",
        "text": "Chai-jQuery",
        "level": 2
      },
      {
        "id": "app/references/assertions#sinon-chai",
        "text": "Sinon-Chai",
        "level": 2
      },
      {
        "id": "app/references/assertions#adding-new-assertions",
        "text": "Adding New Assertions",
        "level": 2
      },
      {
        "id": "app/references/assertions#common-assertions",
        "text": "Common Assertions",
        "level": 2
      },
      {
        "id": "app/references/assertions#length",
        "text": "Length",
        "level": 3
      },
      {
        "id": "app/references/assertions#class",
        "text": "Class",
        "level": 3
      },
      {
        "id": "app/references/assertions#value",
        "text": "Value",
        "level": 3
      },
      {
        "id": "app/references/assertions#text-content",
        "text": "Text Content",
        "level": 3
      },
      {
        "id": "app/references/assertions#visibility",
        "text": "Visibility",
        "level": 3
      },
      {
        "id": "app/references/assertions#existence",
        "text": "Existence",
        "level": 3
      },
      {
        "id": "app/references/assertions#state",
        "text": "State",
        "level": 3
      },
      {
        "id": "app/references/assertions#css",
        "text": "CSS",
        "level": 3
      },
      {
        "id": "app/references/assertions#disabled-property",
        "text": "Disabled property",
        "level": 3
      },
      {
        "id": "app/references/assertions#negative-assertions",
        "text": "Negative assertions",
        "level": 2
      },
      {
        "id": "app/references/assertions#false-passing-tests",
        "text": " False passing tests",
        "level": 3
      },
      {
        "id": "app/references/assertions#should-callback",
        "text": "Should callback",
        "level": 2
      },
      {
        "id": "app/references/assertions#multiple-assertions",
        "text": "Multiple assertions",
        "level": 2
      },
      {
        "id": "app/references/assertions#see-also",
        "text": "See also",
        "level": 2
      }
    ]
  },
  "content": {
    "type": "root",
    "children": [
      {
        "type": "heading",
        "depth": 1,
        "children": [
          {
            "type": "text",
            "value": "Assertions"
          }
        ]
      },
      {
        "type": "heading",
        "depth": 5,
        "children": [
          {
            "type": "text",
            "value": " What you'll learn"
          }
        ]
      },
      {
        "type": "list",
        "ordered": false,
        "start": null,
        "spread": false,
        "children": [
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "text",
                    "value": "Assertions available in Cypress with Chai, Chai-jQuery, and Sinon-Chai assertions"
                  }
                ]
              }
            ]
          },
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "text",
                    "value": "How to write assertions for common use cases"
                  }
                ]
              }
            ]
          },
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "text",
                    "value": "How to chain assertions together"
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Cypress bundles the popular "
          },
          {
            "type": "link",
            "title": null,
            "url": "/llm/markdown/app/references/assertions.md#Chai",
            "children": [
              {
                "type": "text",
                "value": "Chai"
              }
            ]
          },
          {
            "type": "text",
            "value": " assertion\nlibrary, as well as helpful extensions for\n"
          },
          {
            "type": "link",
            "title": null,
            "url": "/llm/markdown/app/references/assertions.md#Sinon-Chai",
            "children": [
              {
                "type": "text",
                "value": "Sinon"
              }
            ]
          },
          {
            "type": "text",
            "value": " and\n"
          },
          {
            "type": "link",
            "title": null,
            "url": "/llm/markdown/app/references/assertions.md#Chai-jQuery",
            "children": [
              {
                "type": "text",
                "value": "jQuery"
              }
            ]
          },
          {
            "type": "text",
            "value": ", bringing you dozens of\npowerful assertions for free."
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "If you're looking to understand how to use these assertions please read\nabout assertions in our\n"
          },
          {
            "type": "link",
            "title": null,
            "url": "/llm/markdown/app/core-concepts/introduction-to-cypress.md#Assertions",
            "children": [
              {
                "type": "text",
                "value": "Introduction to Cypress"
              }
            ]
          },
          {
            "type": "text",
            "value": "\nguide."
          }
        ]
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "Chai"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Icon"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "These chainers are available for BDD assertions (`expect`/`should`). Aliases\nlisted can be used interchangeably with their original chainer. You can see the\nentire list of available BDD Chai assertions "
          },
          {
            "type": "link",
            "title": null,
            "url": "http://chaijs.com/api/bdd/",
            "children": [
              {
                "type": "text",
                "value": "here"
              }
            ]
          },
          {
            "type": "text",
            "value": "."
          }
        ]
      },
      {
        "type": "table",
        "align": [
          null,
          null
        ],
        "children": [
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Chainer"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Example"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "not"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('not.equal', 'Jane')``expect(name).to.not.equal('Jane') ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "deep"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('deep.equal', { name: 'Jane' })``expect(obj).to.deep.equal({ name: 'Jane' }) ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "nested"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.nested.property', 'a.b[1]')``.should('nested.include', {'a.b[1]': 'y'})``expect({a: {b: 'x'}}).to.have.nested.property('a.b')``expect({a: {b: 'x'}}).to.nested.include({'a.b': 'x'}) ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "ordered"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.ordered.members', [1, 2])``expect([1, 2]).to.have.ordered.members([1, 2])``expect([1, 2]).not.to.have.ordered.members([2, 1]) ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "any"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.any.keys', 'age')``expect(arr).to.have.any.keys('age') ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "all"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.all.keys', 'name', 'age')``expect(arr).to.have.all.keys('name', 'age') ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "a(type) Aliases: an"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('be.a', 'string')``expect('test').to.be.a('string') ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "include(value) Aliases: contain, includes, contains"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('include', 2)``expect([1,2,3]).to.include(2) ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "ok"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('not.be.ok')``expect(undefined).to.not.be.ok ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "true"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('be.true')``expect(true).to.be.true ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "false"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('be.false')``expect(false).to.be.false ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "null"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('be.null')``expect(null).to.be.null ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "undefined"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('be.undefined')``expect(undefined).to.be.undefined ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "exist"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('exist')``expect(myVar).to.exist ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "empty"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('be.empty')``expect([]).to.be.empty ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "arguments Aliases: Arguments"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('be.arguments')``expect(arguments).to.be.arguments ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "equal(value) Aliases: equals, eq"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('equal', 42)``expect(42).to.equal(42) ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "deep.equal(value)"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('deep.equal', { name: 'Jane' })``expect({ name: 'Jane' }).to.deep.equal({ name: 'Jane' }) ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "eql(value) Aliases: eqls"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('eql', { name: 'Jane' })``expect({ name: 'Jane' }).to.eql({ name: 'Jane' }) ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "greaterThan(value) Aliases: gt, above"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('be.greaterThan', 5)``expect(10).to.be.greaterThan(5) ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "least(value)Aliases: gte"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('be.at.least', 10)``expect(10).to.be.at.least(10) ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "lessThan(value) Aliases: lt, below"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('be.lessThan', 10)``expect(5).to.be.lessThan(10) ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "most(value) Aliases: lte"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.length.of.at.most', 4)``expect('test').to.have.length.of.at.most(4) ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "within(start, finish)"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('be.within', 5, 10)``expect(7).to.be.within(5, 10) ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "instanceOf(constructor) Aliases: instanceof"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('be.instanceOf', Array)``expect([1, 2, 3]).to.be.instanceOf(Array) ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "property(name, [value])"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.property', 'name')``expect(obj).to.have.property('name') ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "deep.property(name, [value])"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.deep.property', 'tests[1]', 'e2e')``expect(deepObj).to.have.deep.property('tests[1]', 'e2e') ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "ownProperty(name) Aliases: haveOwnProperty, own.property"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.ownProperty', 'length')``expect('test').to.have.ownProperty('length') ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "ownPropertyDescriptor(name) Aliases: haveOwnPropertyDescriptor"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.ownPropertyDescriptor', 'a')``expect({a: 1}).to.have.ownPropertyDescriptor('a') ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "lengthOf(value)"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.lengthOf', 4)``expect('test').to.have.lengthOf(4) ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "match(RegExp) Aliases: matches"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('to.match', /^test/)``expect('testing').to.match(/^test/) ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "string(string)"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.string', 'test')``expect('testing').to.have.string('test') ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "keys(key1, [key2], [...]) Aliases: key"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.keys', 'pass', 'fail')``expect({ pass: 1, fail: 2 }).to.have.keys('pass', 'fail') ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "throw(constructor) Aliases: throws, Throw"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('throw', Error)``expect(fn).to.throw(Error) ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "respondTo(method) Aliases: respondsTo"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('respondTo', 'getName')``expect(obj).to.respondTo('getName') ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "itself"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('itself.respondTo', 'getName')``expect(Foo).itself.to.respondTo('bar') ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "satisfy(method) Aliases: satisfies"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('satisfy', (num) => num > 0)``expect(1).to.satisfy((num) => num > 0) ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "closeTo(expected, delta) Aliases: approximately"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('be.closeTo', 1, 0.5)``expect(1.5).to.be.closeTo(1, 0.5) ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "members(set)"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('include.members', [3, 2])``expect([1, 2, 3]).to.include.members([3, 2]) ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "oneOf(values)"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('be.oneOf', [1, 2, 3])``expect(2).to.be.oneOf([1,2,3]) ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "change(function) Aliases: changes"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('change', obj, 'val')``expect(fn).to.change(obj, 'val') ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "increase(function) Aliases: increases"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('increase', obj, 'val')``expect(fn).to.increase(obj, 'val') ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "decrease(function) Aliases: decreases"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('decrease', obj, 'val')``expect(fn).to.decrease(obj, 'val') ```"
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "These getters are also available for BDD assertions. They don't actually do\nanything, but they enable you to write clear, English sentences."
          }
        ]
      },
      {
        "type": "table",
        "align": [
          null
        ],
        "children": [
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Chainable getters"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "`to`, `be`, `been`, `is`, `that`, `which`, `and`, `has`, `have`, `with`, `at`, `of`, `same`"
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "Chai-jQuery"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Icon"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "These chainers are available when asserting about a DOM object."
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "You will commonly use these chainers after using DOM commands like:\n"
          },
          {
            "type": "link",
            "title": null,
            "url": "/llm/markdown/api/commands/get.md",
            "children": [
              {
                "type": "text",
                "value": "`cy.get()`"
              }
            ]
          },
          {
            "type": "text",
            "value": ", "
          },
          {
            "type": "link",
            "title": null,
            "url": "/llm/markdown/api/commands/contains.md",
            "children": [
              {
                "type": "text",
                "value": "`cy.contains()`"
              }
            ]
          },
          {
            "type": "text",
            "value": ", etc."
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "/* textlint-disable */"
          }
        ]
      },
      {
        "type": "table",
        "align": [
          null,
          null
        ],
        "children": [
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Chainers"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Assertion"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "attr(name, [value])"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.attr', 'bar')``expect($el).to.have.attr('foo', 'bar') ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "prop(name, [value])"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.prop', 'disabled', false)``expect($el).to.have.prop('disabled', false) ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "css(name, [value])"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.css', 'background-color', 'rgb(0, 0, 0)')``expect($el).to.have.css('background-color', 'rgb(0, 0, 0)') ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "data(name, [value])"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.data', 'foo', 'bar')``expect($el).to.have.data('foo', 'bar') ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "class(className)"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.class', 'foo')``expect($el).to.have.class('foo') ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "id(id)"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.id', 'foo')``expect($el).to.have.id('foo') ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "html(html)"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.html', 'I love testing')``expect($el).to.have.html('with Cypress') ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "text(text)"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.text', 'I love testing')``expect($el).to.have.text('with Cypress') ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "value(value)"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.value', 'test@dev.com')``expect($el).to.have.value('test@dev.com') ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "visible"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('be.visible')``expect($el).to.be.visible ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "hidden"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('be.hidden')``expect($el).to.be.hidden ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "selected"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('be.selected')``expect($option).not.to.be.selected ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "checked"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('be.checked')``expect($input).not.to.be.checked ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "focus[ed]"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.focus')``expect($input).not.to.be.focused``expect($input).to.have.focus ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "enabled"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('be.enabled')``expect($input).to.be.enabled ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "disabled"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('be.disabled')``expect($input).to.be.disabled ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "empty"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('be.empty')``expect($el).not.to.be.empty ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "exist"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('exist')``expect($nonexistent).not.to.exist ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "match(selector)"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('match', ':empty')``expect($emptyEl).to.match(':empty') ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "contain(text)"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('contain', 'text')``expect($el).to.contain('text') ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "descendants(selector)"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.descendants', 'div')``expect($el).to.have.descendants('div') ```"
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "/* textlint-enable */"
          }
        ]
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "Sinon-Chai"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Icon"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "These chainers are used on assertions with "
          },
          {
            "type": "link",
            "title": null,
            "url": "/llm/markdown/api/commands/stub.md",
            "children": [
              {
                "type": "text",
                "value": "`cy.stub()`"
              }
            ]
          },
          {
            "type": "text",
            "value": " and\n"
          },
          {
            "type": "link",
            "title": null,
            "url": "/llm/markdown/api/commands/spy.md",
            "children": [
              {
                "type": "text",
                "value": "`cy.spy()`"
              }
            ]
          },
          {
            "type": "text",
            "value": "."
          }
        ]
      },
      {
        "type": "table",
        "align": [
          null,
          null
        ],
        "children": [
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Sinon.JS property/method"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Assertion"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "called"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.been.called')``expect(spy).to.be.called ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "callCount"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.callCount', 3)``expect(spy).to.have.callCount(n) ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "calledOnce"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.been.calledOnce')``expect(spy).to.be.calledOnce ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "calledTwice"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.been.calledTwice')``expect(spy).to.be.calledTwice ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "calledThrice"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.been.calledThrice')``expect(spy).to.be.calledThrice ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "calledBefore"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.been.calledBefore', spy2)``expect(spy1).to.be.calledBefore(spy2) ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "calledAfter"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.been.calledAfter', spy2)``expect(spy1).to.be.calledAfter(spy2) ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "calledWithNew"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.been.calledWithNew')``expect(spy).to.be.calledWithNew ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "alwaysCalledWithNew"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.always.been.calledWithNew')``expect(spy).to.always.be.calledWithNew ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "calledOn"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.been.calledOn', context)``expect(spy).to.be.calledOn(context) ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "alwaysCalledOn"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.always.been.calledOn', context)``expect(spy).to.always.be.calledOn(context) ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "calledWith"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.been.calledWith', ...args)``expect(spy).to.be.calledWith(...args) ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "alwaysCalledWith"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.always.been.calledWith', ...args)``expect(spy).to.always.be.calledWith(...args) ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "calledOnceWith"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.been.calledOnceWith', ...args)``expect(spy).to.be.calledOnceWith(...args) ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "calledWithExactly"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.been.calledWithExactly', ...args)``expect(spy).to.be.calledWithExactly(...args) ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "alwaysCalledWithExactly"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.always.been.calledWithExactly', ...args)``expect(spy).to.always.be.calledWithExactly(...args) ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "calledOnceWithExactly"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.been.calledOnceWithExactly', ...args)``expect(spy).to.be.calledOnceWithExactly(...args) ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "calledWithMatch"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.been.calledWithMatch',...args)``expect(spy).to.be.calledWithMatch(...args) ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "alwaysCalledWithMatch"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.always.been.calledWithMatch',...args)``expect(spy).to.always.be.calledWithMatch(...args) ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "returned"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.returned', 'foo')``expect(spy).to.have.returned(returnVal) ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "alwaysReturned"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.always.returned', 'foo')``expect(spy).to.have.always.returned(returnVal) ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "threw"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.thrown', TypeError)``expect(spy).to.have.thrown(errorObjOrErrorTypeStringOrNothing) ```"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "alwaysThrew"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "``` .should('have.always.thrown', 'TypeError')``expect(spy).to.have.always.thrown(errorObjOrErrorTypeStringOrNothing) ```"
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "Adding New Assertions"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Because we are using `chai`, that means you can extend it however you'd like.\nCypress will \"just work\" with new assertions added to `chai`. You can:"
          }
        ]
      },
      {
        "type": "list",
        "ordered": false,
        "start": null,
        "spread": false,
        "children": [
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "text",
                    "value": "Write your own `chai` assertions as\n"
                  },
                  {
                    "type": "link",
                    "title": null,
                    "url": "https://chaijs.com/guide/helpers/",
                    "children": [
                      {
                        "type": "text",
                        "value": "documented here"
                      }
                    ]
                  },
                  {
                    "type": "text",
                    "value": "."
                  }
                ]
              }
            ]
          },
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "text",
                    "value": "npm install any existing `chai` library and import into your test file or\n"
                  },
                  {
                    "type": "link",
                    "title": null,
                    "url": "/llm/markdown/app/core-concepts/writing-and-organizing-tests.md#Support-file",
                    "children": [
                      {
                        "type": "text",
                        "value": "support file"
                      }
                    ]
                  },
                  {
                    "type": "text",
                    "value": "."
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "link",
            "title": null,
            "url": "/llm/markdown/app/references/recipes.md#Fundamentals",
            "children": [
              {
                "type": "text",
                "value": "Check out our example recipe extending chai with new assertions."
              }
            ]
          }
        ]
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "Common Assertions"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Here is a list of common element assertions. Notice how we use these assertions\n(listed above) with "
          },
          {
            "type": "link",
            "title": null,
            "url": "/llm/markdown/api/commands/should.md",
            "children": [
              {
                "type": "text",
                "value": "`.should()`"
              }
            ]
          },
          {
            "type": "text",
            "value": ". You may also want to\nread about how Cypress "
          },
          {
            "type": "link",
            "title": null,
            "url": "/llm/markdown/app/core-concepts/retry-ability.md",
            "children": [
              {
                "type": "text",
                "value": "retries"
              }
            ]
          },
          {
            "type": "text",
            "value": "\nassertions."
          }
        ]
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Length"
          }
        ]
      },
      {
        "type": "code",
        "lang": "javascript",
        "meta": null,
        "value": "// retry until we find 3 matching <li.selected>\ncy.get('li.selected').should('have.length', 3)"
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Class"
          }
        ]
      },
      {
        "type": "code",
        "lang": "javascript",
        "meta": null,
        "value": "// retry until this input does not have class disabled\ncy.get('form').find('input').should('not.have.class', 'disabled')"
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Value"
          }
        ]
      },
      {
        "type": "code",
        "lang": "javascript",
        "meta": null,
        "value": "// retry until this textarea has the correct value\ncy.get('textarea').should('have.value', 'foo bar baz')"
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Text Content"
          }
        ]
      },
      {
        "type": "code",
        "lang": "javascript",
        "meta": null,
        "value": "// assert the element's text content is exactly the given text\ncy.get('[data-testid=\"user-name\"]').should('have.text', 'Joe Smith')\n// assert the element's text includes the given substring\ncy.get('[data-testid=\"address\"]').should('include.text', 'Atlanta')\n// retry until this span does not contain 'click me'\ncy.get('a').parent('span.help').should('not.contain', 'click me')\n// the element's text should start with \"Hello\"\ncy.get('[data-testid=\"greeting\"]')\n  .invoke('text')\n  .should('match', /^Hello/)\n// use cy.contains to find an element with its text\n// matching the given regular expression\ncy.contains('[data-testid=\"greeting\"]', /^Hello/)"
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Tip: read about assertions against text with non-breaking space entities in\n"
          },
          {
            "type": "link",
            "title": null,
            "url": "/llm/markdown/app/faq.md#How-do-I-get-an-elements-text-contents",
            "children": [
              {
                "type": "text",
                "value": "How do I get an element's text contents?"
              }
            ]
          }
        ]
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Visibility"
          }
        ]
      },
      {
        "type": "code",
        "lang": "javascript",
        "meta": null,
        "value": "// retry until the element with\n// data-testid \"form-submit\" is visible\ncy.get('[data-testid=\"form-submit\"]').should('be.visible')\n// retry until the list item with\n// text \"write tests\" is visible\ncy.contains('[data-testid=\"todo\"] li', 'write tests').should('be.visible')"
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Note: if there are multiple elements, the assertions `be.visible` and\n`not.be.visible` act differently:"
          }
        ]
      },
      {
        "type": "code",
        "lang": "javascript",
        "meta": null,
        "value": "// retry until SOME elements are visible\ncy.get('li').should('be.visible')\n// retry until EVERY element is invisible\ncy.get('li.hidden').should('not.be.visible')"
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Watch the short video\n"
          },
          {
            "type": "link",
            "title": null,
            "url": "https://www.youtube.com/watch?v=LxkrhUEE2Qk",
            "children": [
              {
                "type": "text",
                "value": "\"Multiple elements and should('be.visible') assertion\""
              }
            ]
          },
          {
            "type": "text",
            "value": "\nthat shows how to correctly check the visibility of elements."
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Visibility Semantics"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "For detailed information about how Cypress determines element visibility, including the default behavior and the experimental fast visibility algorithm, see "
          },
          {
            "type": "link",
            "title": null,
            "url": "/llm/markdown/app/core-concepts/interacting-with-elements.md#Visibility",
            "children": [
              {
                "type": "text",
                "value": "Visibility"
              }
            ]
          },
          {
            "type": "text",
            "value": "."
          }
        ]
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Existence"
          }
        ]
      },
      {
        "type": "code",
        "lang": "javascript",
        "meta": null,
        "value": "// retry until loading spinner no longer exists\ncy.get('[data-testid=\"loading\"]').should('not.exist')"
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "State"
          }
        ]
      },
      {
        "type": "code",
        "lang": "javascript",
        "meta": null,
        "value": "// retry until our radio is checked\ncy.get(':radio').should('be.checked')"
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "CSS"
          }
        ]
      },
      {
        "type": "code",
        "lang": "javascript",
        "meta": null,
        "value": "// retry until element has matching css\ncy.get('[data-testid=\"completed\"]').should(\n  'have.css',\n  'text-decoration',\n  'line-through'\n)"
      },
      {
        "type": "code",
        "lang": "javascript",
        "meta": null,
        "value": "// retry while accordion css has the\n// \"display: none\" property\ncy.get('[data-testid=\"accordion\"]').should('not.have.css', 'display', 'none')"
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Disabled property"
          }
        ]
      },
      {
        "type": "code",
        "lang": "html",
        "meta": null,
        "value": "<input type=\"text\" data-testid=\"example-input\" disabled />"
      },
      {
        "type": "code",
        "lang": "javascript",
        "meta": null,
        "value": "cy.get('[data-testid=\"example-input\"]')\n  .should('be.disabled')\n  // let's enable this element from the test\n  .invoke('prop', 'disabled', false)\n\ncy.get('[data-testid=\"example-input\"]')\n  // we can use \"enabled\" assertion\n  .should('be.enabled')\n  // or negate the \"disabled\" assertion\n  .and('not.be.disabled')"
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "Negative assertions"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "There are positive and negative assertions. Examples of positive assertions are:"
          }
        ]
      },
      {
        "type": "code",
        "lang": "javascript",
        "meta": null,
        "value": "cy.get('[data-testid=\"todo-item\"]')\n  .should('have.length', 2)\n  .and('have.class', 'completed')"
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "The negative assertions have the \"not\" chainer prefixed to the assertion.\nExamples of negative assertions are:"
          }
        ]
      },
      {
        "type": "code",
        "lang": "javascript",
        "meta": null,
        "value": "cy.contains('first todo').should('not.have.class', 'completed')\ncy.get('[data-testid=\"loading\"]').should('not.be.visible')"
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": " False passing tests"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Negative assertions may pass for reasons you weren't expecting. Let's say we\nwant to test that a Todo list app adds a new Todo item after typing the Todo and\npressing enter."
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Positive assertions"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "When adding an element to the list and using a positive assertion, the test\nasserts a specific number of Todo items in our application."
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "The test below may still falsely pass if the application behaves unexpectedly,\nlike adding a blank Todo, instead of adding the new Todo with the text \"Write\ntests\"."
          }
        ]
      },
      {
        "type": "code",
        "lang": "javascript",
        "meta": null,
        "value": "cy.get('[data-testid=\"todos\"]').should('have.length', 2)\ncy.get('[data-testid=\"new-todo\"]').type('Write tests{enter}')\n\n// using a positive assertion to check the\n// exact number of items\ncy.get('[data-testid=\"todos\"]').should('have.length', 3)"
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Negative assertions"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "But when using a negative assertion in the test below, the test can falsely\npass when the application behaves in multiple unexpected ways:"
          }
        ]
      },
      {
        "type": "list",
        "ordered": false,
        "start": null,
        "spread": false,
        "children": [
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "text",
                    "value": "The app deletes the entire list of Todo items instead of inserting the 3rd\nTodo"
                  }
                ]
              }
            ]
          },
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "text",
                    "value": "The app deletes a Todo instead of adding a new Todo"
                  }
                ]
              }
            ]
          },
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "text",
                    "value": "The app adds a blank Todo"
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "type": "code",
        "lang": "javascript",
        "meta": null,
        "value": "cy.get('[data-testid=\"todos\"]').should('have.length', 2)\ncy.get('[data-testid=\"new-todo\"]').type('Write tests{enter}')\n\n// using negative assertion to check it's\n// not a number of items\ncy.get('[data-testid=\"todos\"]').should('not.have.length', 2)"
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "Should callback"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "If built-in assertions are not enough, you can write your own assertion function\nand pass it as a callback to the `.should()` command. Cypress will automatically\n"
          },
          {
            "type": "link",
            "title": null,
            "url": "/llm/markdown/app/core-concepts/retry-ability.md",
            "children": [
              {
                "type": "text",
                "value": "retry"
              }
            ]
          },
          {
            "type": "text",
            "value": " the callback function until it\npasses or the command times out. See the\n"
          },
          {
            "type": "link",
            "title": null,
            "url": "/llm/markdown/api/commands/should.md#Function",
            "children": [
              {
                "type": "text",
                "value": "`.should()`"
              }
            ]
          },
          {
            "type": "text",
            "value": " documentation."
          }
        ]
      },
      {
        "type": "code",
        "lang": "html",
        "meta": null,
        "value": "<div class=\"main-abc123 heading-xyz987\">Introduction</div>"
      },
      {
        "type": "code",
        "lang": "javascript",
        "meta": null,
        "value": "cy.get('div').should(($div) => {\n  expect($div).to.have.length(1)\n\n  const className = $div[0].className\n\n  // className will be a string like \"main-abc123 heading-xyz987\"\n  expect(className).to.match(/heading-/)\n})"
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "Multiple assertions"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "You can attach multiple assertions to the same command."
          }
        ]
      },
      {
        "type": "code",
        "lang": "html",
        "meta": null,
        "value": "<a\n  data-testid=\"assertions-link\"\n  class=\"active\"\n  href=\"https://on.cypress.io\"\n  target=\"_blank\"\n>\n  Cypress Docs\n</a>"
      },
      {
        "type": "code",
        "lang": "js",
        "meta": null,
        "value": "cy.get('[data-testid=\"assertions-link\"]')\n  .should('have.class', 'active')\n  .and('have.attr', 'href')\n  .and('include', 'cypress.io')"
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Note that all chained assertions will use the same reference to the original\nsubject. For example, if you wanted to test a loading element that first appears\nand then disappears, the following WILL NOT WORK because the same element cannot\nbe visible and invisible at the same time:"
          }
        ]
      },
      {
        "type": "code",
        "lang": "js",
        "meta": null,
        "value": "// ⛔️ DOES NOT WORK\ncy.get('[data-testid=\"loading\"]').should('be.visible').and('not.be.visible')"
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Instead you should split the assertions and re-query the element:"
          }
        ]
      },
      {
        "type": "code",
        "lang": "js",
        "meta": null,
        "value": "// ✅ THE CORRECT WAY\ncy.get('[data-testid=\"loading\"]').should('be.visible')\ncy.get('[data-testid=\"loading\"]').should('not.be.visible')"
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "See also"
          }
        ]
      },
      {
        "type": "list",
        "ordered": false,
        "start": null,
        "spread": false,
        "children": [
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "link",
                    "title": null,
                    "url": "/llm/markdown/app/core-concepts/introduction-to-cypress.md#Assertions",
                    "children": [
                      {
                        "type": "text",
                        "value": "Guide: Introduction to Cypress"
                      }
                    ]
                  }
                ]
              }
            ]
          },
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "link",
                    "title": null,
                    "url": "https://example.cypress.io/commands/assertions",
                    "children": [
                      {
                        "type": "text",
                        "value": "cypress-example-kitchensink Assertions"
                      }
                    ]
                  }
                ]
              }
            ]
          }
        ]
      }
    ]
  },
  "token_estimate": 2319
}