def test_happy_ascii_tag_CRUD(self): selenium_Tag_CRUD( self, self.wd, self.live_server_url, self.username, self.password, 'TestNextLineName' + random_string(), 'NewTestNextLineName' + random_string())
def test_happy_ascii_task_CRUD(self): selenium_Task_minimal_CRUD( self, self.wd, self.live_server_url, self.username, self.password, 'TestTaskName' + random_string(), 'TestEstimate' + random_string(), 'NewTestTaskName' + random_string())
def test_moving_nextline(self): """Move a nextline and verify that the relative order of tasks in the nextline is preserved """ user = self.user first_task_order = Decimal('0.1') first_name = 'FirstTestTaskName' + random_string() second_task_order = Decimal('0.2') second_name = 'SecondTestTaskName' + random_string() third_task_order = Decimal('0.3') third_name = 'ThirdTestTaskName' + random_string() nextline_name = 'NextLine' + random_unicode_string() # create three tasks and a nextline. Assign bottom two tasks # to nextline first_task = Task.objects.create( name=first_name, user=user, task_order=first_task_order) second_task = Task.objects.create( name=second_name, user=user, task_order=second_task_order) third_task = Task.objects.create( name=third_name, user=user, task_order=third_task_order) nextline = NextLine.objects.create( name=nextline_name, user=user,) second_task.nextline = nextline second_task.save() third_task.nextline = nextline third_task.save() # Move NextLine to top driver = self.wd login(driver, self.live_server_url, self.username, self.password) self.assertIn('Name', driver.page_source) # find the hyperlink which has class="move_nextline_to_top" inside a P # containing the nextline's name move_xpath = '//*[contains(text(),"{0}")]/../a[contains(concat(" ", normalize-space(@class), " "), " move_nextline_to_top ")]'.format(nextline_name) # noqa driver.find_element_by_xpath(move_xpath).click() # verify that task order is now second, third, first # TODO: fix the false negative here - probably caused by # transactions or something keeping these from getting updated order_first = Task.objects.get(id=first_task.id).task_order order_second = Task.objects.get(id=second_task.id).task_order order_third = Task.objects.get(id=third_task.id).task_order self.assertTrue(order_first > order_third) self.assertTrue(order_third > order_second) debug_dump = open('index.html', 'w') debug_dump.write(driver.page_source) debug_dump.close()