-
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 SuccessPage * Assert success_page.is_success() in check_purchase * Setup auto-retry for the check_purchase * Create TGReport * Review fixes * Add the comment to check_purchase's report policy * Apply linter rules * Fix typos
- Loading branch information
1 parent
9cae226
commit a1e74b2
Showing
7 changed files
with
61 additions
and
14 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
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,12 @@ | ||
from django.conf import settings | ||
from telegram import Bot | ||
|
||
|
||
class TelegramReport: | ||
|
||
def __init__(self): | ||
self.bot = Bot(settings.TG_BOT_TOKEN) | ||
|
||
def send(self, text: str): | ||
for id in settings.TG_REPORT_ADDRESSEES: | ||
self.bot.send_message(id, text) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
|
||
from .category import CategoryPage | ||
from .order import OrderPage | ||
from .success import SuccessPage |
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,13 @@ | ||
from shopelectro.selenium.pages import Page | ||
|
||
from pages.models import CustomPage | ||
|
||
|
||
class SuccessPage(Page): | ||
|
||
@property | ||
def path(self): | ||
CustomPage.objects.get(slug='order-success').url | ||
|
||
def is_success(self): | ||
return 'Заказ принят' in self.driver.find_element_by_tag_name('h1').text |
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
a1e74b2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Puzzle
690-44aa8d80
disappeared fromshopelectro/tasks.py
, that's why I closed #704. Please, remember that the puzzle was not necessarily removed in this particular commit. Maybe it happened earlier, but we discovered this fact only now.a1e74b2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Puzzle
690-7e329879
discovered inshopelectro/tasks.py
and submitted as #712. Please, remember that the puzzle was not necessarily added in this particular commit. Maybe it was added earlier, but we discovered it only now.