Skip to content

Instantly share code, notes, and snippets.

@muditlambda
Created April 29, 2020 15:20
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