def load_docs_for_OTP_express(self, filename): file_path = Base().get_file_dir('files', filename) self.wait_until_located(self.passport) self.assertEqual(self.get_docs_count(), 2) self.load_doc(self.passport, file_path) self.load_doc(self.doc_buh_year, file_path) self.wait_until_clickable(self.submit_btn, 'xpath')
def transfer_to_sign(self, filename): self.click_on_elem(self.payment_checkbox) self.find_element_by_locator(self.guarantee_scan).send_keys( Base().get_file_dir('files', filename)) self.wait_until_clickable(self.transfer_to_sign_btn, 'xpath') self.click_on_elem(self.transfer_to_sign_btn) self.wait_until_located(self.sign_btn, 'xpath')
def load_docs_for_group(self, filename): file_path = Base().get_file_dir('files', filename) self.wait_until_located(self.buh) self.assertEqual(self.get_docs_count(), 3) self.load_doc(self.buh, file_path) self.load_doc(self.passport, file_path) self.load_doc(self.doc_buh_year, file_path) self.wait_until_located(self.passport_result_btn, 'xpath')
def load_docs_for_usual_bid_ip(self, filename): file_path = Base().get_file_dir('files', filename) self.wait_until_located(self.buh) self.assertEqual(self.get_docs_count(), 4) self.load_doc(self.buh, file_path) self.load_doc(self.doc_client_locate_fact, file_path) self.load_doc(self.msp_passport_load_btn, file_path) self.load_doc(self.doc_tax, file_path) self.wait_until_located(self.tax_result_btn, 'xpath')
def accept_proposal_otp(self, bid_id, filename): url = self.api_url + str(bid_id) + '/accept-proposal' base = Base() contract_file = open(base.get_file_dir('files', filename), 'rb') notification_file = open(base.get_file_dir('files', filename), 'rb') project_file = open(base.get_file_dir('files', filename), 'rb') values = { 'certificate[expiration]': "2021-06-16", 'certificate[from]': "2021-03-16", 'certificate[issuer]': "CN=CRYPTO-PRO Test Center 2, O=CRYPTO-PRO LLC, L=Moscow, C=RU, [email protected]", 'certificate[selectValue]': "qwe", 'certificate[serial]': "1200513B7743AFB99E76084EDD000100513B77", 'certificate[subject]': "CN=maria0", 'certificate[thumbprint]': "28333F412221A88AC766B5433541F7BF3A34C2DC", 'files[0][file_name]': "doc_bg_contract", 'files[1][file_name]': "doc_bg_notification", 'files[2][file_name]': "doc_bg_project" } files = { 'files[0][file]': contract_file, 'files[1][file]': notification_file, 'files[2][file]': project_file, } r = requests.post(url, data=values, headers={ 'Accept': 'application/json, text/plain, */*', 'Token': self.token, 'Authorization': self.basic_authorization }, files=files) contract_file.close() notification_file.close() project_file.close() try: self.assertEqual(r.status_code, 200) except AssertionError: print(r.text) raise
def load_ip_usual_docs(self, filename): file_path = Base().get_file_dir('files', filename) DocsPage(self.browser).load_doc(self.anketa, file_path) DocsPage(self.browser).load_doc(self.buh, file_path) DocsPage(self.browser).load_doc(self.locate_fact, file_path) DocsPage(self.browser).load_doc(self.passport, file_path) DocsPage(self.browser).load_doc(self.tax, file_path) self.wait_until_clickable(self.transfer_to_bank_btn, 'xpath') self.click_on_elem(self.transfer_to_bank_btn) self.wait_until_disappear(self.transfer_to_bank_btn, 'xpath') Loaders(self.browser).wait_until_agent_loader_disappear()
def load_docs_for_OTP_usual(self, filename): file_path = Base().get_file_dir('files', filename) self.wait_until_located(self.buh) self.assertEqual(self.get_docs_count(), 8) self.load_doc(self.buh, file_path) self.load_doc(self.doc_buh_year, file_path) self.load_doc(self.doc_tax, file_path) self.load_doc(self.passport, file_path) self.load_doc(self.docs_order, file_path) self.load_doc(self.doc_decision, file_path) self.load_doc(self.doc_client_locate_fact, file_path) self.load_doc(self.doc_accept_deal, file_path) self.wait_until_located(self.decision_result_btn, 'xpath')
def load_docs(self, filename, surety_number): agentquestionnaire = AgentQuestionnaire(self.browser) agentquestionnaire.click_on_elem_with_number(agentquestionnaire.docs, surety_number) file_path = Base().get_file_dir('files', filename) docs_page = DocsPage(self.browser) self.wait_until_located(self.buh) docs_page.load_doc(self.buh, file_path) docs_page.load_doc(self.doc_client_locate_fact, file_path) docs_page.load_doc(self.doc_buh_year, file_path) docs_page.load_doc(self.passport, file_path) docs_page.load_doc(self.docs_order, file_path) docs_page.load_doc(self.doc_nomination, file_path) docs_page.load_doc(self.doc_tax, file_path) docs_page.load_doc(self.doc_order_for_executor_nomination, file_path)
def upload_package_otp_express(self, bid_id, filename): url = self.api_url + str(bid_id) + '/document/package/upload' file_dir = Base().get_file_dir('files', filename) file = open(file_dir, 'rb') file1 = open(file_dir, 'rb') file2 = open(file_dir, 'rb') values = { 'certificate[expiration]': "2021-06-16", 'certificate[from]': "2021-03-16", 'certificate[issuer]': "CN=CRYPTO-PRO Test Center 2, O=CRYPTO-PRO LLC, L=Moscow, C=RU, [email protected]", 'certificate[selectValue]': "qwe", 'certificate[serial]': "1200513B7743AFB99E76084EDD000100513B77", 'certificate[subject]': "CN=maria0", 'certificate[thumbprint]': "28333F412221A88AC766B5433541F7BF3A34C2DC", 'documents[0][file_name]': "doc_anketa", 'documents[1][file_name]': "doc_bug_year_report", 'documents[2][file_name]': "doc_individual_identity_document", # Паспорт 'documents[0][signed]': '1', 'documents[1][signed]': '1', 'documents[2][signed]': '1' } files = { 'documents[0][file]': file, 'documents[1][file]': file1, 'documents[2][file]': file2 } r = requests.post(url, data=values, headers={ 'Accept': 'application/json, text/plain, */*', 'Token': self.token, 'Authorization': self.basic_authorization }, files=files) file.close() file1.close() file2.close() try: self.assertEqual(r.status_code, 200) except AssertionError: print(r.text) raise
def upload_unsigned_package_passport_anketa(self, bid_id, filename, ip=False): url = self.api_url + str(bid_id) + '/document/package/upload' file_dir = Base().get_file_dir('files', filename) file = open(file_dir, 'rb') file1 = open(file_dir, 'rb') if ip: passport_name = "doc_identity_document" else: passport_name = "doc_individual_identity_document" values = { 'documents[0][file_name]': "doc_anketa", 'documents[1][file_name]': passport_name, 'documents[0][signed]': '0', 'documents[1][signed]': '0' } files = {'documents[0][file]': file, 'documents[1][file]': file1} r = requests.post(url, data=values, headers={ 'Accept': 'application/json, text/plain, */*', 'Token': self.token, 'Authorization': self.basic_authorization }, files=files) file.close() file1.close() try: self.assertEqual(r.status_code, 200) except AssertionError: print(r.text) raise
def upload_package_otp_usual(self, bid_id, filename): url = self.api_url + str(bid_id) + '/document/package/upload' file_dir = Base().get_file_dir('files', filename) file = open(file_dir, 'rb') file1 = open(file_dir, 'rb') file2 = open(file_dir, 'rb') file3 = open(file_dir, 'rb') file4 = open(file_dir, 'rb') file5 = open(file_dir, 'rb') file6 = open(file_dir, 'rb') file7 = open(file_dir, 'rb') file8 = open(file_dir, 'rb') values = { 'certificate[expiration]': "2021-06-16", 'certificate[from]': "2021-03-16", 'certificate[issuer]': "CN=CRYPTO-PRO Test Center 2, O=CRYPTO-PRO LLC, L=Moscow, C=RU, [email protected]", 'certificate[selectValue]': "qwe", 'certificate[serial]': "1200513B7743AFB99E76084EDD000100513B77", 'certificate[subject]': "CN=maria0", 'certificate[thumbprint]': "28333F412221A88AC766B5433541F7BF3A34C2DC", 'documents[0][file_name]': "doc_anketa", 'documents[1][file_name]': "doc_client_buh_report", 'documents[2][file_name]': "doc_order_current_redaction", 'documents[3][file_name]': "doc_executor_nomination", 'documents[4][file_name]': "doc_bug_year_report", 'documents[5][file_name]': "doc_tax_return", 'documents[6][file_name]': "doc_individual_identity_document", 'documents[7][file_name]': "doc_client_locate_fact", 'documents[8][file_name]': "doc_accept_deal", 'documents[0][signed]': '1', 'documents[1][signed]': '1', 'documents[2][signed]': '1', 'documents[3][signed]': '1', 'documents[4][signed]': '1', 'documents[5][signed]': '1', 'documents[6][signed]': '1', 'documents[7][signed]': '1', 'documents[8][signed]': '1', } files = { 'documents[0][file]': file, 'documents[1][file]': file1, 'documents[2][file]': file2, 'documents[3][file]': file3, 'documents[4][file]': file4, 'documents[5][file]': file5, 'documents[6][file]': file6, 'documents[7][file]': file7, 'documents[8][file]': file8, } r = requests.post(url, data=values, headers={ 'Accept': 'application/json, text/plain, */*', 'Token': self.token, 'Authorization': self.basic_authorization }, files=files) file.close() file1.close() file2.close() file3.close() file4.close() file5.close() file6.close() file7.close() file8.close() try: self.assertEqual(r.status_code, 200) except AssertionError: print(r.text) raise
def load_doc_registry_ordering_AO(self, filename): self.wait_until_clickable(self.doc_registry_ordering_AO_btn, 'css') self.assertEqual(self.get_docs_count(), 2) file_path = Base().get_file_dir('files', filename) self.load_doc(self.doc_registry_ordering_AO_file, file_path)
def load_passport_msp(self, filename): file_path = Base().get_file_dir('files', filename) self.wait_until_located(self.anketa_loaded_download, 'xpath') self.assertEqual(self.get_docs_count(), 1) self.load_doc(self.msp_passport_load_btn, file_path) self.wait_until_located(self.passport_result_btn, 'xpath')