Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make visible children of display contents pass the should('be.visible') test #26818

Closed

Conversation

bastiansmn
Copy link

Make children of display contents that are visible pass the should('be.visible') test

Additional details

This PR doesn't fix the fact that the element marked as display: contents; overflow: hidden is still not visible since it doesn't fit the visibility definition.
See more with the related discussion

Steps to test

On a project with Cypress installed, insert an element with bugged-CSS properties.

<section style="display: contents; overflow: hidden">
  <p>
    Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse, harum.
  </p>
</section>

Now with Cypress, test the following :

describe('example to-do app', () => {
  beforeEach(() => {
    cy.visit('<your_url>')
  })

  it('p element should be visible', () => {
    cy.get('<querySelector path>').should("be.visible")
  })
})

How has the user experience changed?

PR Tasks

I actually don't think it's a user-facing change, but maybe we can add something to the documentation.
I also don't find any tests to the driver package.

Since it is my first PR, can you tell me if I'm missing something ?

@CLAassistant
Copy link

CLAassistant commented May 21, 2023

CLA assistant check
All committers have signed the CLA.

@cypress-app-bot
Copy link
Collaborator

@bastiansmn bastiansmn changed the title Make visible children of display contents pass the should('be.visible') test fix: make visible children of display contents pass the should('be.visible') test May 21, 2023
@cypress
Copy link

cypress bot commented May 21, 2023

2 failed and 33 flaky tests on run #46622 ↗︎

2 27300 1308 0 Flakiness 33

Details:

Fix 25199: Make children of display contents that are visible pass the should('b...
Project: cypress Commit: 6616f6a8bb
Status: Failed Duration: 19:55 💡
Started: May 21, 2023 4:09 PM Ended: May 21, 2023 4:29 PM
Failed  debug.cy.ts • 1 failed test • app-e2e

View Output Video

Test Artifacts
App - Debug Page > shows information about a failed spec Output Screenshots Video
Failed  scaffold-project.cy.ts • 1 failed test • launchpad-e2e

View Output Video

Test Artifacts
scaffolding new projects > generates valid config file for pristine project without cypress installed Output Screenshots Video
Flakiness  create-from-component.cy.ts • 2 flaky tests • app-e2e

View Output Video

Test Artifacts
... > runs generated spec Output Screenshots Video
... > runs generated spec Output Screenshots Video
Flakiness  runs.cy.ts • 1 flaky test • app-e2e

View Output Video

Test Artifacts
App: Runs > Runs - Create Project > when a project is created, injects new projectId into the config file, and sends expected UTM params Output Screenshots Video
Flakiness  specs_list_latest_runs.cy.ts • 1 flaky test • app-e2e

View Output Video

Test Artifacts
App/Cloud Integration - Latest runs and Average duration > when no runs are recorded > shows placeholders for all visible specs Output Screenshots Video
Flakiness  cypress-in-cypress-component.cy.ts • 1 flaky test • app-e2e

View Output Video

Test Artifacts
Cypress In Cypress CT > default config > redirects to the specs list with error if a spec is not found Output Screenshots Video
Flakiness  cypress-origin-communicator.cy.ts • 1 flaky test • app-e2e

View Output Video

Test Artifacts
Cypress In Cypress Origin Communicator > cy.origin passivity with app interactions > passes upon test reload mid test execution Output Screenshots Video

The first 5 flaky specs are shown, see all 18 specs in Cypress Cloud.

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

@warrensplayer
Copy link
Contributor

@bastiansmn Thanks so much for this fix. I apologize for taking so long to get back with you.

Can you please write a test for this update? You can create one similar to the test in this PR: #8130

Also, please pull in the latest from develop and update the changelog entry. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

An ancestor element with display: contents and overflow: hidden causes visibility check to fail
7 participants