Ejemplo n.º 1
0
import requests
from hotdog.Config import GetConfig

from Helpers.FilePath import get_full_path
import unittest
import threading
import builtins
import os

os.environ['PROJECTFOLDER'] = get_full_path('')
from appium_selector.DeviceSelector import DeviceSelector

MustardURL = GetConfig('MUSTARD_URL').replace('results',
                                              'executions') + '/close'
MustardKey = GetConfig('MUSTARD_KEY')

# r = requests.post(MustardURL, data={'project_key': MustardKey,})

os.environ['AddMustard'] = 'True'

builtins.threadlocal = threading.local()


def run_all_test(device=None):
    builtins.threadlocal.config = device
    builtins.threadlocal.driver = None
    builtins.threadlocal.keepSession = False
    loader = unittest.TestLoader()

    tests = loader.discover('./Tests/', pattern='*Tests.py')
    runner = unittest.TextTestRunner()
Ejemplo n.º 2
0
import lxml.builder
import os
import xml.etree.cElementTree as ElementTree
from Helpers.FilePath import get_full_path
"""
A process for parsing a Text (.txt) File and Creating an XML File that Portrays the Same Information,
But in a Much Prettier and More Concise and Easily-Readable Style
"""

# Formatting Functions Used Constantly Throughout The
# Code Talking to the EC2 Instances Seen Below
settings_dir = os.path.dirname(__file__)
PROJECT_ROOT = get_full_path()

XMLFILES_FOLDER = os.path.join(PROJECT_ROOT, 'Plug_and_Play_Files/')
xml_path = XMLFILES_FOLDER + 'Instance_Info.xml'

TXTFILES_FOLDER = os.path.join(PROJECT_ROOT, 'Plug_and_Play_Files/')
txt_path = TXTFILES_FOLDER + 'SampleTextFile.txt'


def indent(elem, level=0):
    i = "\n" + level * "  "
    if len(elem):
        if not elem.text or not elem.text.strip():
            elem.text = i + "  "
        if not elem.tail or not elem.tail.strip():
            elem.tail = i
        for elem in elem:
            indent(elem, level + 1)
        if not elem.tail or not elem.tail.strip():
Ejemplo n.º 3
0
from hotdog.Config import GetConfig
import os
import time
from Helpers.FilePath import get_full_path
from hotdog.Retry import Retry
os.environ['PROJECTFOLDER'] = get_full_path('')
import builtins
from hotdog.BaseTest import HotDogBaseTest


class BaseTest(HotDogBaseTest):

    page_url = GetConfig('APP_URL')

    @classmethod
    def setUpClass(cls):
        super().setUpClass(platform='desktop')

    def setUp(self):
        super().setUp()
        self.driver.implicitly_wait(30)

    def assertAlphabetical(self, list):
        for i in range(len(list)-1):
            assert list[i].lower() < list[i+1].lower(), 'Items not in alphabetical order.  Found entry [%s] before [%s]' % (list[i], list[i+1])

    @Retry
    def assert_in_url(self, string):
        assert string in self.driver.current_url, 'Did not load page with string [%]' % string