@@ -872,6 +872,7 @@ def __activate_shepherd(self):
872
872
backdrop_style = style_sheet .sh_backdrop_style
873
873
874
874
self .__activate_bootstrap ()
875
+ self .wait_for_ready_state_complete ()
875
876
for x in range (4 ):
876
877
# self.activate_jquery() # Included with __activate_bootstrap()
877
878
self .add_css_link (spinner_css )
@@ -1823,6 +1824,8 @@ def pick_select_option_by_value(self, dropdown_selector, option,
1823
1824
dropdown_by = dropdown_by , option_by = "value" ,
1824
1825
timeout = timeout )
1825
1826
1827
+ ############
1828
+
1826
1829
def generate_referral (self , start_page , destination_page ):
1827
1830
""" This method opens the start_page, creates a referral link there,
1828
1831
and clicks on that link, which goes to the destination_page.
@@ -1842,7 +1845,7 @@ def generate_referral(self, start_page, destination_page):
1842
1845
referral_link = ('''<a class='analytics referral test' href='%s' '''
1843
1846
'''style='font-family: Arial,sans-serif; '''
1844
1847
'''font-size: 30px; color: #18a2cd'>'''
1845
- '''* Magic Link Button! * </a>''' % destination_page )
1848
+ '''Magic Link Button</a>''' % destination_page )
1846
1849
self .execute_script (
1847
1850
'''document.body.innerHTML = \" %s\" ''' % referral_link )
1848
1851
time .sleep (0.1 )
@@ -1860,6 +1863,32 @@ def generate_traffic(self, start_page, destination_page, loops=1):
1860
1863
self .generate_referral (start_page , destination_page )
1861
1864
time .sleep (0.05 )
1862
1865
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
+
1863
1892
############
1864
1893
1865
1894
def wait_for_element_present (self , selector , by = By .CSS_SELECTOR ,
0 commit comments