def test_C35_CheckBoatEdited(self):
        # Setup
        boat_name = StringMethods.get_unique_name('boat_name_')
        self.add_office(self.office_name)

        # Setup - edit
        boat_name_edited = StringMethods.get_unique_name('boat_name_edited_')

        # Action
        boats_page = BoatsPage(self.driver)
        boats_page.add_entry(boat_name, self.office_name)
        boat_row = boats_page.table.get_row_for_field_value(
            HeadersBoats.Name, boat_name)
        boats_page.edit_entry(boat_row, boat_name_edited, self.office_name)

        # Assert
        boats_page = BoatsPage(self.driver)
        boat_row = boats_page.table.get_row_for_field_value(
            HeadersBoats.Name, boat_name_edited)
        self.assertIsNotNone(boat_row)
        self.assertEqual(boat_name_edited, boat_row[HeadersBoats.Name])
        self.assertEqual(self.office_name, boat_row[HeadersBoats.Supplier])

        boats_page.remove_entry(boat_name_edited)
        self.remove_office(self.office_name)
    def test_C38_CheckBoatDetailsThenEdit(self):
        # Setup
        boat_name = StringMethods.get_unique_name('boat_name_')
        self.add_office(self.office_name)

        # Setup - edit
        boat_name_edited = StringMethods.get_unique_name('boat_name_edited_')

        # Action
        boats_page = BoatsPage(self.driver)
        boats_page.add_entry(boat_name, self.office_name)

        boat_row = boats_page.table.get_row_for_field_value(
            HeadersBoats.Name, boat_name)
        boat_row.details_row_item.click()
        check_dialog = BoatsCheckDialog(self.driver)
        check_dialog.edit_entry(boat_name_edited, self.office_name)

        # Assert
        boat_row = boats_page.table.get_row_for_field_value(
            HeadersBoats.Name, boat_name_edited)
        self.assertIsNotNone(boat_row)
        self.assertEqual(boat_name_edited, boat_row[HeadersBoats.Name])
        self.assertEqual(self.office_name, boat_row[HeadersBoats.Supplier])

        boats_page.remove_entry(boat_name_edited)
        self.remove_office(self.office_name)
    def test_C109_CheckNoDuplicateEntriesAllowed(self):
        # Setup
        expected_error = 'Duplicate entries are not allowed.'
        boat_name = StringMethods.get_unique_name('boat_name_')
        self.add_office(self.office_name)

        # Action
        boats_page = BoatsPage(self.driver)
        boats_page.add_entry(boat_name, self.office_name)

        boats_page = BoatsPage(self.driver)
        boats_page.add_button.click()
        add_dialog = BoatsAddDialog(self.driver)
        add_dialog.name.send_keys(boat_name)
        add_dialog.office.select_input(self.office_name)
        add_dialog.save_button.click()

        # Assert
        add_dialog.is_text_present(expected_error)

        add_dialog.cancel_button.click()
        boats_page.remove_entry(boat_name)
        self.remove_office(self.office_name)
예제 #4
0
 def remove_boat(self, name):
     boat_page = BoatsPage(self.driver)
     boat_page.remove_entry(name)