Skip to content

bug hunters home work 5 - #5

Open
katerynalol wants to merge 50 commits into
Romapsp:masterfrom
katerynalol:master
Open

bug hunters home work 5 #5
katerynalol wants to merge 50 commits into
Romapsp:masterfrom
katerynalol:master

Conversation

@katerynalol

Copy link
Copy Markdown

make structure and work with pages

if capacity: self.fill(self._CAPACITY, capacity)
return self

def create_event(self, title: str, description: str = "",

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Создание мероприятия требует множество полей обязательных. У тебя тут из обязательных только title. Еще обсудим это на занятии

Comment thread bughunters/pages/auth_page.py Outdated
Comment on lines +12 to +18
_PROFILE_BTN = "button:has-text('Профиль'), a:has-text('Профиль')"
_REGISTER_LINK = "span:has-text('нет аккаунта'), a:has-text('Регистрация')"
_REG_FOR_USER = "button:has-text('Для пользователя')"
_REG_FOR_MANAGER = "button:has-text('Для организатора')"
_FIRST_NAME = "input[name='firstName'], input[placeholder*='Имя']"
_LAST_NAME = "input[name='lastName'], input[placeholder*='Фамилия']"
_REG_SUBMIT = "button[type='submit']:has-text('Зарегистрироваться')"

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Упадет, если язык сменится. Аккуратно с has-text. Удобно, но не практично на сайтах, где 2 и более языка.

Comment thread bughunters/pages/auth_page.py Outdated
class AuthPage(BasePage):
_EMAIL = "input[name='email'], input[type='email']"
_PASSWORD = "input[name='password'], input[type='password']"
_SUBMIT = "button[type='submit']:has-text('Войти')"

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Упадет, если язык сменится. Аккуратно с has-text. Удобно, но не практично на сайтах, где 2 и более языка.

Comment thread bughunters/pages/auth_page.py Outdated
self.fill(self._EMAIL, email)
self.fill(self._PASSWORD, password)
self.click(self._SUBMIT)
# self.page.wait_for_timeout(1_500)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

убирай, если не нужно

Comment on lines +10 to +12
_SAVE_BTN = "button:has-text('Сохранить')"
_SUCCESS_TOAST = "[class*='success'], :text('обновлено'), :text('сохранено')"
_TICKETS_BTN = "button:has-text('Создание/редактирование билетов')"

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Упадет, если язык сменится. Аккуратно с has-text. Удобно, но не практично на сайтах, где 2 и более языка.

Comment on lines +27 to +28
def check_page_loaded(self):
expect(self.title).to_be_visible(timeout=15000)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не уверен, что это нам понадобится

Comment on lines +40 to +61
def test_event_page(page: Page):
event = EventPage(page)

event.open("https://polakohedonist.club/en/events/5ebacd6a-c977-411c-a030-b70f68e68faa")

event.check_page_loaded()
event.page.wait_for_timeout(2000)

event.add_ticket(1)
event.check_buy_button()


def test_event_page(page: Page):
event = EventPage(page)
event.open("https://polakohedonist.club/en/events/5ebacd6a-c977-411c-a030-b70f68e68faa")

print("Все кнопки на странице:")
buttons = page.locator("button").all()
for i, btn in enumerate(buttons[:15]): # первые 15
text = btn.inner_text().strip()[:50]
classes = btn.get_attribute("class")
print(f"{i}: '{text}' | classes: {classes}")

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тесты в пейджах не должны быть

Comment on lines +9 to +17
_TYPE_NO_SEATS = "button:has-text('Без мест')"
_TYPE_WITH_SEATS = "button:has-text('С местами')"
_CONTINUE_BTN = "button:has-text('Продолжить')"
_TICKET_NAME = "input[name='ticketName'], input[placeholder*='Название']"
_QUANTITY = "input[name='quantity'], input[placeholder*='Количество']"
_PRICE = "input[name='price'], input[placeholder*='Цена']"
_SAVE_TICKET_BTN = "button:has-text('Сохранить')"
_CREATE_TICKETS = "button:has-text('Создать билеты')"
_SUCCESS = "[class*='success'], :text('билеты созданы')"

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Упадет, если язык сменится. Аккуратно с has-text. Удобно, но не практично на сайтах, где 2 и более языка.

Comment thread Итоговая структура.txt Outdated

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Удаляй, не нужно

Comment thread .env_example Outdated

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Обычно на проектах .env не коммитят, его буквально прикрепляют в каналах, чтобы сотрудники руками его скачивали

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants