def __init__(self):

        params = get_args()

        self._base_url = {
            'integration': 'http://192.168.2.3:8080',
            'production': 'https://parabank.parasoft.com',
            'localhost': 'http://localhost:8080',
        }[params['env'].lower()]
        '''
    def setUpClass(cls) -> None:

        with allure.step("Start Appium Service"):
            # that you can use to programmatically start/stop an Appium server.
            # Source: https://stackoverflow.com/questions/51734382/how-to-start-appium-server-programmatically-in-python
            # Source: https://github.com/appium/python-client/blob/master/appium/webdriver/appium_service.py
            # Source: https://discuss.appium.io/t/launching-and-stopping-appium-server-programmtically/700/2
            os.system("start /B start cmd.exe @cmd /k appium --relaxed-security")

        with allure.step("Set driver to None"):
            cls._driver = None

        with allure.step("Get args from CLI"):
            cls.args = get_args()
Example #3
0
    def __init__(self):

        params = get_args()

        self._base_url = {
            'production': 'https://parabank.parasoft.com',
            'localhost': 'http://localhost:8080',
        }[params['env'].lower()]

        self._is_headless = params['is_headless']

        self._browser = {
            'chrome': 'chrome',
            'edge': 'edge',
            'firefox': 'mozilla'
        }[params['browser'].lower()]

        self._print_run_config()
Example #4
0
    def __init__(self):
        params = get_args()

        self.__base_url = {
            'google': 'https://www.google.com/',
            'botdetectcaptcha': 'https://captcha.com/',
            'localhost': 'http://localhost:8080',
            'integration': '',
            'production': '',
        }[params['env'].lower()]

        self.__is_headless = params['is_headless']

        self.__browser = {
            'chrome': 'chrome',
            'edge': 'edge',
            'firefox': 'mozilla'
        }[params['browser'].lower()]

        self.__print_run_config()
Example #5
0
from expected_results.users.base_user import BaseUser
from page_object_models.home_page_model import HomePageModel
from expected_results.page_content.home_page_content import HomePageContent
from expected_results.page_content.login_page_content import LoginPageContent
from expected_results.users.invalid_users_templates.no_such_user import NoSuchUser


@allure.epic('Page Functionality')
@allure.parent_suite('End To End')
@allure.suite("User Login/Logout")
@allure.sub_suite('Negative Tests')
@allure.feature("Home Page")
@allure.story('Login/Logout Functionality')
@pytest.mark.skipif(
    get_args()['env'] == 'production',
    reason="This is demo test that will have negative effect on Travis CI status"
)
@screenshot_on_fail()
class TestUserLoginFromHomePageEmptyFieldsError(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        cls.user = BaseUser(NoSuchUser)
        cls.page_model = HomePageModel
        cls.page_content = HomePageContent
        cls.config = Config()

        with allure.step("Initial data setup > clean DB"):
            clean_database(cls.config)

        with allure.step("Open web browser"):