Is there a method to click on a alert button create by ionic AlertController ? #24942
Unanswered
insistedMarin
asked this question in
Component Testing
Replies: 2 comments
-
it needs to use .click({force: true}) |
Beta Was this translation helpful? Give feedback.
0 replies
-
does https://applitools.com/blog/testing-browser-alerts-confirmations-prompts-cypress/ in case that's helpful 🔨 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
let alert = this.alertCtrl.create({
title: 'Confirm purchase',
message: 'Do you want to buy this book?',
buttons: [
{
text: 'Cancel',
role: 'cancel',
handler: () => {
console.log('Cancel clicked');
}
},
{
text: 'Buy',
handler: () => {
console.log('Buy clicked');
}
}
]
});
alert.present();
I try to use .click() or .trigger('click') to click on the button namd 'Buy', but it shows
Timed out retrying after 4050ms: cy.click() failed because this element:
<span class="alert-button-inner sc-ion-alert-ios">Buy</span>
has CSS pointer-events: none
pointer-events: none prevents user mouse interaction.
Beta Was this translation helpful? Give feedback.
All reactions