@@ -516,17 +516,19 @@ def test_presentation_4(self):
516
516
)
517
517
self .begin_presentation (filename = "uc_presentation.html" )
518
518
519
- with SB (uc = True , test = True , locale_code = "en" , ad_block = True ) as sb :
519
+ with SB (uc = True , test = True , ad_block = True ) as sb :
520
520
url = "https://www.walmart.com/"
521
521
sb .activate_cdp_mode (url )
522
522
sb .sleep (2.5 )
523
+ sb .cdp .click_if_visible ('[data-automation-id*="close-mark"]' )
523
524
sb .cdp .mouse_click ('input[aria-label="Search"]' )
524
525
sb .sleep (1.2 )
525
526
search = "Settlers of Catan Board Game"
526
527
required_text = "Catan"
527
528
sb .cdp .press_keys ('input[aria-label="Search"]' , search + "\n " )
528
529
sb .sleep (3.8 )
529
- print ('\n \n *** Walmart Search for "%s":' % search )
530
+ sb .cdp .remove_elements ('[data-testid="skyline-ad"]' )
531
+ print ('*** Walmart Search for "%s":' % search )
530
532
print (' (Results must contain "%s".)' % required_text )
531
533
unique_item_text = []
532
534
items = sb .cdp .find_elements ('div[data-testid="list-view"]' )
@@ -642,7 +644,7 @@ def test_presentation_4(self):
642
644
sb .cdp .click ('button[data-testid="submit"]' )
643
645
sb .sleep (3.5 )
644
646
sb .connect ()
645
- sb .sleep (2.5 )
647
+ sb .sleep (4.2 )
646
648
for window in sb .driver .window_handles :
647
649
sb .switch_to_window (window )
648
650
if "/buy/flights" in sb .get_current_url ():
@@ -708,6 +710,7 @@ def test_presentation_4(self):
708
710
if "Avg/Night" in info and not info .startswith ("Rates from" ):
709
711
name = info .split (" (" )[0 ]
710
712
name = name .split (" + " )[0 ].split (" Award Cat" )[0 ]
713
+ name = name .split (" Rates from :" )[0 ]
711
714
price = "?"
712
715
if "Rates from : " in info :
713
716
price = info .split ("Rates from : " )[1 ]
@@ -728,7 +731,7 @@ def test_presentation_4(self):
728
731
url = "https://www.bestwestern.com/en_US.html"
729
732
sb .activate_cdp_mode (url )
730
733
sb .sleep (2.5 )
731
- sb .cdp .click_if_visible ("div .onetrust-close-btn-handler" )
734
+ sb .cdp .click_if_visible (".onetrust-close-btn-handler" )
732
735
sb .sleep (1 )
733
736
sb .cdp .click ("input#destination-input" )
734
737
sb .sleep (2 )
@@ -741,9 +744,11 @@ def test_presentation_4(self):
741
744
sb .sleep (4 )
742
745
sb .cdp .click ("label#available-label" )
743
746
sb .sleep (2.5 )
744
- print ("\n \n Best Western Hotels in %s:" % location )
747
+ print ("Best Western Hotels in %s:" % location )
745
748
summary_details = sb .cdp .get_text ("#summary-details-column" )
746
- dates = summary_details .split ("ROOM" )[0 ].split ("DATES" )[- 1 ].strip ()
749
+ dates = summary_details .split ("DESTINATION" )[- 1 ]
750
+ dates = dates .split (" CHECK-OUT" )[0 ].strip () + " CHECK-OUT"
751
+ dates = dates .replace (" " , " " )
747
752
print ("(Dates: %s)" % dates )
748
753
flip_cards = sb .cdp .select_all (".flipCard" )
749
754
for i , flip_card in enumerate (flip_cards ):
0 commit comments