Example #1
0
 def verify_quote_result_document_present(self):
     assert get_api_data(
         self.config,
         "create_quote_result_document")["title"] in ClientDocumentsPage(
             self.config).get_first_table_row(
             ), "Quote result document not found"
     return self
    class _Documents:
        def __init__(self, journey):
            self.config = journey.config
            self.journey = journey
            self.page = ClientDocumentsPage(self.config)

        def using_add_documents_to_binder(self):
            self.page.click_add_to_binder()
            return ClientDocuments._AddDocumentsToBinderDialog(
                self.page, self.journey)

        def add_documents_to_binder(self):
            self.page.click_select_all_documents()
            self.using_add_documents_to_binder()\
                .add_document_to_binder(self.config.binder)
            return self

        def using_delete_document_dialog(self):
            self.page.click_delete()
            return ClientDocuments._DeleteDocumentDialog(
                self.page, self.journey)

        def delete_documents(self):
            self.page.click_select_all_documents()
            self.using_delete_document_dialog().delete_document()
            return self

        def open_document(self):
            ClientDocumentsPage(self.config).click_open_first_document()
            return self

        def verify_document_added_to_binder(self):
            document_details = ClientDocumentsPage(
                self.config).get_first_table_row()
            assert self.config.binder in document_details, \
                f"The document {document_details} has not been added to the binder {self.config.binder}"
            return self

        def verify_document_opened(self):
            time.sleep(30)
            assert utils.open_downloaded_file(
                self, "Test Automation Document.pdf"), "Cannot open given file"
            return self

        def verify_documents_deleted(self):
            document_details = ClientDocumentsPage(
                self.config).get_first_table_row()
            assert 'There is no data to display' in document_details, \
                f"The Document {document_details} has not been deleted."
Example #3
0
 def verify_quote_document_present(self):
     assert "Test Automation Quote Document" in ClientDocumentsPage(
         self.config).get_first_table_row(), "Quote Document not found"
     return self
 def verify_document_added_to_binder(self):
     document_details = ClientDocumentsPage(
         self.config).get_first_table_row()
     assert self.config.binder in document_details, \
         f"The document {document_details} has not been added to the binder {self.config.binder}"
     return self
 def open_document(self):
     ClientDocumentsPage(self.config).click_open_first_document()
     return self
 def __init__(self, journey):
     self.config = journey.config
     self.journey = journey
     self.page = ClientDocumentsPage(self.config)
 def verify_document_uploaded(self):
     assert datetime.datetime.now().strftime("%d/%m/%Y") in ClientDocumentsPage(self.config).get_last_update_date(),\
         "Incorrect document updated date"
     return self
 def verify_documents_deleted(self):
     document_details = ClientDocumentsPage(
         self.config).get_first_table_row()
     assert 'There is no data to display' in document_details, \
         f"The Document {document_details} has not been deleted."