def test_3_buy_scholars(self):
     driver = self.driver
     driver.get(self.base_url)
     ml = DamagePageSection(driver)
     evo = EvoPointPageSection(driver)
     header = StatsPage(driver)
     club = ClubberPageSection(driver)
     owned = evo.get_scholar_owned()
     cost = evo.get_scholar_cost()
     try:
         header.import_save()
     except IOError:
         pass
     evo.waiting()
     points = evo.get_evo_points()
     print "Number of available points: " + str(points)
     start = time.time()
     r_present = False
     while owned < 10 or r_present is False:
         ml.click_egg()
         if (time.time() - start) > 30:
             points = evo.get_evo_points()
             print "Updated number of points: " + str(points)
             while points > cost:
                 evo.buy_scholar()
                 points -= cost
                 cost = evo.get_scholar_cost()
                 owned += 1
             start = time.time()
         if points > 600 and r_present is False:
             evo.purchase_upgrades("02", "a")
             club.check_ranged_present()
             r_present = True
     header.export_save()
 def test_6_more_units(self):
     driver = self.driver
     driver.get(self.base_url)
     ml = DamagePageSection(driver)
     evo = EvoPointPageSection(driver)
     header = StatsPage(driver)
     club = ClubberPageSection(driver)
     try:
         header.import_save()
     except IOError:
         pass
     m_cost = club.get_clubber_cost()
     r_cost = club.get_ranged_cost()
     s_cost = evo.get_scholar_cost()
     m_count = club.get_clubber_owned()
     r_count = club.get_ranged_owned()
     s_count = evo.get_scholar_owned()
     max_unit = 30
     start = time.time()
     upgrade = 0
     horse = 0
     crit = time.time()
     while horse < 1:
         ml.click_egg()
         if (time.time() - crit) > 5:
             ml.click_critical()
             crit = time.time()
         while m_count < 30 or r_count < 30 or s_count < 30 or upgrade < 2:
             ml.click_egg()
             if (time.time() - crit) > 5:
                 ml.click_critical()
                 crit = time.time()
             if (time.time() - start) > 60:
                 points = evo.get_evo_points()
                 if points > 2500 and upgrade == 0:
                     club.upgrade_sword("03", "a")
                     points -= 2500
                     upgrade += 1
                 if points > 10000 and upgrade == 1:
                     club.upgrade_sword("03", "b")
                     points -= 10000
                     upgrade += 1
                 while points > m_cost and m_count < max_unit:
                     club.buy_clubber()
                     m_count += 1
                     points -= m_cost
                     m_cost = club.get_clubber_cost()
                 while points > r_cost and r_count < max_unit:
                     club.buy_ranged_unit()
                     r_count += 1
                     points -= r_cost
                     print points
                     r_cost = club.get_ranged_cost()
                 while points > s_cost and s_count < max_unit:
                     evo.buy_scholar()
                     s_count += 1
                     points -= s_cost
                     print points
                     s_cost = evo.get_scholar_cost()
                 start = time.time()
         if (time.time() - start) > 30:
             points = evo.get_evo_points()
             if points > 10000:
                 evo.purchase_upgrades("03", "b")
                 horse += 1
     header.export_save()