def setUp(self): self.num_of_teams = 2 self.num_of_students_in_each_team = 2 self.num_browsers = self.num_of_teams * self.num_of_students_in_each_team self.student_browsers = [] self.student_name = ["Brooks", "Colt", "Robert", "Layla", "Paul", "Steven", "David", "John", "Smith", "Brad", "Chris", "Chloe", "Nina", "Roger", "Michael", "Jack", "Sam", "Peter"] self.instructor = iactions.AccessInstructorElements(webdriver.Chrome()) time.sleep(3) self.instructor.open_url() ip_add = ipaddress.IPv4Address('10.1.101.11') for i in range(self.num_browsers): student_browser = sactions.AccessStudentElements(webdriver.Chrome()) link = "http://localhost:8080/student-dashboard.html?ip=%s" % ip_add student_browser.open_url(link) self.student_browsers.append(student_browser) time.sleep(3) name = self.student_name[i] print(name) student_browser.student_login_with_name(name) time.sleep(2) ip_add += 256 print(ip_add)
def setUp(self): self.num_of_teams = 1 self.num_of_students_in_each_team = 2 self.num_browsers = self.num_of_teams * self.num_of_students_in_each_team self.student_browsers = [] self.student_name = [ "Brooks", "Colt", "Robert", "Layla", "Paul", "Steven", "David", "John", "Smith", "Brad", "Chris", "Chloe", "Nina", "Roger", "Michael", "Jack", "Sam", "Peter" ] #open instructor dashboard self.instructor = iactions.AccessInstructorElements(webdriver.Chrome()) time.sleep(3) self.instructor.open_url() #opens student dashboard with correct ip address ranging from 10.1.101.11 - 10.1.120.11 ip_add = ipaddress.IPv4Address('10.1.101.11') for i in range(self.num_browsers): student_browser = sactions.AccessStudentElements( webdriver.Chrome()) link = "http://localhost:8080/student-dashboard.html?ip=%s" % ip_add student_browser.open_url(link) self.student_browsers.append(student_browser) time.sleep(3) #performs login for each student name = self.student_name[i] print(name) student_browser.student_login_with_name(name) time.sleep(2) ip_add += 256 print(ip_add) #adjust the team number based on the number of teams num_teams = self.num_of_teams - 1 if num_teams > 1: for i in range(num_teams): self.instructor.plus_auto_sign().click() time.sleep(3) self.instructor.start_button().click() time.sleep(2) self.instructor.close_start_modal() time.sleep(2) for i in range(self.num_browsers): self.student_browsers[i].student_end_tour() time.sleep(3)
def setUp(self): self.student_browsers = [] self.num_of_teams = 2 self.num_of_students_in_each_team = 2 self.num_browsers = self.num_of_teams * self.num_of_students_in_each_team ip_add = ipaddress.IPv4Address('10.1.101.11') for i in range(self.num_browsers): link = "http://localhost:8080/student-dashboard.html?ip=%s" % ip_add student_browser = student_actions.AccessStudentElements( webdriver.Chrome()) student_browser.open_url(link) self.student_browsers.append(student_browser) self.assertIn('Student Dashboard', student_browser.get_title()) ip_add += 256 time.sleep(5) time.sleep(5)