Exemplo n.º 1
0
    def test_dashboard_3(self, temp_dir, browser):
        data = DataBuilder().get_default_data()

        data.date = "2017-03-31"
        data.transits = ["95307"]

        dashboard = DashBoardPage(browser).open()
        take_screenshot(browser, "dashboard")

        dashboard.clear()

        dashboard.set_date(data.date)

        for transit in data.transits:
            dashboard.select_transit(transit)

        dashboard.search()

        dashboard.download_csv_1()

        actual_file = path.realpath(path.join(temp_dir, "export.csv"))
        wait_until_file_exists(actual_file)

        data = "sfsdfsdf\ndfsdsdf\nsdfsdfsdfs\n"

        self.reporter = GenericDiffReporterFactory().get_first_working()
        verify(data)
Exemplo n.º 2
0
 def fin():
     if browser:
         print("taking final screenshot")
         take_screenshot(browser, "Test Finished")
         print("closing browser")
         browser.quit()
     else:
         print("browser is null?")
Exemplo n.º 3
0
    def run_dashboard_test(self, browser, data, temp_dir, test_num):

        str_path_expected = self.get_path("dashboard/expected/export_" + str(test_num) + ".csv")

        dashboard = DashBoardPage(browser).open()
        take_screenshot(browser, "dashboard")

        dashboard.clear()

        dashboard.set_date(data.date)

        for transit in data.transits:
            dashboard.select_transit(transit)

        dashboard.search()

        dashboard.download_csv_1()
        files_match = self.downloaded_file_matches(temp_dir, str_path_expected)
        return files_match
Exemplo n.º 4
0
    def run_ntc_test(self, browser, data, temp_dir, grid_number):

        dashboard = DashBoardPage(browser).open()
        take_screenshot(browser, "dashboard")

        ntc_tab = dashboard.select_ntc_tab()
        take_screenshot(browser, "NTC_tab_before_search")

        ntc_tab.clear()

        ntc_tab.set_date(data.date)

        if len(data.transits) == 1 and data.transits[0] == 'all':
            ntc_tab.select_all_transits()
        else:
            for transit in data.transits:
                ntc_tab.select_transit(transit)

        if data.book != "":
            ntc_tab.select_book(data.book)

        if data.parallel_mode.lower() == 'true':
            ntc_tab.select_parallel_mode()

        dashboard.search_no_wait()

        take_screenshot(browser, "NTC_tab_after_search")

        ntc_tab.download_csv(grid_number)

        actual_file = path.realpath(path.join(temp_dir, "export.csv"))
        wait_until_file_exists(actual_file)
        self.reporter = GenericDiffReporterFactory().get_first_working()
        verify_file(actual_file)
Exemplo n.º 5
0
    def run_detail_test(self, browser, data, temp_dir, grid_number):
        dashboard = DashBoardPage(browser).open()
        take_screenshot(browser, "dashboard")

        detail_tab = dashboard.select_detail_tab()
        take_screenshot(browser,
                        "detail_tab_before_search_grid_" + str(grid_number))

        # for transit in data.transits:
        #   dashboard.select_transit(transit)

        detail_tab.search_for_book(data)
        take_screenshot(browser,
                        "detail_tab_after_search_grid_" + str(grid_number))

        # unpivot only for 2-nd and 3-rd grids
        if grid_number != 1:
            detail_tab.unpivot_grid(grid_number - 1)

        if grid_number == 1:
            detail_tab.download_csv_1()
        elif grid_number == 2:
            detail_tab.download_csv_2()
        else:
            detail_tab.download_csv_3()

        actual_file = path.realpath(path.join(temp_dir, "export.csv"))
        wait_until_file_exists(actual_file)
        self.reporter = GenericDiffReporterFactory().get_first_working()
        verify_file(actual_file)
Exemplo n.º 6
0
    def run_balance_sheet_test(self, browser, data, temp_dir):

        dashboard = DashBoardPage(browser).open()
        take_screenshot(browser, "dashboard")

        balance_sheet_tab = dashboard.select_balance_sheet_tab()
        take_screenshot(browser, "Balance_sheet_tab_before_search")

        balance_sheet_tab.clear()

        balance_sheet_tab.set_date(data.date)

        for transit in data.transits:
            balance_sheet_tab.select_transit(transit)

        balance_sheet_tab.select_book(data.book)

        if data.parallel_mode.lower() == 'true':
            balance_sheet_tab.select_parallel_mode()

        dashboard.search()

        take_screenshot(browser, "Balance_sheet_tab__after_search")

        balance_sheet_tab.unpivot_grid(1)

        balance_sheet_tab.download_csv_1()

        actual_file = path.realpath(path.join(temp_dir, "export.csv"))
        wait_until_file_exists(actual_file)
        self.reporter = GenericDiffReporterFactory().get_first_working()
        verify_file(actual_file)
Exemplo n.º 7
0
    def run_management_view_test(self, browser, data, temp_dir):
        dashboard = DashBoardPage(browser).open()
        take_screenshot(browser, "dashboard")

        management_view_tab = dashboard.select_management_view_tab()
        take_screenshot(browser, "Management_View_tab_before_search")

        management_view_tab.set_date(data.date)
        management_view_tab = dashboard.select_management_view_tab()

        take_screenshot(browser, "Management_View_tab__after_search")

        management_view_tab.download_csv_1_long()

        actual_file = path.realpath(path.join(temp_dir, "management-report.csv"))
        wait_until_file_exists(actual_file)
        self.reporter = GenericDiffReporterFactory().get_first_working()
        verify_file(actual_file)
Exemplo n.º 8
0
    def run_position_test(self, browser, data, temp_dir, grid_number):

        dashboard = DashBoardPage(browser).open()
        take_screenshot(browser, "dashboard")

        position_tab = dashboard.select_position_tab()
        take_screenshot(browser,
                        str(grid_number) + " grid. position_tab_before_search")

        position_tab.clear()

        position_tab.set_date(data.date)

        if len(data.transits) == 1 and data.transits[0] == 'all':
            position_tab.select_all_transits()
        else:
            for transit in data.transits:
                position_tab.select_transit(transit)

        if data.book != "":
            position_tab.select_book(data.book)

        if data.parallel_mode.lower() == 'true':
            position_tab.select_parallel_mode()

        dashboard.search_long()

        take_screenshot(browser,
                        str(grid_number) + " grid. position_tab__after_search")

        if grid_number == 2:
            position_tab.load_second_grid()

        position_tab.unpivot_grid(grid_number)

        if grid_number == 1:
            position_tab.download_csv_1()
        elif grid_number == 2:
            position_tab.download_csv_2()

        actual_file = path.realpath(path.join(temp_dir, "export.csv"))
        wait_until_file_exists(actual_file)
        self.reporter = GenericDiffReporterFactory().get_first_working()
        verify_file(actual_file)
Exemplo n.º 9
0
    def test_dashboard_csv(self, temp_dir, browser):
        DashBoardPage(browser).open()
        take_screenshot(browser, "dashboard")

        assert (self.run_all_tests(browser, temp_dir))