Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
Vue-WebDriver
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
高源
Vue-WebDriver
Commits
465531bd
Commit
465531bd
authored
Nov 18, 2023
by
高源
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
ddfd24b9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
sdk-table.js
src/sdk-table.js
+8
-8
No files found.
src/sdk-table.js
View file @
465531bd
...
@@ -64,7 +64,7 @@ function table () {
...
@@ -64,7 +64,7 @@ function table () {
this
.
getData
=
function
()
{
this
.
getData
=
function
()
{
let
rtns
=
[];
//定义返回值
let
rtns
=
[];
//定义返回值
if
(
!
_isVerified
)
return
null
;
//如果还没通过验证不返回数据
if
(
!
_isVerified
)
return
null
;
//如果还没通过验证不返回数据
let
rowIndex
=
0
;
let
rowIndex
=
1
;
while
(
true
)
{
while
(
true
)
{
let
result
=
{}
let
result
=
{}
this
.
cells
.
forEach
(
cell
=>
cell
.
getData
(
result
,
rowIndex
));
this
.
cells
.
forEach
(
cell
=>
cell
.
getData
(
result
,
rowIndex
));
...
@@ -123,13 +123,13 @@ function cell (xpath, name = "", type = "", title = "") {
...
@@ -123,13 +123,13 @@ function cell (xpath, name = "", type = "", title = "") {
*/
*/
this
.
isExist
=
function
()
{
this
.
isExist
=
function
()
{
let
existCount
=
0
;
let
existCount
=
0
;
let
_tableXpathArrays
=
[...
_tableXpathArray
];
//深拷贝,值修改不影响原数组
//
let _tableXpathArrays = [..._tableXpathArray]; //深拷贝,值修改不影响原数组
let
_relativeXpathArrays
=
[...
_relativeXpathArray
];
//深拷贝,值修改不影响原数组
//
let _relativeXpathArrays = [..._relativeXpathArray];//深拷贝,值修改不影响原数组
_tableXpathArrays
=
_tableXpathArray
.
join
(
'/'
)
let
_tableXpathArrays
=
_tableXpathArray
.
join
(
'/'
)
_relativeXpathArrays
=
_relativeXpathArray
.
join
(
'/'
)
let
_relativeXpathArrays
=
_relativeXpathArray
.
join
(
'/'
)
for
(
let
i
=
0
;
i
<
3
;
i
++
)
{
for
(
let
i
=
1
;
i
<
3
;
i
++
)
{
// 验证是否能找到元素
// 验证是否能找到元素
let
_xpath
=
_tableXpathArrays
+
'['
+
(
i
+
1
)
+
']'
+
'/'
+
_relativeXpathArrays
;
let
_xpath
=
_tableXpathArrays
+
'['
+
i
+
']'
+
'/'
+
_relativeXpathArrays
;
let
result
=
document
.
evaluate
(
_xpath
,
document
,
null
,
XPathResult
.
FIRST_ORDERED_NODE_TYPE
,
null
);
let
result
=
document
.
evaluate
(
_xpath
,
document
,
null
,
XPathResult
.
FIRST_ORDERED_NODE_TYPE
,
null
);
if
(
!!
result
.
singleNodeValue
)
{
if
(
!!
result
.
singleNodeValue
)
{
existCount
++
;
existCount
++
;
...
@@ -148,7 +148,7 @@ function cell (xpath, name = "", type = "", title = "") {
...
@@ -148,7 +148,7 @@ function cell (xpath, name = "", type = "", title = "") {
* @param {int} index 索引号
* @param {int} index 索引号
*/
*/
this
.
getData
=
function
(
result
,
index
)
{
this
.
getData
=
function
(
result
,
index
)
{
let
realXpath
=
this
.
tableXpath
+
"["
+
(
index
+
1
)
+
"]"
+
'/'
+
this
.
relativeXpath
;
let
realXpath
=
this
.
tableXpath
+
"["
+
index
+
"]"
+
'/'
+
this
.
relativeXpath
;
let
results
=
document
.
evaluate
(
realXpath
,
document
,
null
,
XPathResult
.
FIRST_ORDERED_NODE_TYPE
,
null
);
let
results
=
document
.
evaluate
(
realXpath
,
document
,
null
,
XPathResult
.
FIRST_ORDERED_NODE_TYPE
,
null
);
if
(
!!
results
.
singleNodeValue
)
{
if
(
!!
results
.
singleNodeValue
)
{
// 后续处理type类型事件
// 后续处理type类型事件
...
...
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