Commit 5c0d56fd by linguangwei

添加时间轴case

parent f4bd3e1c
...@@ -511,7 +511,14 @@ ...@@ -511,7 +511,14 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1626665531521</updated> <updated>1626665531521</updated>
</task> </task>
<option name="localTasksCounter" value="34" /> <task id="LOCAL-00034" summary="添加时间轴case">
<created>1626675947132</created>
<option name="number" value="00034" />
<option name="presentableId" value="LOCAL-00034" />
<option name="project" value="LOCAL" />
<updated>1626675947132</updated>
</task>
<option name="localTasksCounter" value="35" />
<servers /> <servers />
</component> </component>
<component name="TestHistory"> <component name="TestHistory">
......
...@@ -12,6 +12,8 @@ class MainBarPage(Page): ...@@ -12,6 +12,8 @@ class MainBarPage(Page):
day_selected_week = (By.XPATH, "//div[@class='day selected']/p[1]") day_selected_week = (By.XPATH, "//div[@class='day selected']/p[1]")
# 已被选择的日期-月份日期 # 已被选择的日期-月份日期
day_selected_month = (By.XPATH, "//div[@class='day selected']/p[2]") day_selected_month = (By.XPATH, "//div[@class='day selected']/p[2]")
# 今日按钮
today_btn = (By.XPATH, "//span[@class='today']")
# 上周 # 上周
last_week = (By.XPATH, "//div[@class='calendar_Time_week']/div[1]/span[@class='icon iconfont']") last_week = (By.XPATH, "//div[@class='calendar_Time_week']/div[1]/span[@class='icon iconfont']")
# 下周 # 下周
...@@ -38,6 +40,10 @@ class MainBarPage(Page): ...@@ -38,6 +40,10 @@ class MainBarPage(Page):
def month_day_text(self): def month_day_text(self):
return self.get_text(self.day_selected_month) return self.get_text(self.day_selected_month)
# 点击今日按钮
def click_today(self):
self.click(self.today_btn)
# 点击相邻日期 # 点击相邻日期
def click_other_day(self): def click_other_day(self):
self.click(self.day_unselected) self.click(self.day_unselected)
......
...@@ -43,7 +43,19 @@ class TestMainPage(object): ...@@ -43,7 +43,19 @@ class TestMainPage(object):
if week_day() != 6: if week_day() != 6:
first_day = month_not_today(-week_day()-1).strftime("%d") first_day = month_not_today(-week_day()-1).strftime("%d")
else: else:
first_day = month_not_today().strftime("%d") first_day = month_not_today(1).strftime("%d")
self.main_bar_page.click_other_day()
assert self.main_bar_page.month_day_text() == first_day
self.main_bar_page.click_today()
today = month_not_today().strftime("%d")
assert self.main_bar_page.month_day_text() == today
@allure.title("切换到其他日期再切回今日")
def test_SelectToday(self):
if week_day() != 6:
first_day = month_not_today(-week_day()-1).strftime("%d")
else:
first_day = month_not_today(1).strftime("%d")
self.main_bar_page.click_other_day() self.main_bar_page.click_other_day()
assert self.main_bar_page.month_day_text() == first_day assert self.main_bar_page.month_day_text() == first_day
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment