Created
April 29, 2020 15:20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from behave.fixture import use_fixture_by_tag | |
from selenium import webdriver | |
import os | |
from configparser import ConfigParser | |
from selenium.webdriver.common.keys import Keys | |
import time | |
from behave.fixture import use_fixture_by_tag | |
from helper.helper_web import get_browser | |
def before_all(context): | |
config = ConfigParser() | |
print((os.path.join(os.getcwd(), 'setup.cfg'))) | |
my_file = (os.path.join(os.getcwd(), 'setup.cfg')) | |
config.read(my_file) | |
# Reading the browser type from the configuration file for Selenium Python Tutorial | |
helper_func = get_browser(config.get('Environment', 'Browser')) | |
context.helperfunc = helper_func | |
# Local Chrome WebDriver | |
#if context.browser == "chrome": | |
# context.driver = webdriver.Chrome() | |
def after_all(context): | |
context.helperfunc.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment