File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 410
410
click_on "Search"
411
411
end
412
412
413
- expect ( page ) . to have_selector ( "*[data-trigger='linkClipboardCopy']" )
414
- page . find ( "*[data-trigger='linkClipboardCopy']" ) . click
413
+ copy_to_clipboard = "*[data-trigger='linkClipboardCopy']"
414
+ begin
415
+ expect ( page ) . to have_selector ( copy_to_clipboard , wait : 0.05 )
416
+ rescue RSpec ::Expectations ::ExpectationNotMetError
417
+ # the "copy to clipboard" button sometimes fails to show up fast enough.
418
+ # Just click "search" again.
419
+ # See similar workaround below.
420
+ within ( "*[data-ohms-search-form]" ) { click_on "Search" }
421
+ expect ( page ) . to have_selector ( copy_to_clipboard )
422
+ end
423
+
424
+ page . find ( copy_to_clipboard ) . click
415
425
expect ( page ) . to have_content ( "Copied to clipboard" )
416
426
417
427
# ToC tab should be selected as it is first tab with results from search
418
428
expect ( page ) . to have_selector ( "#ohTocTab[aria-selected='true']" )
419
429
expect ( page ) . to have_content ( %r{Table of Contents — 1 / 7}i )
420
430
expect ( page ) . to have_selector ( "*[data-ohms-hitcount='index']" , text : "7" )
421
431
expect ( page ) . to have_selector ( "*[data-ohms-hitcount='transcript']" , text : "43" )
422
-
423
432
click_on "Description"
424
433
# We expect the Description tab to be moved to, but for some reason sometimes
425
434
# the click doesn't work to change tabs... bootstrap tab wasn't ready for it for some reason?...
You can’t perform that action at this time.
0 commit comments