Ejemplo n.º 1
0
    def test_table_multiple_rows_modification(self):

        table_page = TablePage(self.driver, ManufacturingOrderScreen)
        table_page.login()

        # Open manufacturing order screen
        table_page.go_to_target_page_by_menu("Manufacturing",
                                             "manufacturingorder")

        rows = table_page.get_table_multiple_rows(rowNumber=2)

        table_page.multiline_checkboxes_check(targetrows=rows)

        newStatus = "completed"

        table_page.select_action(newStatus)

        q_objects = Q()
        for row in rows:
            q_objects |= Q(reference=row.get_attribute("id"))

        table_page.click_save_button()

        time.sleep(2)

        self.assertEqual(
            ManufacturingOrder.objects.all().filter(q_objects,
                                                    status=newStatus).count(),
            2,
        )
Ejemplo n.º 2
0
    def test_table_multiple_rows_modification(self):

        table_page = TablePage(self.driver, SeleniumTest)
        table_page.login(self)

        # Open purchase order screen
        table_page.go_to_target_page_by_menu("Inventory", "distributionorder")

        distribution_order_table = table_page.get_table()

        rows = table_page.get_table_multiple_rows(rowNumber=2)

        table_page.multiline_checkboxes_check(targetrows=rows)

        references = []
        newStatus = "completed"
        q_objects = Q()

        table_page.select_action(newStatus)

        for row in rows:
            references.append(row.get_attribute("id"))

        table_page.click_save_button()

        time.sleep(2)
        for reference in references:

            q_objects |= Q(reference=reference)

        self.assertEqual(
            DistributionOrder.objects.all().filter(q_objects,
                                                   status=newStatus).count(),
            2,
        )