Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xm-uitest-sow
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiamai-test
xm-uitest-sow
Commits
5c0d56fd
Commit
5c0d56fd
authored
Jul 19, 2021
by
linguangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加时间轴case
parent
f4bd3e1c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
2 deletions
+27
-2
.idea/workspace.xml
+8
-1
src/pageobject/mainbarpage.py
+6
-0
src/testcase/test_MainBarPage.py
+13
-1
No files found.
.idea/workspace.xml
View file @
5c0d56fd
...
...
@@ -511,7 +511,14 @@
<option
name=
"project"
value=
"LOCAL"
/>
<updated>
1626665531521
</updated>
</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
/>
</component>
<component
name=
"TestHistory"
>
...
...
src/pageobject/mainbarpage.py
View file @
5c0d56fd
...
...
@@ -12,6 +12,8 @@ class MainBarPage(Page):
day_selected_week
=
(
By
.
XPATH
,
"//div[@class='day selected']/p[1]"
)
# 已被选择的日期-月份日期
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']"
)
# 下周
...
...
@@ -38,6 +40,10 @@ class MainBarPage(Page):
def
month_day_text
(
self
):
return
self
.
get_text
(
self
.
day_selected_month
)
# 点击今日按钮
def
click_today
(
self
):
self
.
click
(
self
.
today_btn
)
# 点击相邻日期
def
click_other_day
(
self
):
self
.
click
(
self
.
day_unselected
)
...
...
src/testcase/test_MainBarPage.py
View file @
5c0d56fd
...
...
@@ -43,7 +43,19 @@ class TestMainPage(object):
if
week_day
()
!=
6
:
first_day
=
month_not_today
(
-
week_day
()
-
1
)
.
strftime
(
"
%
d"
)
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
()
assert
self
.
main_bar_page
.
month_day_text
()
==
first_day
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment