Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Mizu
Commits
376bb215
Unverified
Commit
376bb215
authored
3 years ago
by
Igor Gov
Committed by
GitHub
3 years ago
Browse files
Options
Download
Plain Diff
Merge branch 'develop' into task/update_permission_examples
parents
adff15e4
c98c99e4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
acceptanceTests/cypress.json
+6
-2
acceptanceTests/cypress.json
acceptanceTests/cypress/integration/testHelpers/TrafficHelper.js
+29
-16
...nceTests/cypress/integration/testHelpers/TrafficHelper.js
acceptanceTests/cypress/integration/tests/Rabbit.js
+1
-1
acceptanceTests/cypress/integration/tests/Rabbit.js
with
36 additions
and
19 deletions
+36
-19
acceptanceTests/cypress.json
+
6
-
2
View file @
376bb215
...
...
@@ -15,7 +15,8 @@
"tests/IgnoredUserAgents.js"
,
"tests/UiTest.js"
,
"tests/Redis.js"
,
"tests/Rabbit.js"
"tests/Rabbit.js"
,
"tests/serviceMapFunction.js"
],
"env"
:
{
...
...
@@ -26,6 +27,9 @@
"minimumEntries"
:
25
,
"greenFilterColor"
:
"rgb(210, 250, 210)"
,
"redFilterColor"
:
"rgb(250, 214, 220)"
,
"bodyJsonClass"
:
".hljs"
"bodyJsonClass"
:
".hljs"
,
"mizuWidth"
:
1920
,
"normalMizuHeight"
:
1080
,
"hugeMizuHeight"
:
3500
}
}
This diff is collapsed.
Click to expand it.
acceptanceTests/cypress/integration/testHelpers/TrafficHelper.js
+
29
-
16
View file @
376bb215
...
...
@@ -4,6 +4,8 @@ export const valueTabs = {
none
:
null
}
const
maxEntriesInDom
=
13
;
export
function
isValueExistsInElement
(
shouldInclude
,
content
,
domPathToContainer
){
it
(
`should
${
shouldInclude
?
''
:
'
not
'
}
include '
${
content
}
'`
,
function
()
{
cy
.
get
(
domPathToContainer
).
then
(
htmlText
=>
{
...
...
@@ -15,11 +17,11 @@ export function isValueExistsInElement(shouldInclude, content, domPathToContaine
}
export
function
resizeToHugeMizu
()
{
cy
.
viewport
(
1920
,
3500
);
cy
.
viewport
(
Cypress
.
env
(
'
mizuWidth
'
),
Cypress
.
env
(
'
hugeMizuHeight
'
)
);
}
export
function
resizeToNormalMizu
()
{
cy
.
viewport
(
1920
,
1080
);
cy
.
viewport
(
Cypress
.
env
(
'
mizuWidth
'
),
Cypress
.
env
(
'
normalMizuHeight
'
)
);
}
export
function
verifyMinimumEntries
()
{
...
...
@@ -61,7 +63,7 @@ export function checkThatAllEntriesShown() {
}
export
function
checkFilterByMethod
(
funcDict
)
{
const
{
protocol
,
method
,
summary
}
=
funcDict
;
const
{
protocol
,
method
,
summary
,
hugeMizu
}
=
funcDict
;
const
summaryDict
=
getSummeryDict
(
summary
);
const
methodDict
=
getMethodDict
(
method
);
const
protocolDict
=
getProtocolDict
(
protocol
.
name
,
protocol
.
text
);
...
...
@@ -82,20 +84,24 @@ export function checkFilterByMethod(funcDict) {
const
listElmWithIdAttr
=
Object
.
values
(
elements
);
let
doneCheckOnFirst
=
false
;
listElmWithIdAttr
.
forEach
(
entry
=>
{
if
(
entry
?.
id
&&
entry
.
id
.
match
(
RegExp
(
/entry-
(\d{2}
|
\d{1})
$/gm
)))
{
const
entryNum
=
getEntryNumById
(
entry
.
id
);
leftTextCheck
(
entryNum
,
methodDict
.
pathLeft
,
methodDict
.
expectedText
);
leftTextCheck
(
entryNum
,
protocolDict
.
pathLeft
,
protocolDict
.
expectedTextLeft
);
if
(
summaryDict
)
leftTextCheck
(
entryNum
,
summaryDict
.
pathLeft
,
summaryDict
.
expectedText
);
if
(
!
doneCheckOnFirst
)
{
deepCheck
(
funcDict
,
protocolDict
,
methodDict
,
entry
);
doneCheckOnFirst
=
true
;
cy
.
get
(
'
#entries-length
'
).
invoke
(
'
text
'
).
then
(
len
=>
{
resizeIfNeeded
(
len
);
listElmWithIdAttr
.
forEach
(
entry
=>
{
if
(
entry
?.
id
&&
entry
.
id
.
match
(
RegExp
(
/entry-
(\d{2}
|
\d{1})
$/gm
)))
{
const
entryNum
=
getEntryNumById
(
entry
.
id
);
leftTextCheck
(
entryNum
,
methodDict
.
pathLeft
,
methodDict
.
expectedText
);
leftTextCheck
(
entryNum
,
protocolDict
.
pathLeft
,
protocolDict
.
expectedTextLeft
);
if
(
summaryDict
)
leftTextCheck
(
entryNum
,
summaryDict
.
pathLeft
,
summaryDict
.
expectedText
);
if
(
!
doneCheckOnFirst
)
{
deepCheck
(
funcDict
,
protocolDict
,
methodDict
,
entry
);
doneCheckOnFirst
=
true
;
}
}
}
});
resizeIfNeeded
(
len
);
});
});
});
...
...
@@ -103,6 +109,13 @@ export function checkFilterByMethod(funcDict) {
});
}
function
resizeIfNeeded
(
entriesLen
)
{
if
(
entriesLen
>
maxEntriesInDom
){
Cypress
.
config
().
viewportHeight
===
Cypress
.
env
(
'
normalMizuHeight
'
)
?
resizeToHugeMizu
()
:
resizeToNormalMizu
()
}
}
function
deepCheck
(
generalDict
,
protocolDict
,
methodDict
,
entry
)
{
const
entryNum
=
getEntryNumById
(
entry
.
id
);
const
{
summary
,
value
}
=
generalDict
;
...
...
This diff is collapsed.
Click to expand it.
acceptanceTests/cypress/integration/tests/Rabbit.js
+
1
-
1
View file @
376bb215
import
{
checkFilterByMethod
,
valueTabs
,}
from
"
../testHelpers/TrafficHelper
"
;
it
(
'
opening mizu
'
,
function
()
{
cy
.
visit
(
Cypress
.
env
(
'
testUrl
'
));
cy
.
get
(
'
#total-entries
'
).
invoke
(
'
text
'
).
should
(
'
match
'
,
/^
[
4-7
][
0-9
]
$/m
)
});
const
rabbitProtocolDetails
=
{
name
:
'
AMQP
'
,
text
:
'
Advanced Message Queuing Protocol 0-9-1
'
};
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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
Menu
Projects
Groups
Snippets
Help