def setUpClass(self): chrome_options = Options() chrome_options.add_argument('--headless') chrome_options.add_argument('--window-size=1920,1080') # chrome_options.add_argument("--auto-open-devtools-for-tabs") #chrome_options.add_argument('--disable-gpu') #chrome_options.headless = True self.driver = webdriver.Chrome( executable_path='C:/webdrivers/chromedriver.exe', options=chrome_options) self.driver.delete_all_cookies() self.driver.maximize_window() config = read_section() self.driver.get(config.get('path')) self.html = HtmlProxy(self.driver) self.menu = MainMenuProxy(self.driver) self.stockseed = StockSeed(self.driver) self.productseed = ProductSeed(self.driver) self.receivingseed = ReceivingSeed(self.driver) self.restaurantseed = RestaurantSeed(self.driver) self.clientseed = ClientSeed(self.driver) self.usersSeed = UsersSeed(self.driver) self.stockAssert = StockAssert(self.html, self.driver) self.productAssert = ProductAssert(self.html, self.driver) self.receivingAssert = ReceivingAssert(self.html, self.driver) self.restaurantAssert = RestaurantAssert(self.html, self.driver) self.clientAssert = ClientManagementAssert(self.html, self.driver) self.usersAssert = UserAssert(self.html, self.driver) self.result = unittest.TestResult
class MainMenuProxy: def __init__(self, driver): self.driver = driver self.html = HtmlProxy(self.driver) config = read_section() self.baseUrl = (config.get('path')) def openRestaurant(self): self.navigate('restaurant/index') self.wait() try: self.html.clickElement('A műveletet elvégeztem') except: pass def openProducts(self): self.navigate('products') self.wait() def openStocks(self): self.navigate('warehouse') self.wait() def openReceiving(self): self.navigate('receiving') self.wait() def openStatistics(self): self.navigate('statistics/itemsale') self.wait() def openProduction(self): self.navigate('conveniences') self.wait() def openClientManagement(self): self.navigate('clients') self.wait() def openUsers(self): self.navigate('staff') self.wait() def openTableMapEditor(self): self.navigate('tablemapeditor/index') self.wait() def openFinance(self): self.navigate('finance') self.wait() def wait(self): self.html.wait() def navigate(self, destination): self.driver.get(self.baseUrl + '/' + destination)
class CGSpecific: html = HtmlProxy(webdriver) def search(self, value, tab): self.html.wait(2) try: currWindow = self.html.getTab(tab) except NoSuchElementException: return self.html.fillInput('searchinput simpleFilterTerm', value, selector='class', element=currWindow) self.html.clickElement('Keresés', element=currWindow) self.html.wait(2)
def __init__(self, driver): self.driver = driver self.html = HtmlProxy(self.driver) self.menu = MainMenuProxy(self.driver) self.stockAssert = StockAssert(self.html, self.driver)
class StockSeed: def __init__(self, driver): self.driver = driver self.html = HtmlProxy(self.driver) self.menu = MainMenuProxy(self.driver) self.stockAssert = StockAssert(self.html, self.driver) def createRawMaterial(self, materialName, me, wareHouse, module=False): if module: self.menu.openStocks() self.html.clickElement('Új nyersanyag felvitele', 'a') self.html.switchFrame('iframe') self.html.fillInput('Nyersanyag neve', materialName) self.html.clickDropdown('ME', me) self.html.clickDropdown('Raktár', wareHouse) self.html.clickElement('Rögzít') self.html.switchFrame() self.html.refresh() self.stockAssert.assertMaterialExist(materialName, 'Raktárkészlet') def createRawMaterialWithOpening(self, testName, grossPrice, openingQty, whName, me='liter', module=False): if module: self.menu.openStocks() self.html.clickElement('Új nyersanyag felvitele', 'a') self.html.switchFrame('iframe') self.html.fillInput('Nyersanyag neve', testName) self.html.fillInput('Bruttó beszerzési egységár', grossPrice) self.html.clickDropdown('ME', me) self.html.fillInput('Nyitó mennyiség', openingQty) self.html.clickDropdown('Raktár', whName) self.html.clickElement('Rögzít') self.html.switchFrame() def deleteRawMaterial(self, name, module=False): if module: self.menu.openStocks() self.html.wait(2) self.html.search(name, 'Raktárkészlet') self.html.wait(2) self.html.clickTableDropdown(name, 'Törlés', 'Raktárkészlet') self.html.wait(2) self.html.clickElement('Igen') self.html.wait(2) self.html.search('', 'Raktárkészlet') self.html.wait(2) def createWarehouse(self, warehouseName, module=False, tab=False): if module: self.menu.openStocks() self.html.clickElement('Raktárak', 'a') elif tab: self.html.clickElement('Raktárak', 'a') self.html.clickElement('Új raktár felvitele', 'a') self.html.switchFrame('iframe') self.html.fillInput('Raktár neve', warehouseName) self.html.clickElement('Rögzít') self.html.switchFrame() def deleteWarehouse(self, warehouseName, module=False, tab=False): if module: self.menu.openStocks() self.html.clickElement('Raktárak', 'a') elif tab: self.html.clickElement('Raktárak', 'a') self.html.refresh() self.html.wait(2) self.html.search(warehouseName, 'Raktárak') self.html.wait(2) currWindow = self.html.getElement('tabs-3', 'div', options=Options(htmlAttribute='id')) # itt azert adjuk at a currWindow-t, hogy az adott oldalon keressen a td-k kozott self.html.clickElement(warehouseName, 'td', Options(following='a', element=currWindow)) self.html.wait(3) self.html.clickElement('Igen') self.html.wait(2) self.html.search('', 'Raktárak') self.html.wait(2)
def __init__(self, driver): self.driver = driver self.html = HtmlProxy(self.driver) config = read_section() self.baseUrl = (config.get('path'))
class ProductSeed: def __init__(self, driver): self.driver = driver self.html = HtmlProxy(self.driver) self.menu = MainMenuProxy(self.driver) self.stockAssert = StockAssert(self.html, self.driver) def createProductGroup(self, groupName, module=False, tab=False): if module: self.menu.openProducts() self.html.clickElement('Termékcsoportok', 'a') if tab: self.html.clickElement('Termékcsoportok', 'a') self.html.clickElement('Új termékcsoport felvitele', 'a') self.html.switchFrame('iframe') self.html.fillInput('Termékcsoport neve', groupName) self.html.clickDropdown('Kategória', 'Étel') self.html.clickElement('Rögzít') self.html.wait(12) self.html.switchFrame() self.html.wait(5) def deleteProductGroup(self, groupName, module=False, tab=False): if module: self.menu.openProducts() self.html.clickElement('Termékcsoportok', 'a') elif tab: self.html.clickElement('Termékcsoportok', 'a') self.html.clickTableElement('product_groups', 'id', groupName, 'span', 'Törlés', 'Termékcsoportok') self.html.wait(2) self.html.clickElement('Igen') def createMenu(self, menuName, firstMeal, secondMeal, module=False, tab=False): if module: self.menu.openProducts() self.html.clickElement('Menü', 'a') elif tab: self.html.clickElement('Menü', 'a') self.html.clickElement('Új menü felvitele', 'a') self.html.switchFrame('iframe') self.html.clickDropdown('Nyomtatási részleg', 'Konyha') self.html.fillInput('Termék neve', menuName) self.html.getElement( 'Termékcsoport', 'label', Options(following='input//following::input')).click() self.html.wait(2) self.html.switchFrame('iframe') self.html.clickElement('Ételek', 'a') self.html.clickElement('Rögzít') self.html.switchFrame('iframe') self.html.fillInput('Kód', '1212') self.html.getElement('27%', 'td', Options(following='td//input')).send_keys('100') self.html.fillInput('Fogás neve', 'Előétel') self.html.clickDropdown('Termékcsoport:', td.ProductGroup['Egyeb']['Name']) self.html.clickElement(td.ProductGroup['Egyeb']['Name']) self.html.fillInput('Mennyiség', '1') self.html.getInput('Mennyiség', 'label').click() self.html.clickElement('Hozzáad') self.html.wait(3) self.html.clickElement(firstMeal, 'span') self.html.clickElement('icon-hozzaadas addNewComponent', 'i', Options(htmlAttribute='class')) self.html.wait(3) tab = self.html.getElement('tabs-2', 'div', Options(htmlAttribute='id')) self.html.fillInput('Fogás neve', 'Főétel', options=Options(element=tab)) self.html.clickDropdown('Termékcsoport:', td.ProductGroup['Egyeb']['Name'], options=Options(element=tab)) self.html.clickElement(td.ProductGroup['Egyeb']['Name'], options=Options(element=tab)) self.html.fillInput('Mennyiség', '1', options=Options(element=tab)) self.html.getInput('Mennyiség', 'label', options=Options(element=tab)).click() self.html.clickElement('Hozzáad', options=Options(element=tab)) self.html.wait(3) self.html.clickElement(secondMeal, 'span', options=Options(element=tab)) self.html.clickElement('Rögzít') self.html.switchFrame() def deleteMenu(self, menuName, module=False, tab=False): if module: self.menu.openProducts() self.html.clickElement('Menü', 'a') elif tab: self.html.clickElement('Menü', 'a') self.html.clickTableElement('menu', 'id', menuName, 'span', 'Törlés', 'Menü') self.html.clickElement('Igen') def createPizza(self, pizzaName, baseComponent, topping, module=False, tab=False): if module: self.menu.openProducts() self.html.clickElement('Pizza (testreszabható)', 'a') elif tab: self.html.clickElement('Pizza (testreszabható)', 'a') self.html.clickElement('Új pizza (testreszabható)', 'a') self.html.switchFrame('iframe') self.html.clickDropdown('Nyomtatási részleg', 'Pizza') self.html.fillInput('Termék neve', pizzaName) self.html.fillInput('Kód', '1211') self.html.clickDropdown('Szósz', 'Paradicsomos alap') self.html.fillAutocomplete('baseComponentName', 'input', baseComponent, baseComponent, 'li', Options(htmlAttribute='id')) table = self.html.getElement('baseComponents', 'table', Options(htmlAttribute='id')) self.html.getElement('Hozzáad', 'button', Options(element=table)).click() # self.html.fillAutocomplete('toppingComponentName', 'input', topping, topping, 'li', Options(htmlAttribute='id')) # table = self.html.getElement('toppingComponents', 'table', Options(htmlAttribute='id')) # self.html.getElement('Hozzáad', 'button', element=table).click() self.html.clickElement('Mennyiségek', 'a') self.html.wait(2) td = self.html.getElement('Eladási ár(ak)', 'td') self.html.clickElement('edit actionButton fright editPriceBtn', 'a', Options(htmlAttribute='class')) self.html.fillInput('Nettó', '1000') self.html.wait(2) self.html.clickElement('Rögzít', 'a', waitSeconds=2) #self.html.closeAllert() #self.html.clickElement('Rögzít', 'a') self.html.clickElement('Rögzít') def deletePizza(self, pizzaName, module=False, tab=False): if module: self.menu.openProducts() self.html.clickElement('Pizza (testreszabható)', 'a') elif tab: self.html.clickElement('Pizza (testreszabható)', 'a') self.html.clickTableElement('customproduct-2', 'id', pizzaName, 'a', 'Törlés', 'Pizza (testreszabható)') self.html.clickElement('Igen') def createProduct(self, name, group, code, counter, component, compQty=2, netPrice=100, module=False): if module: self.menu.openProducts() self.html.clickElement('Új termék felvitele', 'a') self.html.switchFrame('iframe') self.html.clickDropdown('Nyomtatási részleg', 'Pult') self.html.switchFrame('iframe') self.html.clickElement(group, 'a') self.html.clickElement('Rögzít') self.html.switchFrame('iframe') self.html.fillInput('Termék neve', name) self.html.fillInput('Kód', code) self.html.clickElement('p_counters', 'input', Options(htmlAttribute='id'), waitSeconds=1) self.html.switchFrame('iframe') self.html.clickElement(counter, 'td') self.html.clickElement('Rögzít') self.html.switchFrame('iframe') places = self.html.getElement('Eladási ár (Kötelező)', 'td') self.html.clickElement('Ár megadása', options=Options(element=places)) self.html.fillInput('Nettó', netPrice) self.html.wait(1) self.html.clickElement('taxPriceSave', 'a', options=Options(htmlAttribute='id')) self.html.wait(2) self.html.fillAutocomplete('componentName', 'input', component, component, 'li', Options(htmlAttribute='id')) self.html.fillInput('componentQty', compQty, 'input', options=Options(htmlAttribute='id')) self.html.clickElement('Hozzáad') self.html.clickElement('Rögzít') def createProductConveniencies(self, name, group, code, counter, component, compQty=2, module=False): if module: self.menu.openProducts() self.html.clickElement('Új termék felvitele', 'a') self.html.switchFrame('iframe') self.html.clickDropdown('Nyomtatási részleg', 'Pult') self.html.switchFrame('iframe') self.html.clickElement(group, 'a') self.html.clickElement('Rögzít') self.html.switchFrame('iframe') self.html.fillInput('Termék neve', name) self.html.fillInput('Kód', code) self.html.clickElement('p_counters', 'input', Options(htmlAttribute='id'), waitSeconds=1) self.html.switchFrame('iframe') self.html.clickElement(counter, 'td') self.html.clickElement('Rögzít') self.html.switchFrame('iframe') self.html.clickElement( None, './/label[contains(.,"Gyártás termék") and @class="radio formStyle"]', options=Options(uniqueSelector=True)) self.html.fillInput('Recept adag', '1') self.html.fillAutocomplete('componentName', 'input', component, component, 'li', Options(htmlAttribute='id')) self.html.fillInput('componentQty', compQty, 'input', options=Options(htmlAttribute='id')) self.html.clickElement('Hozzáad') self.html.clickElement('Rögzít') def deleteProduct(self, name, module=False): if module: self.menu.openProducts() self.html.refresh() self.html.clickTableElement('products', 'id', name, 'a', 'Törlés', 'Termékek') self.html.clickElement('Igen', waitSeconds=2) self.html.search('', 'Termékek') def createCounter(self, name, position, module=False, tab=False): if module: self.menu.openProducts() self.html.clickElement('Számlálók', 'a') if tab: self.html.clickElement('Számlálók', 'a') self.html.clickElement('Új számláló felvitele', 'a') self.html.switchFrame('iframe') self.html.fillInput('Számláló neve', name) self.html.fillInput('Számláló állás', position) self.html.clickElement('Rögzít') self.html.switchFrame() def deleteCounter(self, name, module=False, tab=False): if module: self.menu.openProducts() self.html.clickElement('Számlálók', 'a') if tab: self.html.clickElement('Számlálók', 'a') self.html.refresh() self.html.clickTableElement('counters', 'id', name, 'a', 'Törlés', 'Számlálók') self.html.clickElement('Igen', waitSeconds=1) self.html.search('', 'Számlálók')
def __init__(self, driver): self.driver = driver self.html = HtmlProxy(self.driver) self.menu = MainMenuProxy(self.driver) self.receivingAssert = ReceivingAssert(self.html, self.driver)
class ReceivingSeed(): def __init__(self, driver): self.driver = driver self.html = HtmlProxy(self.driver) self.menu = MainMenuProxy(self.driver) self.receivingAssert = ReceivingAssert(self.html, self.driver) def createPartner(self, name, id, module=False, tab=False): if module: self.menu.openReceiving() self.html.clickElement('Beszállítók', 'a') if tab: self.html.clickElement('Beszállítók', 'a') self.html.clickElement('Új beszállító', 'a') self.html.switchFrame('iframe') self.html.fillInput('Beszállító neve', name) self.html.fillInput('Belső azonosító', id) self.html.clickElement('Rögzít') self.html.switchFrame() self.receivingAssert.assertPartnerExist(name, 'Beszállítók') def deleteParter(self, partnerName, module=False, tab=False): if module: self.menu.openReceiving() self.html.clickElement('Beszállítók', 'a') if tab: self.html.clickElement('Beszállítók', 'a') self.html.search(partnerName, 'Beszállítók') self.html.clickElement( None, '//table[@id="partners"]//tr[contains(.,"' + partnerName + '")]//label', Options(uniqueSelector=True)) self.html.clickElement('deletePartners', options=Options(htmlAttribute='id')) self.html.clickElement('Igen') self.html.refresh() self.receivingAssert.assertPartnerNotExist(partnerName, 'Beszállítók')
def __init__(self, driver): self.driver = driver self.html = HtmlProxy(self.driver) self.menu = MainMenuProxy(self.driver) self.usersAssert = UserAssert(self.html, self.driver)
class UsersSeed: def __init__(self, driver): self.driver = driver self.html = HtmlProxy(self.driver) self.menu = MainMenuProxy(self.driver) self.usersAssert = UserAssert(self.html, self.driver) def createGroup(self, name): page = self.html.getElement('tabs-groups', 'div', options=Options(htmlAttribute='id')) self.html.fillInput('Név', name) self.html.clickElement('Rögzít', options=Options(element=page)) def deleteGroup(self, name): self.html.clickTableElement('groups', 'id', name, 'a', 'Törlés', 'Csoportok') self.html.clickElement('Igen', waitSeconds=1) self.html.search('', 'Csoportok') def createUser(self, surname, firstName, userName, password, position, group): self.html.fillInput('Vezetéknév', surname) #self.html.fillInput('Vezetéknévasdasd', surname) self.html.fillInput('Keresztnév', firstName) self.html.fillInput('Felhasználónév', userName) self.html.fillInput('Jelszó', password) self.html.fillInput('Jelszó ismét', password) self.html.fillInput('Belépő kód', password) self.html.clickDropdown('Beosztás', position) self.html.clickDropdown('Csoportok', group) self.html.clickElement('Rögzít') def deleteUser(self, surname): self.html.search(surname, 'Személyzet') self.html.clickTableElement('users', 'id', surname, 'a', 'Törlés', 'Személyzet') self.html.clickElement('Igen', waitSeconds=1) self.html.search('', 'Személyzet')
class RestaurantSeed: def __init__(self, driver): self.driver = driver self.html = HtmlProxy(self.driver) self.menu = MainMenuProxy(self.driver) self.receivingAssert = ReceivingAssert(self.html, self.driver) def createTable(self, tableName, tableShape='Kör', tableType='Normál', discount='0', module=False): if module: self.menu.openTableMapEditor() self.html.clickElement(tableShape + ' asztal hozzáadása', 'a', Options(htmlAttribute='title')) self.html.refresh() self.html.clickElement('Étterem', 'i') self.html.fillInput('Asztal neve', tableName) if not tableType == 'Normál': self.html.clickDropdown('Asztal típusa', tableType) if tableType == 'Főnöki' or tableType == 'Személyzeti': self.html.fillInput('Kedv.', discount) self.html.clickElement( 'Rögzít', 'span' ) # Span-t kell használni mert valamiért 'Rögzít' buttonból van egy amit előbb megtalál és az nem interactable def deleteTable(self, tableName, module=False): if module: self.menu.openTableMapEditor() self.html.clickElement(tableName, 'i') self.html.clickElement( 'Törlés', 'span') # ugyan az az állás mint a fenti kommentnél self.html.clickElement('Igen') def createDynamicCourierTable(self, name): self.html.clickElement('+', waitSeconds=1) self.html.fillAutocomplete('cl_name', 'input', name, name, 'li', options=Options(htmlAttribute='id')) self.html.clickElement('Rögzít', 'span')
class BaseTestCase(unittest.TestCase): @classmethod def setUpClass(self): chrome_options = Options() chrome_options.add_argument('--headless') chrome_options.add_argument('--window-size=1920,1080') # chrome_options.add_argument("--auto-open-devtools-for-tabs") #chrome_options.add_argument('--disable-gpu') #chrome_options.headless = True self.driver = webdriver.Chrome( executable_path='C:/webdrivers/chromedriver.exe', options=chrome_options) self.driver.delete_all_cookies() self.driver.maximize_window() config = read_section() self.driver.get(config.get('path')) self.html = HtmlProxy(self.driver) self.menu = MainMenuProxy(self.driver) self.stockseed = StockSeed(self.driver) self.productseed = ProductSeed(self.driver) self.receivingseed = ReceivingSeed(self.driver) self.restaurantseed = RestaurantSeed(self.driver) self.clientseed = ClientSeed(self.driver) self.usersSeed = UsersSeed(self.driver) self.stockAssert = StockAssert(self.html, self.driver) self.productAssert = ProductAssert(self.html, self.driver) self.receivingAssert = ReceivingAssert(self.html, self.driver) self.restaurantAssert = RestaurantAssert(self.html, self.driver) self.clientAssert = ClientManagementAssert(self.html, self.driver) self.usersAssert = UserAssert(self.html, self.driver) self.result = unittest.TestResult @classmethod def tearDownClass(self): self.driver.quit() ''' @classmethod def tearDown(self): print('kint') # if not unittest.TestResult.wasSuccessful(unittest.TestResult()): print(self.defaultTestResult(self).errors) print('error:') print(len(self.result().errors)) print('fail:') print(len(self.result().failures)) if not len(self.result(self).errors) == 0: print('bent') now = datetime.now().strftime('%Y-%m-%d_%H-%M-%S') name = 'screenshot-%s.png' % now self.driver.save_screenshot(name) print(name) ''' def login(self): self.html.fillInput('Felhasználónév', 'admin', selector='placeholder') self.html.fillInput('Jelszó', 'admin', selector='placeholder') self.html.clickElement('Belépés') self.html.fillInput('Belépési kód', 'admin', selector='placeholder') self.html.clickElement('Belépés')
def __init__(self, driver): self.driver = driver self.html = HtmlProxy(self.driver) self.menu = MainMenuProxy(self.driver) self.clientAssert = ClientManagementAssert(self.html, self.driver)
class ClientSeed: def __init__(self, driver): self.driver = driver self.html = HtmlProxy(self.driver) self.menu = MainMenuProxy(self.driver) self.clientAssert = ClientManagementAssert(self.html, self.driver) def createClient(self, name, code, phone, discount, taxnumber, country, postalCode, city, street, houseNumber, tab=False): if tab: self.html.clickElement('Házhozszállítási cím', 'a') self.html.clickElement('Új házhozszállítási cím', 'a', waitSeconds=2) self.html.switchFrame('iframe') self.html.fillInput('Név / azonosító', name) self.html.fillInput('Ügyfélazonosító', code) self.html.fillInput('Telefon', phone) self.html.fillInput('Kedv. (%)', discount) self.html.fillInput('Adószám', taxnumber) self.html.fillInput('ca_country_helper', country, 'input', options=Options(htmlAttribute='id')) self.html.fillInput('ca_zip_helper', postalCode, 'input', options=Options(htmlAttribute='id')) self.html.fillInput('ca_city_helper', city, 'input', options=Options(htmlAttribute='id')) self.html.fillInput('ca_street_helper', street, 'input', options=Options(htmlAttribute='id')) self.html.fillInput('ca_housenumber_helper', houseNumber, 'input', options=Options(htmlAttribute='id')) self.html.clickElement('Hozzáad') self.html.clickElement('Rögzít', waitSeconds=2) self.html.switchFrame() address = country + ', ' + postalCode + ' ' + city + ' ' + street + ' ' + houseNumber return address def createRegular(self, name, code, phone, discount, taxnumber, country, postalCode, city, street, houseNumber, module=False, tab=False): if module: self.menu.openClientManagement() self.html.clickElement('Törzsvendégek', 'a') if tab: self.html.clickElement('Törzsvendégek', 'a') self.html.clickElement('Új törzsvendég', 'a', waitSeconds=2) self.html.switchFrame('iframe') self.html.fillInput('Név / azonosító', name) self.html.fillInput('Ügyfélazonosító', code) self.html.fillInput('Telefon', phone) self.html.fillInput('Kedv. (%)', discount) self.html.fillInput('Adószám', taxnumber) self.html.fillInput('ca_country_helper', country, 'input', options=Options(htmlAttribute='id')) self.html.fillInput('ca_zip_helper', postalCode, 'input', options=Options(htmlAttribute='id')) self.html.fillInput('ca_city_helper', city, 'input', options=Options(htmlAttribute='id')) self.html.fillInput('ca_street_helper', street, 'input', options=Options(htmlAttribute='id')) self.html.fillInput('ca_housenumber_helper', houseNumber, 'input', options=Options(htmlAttribute='id')) self.html.clickElement('Hozzáad') self.html.clickElement('Rögzít', waitSeconds=2) self.html.switchFrame() address = country + ', ' + postalCode + ' ' + city + ' ' + street + ' ' + houseNumber return address def deleteRegular(self, name, module=False, tab=False): if module: self.menu.openClientManagement() self.html.clickElement('Törzsvendégek', 'a') elif tab: self.html.clickElement('Törzsvendégek', 'a') self.html.wait(2) self.html.search(name, 'Törzsvendégek') self.html.wait(2) self.html.clickTableElement('frequenters', 'id', name, 'a', 'Törlés') self.html.wait(2) self.html.clickElement('Igen') self.html.wait(2) self.html.search('', 'Törzsvendégek') self.html.wait(2) def deleteCard(self, name, module=False, tab=False): if module: self.menu.openClientManagement() self.html.clickElement('Kedvezménykártyák', 'a') elif tab: self.html.clickElement('Kedvezménykártyák', 'a') self.html.wait(2) self.html.search(name, 'Kedvezménykártyák') self.html.wait(2) self.html.clickTableElement('discount_cards', 'id', name, 'a', 'Törlés') self.html.wait(2) self.html.clickElement('Igen') self.html.wait(2) self.html.search('', 'Kedvezménykártyák') self.html.wait(2) def deleteClient(self, name, module=False, tab=False): if module: self.menu.openClientManagement() self.html.clickElement('Házhozszállítási cím', 'a') elif tab: self.html.clickElement('Házhozszállítási cím', 'a') self.html.wait(2) self.html.search(name, 'Házhozszállítási cím') self.html.wait(2) self.html.clickTableElement('frequenters', 'id', name, 'a', 'Törlés') self.html.wait(2) self.html.clickElement('Igen') self.html.wait(2) self.html.search('', 'Törzsvendégek') self.html.wait(2)