Skip to content

Commit

Permalink
[241120] POM에 맞춰서 파일 이동 및 홈페이지 카드 테스트 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
sc303030 committed Nov 20, 2024
1 parent 45a2266 commit 6a8ebed
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 14 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion app/home_page.py → app/Pages/home_page.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from appium.webdriver.common.appiumby import AppiumBy
from base_page import BasePage
from app.Pages.base_page import BasePage


class HomePage(BasePage):
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions app/main_test.py → app/Tests/main_test.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import time
import unittest

from home_page import HomePage
from base_test import BaseTest
from app.Pages.home_page import HomePage
from app.TestBase.base_test import BaseTest


class TestMain(BaseTest):
Expand Down
File renamed without changes.
21 changes: 21 additions & 0 deletions web/Pages/home_page.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from web.Pages.base_page import BasePage
from selenium.webdriver.common.by import By


class HomePage(BasePage):
def __init__(self, driver):
super().__init__(driver)
self.logo_locator = (By.CLASS_NAME, "logo")
self.card_slider_parent_xpath = (
'//*[@id="root"]/main/div[2]/div[1]/div[1]/div/div[1]/div[1]'
)

def verify_logo_present(self):
logo = self.get_element(self.logo_locator)
return logo is not None

def get_slide_card_count(self):
slide_cards = self.driver.find_elements(
By.XPATH, f"{self.card_slider_parent_xpath}/*"
)
return len(slide_cards)
File renamed without changes.
19 changes: 19 additions & 0 deletions web/Tests/main_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from web.TestBase.base_test import BaseTest
from web.Pages.home_page import HomePage


class MainTest(BaseTest):
def test_visit_kbl_homepage(self):
self.driver.get("https://kbl.or.kr/")
home_page = HomePage(self.driver)

self.assertTrue(
home_page.verify_logo_present(), "홈페이지 로고가 보이지 않습니다."
)

slide_card_count = home_page.get_slide_card_count()
self.assertEqual(
slide_card_count,
13,
f"슬라이드 카드의 개수는 10개가 아닙니다. 현재 개수: {slide_card_count}",
)
5 changes: 0 additions & 5 deletions web/home_002.py

This file was deleted.

6 changes: 0 additions & 6 deletions web/login.py

This file was deleted.

0 comments on commit 6a8ebed

Please sign in to comment.