@@ -872,6 +872,7 @@ def __activate_shepherd(self):
872872 backdrop_style = style_sheet .sh_backdrop_style
873873
874874 self .__activate_bootstrap ()
875+ self .wait_for_ready_state_complete ()
875876 for x in range (4 ):
876877 # self.activate_jquery() # Included with __activate_bootstrap()
877878 self .add_css_link (spinner_css )
@@ -1823,6 +1824,8 @@ def pick_select_option_by_value(self, dropdown_selector, option,
18231824 dropdown_by = dropdown_by , option_by = "value" ,
18241825 timeout = timeout )
18251826
1827+ ############
1828+
18261829 def generate_referral (self , start_page , destination_page ):
18271830 """ This method opens the start_page, creates a referral link there,
18281831 and clicks on that link, which goes to the destination_page.
@@ -1842,7 +1845,7 @@ def generate_referral(self, start_page, destination_page):
18421845 referral_link = ('''<a class='analytics referral test' href='%s' '''
18431846 '''style='font-family: Arial,sans-serif; '''
18441847 '''font-size: 30px; color: #18a2cd'>'''
1845- '''* Magic Link Button! * </a>''' % destination_page )
1848+ '''Magic Link Button</a>''' % destination_page )
18461849 self .execute_script (
18471850 '''document.body.innerHTML = \" %s\" ''' % referral_link )
18481851 time .sleep (0.1 )
@@ -1860,6 +1863,32 @@ def generate_traffic(self, start_page, destination_page, loops=1):
18601863 self .generate_referral (start_page , destination_page )
18611864 time .sleep (0.05 )
18621865
1866+ def generate_referral_chain (self , pages ):
1867+ """ Use this method to chain the action of creating button links on
1868+ one website page that will take you to the next page.
1869+ (When you want to create a referral to a website for traffic
1870+ generation without increasing the bounce rate, you'll want to visit
1871+ at least one additional page on that site with a button click.) """
1872+ if not type (pages ) is tuple and not type (pages ) is list :
1873+ raise Exception (
1874+ "Exception: Expecting a list of website pages for chaining!" )
1875+ if len (pages ) < 2 :
1876+ raise Exception (
1877+ "Exception: At least two website pages required for chaining!" )
1878+ for page in pages :
1879+ # Find out if any of the web pages are invalid before continuing
1880+ if not page_utils .is_valid_url (page ):
1881+ raise Exception (
1882+ "Exception: Website page {%s} is not a valid URL!" % page )
1883+ for page in pages :
1884+ self .generate_referral (None , page )
1885+
1886+ def generate_traffic_chain (self , pages , loops = 1 ):
1887+ """ Similar to generate_referral_chain(), but for multiple loops. """
1888+ for loop in range (loops ):
1889+ self .generate_referral_chain (pages )
1890+ time .sleep (0.05 )
1891+
18631892 ############
18641893
18651894 def wait_for_element_present (self , selector , by = By .CSS_SELECTOR ,
0 commit comments