diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ec73e8f..a880afe 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,10 +26,6 @@ jobs: run: | sudo apt-get update sudo apt-get install -y google-chrome-stable - sudo apt-get install -y chromium-chromedriver - - - name: Install WebDriver Manager - run: | pip install webdriver_manager - name: Set up secrets as environment variables diff --git a/features/environment.py b/features/environment.py index 85320af..2574312 100644 --- a/features/environment.py +++ b/features/environment.py @@ -4,6 +4,8 @@ import yaml import os from datetime import datetime +from webdriver_manager.chrome import ChromeDriverManager +from behave import fixture def before_all(context): # Carregue as variáveis do arquivo YAML @@ -38,10 +40,14 @@ def before_scenario(context, scenario): context.browser.delete_all_cookies() context.browser.maximize_window() else: - service = Service('drivers\chromedriver.exe') - context.browser = webdriver.Chrome(service=service) + context.browser = webdriver.Chrome(executable_path=ChromeDriverManager().install()) context.browser.delete_all_cookies() context.browser.maximize_window() + # else: + # service = Service('drivers\chromedriver.exe') + # context.browser = webdriver.Chrome(service=service) + # context.browser.delete_all_cookies() + # context.browser.maximize_window() def after_step(context, step): # Tire um screenshot após cada step, independentemente de passar ou falhar