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

Cypress cant see chrome confirmation box when run test, and cant click on buttons of the confirmation box #4497

Closed
mushon89 opened this issue Jun 19, 2019 · 5 comments

Comments

@mushon89
Copy link

mushon89 commented Jun 19, 2019

Current behavior:
Hi all
I'm using cypress and I'm trying to click on the button that appears on chrome confirmation box
but when I'm running the test I'm getting this error
image
image

in addition, the confirmation box does not appear

it('delete user', () => {
    //delete user
    cy.get('.fa-user').click();
    cy.get('.pull-left > .form-control').type('example');
    cy.get('.ng-scope:nth-child(1) > td > .iconBtn').click({ force: true })    
})

the correct confirmation box is:
image
image

I'm want to click on the 'OK' button, but the confirmation box does not appear and cant click on the button

thanks

@jennifer-shehane
Copy link
Member

Please see this docs on testing confirmation boxes: https://on.cypress.io/catalog-of-events#Window-Confirm

Also, check out our community chat, it can be helpful for debugging or answering questions on how to use Cypress.

@jennifer-shehane
Copy link
Member

@mushon89 In the code and screenshot provided above, it seems to indicate that the test is failing at cy.get('.fa-user').click(), have you tried passing cy.get('.fa-user').click({force: true}) to this command?

I'm not completely sure why the confirmation dialog is already open at the point where cy.get('.fa-user').click() is open though, with the code I see provided.

@mushon89
Copy link
Author

thank u very much,
I succeed to click o the confirmation box button.

@timaihsoj
Copy link

thank u very much, I succeed to click o the confirmation box button.

@mushon89 How you resolved this , I am facing same issue.

@DanielPhangHL
Copy link

@mushon89 please share your way to fix this please

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

No branches or pull requests

4 participants