fix login
This commit is contained in:
parent
b8eb34c804
commit
d03bd47981
1 changed files with 5 additions and 4 deletions
|
|
@ -31,16 +31,17 @@ class Cragr(Browser):
|
||||||
|
|
||||||
def __init__(self, website, *args, **kwargs):
|
def __init__(self, website, *args, **kwargs):
|
||||||
self.DOMAIN = website
|
self.DOMAIN = website
|
||||||
self.PAGES = {'https://%s/' % website: pages.LoginPage,
|
self.PAGES = {'https://%s/' % website: pages.LoginPage,
|
||||||
'https://%s/.*\.c.*' % website: pages.AccountsList,
|
'https://%s/.*\.c.*' % website: pages.AccountsList,
|
||||||
|
'https://%s/login/process' % website: pages.AccountsList,
|
||||||
}
|
}
|
||||||
Browser.__init__(self, *args, **kwargs)
|
Browser.__init__(self, *args, **kwargs)
|
||||||
|
|
||||||
def home(self):
|
def home(self):
|
||||||
self.location('https://%s/' % self.DOMAIN)
|
self.location('https://%s/login/process' % self.DOMAIN)
|
||||||
|
|
||||||
def is_logged(self):
|
def is_logged(self):
|
||||||
return not self.is_on_page(pages.LoginPage) or self.is_logging
|
return not self.is_on_page(pages.LoginPage) or self.page.is_logged()
|
||||||
|
|
||||||
def login(self):
|
def login(self):
|
||||||
assert isinstance(self.username, (str,unicode))
|
assert isinstance(self.username, (str,unicode))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue