0

i want to trigger an event using protractor for close the Toastr notification messages. whenever the notification appears this event should triggered.. is this possible??

I have 10 forms ,i am validating these forms using protractor. In each form i have editable text fields. If you add/edit/delete any fields you will get toastr notification message. I want to close these messge whenever it appears in my appliaction. is this possible?? Thanks in advance..

1 Answers1

0

You can execute JS code while running your test for closing toastr notification, you could try this one (I tested it in their demo project - run this code toastr.remove() in a console when toastr notification was shown):

await browser.executeScript(toastr.remove())

note that browser.executeScript() return Promise so you need to resolve it.

Oleksii
  • 1,623
  • 20
  • 26