def before_all(context): webenv.before_all(context) smsenv.before_all(context) mailenv.before_all(context) gcmenv.before_all(context) personaenv.before_all(context) context.config.log_capture = False
def before_all(context): webenv.before_all(context) smsenv.before_all(context) mailenv.before_all(context) mobileenv.before_all(context) personaenv.before_all(context) context.config.log_capture = False
def before_all(context): """ Load the configuration config and setup the context """ log.info("Starting before all hook") log.info("Webdriver path:" + config.WEBDRIVER_PATH) log.info("Webdriver log:" + config.WEBDRIVER_LOG) log.info("JS console log:" + config.JS_CONSOLE_LOG) context.mist_config = dict() context.mist_config['browser'] = choose_driver() context.browser = context.mist_config['browser'] context.mist_config['MAYDAY_TOKEN'] = config.MAYDAY_TOKEN context.mist_config['NAME'] = config.NAME context.mist_config['BASE_EMAIL'] = config.BASE_EMAIL context.mist_config['EMAIL'] = config.EMAIL context.mist_config['PASSWORD1'] = config.PASSWORD1 context.mist_config['PASSWORD2'] = config.PASSWORD2 context.mist_config['CHANGED_PASSWORD'] = config.CHANGED_PASSWORD context.mist_config['SETUP_ENVIRONMENT'] = config.SETUP_ENVIRONMENT context.mist_config['MAYDAY_MACHINE'] = config.MAYDAY_MACHINE context.mist_config['MAYDAY_MACHINE_ID'] = config.MAYDAY_MACHINE_ID context.mist_config['OWNER_EMAIL'] = config.OWNER_EMAIL context.mist_config['OWNER_PASSWORD'] = config.OWNER_PASSWORD context.mist_config['MEMBER1_EMAIL'] = config.MEMBER1_EMAIL context.mist_config['MEMBER1_PASSWORD'] = config.MEMBER1_PASSWORD context.mist_config['MEMBER2_EMAIL'] = config.MEMBER2_EMAIL context.mist_config['MEMBER2_PASSWORD'] = config.MEMBER2_PASSWORD context.mist_config['LOCAL'] = config.LOCAL context.mist_config['ORG_NAME'] = config.ORG_NAME + str( random.randint(1, 10000000)) context.mist_config['NON_STOP'] = '--stop' not in sys.argv context.mist_config['ERROR_NUM'] = 0 context.mist_config['MIST_URL'] = config.MIST_URL context.mist_config['LOCAL_DOCKER'] = config.LOCAL_DOCKER context.mist_config['MP_DB_DIR'] = config.MP_DB_DIR context.mist_config['MAIL_PATH'] = config.MAIL_PATH context.mist_config['SCREENSHOT_PATH'] = config.SCREENSHOT_PATH context.mist_config['ARTIFACTS_PATH'] = config.ARTIFACTS_PATH context.mist_config['JS_CONSOLE_LOG'] = config.JS_CONSOLE_LOG context.mist_config['BROWSER_FLAVOR'] = config.BROWSER_FLAVOR context.mist_config['TESTING_PRIVATE_KEY'] = config.TESTING_PRIVATE_KEY context.mist_config['CREDENTIALS'] = config.CREDENTIALS context.mist_config['GOOGLE_TEST_EMAIL'] = config.GOOGLE_TEST_EMAIL context.mist_config['GOOGLE_TEST_PASSWORD'] = config.GOOGLE_TEST_PASSWORD context.mist_config['GITHUB_TEST_EMAIL'] = config.GITHUB_TEST_EMAIL context.mist_config['GITHUB_TEST_PASSWORD'] = config.GITHUB_TEST_PASSWORD context.mist_config[ 'GOOGLE_REGISTRATION_TEST_EMAIL'] = config.GOOGLE_REGISTRATION_TEST_EMAIL context.mist_config[ 'GOOGLE_REGISTRATION_TEST_PASSWORD'] = config.GOOGLE_REGISTRATION_TEST_PASSWORD context.mist_config[ 'GITHUB_REGISTRATION_TEST_EMAIL'] = config.GITHUB_REGISTRATION_TEST_EMAIL context.mist_config[ 'GITHUB_REGISTRATION_TEST_PASSWORD'] = config.GITHUB_REGISTRATION_TEST_PASSWORD context.mist_config['GMAIL_THINGIRL_USER'] = config.GMAIL_THINGIRL_USER context.mist_config[ 'GMAIL_THINGIRL_PASSWORD'] = config.GMAIL_THINGIRL_PASSWORD context.mist_config['recording_session'] = config.RECORD_SELENIUM context.mist_config['IMAP_USE_SSL'] = config.IMAP_USE_SSL context.mist_config['IMAP_HOST'] = config.IMAP_HOST context.mist_config['IMAP_PORT'] = config.IMAP_PORT context.mist_config['CC_CVC'] = config.CC_CVC context.mist_config['CC_CC'] = config.CC_CC context.mist_config['CC_EXPIRE_MONTH'] = config.CC_EXPIRE_MONTH context.mist_config['CC_EXPIRE_YEAR'] = config.CC_EXPIRE_YEAR context.mist_config['CC_ZIP_CODE'] = config.CC_ZIP_CODE context.mist_config['SLACK_WEBHOOK_URL'] = config.SLACK_WEBHOOK_URL context.mist_config['SLACK_WEBHOOK_CHANNEL'] = config.SLACK_WEBHOOK_CHANNEL context.mist_config['SLACK_WEBHOOK_TOKEN'] = config.SLACK_WEBHOOK_TOKEN context.link_inside_email = '' context.mist_config['ORG_ID'] = '' context.mist_config[ 'PRODUCE_VIDEO_SCREENCAST_ON_ERROR'] = config.PRODUCE_VIDEO_SCREENCAST_ON_ERROR if config.LOCAL: log.info("Initializing behaving mail for path: %s" % config.MAIL_PATH) from behaving.mail import environment as behaving_mail # with this behaving will get the path to save and retrieve mails context.mail_path = config.MAIL_PATH # calling behaving to setup it's context variables. behaving_mail.before_all(context) if config.REGISTER_USER_BEFORE_FEATURE: payload = { 'email': context.mist_config['EMAIL'], 'password': context.mist_config['PASSWORD1'], 'name': "Atheofovos Gkikas" } response = requests.post("%s/api/v1/dev/register" % context.mist_config['MIST_URL'], data=json.dumps(payload)) context.mist_config['ORG_ID'] = response.json().get('org_id') context.mist_config['ORG_NAME'] = response.json().get('org_name') # check whether hs repo is tested api_token = get_api_token(context) headers = {'Authorization': api_token} response = requests.get("%s/api/v1/billing" % context.mist_config['MIST_URL'], headers=headers) if response.status_code == 404: context.mist_config['IS_HS_REPO'] = False else: context.mist_config['IS_HS_REPO'] = True log.info("Finished with before_all hook. Starting tests") log.info("EMAIL: %s" % context.mist_config['EMAIL']) log.info("PASSWORD1: %s" % context.mist_config['PASSWORD1'])
def before_all(context): """ Load the configuration config and setup the context """ log.info("Starting before all hook") log.info("Webdriver path:" + config.WEBDRIVER_PATH) log.info("Webdriver log:" + config.WEBDRIVER_LOG) log.info("JS console log:" + config.JS_CONSOLE_LOG) context.mist_config = dict() context.mist_config['browser'] = choose_driver() context.browser = context.mist_config['browser'] context.mist_config['MAYDAY_TOKEN'] = config.MAYDAY_TOKEN context.mist_config['NAME'] = config.NAME context.mist_config['BASE_EMAIL'] = config.BASE_EMAIL context.mist_config['EMAIL'] = config.EMAIL context.mist_config['PASSWORD1'] = config.PASSWORD1 context.mist_config['PASSWORD2'] = config.PASSWORD2 context.mist_config['CHANGED_PASSWORD'] = config.CHANGED_PASSWORD context.mist_config['SETUP_ENVIRONMENT'] = config.SETUP_ENVIRONMENT context.mist_config['MAYDAY_MACHINE'] = config.MAYDAY_MACHINE context.mist_config['MAYDAY_MACHINE_ID'] = config.MAYDAY_MACHINE_ID context.mist_config['OWNER_EMAIL'] = config.OWNER_EMAIL context.mist_config['OWNER_PASSWORD'] = config.OWNER_PASSWORD context.mist_config['MEMBER1_EMAIL'] = config.MEMBER1_EMAIL context.mist_config['MEMBER1_PASSWORD'] = config.MEMBER1_PASSWORD context.mist_config['MEMBER2_EMAIL'] = config.MEMBER2_EMAIL context.mist_config['MEMBER2_PASSWORD'] = config.MEMBER2_PASSWORD context.mist_config['LOCAL'] = config.LOCAL context.mist_config['ORG_NAME'] = config.ORG_NAME + str(random.randint(1, 10000000)) context.mist_config['NON_STOP'] = '--stop' not in sys.argv context.mist_config['ERROR_NUM'] = 0 context.mist_config['MIST_URL'] = config.MIST_URL context.mist_config['LOCAL_DOCKER'] = config.LOCAL_DOCKER context.mist_config['MP_DB_DIR'] = config.MP_DB_DIR context.mist_config['MAIL_PATH'] = config.MAIL_PATH context.mist_config['SCREENSHOT_PATH'] = config.SCREENSHOT_PATH context.mist_config['ARTIFACTS_PATH'] = config.ARTIFACTS_PATH context.mist_config['JS_CONSOLE_LOG'] = config.JS_CONSOLE_LOG context.mist_config['BROWSER_FLAVOR'] = config.BROWSER_FLAVOR context.mist_config['TESTING_PRIVATE_KEY'] = config.TESTING_PRIVATE_KEY context.mist_config['CREDENTIALS'] = config.CREDENTIALS context.mist_config['GOOGLE_TEST_EMAIL'] = config.GOOGLE_TEST_EMAIL context.mist_config['GOOGLE_TEST_PASSWORD'] = config.GOOGLE_TEST_PASSWORD context.mist_config['GITHUB_TEST_EMAIL'] = config.GITHUB_TEST_EMAIL context.mist_config['GITHUB_TEST_PASSWORD'] = config.GITHUB_TEST_PASSWORD context.mist_config['GOOGLE_REGISTRATION_TEST_EMAIL'] = config.GOOGLE_REGISTRATION_TEST_EMAIL context.mist_config['GOOGLE_REGISTRATION_TEST_PASSWORD'] = config.GOOGLE_REGISTRATION_TEST_PASSWORD context.mist_config['GITHUB_REGISTRATION_TEST_EMAIL'] = config.GITHUB_REGISTRATION_TEST_EMAIL context.mist_config['GITHUB_REGISTRATION_TEST_PASSWORD'] = config.GITHUB_REGISTRATION_TEST_PASSWORD context.mist_config['GMAIL_THINGIRL_USER'] = config.GMAIL_THINGIRL_USER context.mist_config['GMAIL_THINGIRL_PASSWORD'] = config.GMAIL_THINGIRL_PASSWORD context.mist_config['recording_session'] = config.RECORD_SELENIUM context.mist_config['IMAP_USE_SSL'] = config.IMAP_USE_SSL context.mist_config['IMAP_HOST'] = config.IMAP_HOST context.mist_config['IMAP_PORT'] = config.IMAP_PORT context.mist_config['CC_CVC'] = config.CC_CVC context.mist_config['CC_CC'] = config.CC_CC context.mist_config['CC_EXPIRE_MONTH'] = config.CC_EXPIRE_MONTH context.mist_config['CC_EXPIRE_YEAR'] = config.CC_EXPIRE_YEAR context.mist_config['CC_ZIP_CODE'] = config.CC_ZIP_CODE context.link_inside_email = '' context.mist_config['ORG_ID'] = '' context.mist_config['PRODUCE_VIDEO_SCREENCAST_ON_ERROR'] = config.PRODUCE_VIDEO_SCREENCAST_ON_ERROR if config.LOCAL: log.info("Initializing behaving mail for path: %s" % config.MAIL_PATH) from behaving.mail import environment as behaving_mail # with this behaving will get the path to save and retrieve mails context.mail_path = config.MAIL_PATH # calling behaving to setup it's context variables. behaving_mail.before_all(context) if config.REGISTER_USER_BEFORE_FEATURE: payload = { 'email': context.mist_config['EMAIL'], 'password': context.mist_config['PASSWORD1'], 'name': "Atheofovos Gkikas" } response = requests.post( "%s/api/v1/dev/register" % context.mist_config['MIST_URL'], data=json.dumps(payload) ) context.mist_config['ORG_ID'] = response.json().get('org_id') context.mist_config['ORG_NAME'] = response.json().get('org_name') # check whether hs repo is tested api_token = get_api_token(context) headers = {'Authorization': api_token} response = requests.get( "%s/api/v1/billing" % context.mist_config['MIST_URL'], headers=headers ) if response.status_code == 404: context.mist_config['IS_HS_REPO'] = False else: context.mist_config['IS_HS_REPO'] = True log.info("Finished with before_all hook. Starting tests") log.info("EMAIL: %s" % context.mist_config['EMAIL']) log.info("PASSWORD1: %s" % context.mist_config['PASSWORD1'])
def before_all(context): """ Load the configuration config and setup the context """ log.info("Starting before all hook") log.info("Webdriver path:" + config.WEBDRIVER_PATH) log.info("Webdriver log:" + config.WEBDRIVER_LOG) log.info("JS console log:" + config.JS_CONSOLE_LOG) context.mist_config = dict() context.mist_config['browser'] = choose_driver() context.browser = context.mist_config['browser'] context.mist_config['NAME'] = config.NAME context.mist_config['BASE_EMAIL'] = config.BASE_EMAIL context.mist_config['EMAIL'] = config.EMAIL context.mist_config['PASSWORD1'] = config.PASSWORD1 context.mist_config['PASSWORD2'] = config.PASSWORD2 context.mist_config['CHANGED_PASSWORD'] = config.CHANGED_PASSWORD context.mist_config['SETUP_ENVIRONMENT'] = config.SETUP_ENVIRONMENT context.mist_config['MAYDAY_MACHINE'] = config.MAYDAY_MACHINE context.mist_config['OWNER_EMAIL'] = config.OWNER_EMAIL context.mist_config['OWNER_PASSWORD'] = config.OWNER_PASSWORD context.mist_config['MEMBER1_EMAIL'] = config.MEMBER1_EMAIL context.mist_config['MEMBER1_PASSWORD'] = config.MEMBER1_PASSWORD context.mist_config['MEMBER2_EMAIL'] = config.MEMBER2_EMAIL context.mist_config['MEMBER2_PASSWORD'] = config.MEMBER2_PASSWORD context.mist_config['LOCAL'] = config.LOCAL context.mist_config['DEBUG'] = config.DEBUG context.mist_config['ORG_NAME'] = config.ORG_NAME + str( random.randint(1, 10000000)) context.mist_config['NON_STOP'] = '--stop' not in sys.argv context.mist_config['ERROR_NUM'] = 0 context.mist_config['MIST_URL'] = config.MIST_URL context.mist_config['LOCAL_DOCKER'] = config.LOCAL_DOCKER context.mist_config['MP_DB_DIR'] = config.MP_DB_DIR context.mist_config['MAIL_PATH'] = config.MAIL_PATH context.mist_config['SCREENSHOT_PATH'] = config.SCREENSHOT_PATH context.mist_config['ARTIFACTS_PATH'] = config.ARTIFACTS_PATH context.mist_config['JS_CONSOLE_LOG'] = config.JS_CONSOLE_LOG context.mist_config['BROWSER_FLAVOR'] = config.BROWSER_FLAVOR context.mist_config['TESTING_PRIVATE_KEY'] = config.TESTING_PRIVATE_KEY context.mist_config['CREDENTIALS'] = config.CREDENTIALS context.mist_config['GOOGLE_TEST_EMAIL'] = config.GOOGLE_TEST_EMAIL context.mist_config['GOOGLE_TEST_PASSWORD'] = config.GOOGLE_TEST_PASSWORD context.mist_config['GITHUB_TEST_EMAIL'] = config.GITHUB_TEST_EMAIL context.mist_config['GITHUB_TEST_PASSWORD'] = config.GITHUB_TEST_PASSWORD context.mist_config[ 'GOOGLE_REGISTRATION_TEST_EMAIL'] = config.GOOGLE_REGISTRATION_TEST_EMAIL context.mist_config[ 'GOOGLE_REGISTRATION_TEST_PASSWORD'] = config.GOOGLE_REGISTRATION_TEST_PASSWORD context.mist_config[ 'GITHUB_REGISTRATION_TEST_EMAIL'] = config.GITHUB_REGISTRATION_TEST_EMAIL context.mist_config[ 'GITHUB_REGISTRATION_TEST_PASSWORD'] = config.GITHUB_REGISTRATION_TEST_PASSWORD context.mist_config['GMAIL_FATBOY_USER'] = config.GMAIL_FATBOY_USER context.mist_config['GMAIL_FATBOY_PASSWORD'] = config.GMAIL_FATBOY_PASSWORD context.mist_config['recording_session'] = config.RECORD_SELENIUM context.link_inside_email = '' context.mist_config['ORG_ID'] = '' if config.LOCAL: log.info("Initializing behaving mail for path: %s" % config.MAIL_PATH) from behaving.mail import environment as behaving_mail # with this behaving will get the path to save and retrieve mails context.mail_path = config.MAIL_PATH # calling behaving to setup it's context variables. behaving_mail.before_all(context) if config.REGISTER_USER_BEFORE_FEATURE: payload = { 'email': context.mist_config['EMAIL'], 'password': context.mist_config['PASSWORD1'], 'name': "Atheofovos Gkikas" } response = requests.post("%s/api/v1/dev/register" % context.mist_config['MIST_URL'], data=json.dumps(payload)) context.mist_config['ORG_ID'] = response.json().get('org_id') context.mist_config['ORG_NAME'] = response.json().get('org_name') log.info("Finished with before_all hook. Starting tests") log.info("USER: %s" % context.mist_config['EMAIL']) log.info("PASSWORD1: %s" % context.mist_config['PASSWORD1'])