Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
aliwaleed1 authored Aug 24, 2023
1 parent 73d0da5 commit a71d62b
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
17 changes: 17 additions & 0 deletions pages/birthday.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"""page objects."""
from selenium.webdriver.common.by import By


class Login:
"""login class."""
email = (By.XPATH, '//*[@type="email"]')
password = (By.XPATH, '//*[@type="password"]')
login_button = (By.XPATH, '//button[text()="Login"]')
undefined_message = (By.XPATH, '//*[@id="liveToast"]/div[2]')


class Birthday:
"""Birthday class."""
text1 = "//section[@class='task task--primary svelte-11utwz3']"
text2 = '//button'
birthday_button = (By.XPATH, text1+text2)
34 changes: 34 additions & 0 deletions tests/test_birthday.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"""Module to test meeting page."""
import time
from selenium import webdriver
import pytest
from pages.birthday import Login, Birthday
from utils.base import BASEURL


@pytest.fixture(name="driver1")
def driver1_fixture():
"""Function to save driver fixture."""
driver = webdriver.Edge()
driver.get(BASEURL)
yield driver
driver.quit()


def to_login(driver1):
"""Function to login in tests."""
email_input = driver1.find_element(*Login.email)
email_input.send_keys("[email protected]")
password_input = driver1.find_element(*Login.password)
password_input.send_keys("123456789")
login_button = driver1.find_element(*Login.login_button)
login_button.click()
time.sleep(3)


def test_display_of_birthday_icon(driver1):
"""Function to test birthday."""
to_login(driver1)
birthday_button = driver1.find_element(*Birthday.birthday_button)
button_text = birthday_button.text
assert "🎂 BIRTHDAY" == button_text
2 changes: 2 additions & 0 deletions utils/base.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"""base URL"""
BASEURL = "https://cshr.gent01.dev.grid.tf/"

0 comments on commit a71d62b

Please sign in to comment.