示例#1
0
文件: base.py 项目: Prodject/arjuna
 def __convert_to_with(self, input):
     w = None
     if isinstance(input, With):
         w = input
     elif type(input) is str:
         w = With.gns_name(input)
     elif isinstance(input, Enum):
         w = With.gns_name(input.name)
     else:
         raise Exception(
             "A With object or name of element is expected as argument.")
     return w
    def login_with_default_creds(self):
        self.app.browser.go_to_url(
            self.config.get_user_option_value("wp.login.url").as_str())

        user, pwd = self.config.get_user_option_value(
            "wp.users.admin").split_as_str_list()

        # Login
        self.app.element(
            With.gns_name("login").format(RoLe="user")).set_text(user)
        self.app.element(
            With.gns_name("password").format(roLE="user")).set_text(pwd)
        self.app.element("submit").click()

        self.app.element("view-site").wait_until_visible()