@@ -516,17 +516,19 @@ def test_presentation_4(self):
516516 )
517517 self .begin_presentation (filename = "uc_presentation.html" )
518518
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 :
520520 url = "https://www.walmart.com/"
521521 sb .activate_cdp_mode (url )
522522 sb .sleep (2.5 )
523+ sb .cdp .click_if_visible ('[data-automation-id*="close-mark"]' )
523524 sb .cdp .mouse_click ('input[aria-label="Search"]' )
524525 sb .sleep (1.2 )
525526 search = "Settlers of Catan Board Game"
526527 required_text = "Catan"
527528 sb .cdp .press_keys ('input[aria-label="Search"]' , search + "\n " )
528529 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 )
530532 print (' (Results must contain "%s".)' % required_text )
531533 unique_item_text = []
532534 items = sb .cdp .find_elements ('div[data-testid="list-view"]' )
@@ -642,7 +644,7 @@ def test_presentation_4(self):
642644 sb .cdp .click ('button[data-testid="submit"]' )
643645 sb .sleep (3.5 )
644646 sb .connect ()
645- sb .sleep (2.5 )
647+ sb .sleep (4.2 )
646648 for window in sb .driver .window_handles :
647649 sb .switch_to_window (window )
648650 if "/buy/flights" in sb .get_current_url ():
@@ -708,6 +710,7 @@ def test_presentation_4(self):
708710 if "Avg/Night" in info and not info .startswith ("Rates from" ):
709711 name = info .split (" (" )[0 ]
710712 name = name .split (" + " )[0 ].split (" Award Cat" )[0 ]
713+ name = name .split (" Rates from :" )[0 ]
711714 price = "?"
712715 if "Rates from : " in info :
713716 price = info .split ("Rates from : " )[1 ]
@@ -728,7 +731,7 @@ def test_presentation_4(self):
728731 url = "https://www.bestwestern.com/en_US.html"
729732 sb .activate_cdp_mode (url )
730733 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" )
732735 sb .sleep (1 )
733736 sb .cdp .click ("input#destination-input" )
734737 sb .sleep (2 )
@@ -741,9 +744,11 @@ def test_presentation_4(self):
741744 sb .sleep (4 )
742745 sb .cdp .click ("label#available-label" )
743746 sb .sleep (2.5 )
744- print ("\n \n Best Western Hotels in %s:" % location )
747+ print ("Best Western Hotels in %s:" % location )
745748 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 (" " , " " )
747752 print ("(Dates: %s)" % dates )
748753 flip_cards = sb .cdp .select_all (".flipCard" )
749754 for i , flip_card in enumerate (flip_cards ):
0 commit comments