This repository has been archived by the owner on Mar 19, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split exceptions/test, fix test_client_disabling
Move exceptions to own file Get environment variables in own method Make chromedriver path an environment variable and check for it Remove empty lines Add excplicit wait in job cancel test Fix test_client_disabling by going back to dashboard before disabling a client Signed-off-by: Frank Bergkemper <frank.bergkemper@bareos.com>
- Loading branch information
1 parent
76da6ce
commit 833e142
Showing
3 changed files
with
131 additions
and
96 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
class BadJobException(Exception): | ||
'''Raise when a started job doesn't result in ID''' | ||
def __init__(self, msg=None): | ||
msg = 'Job ID could not be saved after starting the job.' | ||
super(BadJobException, self).__init__(msg) | ||
|
||
class ClientStatusException(Exception): | ||
'''Raise when a client does not have the expected status''' | ||
def __init__(self,client, status, msg=None): | ||
if status=='enabled': | ||
msg = '%s is enabled and cannot be enabled again.' % client | ||
if status=='disabled': | ||
msg = '%s is disabled and cannot be disabled again.' % client | ||
super(ClientStatusException, self).__init__(msg) | ||
|
||
class ClientNotFoundException(Exception): | ||
'''Raise when the expected client is not found''' | ||
def __init__(self, client, msg=None): | ||
msg = 'The client %s was not found.' % client | ||
super(ClientNotFoundException, self).__init__(msg) | ||
|
||
class ElementCoveredException(Exception): | ||
'''Raise when an element is covered by something''' | ||
def __init__(self, value): | ||
msg = 'Click on element %s failed as it was covered by another element.' % value | ||
super(ElementCoveredException, self).__init__(msg) | ||
|
||
class ElementTimeoutException(Exception): | ||
'''Raise when waiting on an element times out''' | ||
def __init__(self, value): | ||
if value != 'spinner': | ||
msg = 'Waiting for element %s returned a TimeoutException.' % value | ||
else: | ||
msg = 'Waiting for the spinner to disappear returned a TimeoutException.' % value | ||
super(ElementTimeoutException, self).__init__(msg) | ||
|
||
class ElementNotFoundException(Exception): | ||
'''Raise when an element is not found''' | ||
def __init__(self, value): | ||
msg = 'Element %s was not found.' % value | ||
super(ElementTimeoutException, self).__init__(msg) | ||
|
||
class FailedClickException(Exception): | ||
'''Raise when wait_and_click fails''' | ||
def __init__(self, value): | ||
msg = 'Waiting and trying to click %s failed.' % value | ||
super(FailedClickException, self).__init__(msg) |
Oops, something went wrong.