@@ -111,7 +111,6 @@
Loading
111 111
from selenium.webdriver.support import expected_conditions as econd
112 112
from selenium.webdriver.support.wait import WebDriverWait
113 113
from selenium.webdriver.common.keys import Keys
114 -
from collections import OrderedDict
115 114
"""
116 115
117 116
    BY_TAGS = ("byName", "byID", "byCSS", "byXPath", "byLinkText", "byElement", "byShadow")
@@ -542,10 +541,6 @@
Loading
542 541
                        self._gen_dynamic_locator("var_loc_keys", selectors),
543 542
                        action)),
544 543
                args=args))
545 -
            if atype == "click":
546 -
                method = "check_opened_new_window"
547 -
                self.selenium_extras.add(method)
548 -
                elements.append(ast_call(func=ast_attr(method)))
549 544
        return elements
550 545
551 546
    def _gen_edit_mngr(self, param, locators):
@@ -650,14 +645,6 @@
Loading
650 645
651 646
        return elements
652 647
653 -
    def _go_to_url(self, url):
654 -
        method = "go"
655 -
        self.selenium_extras.add(method)
656 -
        return [ast_call(
657 -
            func=ast_attr(method),
658 -
            args=[self._gen_expr(url.strip())]
659 -
        )]
660 -
661 648
    def _gen_select_mngr(self, param, selectors):
662 649
        elements = [self._gen_get_locator_call("var_loc_select", selectors), ast_call(
663 650
            func=ast_attr(
@@ -710,7 +697,9 @@
Loading
710 697
            action_elements.append(ast.parse(param))
711 698
        elif atype == 'go':
712 699
            if param:
713 -
                action_elements.append(self._go_to_url(param))
700 +
                action_elements.append(ast_call(func=ast_attr("self.driver.get"),
701 +
                                                args=[self._gen_expr(param.strip())]))
702 +
                action_elements.append(self._gen_replace_dialogs())
714 703
        elif atype == "editcontent":
715 704
            action_elements.extend(self._gen_edit_mngr(param, selectors))
716 705
        elif atype.startswith('wait'):
@@ -815,6 +804,18 @@
Loading
815 804
816 805
        return elements
817 806
807 +
    def _gen_replace_dialogs(self):
808 +
        """
809 +
        Generates the call to DialogsManager to replace dialogs
810 +
        """
811 +
        method = "dialogs_replace"
812 +
        self.selenium_extras.add(method)
813 +
        return [
814 +
            gen_empty_line_stmt(),
815 +
            ast_call(
816 +
                func=ast_attr(method))
817 +
        ]
818 +
818 819
    @staticmethod
819 820
    def _convert_to_number(arg):
820 821
        if isinstance(arg, str) and arg.isdigit():
@@ -1221,7 +1222,7 @@
Loading
1221 1222
        if target_init:
1222 1223
            if self.test_mode == "selenium":
1223 1224
                stored_vars["driver"] = "self.driver"
1224 -
                stored_vars["windows"] = "OrderedDict()"
1225 +
                stored_vars["windows"] = "{}"
1225 1226
1226 1227
        has_ds = bool(list(self.scenario.get_data_sources()))
1227 1228
        stored_vars['scenario_name'] = [ast.Str(self.label, kind="")]
@@ -1475,8 +1476,13 @@
Loading
1475 1476
                    url = default_address + req.url
1476 1477
                else:
1477 1478
                    url = req.url
1478 -
                lines.append(gen_empty_line_stmt())
1479 -
                lines.append(self._go_to_url(url))
1479 +
1480 +
                lines.append(ast.Expr(
1481 +
                    ast_call(
1482 +
                        func=ast_attr("self.driver.get"),
1483 +
                        args=[self._gen_expr(url)])))
1484 +
                lines.append(self._gen_replace_dialogs())
1485 +
1480 1486
            else:
1481 1487
                method = req.method.lower()
1482 1488
                named_args = self._extract_named_args(req)

@@ -115,7 +115,7 @@
Loading
115 115
            "for i in range(10):",
116 116
            "if ((i % 2) == 0):",
117 117
            print_i,
118 -
            "go('http:\\\\blazemeter.com')",
118 +
            "self.driver.get(\'http:\\\\blazemeter.com\')",
119 119
            "ifself.driver.find_element(var_edit_content[0], var_edit_content[1])."
120 120
            "get_attribute('contenteditable'):"
121 121
            "self.driver.execute_script((\"arguments[0].innerHTML=\'%s\';\"%\'lo-la-lu\'),"
@@ -813,7 +813,7 @@
Loading
813 813
814 814
        target_lines = [
815 815
            "with apiritif.smart_transaction('http://blazedemo.com/测试')",
816 -
            "go('http://blazedemo.com/测试')"
816 +
            "self.driver.get(\'http://blazedemo.com/测试')"
817 817
        ]
818 818
819 819
        for idx in range(len(target_lines)):

@@ -399,7 +399,7 @@
Loading
399 399
        self.obj.prepare()
400 400
        with open(os.path.join(self.obj.engine.artifacts_dir, os.path.basename(self.obj.script))) as fds:
401 401
            script = fds.read()
402 -
        urls = re.findall(r"go\('(.+)'\)", script)
402 +
        urls = re.findall(r"\.get\('(.+)'\)", script)
403 403
        self.assertEqual("http://blazedemo.com/", urls[0])
404 404
        self.assertEqual("http://absolute.address.com/somepage", urls[1])
405 405
        self.assertEqual("http://blazedemo.com/reserve.php", urls[2])
Files Coverage
bzt 90.40%
tests/unit 97.26%
setup.py 0.00%
Project Totals (117 files) 92.98%
8875.3
TRAVIS_PYTHON_VERSION=3.8
TRAVIS_OS_NAME=linux
1
codecov:
2
  notify:
3
    require_ci_to_pass: yes
4

5
coverage:
6
  round: up
7

8
ignore:
9
  - bzt/resources/.*
10
  - tests/resources/.*
11
  - scripts/installer/.*
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading