def test_1_correct_credentials():
        print(colored('Running: test_1_correct_credentials - estimate: 2s', 'yellow'))

        clear_inputs(['username', 'password'], 'id')
        Root.login_user(browser, {'username': '******', 'password': '******'})

        print(colored('\ttest_1_correct_credentials: login successful - asserting...', 'blue'))
        assert "No user in Juice matches the login credentials." not in browser.page_source
        assert "Username and Password are required." not in browser.page_source

        # check for user menu

        print(colored('\ttest_1_correct_credentials: passed.', 'cyan'))
Exemplo n.º 2
0
    def test_1_commands_list_no_network(self):
        print(colored('Running: test_1_commands_list_no_network - estimate: 27s', 'yellow'))
        prompt_to_disable_network()

        browser.refresh()
        Root.navigate_to(browser, 'Administration/GatewayCommand')
        sleep(2*SLEEP_INTERVAL)

        print(colored('\ttest_1_commands_list_no_network: commands list no network - asserting...', 'blue'))
        self.assertTrue(check_existence('//div[@class="inform"]', is_id=False))
        self.assertFalse(check_existence('//tbody[@class="MuiTableBody-root"]', is_id=False))

        print(colored('\ttest_1_commands_list_no_network: passed.', 'cyan'))
        prompt_to_enable_network_and_setup(browser, 'Administration/GatewayCommand')
Exemplo n.º 3
0
    def test_1_no_network(self):
        print(colored('Running: test_1_no_network - estimate: 11s', 'yellow'))
        prompt_to_disable_network()

        browser.refresh()
        Root.navigate_to(browser, 'Administration/ManageUser')
        sleep(9 + SLEEP_INTERVAL)

        print(colored('\ttest_1_no_network: no network - asserting...',
                      'blue'))
        self.assertEqual(check_existence('account_lists'), False)
        self.assertEqual(
            check_existence('//div[@class="inform"]', is_id=False), True)
        self.assertEqual(
            check_existence(
                '//div[@class="MuiFormControl-root MuiFormControl-fullWidth"]',
                is_id=False), True)

        print(colored('\ttest_1_no_network: passed.', 'cyan'))
        prompt_to_enable_network_and_setup(browser,
                                           'Administration/ManageUser')
    def test_1_gateways_list_no_network(self):
        print(
            colored('Running: test_1_gateways_list_no_network - estimate: 27s',
                    'yellow'))
        prompt_to_disable_network()

        browser.refresh()
        Root.navigate_to(browser, 'Factory/ManageGateways')
        sleep(9 + SLEEP_INTERVAL)

        print(
            colored(
                '\ttest_1_gateways_list_no_network: gateways list no network - asserting...',
                'blue'))
        self.assertTrue(check_existence('//div[@class="inform"]', is_id=False))
        self.assertFalse(
            check_existence('//tbody[@class="MuiTableBody-root"]',
                            is_id=False))
        self.assertFalse(check_existence('gateway-search-form'))

        print(colored('\ttest_1_gateways_list_no_network: passed.', 'cyan'))
        prompt_to_enable_network_and_setup(browser, 'Factory/ManageGateways')
    def test_3_incorrect_credentials(self, form):
        print(
            colored('Running: test_3_incorrect_credentials - estimate: 2m 10s',
                    'yellow'))

        print(
            colored(
                '\ttest_3_incorrect_credentials: both fields incorrect - asserting...',
                'blue'))
        clear_inputs(['username', 'password'], 'id')
        Root.login_user(browser, {
            'username': faker.last_name(),
            'password': faker.word()
        })
        try:
            assert_checking(self,
                            'No user in Juice matches the login credentials.')
        except AssertionError:
            assert_checking(self, 'No record in Juice matches the data.')

        print(
            colored(
                '\ttest_3_incorrect_credentials: password incorrect - asserting...',
                'blue'))
        clear_inputs(['username', 'password'], 'id')
        Root.login_user(browser, {
            'username': '******',
            'password': faker.word()
        })
        try:
            assert_checking(self,
                            'No user in Juice matches the login credentials.')
        except AssertionError:
            assert_checking(self, 'No record in Juice matches the data.')

        print(colored('\ttest_3_incorrect_credentials: passed.', 'cyan'))
Exemplo n.º 6
0
import os.path

from src.root import Root
from src.utility import browser
from src.utility import get_tests_to_run, make_test_list

if __name__ == '__main__':
    Root.navigate_to(browser, 'Factory/ManageGateways')

    tests = [
        name for name in os.listdir(
            os.path.dirname(os.path.realpath(__file__)) + "\\gateway")
        if "main" not in name and "__" not in name
    ]

    test_list = make_test_list(tests)
    tests_to_run = get_tests_to_run(test_list, len(tests))

    for test in tests_to_run:
        exec(
            open(
                os.path.dirname(os.path.realpath(__file__)) + "\\gateway\\" +
                tests[test - 1]).read(), globals(), locals())
Exemplo n.º 7
0
import os.path

from src.root import Root
from src.utility import browser
from src.utility import get_tests_to_run, make_test_list

if __name__ == '__main__':
    Root.navigate_to(browser, 'Administration/ManageOrganization')

    tests = [
        name for name in os.listdir(
            os.path.dirname(os.path.realpath(__file__)) + "\\organization")
        if "main" not in name and "__" not in name
    ]

    test_list = make_test_list(tests)
    tests_to_run = get_tests_to_run(test_list, len(tests))

    for test in tests_to_run:
        exec(
            open(
                os.path.dirname(os.path.realpath(__file__)) +
                "\\organization\\" + tests[test - 1]).read(), globals(),
            locals())
Exemplo n.º 8
0
import os.path

from src.root import Root
from src.utility import browser
from src.utility import get_tests_to_run, make_test_list

if __name__ == '__main__':
    Root.navigate_to(browser, 'Factory/ManageMeter')

    tests = [
        name for name in os.listdir(
            os.path.dirname(os.path.realpath(__file__)) + "\\meter")
        if "main" not in name and "__" not in name
    ]

    test_list = make_test_list(tests)
    tests_to_run = get_tests_to_run(test_list, len(tests))

    for test in tests_to_run:
        exec(
            open(
                os.path.dirname(os.path.realpath(__file__)) + "\\meter\\" +
                tests[test - 1]).read(), globals(), locals())
Exemplo n.º 9
0
from src.root import Root
from src.utility import browser
from src.authentication.login_form_ui import LoginForm, LoginFormUITest
from src.authentication.auth_process import AuthProcessTest
from termcolor import colored

if __name__ == '__main__':
    Root.open_juice_app_on_chrome(browser)

    runLoginFormUITest = LoginFormUITest()

    print(colored('LoginFormUITest - 3 tests in login page.', 'green'))
    runLoginFormUITest.test_1_fields_availability()

    login_form = LoginForm()
    runLoginFormUITest.test_2_missing_inputs(login_form)
    runLoginFormUITest.test_3_incorrect_credentials(login_form)

    runAuthProcessTest = AuthProcessTest()

    print(colored('AuthProcessTest - 3 tests for authentication.', 'green'))
    runAuthProcessTest.test_1_correct_credentials()
    runAuthProcessTest.test_2_session_data()
    runAuthProcessTest.test_3_logout()

    Root.tear_down_on_test_done(browser)
Exemplo n.º 10
0
import os.path

from src.root import Root
from src.utility import browser
from src.utility import get_tests_to_run, make_test_list

if __name__ == '__main__':
    Root.navigate_to(browser, 'Factory/ManageDevice')

    tests = [
        name for name in os.listdir(
            os.path.dirname(os.path.realpath(__file__)) + "\\node")
        if "main" not in name and "__" not in name
    ]

    test_list = make_test_list(tests)
    tests_to_run = get_tests_to_run(test_list, len(tests))

    for test in tests_to_run:
        exec(
            open(
                os.path.dirname(os.path.realpath(__file__)) + "\\node\\" +
                tests[test - 1]).read(), globals(), locals())
Exemplo n.º 11
0
import os.path

from src.root import Root
from src.utility import browser
from src.utility import get_tests_to_run, make_test_list

if __name__ == '__main__':
    Root.navigate_to(browser, 'Administration/ManageUser')

    tests = [
        name for name in os.listdir(
            os.path.dirname(os.path.realpath(__file__)) + "\\account")
        if "main" not in name and "__" not in name
    ]

    test_list = make_test_list(tests)
    tests_to_run = get_tests_to_run(test_list, len(tests))

    for test in tests_to_run:
        exec(
            open(
                os.path.dirname(os.path.realpath(__file__)) + "\\account\\" +
                tests[test - 1]).read(), globals(), locals())