Skip to content

Commit

Permalink
chore: try triggering mouseleave on buttons to ensure that tooltips a…
Browse files Browse the repository at this point in the history
…ren't showing (#26524)

Co-authored-by: Mark Noonan <mark@cypress.io>
  • Loading branch information
astone123 and marktnoonan authored Apr 24, 2023
1 parent e2439b1 commit d6f525c
Showing 1 changed file with 6 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@ import { Clipboard_CopyToClipboardDocument } from '../../generated/graphql-test'
import SelectorPlayground from './SelectorPlayground.vue'
import { logger } from '../logger'

/**
* Helper to reset focus for tooltips
* jQuery .blur() seemed unreliable, leading to flake
*/
function clickAway () {
cy.get('body').click('topLeft')
}

describe('SelectorPlayground', () => {
const mountSelectorPlayground = (
eventManager = createEventManager(),
Expand Down Expand Up @@ -121,9 +113,10 @@ describe('SelectorPlayground', () => {
cy.get('@copy').click()
cy.get('@copy').should('be.focused')

// make sure some tooltip is not already showing
// trigger mouseleave on print button to ensure tooltip is not showing
// sometimes there's flake in CI because mouse position is over "print to console" button
clickAway()
cy.get('[data-cy="playground-print"]').trigger('mouseleave')

cy.get('[data-cy="playground-copy"]').trigger('mouseenter')
cy.get('[data-cy="selector-playground-tooltip"]').should('be.visible').contains('Copy to clipboard')

Expand Down Expand Up @@ -194,21 +187,21 @@ describe('SelectorPlayground', () => {

cy.get('[data-cy="playground-toggle"]').focus()
cy.get('[data-cy="selector-playground-tooltip"]').should('be.visible').contains('Click an element to see a suggested selector')
clickAway()
cy.get('[data-cy="playground-toggle"]').trigger('mouseleave')
cy.get('[data-cy="selector-playground-tooltip"]').should('not.exist')

cy.get('[data-cy="playground-copy"]').focus()
cy.get('[data-cy="selector-playground-tooltip"]').should('be.visible').contains('Copy to clipboard')
cy.get('[data-cy="playground-copy"]').click()
cy.get('[data-cy="selector-playground-tooltip"]').should('be.visible').contains('Copied')
clickAway()
cy.get('[data-cy="playground-copy"]').trigger('mouseleave')
cy.get('[data-cy="selector-playground-tooltip"]').should('not.exist')

cy.get('[data-cy="playground-print"]').focus()
cy.get('[data-cy="selector-playground-tooltip"]').should('be.visible').contains('Print to console')
cy.get('[data-cy="playground-print"]').click()
cy.get('[data-cy="selector-playground-tooltip"]').should('be.visible').contains('Printed')
clickAway()
cy.get('[data-cy="playground-print"]').trigger('mouseleave')
cy.get('[data-cy="selector-playground-tooltip"]').should('not.exist')
})

Expand Down

5 comments on commit d6f525c

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on d6f525c Apr 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/12.11.0/linux-arm64/develop-d6f525c233f17a2d701cf236aab9f1e273c476b9/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on d6f525c Apr 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/12.11.0/linux-x64/develop-d6f525c233f17a2d701cf236aab9f1e273c476b9/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on d6f525c Apr 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/12.11.0/darwin-arm64/develop-d6f525c233f17a2d701cf236aab9f1e273c476b9/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on d6f525c Apr 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/12.11.0/darwin-x64/develop-d6f525c233f17a2d701cf236aab9f1e273c476b9/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on d6f525c Apr 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the win32 x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/12.11.0/win32-x64/develop-d6f525c233f17a2d701cf236aab9f1e273c476b9/cypress.tgz

Please sign in to comment.