Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
疯人忠
Cvat
提交
7ee8efb3
C
Cvat
项目概览
疯人忠
/
Cvat
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
Cvat
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
7ee8efb3
编写于
8月 04, 2021
作者:
D
Dmitry Kruchinin
提交者:
GitHub
8月 04, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update Cypress tests. Added the use of the "Done" button. (#3505)
* Updated tests, commands * Apply comments * Removed unnecessary lines
上级
b293718e
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
43 addition
and
50 deletion
+43
-50
tests/cypress/integration/actions_objects2/case_10_polygon_shape_track_label_points.js
...ions_objects2/case_10_polygon_shape_track_label_points.js
+4
-10
tests/cypress/integration/actions_objects2/case_11_polylines_shape_track_label_points.js
...ns_objects2/case_11_polylines_shape_track_label_points.js
+4
-10
tests/cypress/integration/actions_objects2/case_12_points_shape_track_label.js
...tion/actions_objects2/case_12_points_shape_track_label.js
+8
-12
tests/cypress/support/commands.js
tests/cypress/support/commands.js
+27
-18
未找到文件。
tests/cypress/integration/actions_objects2/case_10_polygon_shape_track_label_points.js
浏览文件 @
7ee8efb3
...
...
@@ -6,7 +6,7 @@
import
{
taskName
,
labelName
}
from
'
../../support/const
'
;
context
(
'
Actions on polygon
'
,
()
=>
{
context
(
'
Actions on polygon
.
'
,
()
=>
{
const
caseId
=
'
10
'
;
const
newLabelName
=
`New label for case
${
caseId
}
`
;
const
createPolygonShape
=
{
...
...
@@ -18,8 +18,6 @@ context('Actions on polygon', () => {
{
x
:
250
,
y
:
200
},
{
x
:
250
,
y
:
250
},
],
complete
:
true
,
numberOfPoints
:
null
,
};
const
createPolygonTrack
=
{
reDraw
:
false
,
...
...
@@ -30,8 +28,6 @@ context('Actions on polygon', () => {
{
x
:
350
,
y
:
200
},
{
x
:
350
,
y
:
350
},
],
complete
:
true
,
numberOfPoints
:
null
,
};
const
createPolygonShapePoints
=
{
reDraw
:
false
,
...
...
@@ -68,8 +64,7 @@ context('Actions on polygon', () => {
{
x
:
650
,
y
:
200
},
{
x
:
650
,
y
:
250
},
],
complete
:
true
,
numberOfPoints
:
null
,
finishWithButton
:
true
,
};
const
createPolygonTrackSwitchLabel
=
{
reDraw
:
false
,
...
...
@@ -80,8 +75,7 @@ context('Actions on polygon', () => {
{
x
:
750
,
y
:
200
},
{
x
:
750
,
y
:
250
},
],
complete
:
true
,
numberOfPoints
:
null
,
finishWithButton
:
true
,
};
before
(()
=>
{
...
...
@@ -101,7 +95,7 @@ context('Actions on polygon', () => {
cy
.
createPolygon
(
createPolygonTrackPoints
);
});
it
(
'
Draw a polygon shape, track with second label.
'
,
()
=>
{
it
(
'
Draw a polygon shape, track with second label
and "Done" button
.
'
,
()
=>
{
cy
.
createPolygon
(
createPolygonShapeSwitchLabel
);
cy
.
createPolygon
(
createPolygonTrackSwitchLabel
);
});
...
...
tests/cypress/integration/actions_objects2/case_11_polylines_shape_track_label_points.js
浏览文件 @
7ee8efb3
...
...
@@ -6,7 +6,7 @@
import
{
taskName
,
labelName
}
from
'
../../support/const
'
;
context
(
'
Actions on polylines
'
,
()
=>
{
context
(
'
Actions on polylines
.
'
,
()
=>
{
const
caseId
=
'
11
'
;
const
newLabelName
=
`New label for case
${
caseId
}
`
;
const
createPolylinesShape
=
{
...
...
@@ -17,8 +17,6 @@ context('Actions on polylines', () => {
{
x
:
250
,
y
:
200
},
{
x
:
250
,
y
:
250
},
],
complete
:
true
,
numberOfPoints
:
null
,
};
const
createPolylinesTrack
=
{
type
:
'
Track
'
,
...
...
@@ -28,8 +26,6 @@ context('Actions on polylines', () => {
{
x
:
350
,
y
:
200
},
{
x
:
350
,
y
:
350
},
],
complete
:
true
,
numberOfPoints
:
null
,
};
const
createPolylinesShapePoints
=
{
type
:
'
Shape
'
,
...
...
@@ -63,8 +59,7 @@ context('Actions on polylines', () => {
{
x
:
650
,
y
:
200
},
{
x
:
650
,
y
:
250
},
],
complete
:
true
,
numberOfPoints
:
null
,
finishWithButton
:
true
,
};
const
createPolylinesTrackSwitchLabel
=
{
type
:
'
Track
'
,
...
...
@@ -74,8 +69,7 @@ context('Actions on polylines', () => {
{
x
:
750
,
y
:
200
},
{
x
:
750
,
y
:
250
},
],
complete
:
true
,
numberOfPoints
:
null
,
finishWithButton
:
true
,
};
before
(()
=>
{
...
...
@@ -95,7 +89,7 @@ context('Actions on polylines', () => {
cy
.
createPolyline
(
createPolylinesTrackPoints
);
});
it
(
'
Draw a polylines shape, track with second label.
'
,
()
=>
{
it
(
'
Draw a polylines shape, track with second label
and "Done" button
.
'
,
()
=>
{
cy
.
createPolyline
(
createPolylinesShapeSwitchLabel
);
cy
.
createPolyline
(
createPolylinesTrackSwitchLabel
);
});
...
...
tests/cypress/integration/actions_objects2/case_12_points_shape_track_label.js
浏览文件 @
7ee8efb3
...
...
@@ -6,7 +6,7 @@
import
{
taskName
,
labelName
}
from
'
../../support/const
'
;
context
(
'
Actions on points
'
,
()
=>
{
context
(
'
Actions on points
.
'
,
()
=>
{
const
caseId
=
'
12
'
;
const
newLabelName
=
`New label for case
${
caseId
}
`
;
const
createPointsShape
=
{
...
...
@@ -17,8 +17,6 @@ context('Actions on points', () => {
{
x
:
250
,
y
:
200
},
{
x
:
250
,
y
:
250
},
],
complete
:
true
,
numberOfPoints
:
null
,
};
const
createPointsTrack
=
{
type
:
'
Track
'
,
...
...
@@ -28,8 +26,6 @@ context('Actions on points', () => {
{
x
:
350
,
y
:
200
},
{
x
:
350
,
y
:
350
},
],
complete
:
true
,
numberOfPoints
:
null
,
};
const
createPointsShapePoints
=
{
type
:
'
Shape
'
,
...
...
@@ -63,8 +59,7 @@ context('Actions on points', () => {
{
x
:
650
,
y
:
200
},
{
x
:
650
,
y
:
250
},
],
complete
:
true
,
numberOfPoints
:
null
,
finishWithButton
:
true
,
};
const
createPointsTrackSwitchLabel
=
{
type
:
'
Track
'
,
...
...
@@ -74,8 +69,7 @@ context('Actions on points', () => {
{
x
:
750
,
y
:
200
},
{
x
:
750
,
y
:
250
},
],
complete
:
true
,
numberOfPoints
:
null
,
finishWithButton
:
true
,
};
before
(()
=>
{
...
...
@@ -85,15 +79,17 @@ context('Actions on points', () => {
});
describe
(
`Testing case "
${
caseId
}
"`
,
()
=>
{
it
(
'
Draw a points shape, track
'
,
()
=>
{
it
(
'
Draw a points shape, track
.
'
,
()
=>
{
cy
.
createPoint
(
createPointsShape
);
cy
.
createPoint
(
createPointsTrack
);
});
it
(
'
Draw a points shape, track with use parameter "number of points"
'
,
()
=>
{
it
(
'
Draw a points shape, track with use parameter "number of points".
'
,
()
=>
{
cy
.
createPoint
(
createPointsShapePoints
);
cy
.
createPoint
(
createPointsTrackPoints
);
});
it
(
'
Draw a points shape, track with second label
'
,
()
=>
{
it
(
'
Draw a points shape, track with second label and "Done" button.
'
,
()
=>
{
cy
.
createPoint
(
createPointsShapeSwitchLabel
);
cy
.
createPoint
(
createPointsTrackSwitchLabel
);
});
...
...
tests/cypress/support/commands.js
浏览文件 @
7ee8efb3
...
...
@@ -304,7 +304,6 @@ Cypress.Commands.add('createPoint', (createPointParams) => {
selectedValueGlobal
=
$labelValue
.
text
();
});
if
(
createPointParams
.
numberOfPoints
)
{
createPointParams
.
complete
=
false
;
cy
.
get
(
'
.ant-input-number-input
'
).
clear
().
type
(
createPointParams
.
numberOfPoints
);
}
cy
.
contains
(
'
button
'
,
createPointParams
.
type
).
click
();
...
...
@@ -312,11 +311,15 @@ Cypress.Commands.add('createPoint', (createPointParams) => {
createPointParams
.
pointsMap
.
forEach
((
element
)
=>
{
cy
.
get
(
'
.cvat-canvas-container
'
).
click
(
element
.
x
,
element
.
y
);
});
if
(
createPointParams
.
complete
)
{
const
keyCodeN
=
78
;
cy
.
get
(
'
.cvat-canvas-container
'
)
.
trigger
(
'
keydown
'
,
{
keyCode
:
keyCodeN
})
.
trigger
(
'
keyup
'
,
{
keyCode
:
keyCodeN
});
if
(
createPointParams
.
finishWithButton
)
{
cy
.
contains
(
'
span
'
,
'
Done
'
).
click
();
}
else
{
if
(
!
createPointParams
.
numberOfPoints
)
{
const
keyCodeN
=
78
;
cy
.
get
(
'
.cvat-canvas-container
'
)
.
trigger
(
'
keydown
'
,
{
keyCode
:
keyCodeN
})
.
trigger
(
'
keyup
'
,
{
keyCode
:
keyCodeN
});
}
}
cy
.
checkObjectParameters
(
createPointParams
,
'
POINTS
'
);
});
...
...
@@ -348,7 +351,6 @@ Cypress.Commands.add('createPolygon', (createPolygonParams) => {
selectedValueGlobal
=
$labelValue
.
text
();
});
if
(
createPolygonParams
.
numberOfPoints
)
{
createPolygonParams
.
complete
=
false
;
cy
.
get
(
'
.ant-input-number-input
'
).
clear
().
type
(
createPolygonParams
.
numberOfPoints
);
}
cy
.
contains
(
'
button
'
,
createPolygonParams
.
type
).
click
();
...
...
@@ -357,11 +359,15 @@ Cypress.Commands.add('createPolygon', (createPolygonParams) => {
createPolygonParams
.
pointsMap
.
forEach
((
element
)
=>
{
cy
.
get
(
'
.cvat-canvas-container
'
).
click
(
element
.
x
,
element
.
y
);
});
if
(
createPolygonParams
.
complete
)
{
const
keyCodeN
=
78
;
cy
.
get
(
'
.cvat-canvas-container
'
)
.
trigger
(
'
keydown
'
,
{
keyCode
:
keyCodeN
})
.
trigger
(
'
keyup
'
,
{
keyCode
:
keyCodeN
});
if
(
createPolygonParams
.
finishWithButton
)
{
cy
.
contains
(
'
span
'
,
'
Done
'
).
click
();
}
else
{
if
(
!
createPolygonParams
.
numberOfPoints
)
{
const
keyCodeN
=
78
;
cy
.
get
(
'
.cvat-canvas-container
'
)
.
trigger
(
'
keydown
'
,
{
keyCode
:
keyCodeN
})
.
trigger
(
'
keyup
'
,
{
keyCode
:
keyCodeN
});
}
}
cy
.
checkObjectParameters
(
createPolygonParams
,
'
POLYGON
'
);
});
...
...
@@ -490,7 +496,6 @@ Cypress.Commands.add('createPolyline', (createPolylineParams) => {
selectedValueGlobal
=
$labelValue
.
text
();
});
if
(
createPolylineParams
.
numberOfPoints
)
{
createPolylineParams
.
complete
=
false
;
cy
.
get
(
'
.ant-input-number-input
'
).
clear
().
type
(
createPolylineParams
.
numberOfPoints
);
}
cy
.
contains
(
'
button
'
,
createPolylineParams
.
type
).
click
();
...
...
@@ -498,11 +503,15 @@ Cypress.Commands.add('createPolyline', (createPolylineParams) => {
createPolylineParams
.
pointsMap
.
forEach
((
element
)
=>
{
cy
.
get
(
'
.cvat-canvas-container
'
).
click
(
element
.
x
,
element
.
y
);
});
if
(
createPolylineParams
.
complete
)
{
const
keyCodeN
=
78
;
cy
.
get
(
'
.cvat-canvas-container
'
)
.
trigger
(
'
keydown
'
,
{
keyCode
:
keyCodeN
})
.
trigger
(
'
keyup
'
,
{
keyCode
:
keyCodeN
});
if
(
createPolylineParams
.
finishWithButton
)
{
cy
.
contains
(
'
span
'
,
'
Done
'
).
click
();
}
else
{
if
(
!
createPolylineParams
.
numberOfPoints
)
{
const
keyCodeN
=
78
;
cy
.
get
(
'
.cvat-canvas-container
'
)
.
trigger
(
'
keydown
'
,
{
keyCode
:
keyCodeN
})
.
trigger
(
'
keyup
'
,
{
keyCode
:
keyCodeN
});
}
}
cy
.
checkObjectParameters
(
createPolylineParams
,
'
POLYLINE
'
);
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录