Skip to content

Commit

Permalink
feat: move .contains() and .shadow() to be queries; remove cy.ng() (#…
Browse files Browse the repository at this point in the history
…23791)

* First stab at removing old .get() implementation

* Fix TS and a couple of tests

* Fix tests and TS

* Fix case-sensitivity for .contains()

* Stop TS complaining

* Rework cy-contains jquery expression

* Add comments, make ts happy

* Fix one test, review feedback

* Review updates

* Fix additional tests

* Fix accidental deletion of vital code

* One more try at getting logs right

* Fix race condition in cross-origin .contains

* Add commented out test to ensure .within() works properly with selectors

* Fix for sessions + query subject chaining

* Fix mixing .within() shadow DOM and .contains() in same chainer

* One more attempt at .within + .contains

* Fix rebase commits
  • Loading branch information
Blue F authored Oct 11, 2022
1 parent 555ed23 commit 2326f96
Show file tree
Hide file tree
Showing 25 changed files with 319 additions and 1,219 deletions.
5 changes: 3 additions & 2 deletions packages/app/cypress/e2e/reporter_header.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ describe('Reporter Header', () => {
cy.get('[data-selected-spec="false"]').should('have.length', '27')
})

it('filters the list of specs when searching for specs', () => {
// TODO: Reenable as part of https://github.com/cypress-io/cypress/issues/23902
it.skip('filters the list of specs when searching for specs', () => {
cy.get('body').type('f')

cy.findByTestId('specs-list-panel').within(() => {
Expand All @@ -28,7 +29,7 @@ describe('Reporter Header', () => {

cy.get('@searchInput').clear()

cy.get('[data-cy="spec-file-item"]').should('have.length', 3)
cy.get('[data-cy="spec-file-item"]').should('have.length', 23)

cy.get('@searchInput').type('asdf', { force: true })

Expand Down
9 changes: 9 additions & 0 deletions packages/driver/cypress/e2e/commands/aliasing.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -495,5 +495,14 @@ describe('src/cy/commands/aliasing', () => {
.get('@lastDiv')
})
})

// TODO: Re-enable as part of https://github.com/cypress-io/cypress/issues/23902
it.skip('maintains .within() context while reading aliases', () => {
cy.get('#specific-contains').within(() => {
cy.get('span').as('spanWithin').should('have.length', 1)
})

cy.get('@spanWithin').should('have.length', 1)
})
})
})
332 changes: 0 additions & 332 deletions packages/driver/cypress/e2e/commands/angular.cy.js

This file was deleted.

4 changes: 1 addition & 3 deletions packages/driver/cypress/e2e/commands/assertions.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,6 @@ describe('src/cy/commands/assertions', () => {
assertLogLength(this.logs, 6)

expect(this.logs[3].get('name')).to.eq('get')
expect(this.logs[3].get('state')).to.eq('failed')
expect(this.logs[3].get('error')).to.eq(err)

expect(this.logs[4].get('name')).to.eq('assert')
expect(this.logs[4].get('state')).to.eq('failed')
Expand Down Expand Up @@ -448,7 +446,7 @@ describe('src/cy/commands/assertions', () => {
done()
})

cy.contains('Nested Find').should('have.length', 2)
cy.contains('Nested Find', { timeout: 50 }).should('have.length', 2)
})

// https://github.com/cypress-io/cypress/issues/6384
Expand Down
Loading

0 comments on commit 2326f96

Please sign in to comment.