def __init__(self, password): rf_string = String() # RF Library self.time = int(time.time()) self.company_code = 1300 self.status = 1 self.enable_e_carrier = 1 self.country_code = 'TW' self.gender = 'M' self.gogoro_guid = str(uuid.uuid4()) self.first_name = rf_string.generate_random_string(5, '[UPPER]') self.last_name = 'PASW' + rf_string.generate_random_string(5, '[UPPER]') self.display_name = self.last_name + self.first_name # self.email = 'pasw.verify+{}@gogoro.com'.format(self.time) #this account have a lot of scooters, the invoice setting cannot be change by userself self.email = 'pasw.verify.{}@yopmail.com'.format(self.time) self.emailv1 = 'pasw.verify-{}@yopmail.com'.format(self.time) self.mobile = '09' + rf_string.generate_random_string(8, '[NUMBERS]') # self.mobile = '886' + '09' + rf_string.generate_random_string(8, '[NUMBERS]') self.encode_password = password # Since myaccount user should over 20 ages. Therefore, the birthday is use current date -7500 days. self.birthday = (date.fromtimestamp(time.time()) + timedelta(days=-7500)).isoformat() self.contact_city = '臺北市' self.contact_district = '松山區' self.contact_zipcode = '10552' self.contact_address = '長安東路二段225號C棟11樓' self.phone = self.mobile # self.phone = self.mobile.replace('09', '+8869') # self.phone_number = self.phone.replace('+886', '') # print(self.phone) self.occupation = '1' self.invoice_city = '臺北市' self.invoice_district = '松山區' self.invoice_zipcode = '10552' self.invoice_address = '長安東路二段225號C棟11樓'
def __init__(self, company_code, scooter_model): rf_string = String() # RF Library self.scooter_id = None self.atmel_key = 'ED554638AD91C64694A39262CA1A3C14663B8ACBDF8E074E98BBD965EA1969C8' self.atmel_sn = '0123F61FCBFED2A0B1' self.company_code = company_code self.ecu_mac = 'rpNx83uY' self.ecu_sn = 'MABBQUFCBBIwABYzRQBkEA==' self.ecu_status = '1' self.es_state = '13' self.file_name = rf_string.generate_random_string( 8, '[LETTERS][NUMBERS]') self.guid = str(uuid.uuid4()) self.keyfobs_id = rf_string.generate_random_string(3, '[NUMBERS]') self.keyfobs_status = '1' self.manufacture_date = time.strftime("%Y-%m-%d") self.matnr = 'PI' + scooter_model + '-160-ORI' self.motor_num = self.matnr self.plate_first = rf_string.generate_random_string(3, '[UPPER]') self.plate_second = rf_string.generate_random_string(4, '[NUMBERS]') self.plate = self.plate_first + '-' + self.plate_second self.state = '9' self.plate_date = int(time.time()) self.vin = 'SWQA' + \ rf_string.generate_random_string(13, '[UPPER][NUMBERS]') self.warranty_start = int(time.time()) self.warranty_end = int(time.time() + 10)
def __init__(self, user_type, password): if user_type == 'new_user': rf_string = String() # RF Library self.time = int(time.time()) self.company_code = 1300 self.status = 1 self.enable_e_carrier = 1 self.country_code = 'TW' self.gender = 'M' self.gogoro_guid = str(uuid.uuid4()) self.first_name = rf_string.generate_random_string(5, '[UPPER]') self.last_name = rf_string.generate_random_string(5, '[UPPER]') self.display_name = self.last_name + self.first_name self.email = 'pasw.verify-{}@yopmail.com'.format(self.time) self.mobile = '09' + rf_string.generate_random_string( 8, '[NUMBERS]') self.profile_id = 'A1' + rf_string.generate_random_string( 8, '[NUMBERS]') self.encode_password = password self.birthday = time.strftime("%Y-%m-%d") self.contact_city = '臺北市' self.contact_district = '松山區' self.contact_zipcode = '10552' self.contact_address = '長安東路二段225號C棟11樓' self.phone = self.mobile self.occupation = '1' self.invoice_city = '臺北市' self.invoice_district = '松山區' self.invoice_zipcode = '10552' self.invoice_address = '長安東路二段225號C棟11樓' else: self.variable = LibVar() self.encode_password = password self.email = self.variable.get_var('PAYMENT_GATEWAY_ACCOUNT') self.gogoro_guid = self.variable.get_var('PAYMENT_GATEWAY_GUID')
def __init__(self, password='******'): rf_string = String() # RF Library self.user_id = None self.contract_owner_id = None self.birthday = time.strftime("%Y-%m-%d") self.company_code = 1300 self.contact_address = '長安東路二段225號C棟11樓' self.contact_city = '臺北市' self.contact_district = '松山區' self.contact_zip = '10552' self.country_code = 'TW' self.enable_e_carrier = 1 self.encode_password = LibAppCipher().encode_password_get( password).text self.first_name = rf_string.generate_random_string(5, '[UPPER]') self.last_name = rf_string.generate_random_string(5, '[UPPER]') self.gender = 'M' self.gogoro_guid = str(uuid.uuid4()) self.invoice_address = '長安東路二段225號C棟11樓' self.invoice_city = '臺北市' self.invoice_district = '松山區' self.invoice_zip = '10552' self.mobile = '09' + rf_string.generate_random_string(8, '[NUMBERS]') self.occupation = '1' self.phone = self.mobile self.login_phone = self.mobile self.status = 1 self.time = int(time.time() * 1000) self.display_name = self.last_name + self.first_name self.email = 'pasw.verify+{}@gogoro.com'.format(self.time) self.profile_id = 'E1' + \ rf_string.generate_random_string(8, '[NUMBERS]')
def __init__(self): self._builtin = BuiltIn() self._string = String() self._builtin.import_library('SSHLibrary') self._sshlibrary = self._builtin.get_library_instance('SSHLibrary') self._default_user = {} self._prompt = ':prompt:' self._local_infra_int_ip_ipv4 = '' self._key_exists = False
def __init__(self, login_user, battery_sn): rf_string = String() # RF Library self.time = int(time.time() * 1000) self.login_user = '******'.format(login_user) self.battery_sn = 'SWQA' + battery_sn self.cmd_id = rf_string.generate_random_string(8, '[NUMBERS]') self.cmd_val = rf_string.generate_random_string(8, '[UPPER]') self.log_path = '/log_' + time.strftime("%Y_%m_%d") + '.zip' self.description = rf_string.generate_random_string(8, '[UPPER]')
def __init__(self): rf_string = String() # RF Library self.battery_guid = str(uuid.uuid4()) self.charge_cycles = '0' self.manufacture_date = time.strftime("%Y-%m-%d") self.pn = rf_string.generate_random_string(2, '[NUMBERS]') self.sn = rf_string.generate_random_string(7, '[UPPER][NUMBERS]') self.pn = 'QA_TEST_' + self.pn self.battery_sn = 'TWSWQA' + self.sn self.state = '1'
def __init__(self, order_no=None): rf_string = String() # RF Library self.order_id = None self.owner_id = None if order_no is None: self.order_no = 'P0' + \ rf_string.generate_random_string(8, '[NUMBERS]') else: self.order_no = order_no
def __init__(self, status=1): rf_string = String() # RF Library self.hub_code = rf_string.generate_random_string(8, '[NUMBERS]') self.name = rf_string.generate_random_string(8, '[NUMBERS]') self.type = 123 self.country_code = "TW" self.address = "長安東路二段225號C棟11樓" self.city = "Taipei" self.zip = 10552 self.status = status self.remark = "remark"
def generate_bank_code1(): total = 0 enterprise_code = '8765' rf_string = String() random_code = rf_string.generate_random_string(11, '[NUMBERS]') bank_code_prefix = enterprise_code + random_code for i in range(len(bank_code_prefix)): if i % 2 == 0: total = int(bank_code_prefix[i:i + 1]) * 3 + total else: total = int(bank_code_prefix[i:i + 1]) * 1 + total if total % 10 == 0: bank_code_1 = bank_code_prefix + '0' else: bank_code_1 = bank_code_prefix + str(10 - (total % 10)) return bank_code_1
def __init__(self): timestamp = int(round(time.time() * 1000)) rf_string = String() # RF Library self.department_id = None self.department_code = "DH_" + '{}'.format(timestamp) self.department_name = "DH_" + '{}'.format(timestamp) self.department_type = 1 self.owner_company_id = None self.contract_start_date = timestamp self.contract_expiration_date = timestamp + 30 * 60 * 1000 self.contact_address = '長安東路二段225號C棟11樓' self.contact_zip = '10552' self.contact_person = 'SWQA' + \ rf_string.generate_random_string(5, '[UPPER]') self.contact_email = '{}@gogoro.com'.format(timestamp) self.contact_phone1 = rf_string.generate_random_string(8, '[NUMBERS]') self.contact_phone2 = rf_string.generate_random_string(8, '[NUMBERS]') self.country_code = 'TW' self.status = 1
def __init__(self, password='******'): rf_string = String() # RF Library self.time = int(time.time() * 1000) self.emp_code = 'SWQA_{}'.format(self.time) self.contact_address = '長安東路二段225號C棟11樓' self.contact_zip = '10552' self.encode_password = LibAppCipher().encode_password_get( password).text self.first_name = rf_string.generate_random_string(5, '[UPPER]') self.middle_name = rf_string.generate_random_string(5, '[UPPER]') self.last_name = rf_string.generate_random_string(5, '[UPPER]') self.legal_first_name = rf_string.generate_random_string(5, '[UPPER]') self.legal_middle_name = rf_string.generate_random_string(5, '[UPPER]') self.legal_last_name = rf_string.generate_random_string(5, '[UPPER]') self.gender = 'M' self.mobile = '09' + rf_string.generate_random_string(8, '[NUMBERS]') self.phone = self.mobile self.email = 'sw.verify+{}@gogoro.com'.format(self.time) self.profile_id = 'E1' + \ rf_string.generate_random_string(8, '[NUMBERS]')
def __init__(self, scooter_model): rf_string = String() # RF Library self.company_code = '1500' self.country = 'TW' self.keyfobs_id = rf_string.generate_random_string(3, '[NUMBERS]') self.vin = rf_string.generate_random_string(13, '[UPPER][NUMBERS]') self.plate = rf_string.generate_random_string(3, '[UPPER][NUMBERS]')+'-'+rf_string.generate_random_string(4, '[UPPER][NUMBERS]') self.scooter_guid = str(uuid.uuid4()) self.matnr = scooter_model self.motor_num = self.matnr self.scooter_vin = 'SWQA' + self.vin self.atmel_key = 'ED554638AD91C64694A39262CA1A3C14663B8ACBDF8E074E98BBD965EA1969C8' self.atmel_sn = '0123F61FCBFED2A0B1' self.manufacture_date = time.strftime("%Y-%m-%d") self.state = '1' self.es_state = '13' self.ecu_mac = 'rpNx83uY' self.ecu_sn = 'MABBQUFCBBIwABYzRQBkEA==' self.ecu_status = '1' self.keyfobs_status = '1' self.keyfobs_id = '321'
def __init__(self, part_category_type, names=None, prices=None): rf_string = String() # RF Library self.sequence_id = 'SWQA' + \ rf_string.generate_random_string(6, '[NUMBERS]') self.part_code = 'SWQA' + \ rf_string.generate_random_string(6, '[NUMBERS]') self.part_category_type = part_category_type self.part_category_sub_type = 0 self.part_category_id = None self.brand_company_code = None self.names = names self.production_start_time = int(time.time()) self.production_end_time = int(time.time()) self.sale_status = 1 self.sale_suspend_time = int(time.time()) self.warranty_period = 12 self.warranty_distance = rf_string.generate_random_string( 4, '[NUMBERS]') self.endurance_period = 12 self.endurance_distance = rf_string.generate_random_string( 4, '[NUMBERS]') self.prices = prices
def scooteroutbound_post(self, date, vin, order_no, department_code, key, scooter_model='GSBH2-000-CF', account=None): """ Add scooter into outbound on DMS with vin Arguments: :param date: string type, format with YYYY/mm/dd, :param order_no: string type, dms_order_no :param vin: string type, scooter_vin :param key: string type, encrypted information, default use key in setting.py Examples: | Scooteroutbound Post | PAYLOAD | """ rf_string = String() purchase_order = rf_string.generate_random_string(10, '[NUMBERS]') delivery_note = rf_string.generate_random_string(8, '[NUMBERS]') self.init.authHeader(account) data = { "key": key, "data": [{ "g01": purchase_order, "g02": delivery_note, "g03": date, "g04": scooter_model, "g05": vin, "g06": order_no, "g07": department_code, "g08": date }] } resp = self.init.request('post', "/scooteroutbound", json=data) return resp
def __init__(self, status): rf_string = String() # RF Library self.company_name = 'SWQA' + \ rf_string.generate_random_string(5, '[UPPER]') self.company_code = 'SWQA' + \ rf_string.generate_random_string(5, '[NUMBERS]') self.company_type = 11 self.company_sub_type = 11 self.company_group_id = None self.brand_name = 'SWQA' self.address = '長安東路二段225號C棟11樓' self.zip_code = '10552' self.country_code = 'TW' self.contact_person_firstname = rf_string.generate_random_string( 5, '[UPPER]') self.contact_person_lastname = rf_string.generate_random_string( 5, '[UPPER]') self.contact_email = 'sw.verify+{}@gogoro.com'.format(int(time.time())) self.contact_phone1 = '09' + \ rf_string.generate_random_string(8, '[NUMBERS]') self.contact_phone2 = '09' + \ rf_string.generate_random_string(8, '[NUMBERS]') self.status = status
import sys import os.path from robot.libraries.String import String _here = os.path.dirname(__file__) string = String() _here = string.fetch_from_left(_here, "tests") sys.path.insert(0, os.path.abspath(os.path.join(_here))) from globals import config from pagefactory.homepage import Loginpage as elem from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as ec from selenium.webdriver.common.by import By from globals.functions import Functions import random import time class Loginpage(object): def __init__(self, browser='chrome'): self.browser = browser self.driver = None self.wait = WebDriverWait(self.driver, 10) self.func = Functions(self.driver) self.choice = None self.selected_category = None self.random_category_text = None self.login_url = "https://bank.paysera.com/en/login"
def __init__(self): self._string = String()