Best Python code snippet using SeleniumBase
init.py
Source:init.py
1from flask import render_template, redirect, url_for2from app import db3from app.models import *4from app.main import bp5@bp.route('/init_system', methods=['GET', 'POST'])6def init_system():7 ### create Abilities_cat8 categorylist = ['Wissen','Soziales', 'Sportliches','Aktionen','Handwerk', 'Kampf']9 for item in categorylist:10 if db.session.query(Abilities_cat).filter(Abilities_cat.name==item).count() == 0:11 new_ac=Abilities_cat(name=item)12 db.session.add(new_ac)13 db.session.commit()14 ### create STas List15 statlist = ['KK','AU','GE','IN','CH','MB','ATN','PA','ATD','INI','LE','GG','--']16 for item in statlist:17 if db.session.query(stats_templates).filter(stats_templates.Stat==item).count() == 0:18 new_ac=stats_templates(Stat=item)19 db.session.add(new_ac)20 db.session.commit()21 ### create Abilites_tempalte22 abilitlist = [23 ('Chemie','IN','IN','MB', 'Wissen'),24 ('Physik','IN','IN','MB', 'Wissen'),25 ('Biologie','IN','IN','MB', 'Wissen'),26 ('Medizin','IN','IN','MB', 'Wissen'),27 ('Mathematik','IN','IN','MB', 'Wissen'),28 ('Meterologie','IN','MB','IN', 'Wissen'),29 ('Botanik','IN','IN','MB', 'Wissen'),30 ('Literatur','IN','IN','IN', 'Wissen'),31 ('Ãberlebenstechnik','IN','MB','MB', 'Wissen'),32 ('Urbanes Wissen','IN','MB','MB', 'Wissen'),33 ('Ländliches Wissen','IN','MB','MB', 'Wissen'),34 ('Beruhigen','CH','CH','IN', 'Soziales'),35 ('Manipulieren','CH','IN','IN', 'Soziales'),36 ('Bedrohen','CH','MB','MB', 'Soziales'),37 ('Ãberreden','IN','CH','CH', 'Soziales'),38 ('Betöhren','GE','IN','MB', 'Soziales'),39 ('Feilschen','CH','CH','CH', 'Soziales'),40 ('Lügen','CH','IN','IN', 'Soziales'),41 ('Menschenkenntnis','IN','IN','MB', 'Soziales'),42 ('Begeistern/Führen','CH','CH','MB', 'Soziales'),43 ('Laufen','AU','KK','AU', 'Sportliches'),44 ('Klettern','KK','AU','KK', 'Sportliches'),45 ('Schwimmen','KK','AU','AU', 'Sportliches'),46 ('Springen','KK','GE','AU', 'Sportliches'),47 ('Werfen','KK','KK','GE', 'Sportliches'),48 ('Balancieren','GE','GE','AU', 'Sportliches'),49 ('Erste Hilfe','IN','GE','GE', 'Aktionen'),50 ('Fahren','GE','GE','MB', 'Aktionen'),51 ('Reiten','GE','GE','AU', 'Aktionen'),52 ('Spurenlesen','IN','MB','MB', 'Aktionen'),53 ('Fliegen','MB','GE','GE', 'Aktionen'),54 ('Tiere Zähmen','CH','IN','MB', 'Aktionen'),55 ('Schlösser Knacken','GE','GE','IN', 'Aktionen'),56 ('Schleichen','GE','GE','AU', 'Aktionen'),57 ('Bogenbau','GE','GE','IN', 'Handwerk'),58 ('Schmieden','GE','KK','GE', 'Handwerk'),59 ('Tischlern','GE','GE','KK', 'Handwerk'),60 ('Maurern','KK','KK','GE', 'Handwerk'),61 ('Zeichnen','IN','IN','MB', 'Handwerk'),62 ('Mechanik','GE','IN','IN', 'Handwerk'),63 ('Nahkampfwaffe Spitz','--','--','--', 'Kampf'),64 ('Nahkampfwaffe Scharf','--','--','--', 'Kampf'),65 ('Nahkampfwaffe Stumpf','--','--','--', 'Kampf'),66 ('Wurfwaffen','--','--','--', 'Kampf'),67 ('Faustfeuerwaffen','--','--','--', 'Kampf'),68 ('Langwaffen','--','--','--', 'Kampf'),69 ('Spezialwaffen','--','--','--', 'Kampf'),70 ('Bogenschiessen','--','--','--', 'Kampf'),71 ('Faustkampf / Kampfkunst','--','--','--', 'Kampf'),72 ]73 for item in abilitlist:74 if db.session.query(Abilities_templates).filter(Abilities_templates.Name==item[0]).count() == 0:75 new_ac=Abilities_templates(Name=item[0],76 test01=db.session.query(stats_templates).filter(stats_templates.Stat==item[1]).first().id,77 test02=db.session.query(stats_templates).filter(stats_templates.Stat==item[2]).first().id,78 test03=db.session.query(stats_templates).filter(stats_templates.Stat==item[3]).first().id,79 category=db.session.query(Abilities_cat).filter(Abilities_cat.name==item[4]).first().id80 )81 db.session.add(new_ac)82 db.session.commit()...
proceeding.py
Source:proceeding.py
1from random import choice2from config import Handeln, Wissen, Soziales3from spending import *4import inquirer5def proceed_all(total_in):6 dist_q = [7 inquirer.List('choice',8 message="Select distibution",9 choices=['Uniform', 'Random'],10 ),11 ]12 dist = inquirer.prompt(dist_q)13 if dist['choice'] == 'Uniform':14 spend_all_points_evenly(total_in, Handeln, Wissen, Soziales)15 if dist['choice'] == 'Random':16 spend_all_points_random(total_in, Handeln, Wissen, Soziales)17def proceed_selector(total_in):18 handeln_q = [19 inquirer.Checkbox('choices',20 message="Select Values from Handeln",21 choices=Handeln,22 ),23 ]24 handeln_v = inquirer.prompt(handeln_q)['choices']25 wissen_q = [26 inquirer.Checkbox('choices',27 message="Select Values from Wissen",28 choices=Wissen,29 ),30 ]31 wissen_v = inquirer.prompt(wissen_q)['choices']32 soziales_q = [33 inquirer.Checkbox('choices',34 message="Select Values from Soziales",35 choices=Soziales,36 ),37 ]38 soziales_v = inquirer.prompt(soziales_q)['choices']39 dist = select_distribution()40 if dist['choice'] == 'Uniform':41 spend_all_points_evenly(total_in, handeln_v, wissen_v, soziales_v)42 if dist['choice'] == 'Random':43 spend_all_points_random(total_in, handeln_v, wissen_v, soziales_v)44def select_distribution():45 dist_q = [46 inquirer.List('choice',47 message="Select distibution",48 choices=['Uniform', 'Random'],49 ),50 ]51 dist = inquirer.prompt(dist_q)...
__init__.py
Source:__init__.py
1# -*- coding: utf-8 -*-2"""3/***************************************************************************4 wissenLteTool5 A QGIS plugin6 wissenLteTool7 Generated by Plugin Builder: http://g-sherman.github.io/Qgis-Plugin-Builder/8 -------------------9 begin : 2021-07-1310 copyright : (C) 2021 by wissen11 email : wissen.gs.tool@outlook.com12 git sha : $Format:%H$13 ***************************************************************************/14/***************************************************************************15 * *16 * This program is free software; you can redistribute it and/or modify *17 * it under the terms of the GNU General Public License as published by *18 * the Free Software Foundation; either version 2 of the License, or *19 * (at your option) any later version. *20 * *21 ***************************************************************************/22 This script initializes the plugin, making it known to QGIS.23"""24# noinspection PyPep8Naming25def classFactory(iface): # pylint: disable=invalid-name26 """Load wissenLteTool class from file wissenLteTool.27 :param iface: A QGIS interface instance.28 :type iface: QgsInterface29 """30 #31 from .wissenLteTool import wissenLteTool...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!