status-desktop/test/e2e/scripts/utils/browser.py

26 lines
465 B
Python
Raw Permalink Normal View History

import allure
import requests
2024-05-31 10:45:47 +00:00
import webbrowser
from bs4 import BeautifulSoup
2024-05-31 10:45:47 +00:00
@allure.step('Open link in default browser')
2024-05-31 10:45:47 +00:00
def open_link(url):
webbrowser.open(url)
@allure.step('Get response')
2024-05-31 10:45:47 +00:00
def get_response(url):
response = requests.get(
url)
return response
@allure.step('Get page content')
def get_page_content(url):
request = requests.get(url)
src = request.text
soup = BeautifulSoup(src, 'html.parser')
return soup