Compare commits
19 Commits
9bd96ad876
...
3c74aa025e
Author | SHA1 | Date | |
---|---|---|---|
|
3c74aa025e | ||
|
3123a1dbd0 | ||
|
27d45e88dd | ||
|
0685a42922 | ||
|
6729703827 | ||
|
304a222de1 | ||
|
04d33f4ecd | ||
|
ac22814605 | ||
|
b7a89b56d0 | ||
|
127d16afea | ||
|
9bcbc81c2f | ||
|
12eba5cde7 | ||
|
22ea727c47 | ||
|
05a1fd8557 | ||
|
39e226b564 | ||
|
cd00c8ca88 | ||
|
43793d2c2c | ||
|
ee6ec458fc | ||
|
e6e8bdaa06 |
3
.gitignore
vendored
3
.gitignore
vendored
@ -15,4 +15,5 @@ nohup.out
|
|||||||
file.png
|
file.png
|
||||||
*.ts
|
*.ts
|
||||||
LICENSE
|
LICENSE
|
||||||
README.md
|
README.md
|
||||||
|
venv
|
||||||
|
163
V6.py
163
V6.py
@ -1,16 +1,17 @@
|
|||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
import random
|
||||||
|
import subprocess
|
||||||
|
|
||||||
from modules.Classes.Config import Config
|
from modules.Classes.Config import Config
|
||||||
from modules.Classes.DiscordLogger import DiscordLogger
|
from modules.Classes.DiscordLogger import DiscordLogger
|
||||||
from modules.Classes.UserCredentials import UserCredentials
|
from modules.Classes.UserCredentials import UserCredentials
|
||||||
from modules.Tools.logger import warning, critical
|
from modules.Tools.logger import critical, warning
|
||||||
from modules.cards import *
|
from modules.cards import *
|
||||||
from modules.config import *
|
from modules.config import *
|
||||||
from modules.db import add_to_database
|
from modules.db import add_to_database
|
||||||
from modules.driver_tools import *
|
from modules.driver_tools import *
|
||||||
from modules.error import *
|
from modules.error import *
|
||||||
|
|
||||||
import random
|
|
||||||
|
|
||||||
|
|
||||||
# create a webdriver
|
# create a webdriver
|
||||||
def create_driver(mobile=False):
|
def create_driver(mobile=False):
|
||||||
@ -210,12 +211,12 @@ def all_cards():
|
|||||||
welcome_tour = driver.find_element(By.ID, "welcome-tour")
|
welcome_tour = driver.find_element(By.ID, "welcome-tour")
|
||||||
interest_button_box = welcome_tour.find_element(By.CLASS_NAME, "interest-buttons")
|
interest_button_box = welcome_tour.find_element(By.CLASS_NAME, "interest-buttons")
|
||||||
interests = interest_button_box.find_elements(By.CLASS_NAME, "ng-binding")
|
interests = interest_button_box.find_elements(By.CLASS_NAME, "ng-binding")
|
||||||
debug("Got the following interests: "+str(interests))
|
debug("Got the following interests: " + str(interests))
|
||||||
random.choice(interests).click() # Choose interest
|
random.choice(interests).click() # Choose interest
|
||||||
custom_sleep(1.5)
|
custom_sleep(1.5)
|
||||||
|
|
||||||
claim_button = welcome_tour.find_element(By.ID, "claim-button")
|
claim_button = welcome_tour.find_element(By.ID, "claim-button")
|
||||||
claim_button.click() # submit
|
claim_button.click() # submit
|
||||||
custom_sleep(1.5)
|
custom_sleep(1.5)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@ -265,6 +266,12 @@ def all_cards():
|
|||||||
if not checked:
|
if not checked:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
try:
|
||||||
|
activity = findall("data-bi-id=\"([^\"]+)\"", card_list[i].get_attribute("innerHTML"))[0]
|
||||||
|
except Exception as e:
|
||||||
|
warning("Can't find activity." + str(e))
|
||||||
|
activity = ""
|
||||||
|
|
||||||
custom_sleep(1.5)
|
custom_sleep(1.5)
|
||||||
check_welcome_tour()
|
check_welcome_tour()
|
||||||
driver.execute_script("arguments[0].scrollIntoView();", card_list[i])
|
driver.execute_script("arguments[0].scrollIntoView();", card_list[i])
|
||||||
@ -273,7 +280,7 @@ def all_cards():
|
|||||||
|
|
||||||
if len(driver.window_handles) > 1:
|
if len(driver.window_handles) > 1:
|
||||||
driver.switch_to.window(driver.window_handles[1])
|
driver.switch_to.window(driver.window_handles[1])
|
||||||
try_play(driver.title)
|
try_play(driver.title, activity)
|
||||||
close_tab(driver.window_handles[1])
|
close_tab(driver.window_handles[1])
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@ -340,8 +347,35 @@ def promo():
|
|||||||
custom_sleep(3)
|
custom_sleep(3)
|
||||||
|
|
||||||
|
|
||||||
|
def explore_on_bing(activity: str, config: Config):
|
||||||
|
driver = config.WebDriver.driver
|
||||||
|
|
||||||
|
def search_bing(txt):
|
||||||
|
search_elm = driver.find_element(By.ID, "sb_form_q")
|
||||||
|
send_keys_wait(search_elm, txt)
|
||||||
|
send_keys_wait(search_elm, Keys.ENTER)
|
||||||
|
|
||||||
|
if "lyrics" in activity:
|
||||||
|
search_bing(
|
||||||
|
f"paroles de {['Gata', 'Pyramide', 'Dolce Camara', 'Position', 'Mami Wata'][randint(0, 4)]}") # merci bing copilot pour les titres
|
||||||
|
elif "flight" in activity:
|
||||||
|
search_bing(
|
||||||
|
f"vol {['Paris - New York', 'Londres Amsterdam', 'Bora-Bora Miami', 'Los Angeles Toulouse', 'Rome Dubai'][randint(0, 4)]}")
|
||||||
|
elif "shopping" in activity:
|
||||||
|
search_bing(f"idée cadeau {['Noel', 'Anniversaire'][randint(0, 1)]}")
|
||||||
|
elif "movie" in activity:
|
||||||
|
search_bing(
|
||||||
|
f"Distribution {['Code 8 part 2', 'The Hunger Games: The ballad of Songbirds & Snakes', 'Rebel Moon: Part Two', 'Dune II', 'Wonka'][randint(0, 4)]}")
|
||||||
|
elif "translator" in activity:
|
||||||
|
search_bing(f"traduction {config.wordlist.get_word()} en anglais")
|
||||||
|
elif "map" in activity:
|
||||||
|
search_bing(f"{['Paris', 'Nice', 'Marseille', 'Bordeaux', 'Lyon'][randint(0, 4)]} carte")
|
||||||
|
else:
|
||||||
|
log_error(f"Explore on bing: {activity} not found.")
|
||||||
|
|
||||||
|
|
||||||
# Find out which type of action to do
|
# Find out which type of action to do
|
||||||
def try_play(nom="unknown"):
|
def try_play(nom="unknown", activity=""):
|
||||||
driver = config.WebDriver.driver
|
driver = config.WebDriver.driver
|
||||||
rgpd_popup(config)
|
rgpd_popup(config)
|
||||||
|
|
||||||
@ -387,7 +421,7 @@ def try_play(nom="unknown"):
|
|||||||
info("On fidelity page.")
|
info("On fidelity page.")
|
||||||
fidelity()
|
fidelity()
|
||||||
|
|
||||||
elif wait_until_visible(By.ID, "rqStartQuiz", 5, driver):
|
elif wait_until_visible(By.ID, "rqStartQuiz", 5, driver, raise_error=False):
|
||||||
custom_sleep(3)
|
custom_sleep(3)
|
||||||
driver.find_element(By.ID, "rqStartQuiz").click() # start the quiz
|
driver.find_element(By.ID, "rqStartQuiz").click() # start the quiz
|
||||||
answer_number = driver.page_source.count("rqAnswerOption")
|
answer_number = driver.page_source.count("rqAnswerOption")
|
||||||
@ -397,9 +431,12 @@ def try_play(nom="unknown"):
|
|||||||
number = driver.page_source.count("rqAnswerOption")
|
number = driver.page_source.count("rqAnswerOption")
|
||||||
warning(f"recovery detected. quiz : {number}")
|
warning(f"recovery detected. quiz : {number}")
|
||||||
play(number - 1)
|
play(number - 1)
|
||||||
|
elif "exploreonbing" in activity:
|
||||||
|
info(f"Explore on bing: {activity}")
|
||||||
|
explore_on_bing(activity, config)
|
||||||
|
custom_sleep(uniform(3, 5))
|
||||||
else:
|
else:
|
||||||
info(f"Nothing to do on page `{nom}`")
|
info(f"Nothing obvious to do on page `{nom}`.")
|
||||||
custom_sleep(uniform(3, 5))
|
custom_sleep(uniform(3, 5))
|
||||||
|
|
||||||
|
|
||||||
@ -476,10 +513,12 @@ def login():
|
|||||||
def logged_in():
|
def logged_in():
|
||||||
driver.get("https://login.live.com")
|
driver.get("https://login.live.com")
|
||||||
custom_sleep(10)
|
custom_sleep(10)
|
||||||
|
debug(get_domain(driver))
|
||||||
if get_domain(driver) == "account.microsoft.com":
|
if get_domain(driver) == "account.microsoft.com":
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
info("Logging in...")
|
||||||
driver = config.WebDriver.driver
|
driver = config.WebDriver.driver
|
||||||
try:
|
try:
|
||||||
if not logged_in():
|
if not logged_in():
|
||||||
@ -608,19 +647,23 @@ def fidelity():
|
|||||||
pause = driver.find_element(By.CSS_SELECTOR, f'[class="c-action-toggle c-glyph f-toggle glyph-pause"]')
|
pause = driver.find_element(By.CSS_SELECTOR, f'[class="c-action-toggle c-glyph f-toggle glyph-pause"]')
|
||||||
pause.click()
|
pause.click()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
error(f"Error while clicking pause. Probably no cards. {e}")
|
debug("No pause button.")
|
||||||
return "no cards"
|
|
||||||
cartes = driver.find_elements(By.CSS_SELECTOR, f'[ng-repeat="item in $ctrl.transcludedItems"]')
|
cartes = driver.find_elements(By.CSS_SELECTOR, f'[ng-repeat="item in $ctrl.transcludedItems"]')
|
||||||
nb_cartes = len(cartes)
|
nb_cartes = len(cartes)
|
||||||
|
if nb_cartes == 0:
|
||||||
|
warning("No fidelity cards detected")
|
||||||
|
return "No cards."
|
||||||
checked_list_all = driver.find_elements(By.CSS_SELECTOR, f'[ng-if="$ctrl.complete"]')
|
checked_list_all = driver.find_elements(By.CSS_SELECTOR, f'[ng-if="$ctrl.complete"]')
|
||||||
for i in range(nb_cartes):
|
for i in range(nb_cartes):
|
||||||
cartes[i].click()
|
cartes[i].click()
|
||||||
checked_txt = checked_list_all[i].get_attribute("innerHTML")
|
checked_txt = checked_list_all[i].get_attribute("innerHTML")
|
||||||
ok = checked_txt.count("StatusCircleOuter checkmark")
|
ok = checked_txt.count("StatusCircleOuter checkmark")
|
||||||
total = checked_txt.count("StatusCircleOuter")
|
total = checked_txt.count("StatusCircleOuter")
|
||||||
if (ok != total):
|
if ok != total:
|
||||||
elm = driver.find_elements(By.CLASS_NAME, 'clickable-link')[i]
|
elm = driver.find_elements(By.CLASS_NAME, 'clickable-link')[i]
|
||||||
if not "moviesandtv" in elm.get_attribute("innerHTML"): # not the film card
|
# legacy code. Should be removed
|
||||||
|
if "moviesandtv" not in elm.get_attribute("innerHTML"): # not the film card
|
||||||
elm.click()
|
elm.click()
|
||||||
driver.switch_to.window(driver.window_handles[len(driver.window_handles) - 1])
|
driver.switch_to.window(driver.window_handles[len(driver.window_handles) - 1])
|
||||||
sub_fidelity()
|
sub_fidelity()
|
||||||
@ -738,53 +781,53 @@ def json_start(json_entry, cred: UserCredentials):
|
|||||||
config.WebDriver.set_pc_driver(create_driver())
|
config.WebDriver.set_pc_driver(create_driver())
|
||||||
config.WebDriver.switch_to_driver("PC")
|
config.WebDriver.switch_to_driver("PC")
|
||||||
driver = config.WebDriver.driver
|
driver = config.WebDriver.driver
|
||||||
try:
|
if "unban" in json_entry and str(account_id) in json_entry["unban"]:
|
||||||
if "unban" in json_entry and str(account_id) in json_entry["unban"]:
|
login()
|
||||||
login_part_1()
|
info("\nGO TO example.com TO PROCEED or wait 1200 secs.")
|
||||||
info("\nGO TO example.com TO PROCEED or wait 1200 secs.")
|
for _ in range(1200):
|
||||||
for _ in range(1200):
|
sleep(1)
|
||||||
sleep(1)
|
if driver.current_url == "https://example.com/":
|
||||||
if driver.current_url == "https://example.com/":
|
info("proceeding")
|
||||||
info("proceeding")
|
break
|
||||||
break
|
else:
|
||||||
else:
|
|
||||||
login()
|
|
||||||
except KeyError:
|
|
||||||
login()
|
login()
|
||||||
try:
|
try:
|
||||||
if str(account_id) in json_entry["tout"]:
|
if str(account_id) in json_entry["tout"]:
|
||||||
daily_routine(cred, True)
|
daily_routine(cred, True)
|
||||||
|
|
||||||
|
else:
|
||||||
|
try:
|
||||||
|
if str(account_id) in json_entry["daily"]:
|
||||||
|
try:
|
||||||
|
all_cards()
|
||||||
|
except Exception as e:
|
||||||
|
log_error(e)
|
||||||
|
except KeyError:
|
||||||
|
pass
|
||||||
|
try:
|
||||||
|
if str(account_id) in json_entry["pc"]:
|
||||||
|
try:
|
||||||
|
bing_pc_search()
|
||||||
|
except Exception as e:
|
||||||
|
log_error(e)
|
||||||
|
except KeyError:
|
||||||
|
pass
|
||||||
|
try:
|
||||||
|
if str(account_id) in json_entry["mobile"]:
|
||||||
|
try:
|
||||||
|
bing_mobile_search(cred)
|
||||||
|
except Exception as e:
|
||||||
|
log_error(e)
|
||||||
|
except KeyError:
|
||||||
|
pass
|
||||||
|
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
else:
|
try:
|
||||||
try:
|
log_points()
|
||||||
if str(account_id) in json_entry["daily"]:
|
except Exception as e:
|
||||||
try:
|
error(f"CustomStart {e}")
|
||||||
all_cards()
|
|
||||||
except Exception as e:
|
|
||||||
log_error(e)
|
|
||||||
except KeyError:
|
|
||||||
pass
|
|
||||||
try:
|
|
||||||
if str(account_id) in json_entry["pc"]:
|
|
||||||
try:
|
|
||||||
bing_pc_search()
|
|
||||||
except Exception as e:
|
|
||||||
log_error(e)
|
|
||||||
except KeyError:
|
|
||||||
pass
|
|
||||||
try:
|
|
||||||
if str(account_id) in json_entry["mobile"]:
|
|
||||||
try:
|
|
||||||
bing_mobile_search(cred)
|
|
||||||
except Exception as e:
|
|
||||||
log_error(e)
|
|
||||||
except KeyError:
|
|
||||||
pass
|
|
||||||
try:
|
|
||||||
log_points()
|
|
||||||
except Exception as e:
|
|
||||||
error(f"CustomStart {e}")
|
|
||||||
driver.close()
|
driver.close()
|
||||||
cred.next_account()
|
cred.next_account()
|
||||||
account_id += 1
|
account_id += 1
|
||||||
@ -801,13 +844,16 @@ def default_start():
|
|||||||
while config.UserCredentials.is_valid():
|
while config.UserCredentials.is_valid():
|
||||||
custom_sleep(1)
|
custom_sleep(1)
|
||||||
info("Starting and configuring driver.")
|
info("Starting and configuring driver.")
|
||||||
config.WebDriver.set_pc_driver(create_driver())
|
try:
|
||||||
|
config.WebDriver.set_pc_driver(create_driver())
|
||||||
|
except:
|
||||||
|
subprocess.Popen(["python3", "/app/MsRewards-Reborn/modules/Tools/update_chrome.py"])
|
||||||
|
config.WebDriver.set_pc_driver(create_driver())
|
||||||
config.WebDriver.switch_to_driver("PC")
|
config.WebDriver.switch_to_driver("PC")
|
||||||
info("Driver started.")
|
info("Driver started.")
|
||||||
config.WebDriver.pc_driver.implicitly_wait(3)
|
config.WebDriver.pc_driver.implicitly_wait(3)
|
||||||
try:
|
try:
|
||||||
wait_time = uniform(1200, 3600)
|
wait_time = uniform(1200, 3600)
|
||||||
wait_time = 10 # the display closes when I ctrl + c
|
|
||||||
info(f"Waiting for {round(wait_time / 60)}min before starting")
|
info(f"Waiting for {round(wait_time / 60)}min before starting")
|
||||||
custom_sleep(wait_time)
|
custom_sleep(wait_time)
|
||||||
daily_routine(config.UserCredentials)
|
daily_routine(config.UserCredentials)
|
||||||
@ -835,7 +881,6 @@ def log_error(msg):
|
|||||||
|
|
||||||
|
|
||||||
def check_updated():
|
def check_updated():
|
||||||
debug(f"updated: {config.has_been_updated()}")
|
|
||||||
if config.has_been_updated():
|
if config.has_been_updated():
|
||||||
config.discord.wh.send(f"Updated to {config.version}", username="update",
|
config.discord.wh.send(f"Updated to {config.version}", username="update",
|
||||||
avatar_url="https://cdn-icons-png.flaticon.com/512/1688/1688988.png")
|
avatar_url="https://cdn-icons-png.flaticon.com/512/1688/1688988.png")
|
||||||
|
12
hooks/bump.sh
Executable file
12
hooks/bump.sh
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
file=version
|
||||||
|
|
||||||
|
if [ "$(git diff HEAD version | wc -w)" -eq 0 ]
|
||||||
|
then
|
||||||
|
echo 'updating minor version'
|
||||||
|
new_path=$(cat $file | awk -F . '{print $1"."$2"."$3+1 }')
|
||||||
|
echo $new_path > $file
|
||||||
|
git add version
|
||||||
|
else
|
||||||
|
echo 'Version have been updated manually'
|
||||||
|
fi
|
||||||
|
echo Version: $(cat $file)
|
1
hooks/pre-commit
Executable file
1
hooks/pre-commit
Executable file
@ -0,0 +1 @@
|
|||||||
|
sh hooks/bump.sh
|
@ -22,7 +22,8 @@ class Config:
|
|||||||
proxy = json.load(inFile)
|
proxy = json.load(inFile)
|
||||||
with open("/app/MsRewards-Reborn/user_data/configs.json", "r") as inFile:
|
with open("/app/MsRewards-Reborn/user_data/configs.json", "r") as inFile:
|
||||||
config = json.load(inFile)
|
config = json.load(inFile)
|
||||||
|
with open("/app/MsRewards-Reborn/user_data/version", "r") as inFile:
|
||||||
|
version = inFile.readline()
|
||||||
"""
|
"""
|
||||||
setup standalone stuff
|
setup standalone stuff
|
||||||
"""
|
"""
|
||||||
@ -31,10 +32,9 @@ class Config:
|
|||||||
self.json_entry = args.json.replace("'", "\"")
|
self.json_entry = args.json.replace("'", "\"")
|
||||||
self.wordlist = WordList("/usr/share/dict/french")
|
self.wordlist = WordList("/usr/share/dict/french")
|
||||||
self.vnc = args.vnc
|
self.vnc = args.vnc
|
||||||
self.version = args.update_version
|
|
||||||
self.WebDriver = Driver()
|
self.WebDriver = Driver()
|
||||||
self.display = None
|
self.display = None
|
||||||
|
self.version = version
|
||||||
"""
|
"""
|
||||||
setup UserCredential
|
setup UserCredential
|
||||||
"""
|
"""
|
||||||
@ -52,11 +52,11 @@ class Config:
|
|||||||
self.discord.avatar_url = settings["avatarlink"]
|
self.discord.avatar_url = settings["avatarlink"]
|
||||||
|
|
||||||
if (
|
if (
|
||||||
"discord" in config[args.config]
|
"discord" in config[args.config]
|
||||||
and config[args.config]["discord"] in discord
|
and config[args.config]["discord"] in discord
|
||||||
and "errorsL" in discord[config[args.config]["discord"]]
|
and "errorsL" in discord[config[args.config]["discord"]]
|
||||||
and discord[config[args.config]["discord"]]["errorsL"] != ""
|
and discord[config[args.config]["discord"]]["errorsL"] != ""
|
||||||
):
|
):
|
||||||
self.discord.wh_link = discord[config[args.config]["discord"]]["errorsL"]
|
self.discord.wh_link = discord[config[args.config]["discord"]]["errorsL"]
|
||||||
self.discord.wh = Webhook.from_url(self.discord.wh_link, adapter=RequestsWebhookAdapter())
|
self.discord.wh = Webhook.from_url(self.discord.wh_link, adapter=RequestsWebhookAdapter())
|
||||||
else:
|
else:
|
||||||
@ -81,4 +81,11 @@ class Config:
|
|||||||
self.display = display
|
self.display = display
|
||||||
|
|
||||||
def has_been_updated(self):
|
def has_been_updated(self):
|
||||||
return self.version != "None"
|
with open('/app/MsRewards-Reborn/version', "r") as inFile:
|
||||||
|
in_file_content = inFile.readlines()
|
||||||
|
if self.version != in_file_content[0]:
|
||||||
|
self.version = in_file_content[0]
|
||||||
|
with open('/app/MsRewards-Reborn/user_data/version', "w") as outFile:
|
||||||
|
outFile.write(self.version)
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import os
|
|
||||||
import json
|
import json
|
||||||
|
import os
|
||||||
from random import uniform
|
from random import uniform
|
||||||
|
|
||||||
from selenium.common import TimeoutException
|
from selenium.common import TimeoutException
|
||||||
from selenium.webdriver import ActionChains, Keys
|
from selenium.webdriver import Keys
|
||||||
from selenium.webdriver.common.by import By
|
from selenium.webdriver.common.by import By
|
||||||
from selenium.webdriver.support import expected_conditions
|
from selenium.webdriver.support import expected_conditions
|
||||||
from selenium.webdriver.support.wait import WebDriverWait
|
from selenium.webdriver.support.wait import WebDriverWait
|
||||||
@ -14,9 +14,9 @@ from modules.Tools.tools import *
|
|||||||
|
|
||||||
def init_profile(mail, mobile=False):
|
def init_profile(mail, mobile=False):
|
||||||
if not mobile:
|
if not mobile:
|
||||||
chrome_profile_dir = "/app/MsRewards-Reborn/user_data/profile/"+mail
|
chrome_profile_dir = "/app/MsRewards-Reborn/user_data/profile/" + mail
|
||||||
else:
|
else:
|
||||||
chrome_profile_dir = "/app/MsRewards-Reborn/user_data/profile/mobile-"+mail
|
chrome_profile_dir = "/app/MsRewards-Reborn/user_data/profile/mobile-" + mail
|
||||||
|
|
||||||
os.makedirs(chrome_profile_dir, exist_ok=True)
|
os.makedirs(chrome_profile_dir, exist_ok=True)
|
||||||
|
|
||||||
@ -30,12 +30,12 @@ def init_profile(mail, mobile=False):
|
|||||||
"accept_languages": "fr-FR,en-US,en",
|
"accept_languages": "fr-FR,en-US,en",
|
||||||
"selected_languages": "fr-FR,en-US,en"
|
"selected_languages": "fr-FR,en-US,en"
|
||||||
}
|
}
|
||||||
}, f
|
}, f
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
with open(preferences_file, "r") as f:
|
with open(preferences_file, "r") as f:
|
||||||
settings = json.load(f)
|
settings = json.load(f)
|
||||||
|
|
||||||
if "intl" not in settings:
|
if "intl" not in settings:
|
||||||
settings["intl"] = {}
|
settings["intl"] = {}
|
||||||
|
|
||||||
@ -69,6 +69,7 @@ def send_keys_wait(element, keys: str) -> None:
|
|||||||
element.send_keys(i)
|
element.send_keys(i)
|
||||||
sleep(uniform(0.1, 0.3))
|
sleep(uniform(0.1, 0.3))
|
||||||
|
|
||||||
|
|
||||||
def send_wait_and_confirm(element, keys: str) -> None:
|
def send_wait_and_confirm(element, keys: str) -> None:
|
||||||
send_keys_wait(element, keys)
|
send_keys_wait(element, keys)
|
||||||
element.send_keys(Keys.ENTER)
|
element.send_keys(Keys.ENTER)
|
||||||
@ -81,6 +82,6 @@ def wait_until_visible(search_by: str, identifier: str, timeout: int = 20, brows
|
|||||||
expected_conditions.visibility_of_element_located((search_by, identifier)), "element not found")
|
expected_conditions.visibility_of_element_located((search_by, identifier)), "element not found")
|
||||||
return True
|
return True
|
||||||
except TimeoutException as e:
|
except TimeoutException as e:
|
||||||
if raise_error:
|
f = error if raise_error else debug
|
||||||
error(f"element {identifier} not found after {timeout}s")
|
f(f"element {identifier} not found after {timeout}s")
|
||||||
return False
|
return False
|
||||||
|
1
user_data/version
Normal file
1
user_data/version
Normal file
@ -0,0 +1 @@
|
|||||||
|
0.0.0
|
Loading…
Reference in New Issue
Block a user