-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create file with exceptions for elements
- Loading branch information
1 parent
ec4d935
commit aace71d
Showing
5 changed files
with
21 additions
and
17 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
from .input import Input | ||
from .button import Button | ||
from .exceptions import Unavailable | ||
from .input import Input | ||
from .product import CatalogProduct, CartPosition |
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 |
---|---|---|
@@ -1,14 +1,22 @@ | ||
from shopelectro.selenium.elements import Unavailable | ||
|
||
# @todo #799:120m Reuse shopelectro.selenium.elements.cart.Cart for selenium tests. | ||
|
||
|
||
class Cart: | ||
""""Represent the cart at the site.""" | ||
|
||
def __init__(self, driver: SiteDriver): | ||
self.driver = driver | ||
|
||
def positions(self): | ||
pass | ||
def positions(self): | ||
raise Unavailable('to get positions.') | ||
|
||
def clear(self): | ||
raise Unavailable('to get positions.') | ||
|
||
def clear(self): | ||
pass | ||
def total(self): | ||
raise Unavailable('to get positions.') | ||
|
||
def total(self): | ||
pass | ||
def is_empty(self): | ||
raise Unavailable('to get positions.') |
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,4 @@ | ||
class Unavailable(NotImplementedError): | ||
|
||
def __init__(self, msg, *args, **kwargs): | ||
super().__init__(f'The element doesn\'t provide ability to {msg}', *args, **kwargs) |
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
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