summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--__init__.robot7
-rw-r--r--case/administration/user.robot3
-rw-r--r--keyword/common/page.robot18
-rw-r--r--other/data/administration/user_data.yaml3
-rw-r--r--other/data/template/page_template.yaml11
5 files changed, 25 insertions, 17 deletions
diff --git a/__init__.robot b/__init__.robot
new file mode 100644
index 0000000..f7baeb7
--- /dev/null
+++ b/__init__.robot
@@ -0,0 +1,7 @@
+*** Settings ***
+#Suite Setup LoginAndAddLocalIP
+#Suite Teardown LogoutAndDelLocalIP
+#Resource keyword/common/login_logout_switch.robot
+Suite Setup LoginAndAddLocalIP
+Suite Teardown LogoutAndDelLocalIP
+Resource keyword/common/login_logout_switch.robot \ No newline at end of file
diff --git a/case/administration/user.robot b/case/administration/user.robot
index 4e50599..38230cd 100644
--- a/case/administration/user.robot
+++ b/case/administration/user.robot
@@ -38,9 +38,10 @@ user_column_setup
${objDataList} Get From Dictionary ${yamlData} ${TEST NAME}_data
# 读取模板文件中OpenCreateOrEditPageIds中的数据(打开页面)
${tempData} Get From Dictionary ${objtemplate} templateData
+ ${ColumnPosition} Get From Dictionary ${objtemplate} ColumnPosition
${openCreateOrEditPageIds} Get From Dictionary ${objtemplate} openCreateOrEditPage
FOR ${objData} IN @{objDataList}
- ColumnSetup ${openCreateOrEditPageIds} ${objData} ${tempData}
+ ColumnSetup ${openCreateOrEditPageIds} ${objData} ${tempData} ${ColumnPosition}
END
# 翻页功能验证
diff --git a/keyword/common/page.robot b/keyword/common/page.robot
index 0d745ff..bed0332 100644
--- a/keyword/common/page.robot
+++ b/keyword/common/page.robot
@@ -446,13 +446,6 @@ AssertPage
Page Should Contain ${text}
END
-TextContain
- [Arguments] ${columnList} ${text}
- [Documentation] 验证页面不存在文本关键字
- FOR ${column} IN @{columnList}
- should not be equal ${column} ${text}
- END
-
CreatePageTextAssert
[Arguments] ${elementList} ${dataList} ${OpenCreateOrEditPage}
[Documentation] 用于创建页面内文本断言
@@ -507,9 +500,8 @@ TestPageVerifyOperation
OpenPage ${openCreateOrEditPage}
OperatPage ${tempData} ${data}
-
-ColumnSetup
- [Arguments] ${openCreateOrEditPage} ${data} ${tempData}
+ColumnSetup
+ [Arguments] ${openCreateOrEditPage} ${data} ${tempData} ${ColumnPosition}
[Documentation] 列设置验证关键字
... ${openCreateOrEditPage}:模板文件中openCreateOrEditPage中数据,打开页面定位信息
#登录后打开测试页面
@@ -517,10 +509,10 @@ ColumnSetup
OperatPage ${tempData} ${data}
# 断言页面不存在列
${columnList} Get From Dictionary ${data} cancel_show
- ${assertPosition} Get From Dictionary ${data} assertPosition
- FOR ${position} IN @{assertPosition}
+ FOR ${column} IN @{columnList}
+ ${position} Get From Dictionary ${ColumnPosition} ${column}
${text} Get text ${position}
- TextContain ${columnList} ${text}
+ should not be equal ${text} ${column}
END
TurnPage
diff --git a/other/data/administration/user_data.yaml b/other/data/administration/user_data.yaml
index 98b6f6a..402befe 100644
--- a/other/data/administration/user_data.yaml
+++ b/other/data/administration/user_data.yaml
@@ -25,7 +25,4 @@ user_column_setup_data:
- Role
- Last login time
save_column_setup: click
- assertPosition:
- - xpath=//*[@id="userTable"]/div[2]/table/thead/tr/th[5]/div/span
- - xpath=//*[@id="userTable"]/div[2]/table/thead/tr/th[7]/div/span
\ No newline at end of file
diff --git a/other/data/template/page_template.yaml b/other/data/template/page_template.yaml
index 847f24b..1c28301 100644
--- a/other/data/template/page_template.yaml
+++ b/other/data/template/page_template.yaml
@@ -75,4 +75,15 @@ user_page:
ID: xpath=//*[@id="userTable"]/div[3]/table/tbody/tr[1]/td[2]/div/span # ID定位
delete: id=account-list-batch-delete #删除按钮定位
Selected: xpath=//*[@id="userTable"]/div[3]/table/tbody/tr/td[1]/div/label/span/span #查询后第一条数据的选中框定位
+ ColumnPosition:
+ ID: xpath=//*[@id="userTable"]/div[2]/table/thead/tr/th[2]/div/span[1]
+ Name: xpath=//*[@id="userTable"]/div[2]/table/thead/tr/th[3]/div/span[1]
+ Username: xpath=//*[@id="userTable"]/div[2]/table/thead/tr/th[4]/div/span[1]
+ Role: xpath=//*[@id="userTable"]/div[2]/table/thead/tr/th[5]/div/span[1]
+ E-mail: xpath=//*[@id="userTable"]/div[2]/table/thead/tr/th[6]/div/span[1]
+ Last login time: xpath=//*[@id="userTable"]/div[2]/table/thead/tr/th[7]/div/span[1]
+ Last login IP: xpath=//*[@id="userTable"]/div[2]/table/thead/tr/th[8]/div/span[1]
+ Source: xpath=//*[@id="userTable"]/div[2]/table/thead/tr/th[9]/div/span[1]
+ Enable: xpath=//*[@id="userTable"]/div[2]/table/thead/tr/th[10]/div/span[1]
+ Operation: xpath=//*[@id="userTable"]/div/div[1]/table/thead/tr/th[11]/div/div
\ No newline at end of file