Dismissing data-confirm javascript on a link.

64 views
Skip to first unread message

jdb

unread,
May 14, 2012, 8:12:54 PM5/14/12
to Fake
Greetings -

I'm setting up a test for a web page that has a link with an included
data-confirm popup:

<a href="/foo/50?destroy_action=true&amp;utf8=%E2%9C%93"
class="destroy as_action" data-confirm="Are you sure you want to
delete Bar?" data-method="delete" data-remote="true" id="foo-
destroy-50-link" rel="nofollow">Delete</a>

What happens when using Fakeapp is that the Click Action will not
complete until the popup has been dismissed.

Has anyone else been able to solve this problem? Thanks much.

Todd Ditchendorf

unread,
May 14, 2012, 8:30:04 PM5/14/12
to fak...@googlegroups.com
yes, see the "Dismiss JavaScript Dialog" Action in the Action Library

TD

jdb

unread,
May 15, 2012, 12:32:53 PM5/15/12
to Fake
That doesn't actually work, because the previous Click action never
ends. Since it never ends, it never moves to the next action.

On May 14, 5:30 pm, Todd Ditchendorf <todd.ditchend...@gmail.com>
wrote:

Todd Ditchendorf

unread,
May 15, 2012, 12:34:07 PM5/15/12
to fak...@googlegroups.com
Due to the way confirm() works, the only way this  can be worked around is like this:


redefine the confirm() function in a "Do JavaScript" Action just before you expect the dialog to appear. Hard code the boolean return value you want.


jdb

unread,
May 15, 2012, 5:05:49 PM5/15/12
to Fake
I see, I would use this redefinition JavaScript action first, *then*
the Click action, right?

In the meantime, I figured out a way to work around this by having the
link open in a new tab. :-)

Thanks again -

On May 15, 9:34 am, Todd Ditchendorf <todd.ditchend...@gmail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages