Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nghyd
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
A compter du 1er avril, attention à vos pipelines :
Nouvelles limitations de Docker Hub
Show more breadcrumbs
Cassiopée
nghyd
Commits
170981ea
Commit
170981ea
authored
2 years ago
by
François Grand
Browse files
Options
Downloads
Patches
Plain Diff
test(e2e): check pre-dams calculate button/schema items validity
refs
#544
parent
178fd968
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!144
Resolve "PréBarrages: les changements de couleur du schéma ne sont pas instantanées"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
e2e/calculate-button-validation.e2e-spec.ts
+72
-1
72 additions, 1 deletion
e2e/calculate-button-validation.e2e-spec.ts
e2e/calculator.po.ts
+7
-0
7 additions, 0 deletions
e2e/calculator.po.ts
with
79 additions
and
1 deletion
e2e/calculate-button-validation.e2e-spec.ts
+
72
−
1
View file @
170981ea
import
{
ListPage
}
from
"
./list.po
"
;
import
{
CalculatorPage
}
from
"
./calculator.po
"
;
import
{
Navbar
}
from
"
./navbar.po
"
;
import
{
browser
}
from
"
protractor
"
;
import
{
browser
,
by
,
element
}
from
"
protractor
"
;
import
{
PreferencesPage
}
from
"
./preferences.po
"
;
describe
(
"
Calculate button -
"
,
()
=>
{
...
...
@@ -71,4 +71,75 @@ describe("Calculate button - ", () => {
disabledStateClone
=
await
calcButtonClone
.
getAttribute
(
"
disabled
"
);
expect
(
disabledStateClone
).
toBe
(
"
true
"
);
});
describe
(
"
check button status in prébarrages -
"
,
()
=>
{
it
(
"
invalid data in Q input
"
,
async
()
=>
{
// start page
await
navBar
.
clickNewCalculatorButton
();
await
browser
.
sleep
(
200
);
// open prébarrages calculator
await
listPage
.
clickMenuEntryForCalcType
(
30
);
await
browser
.
sleep
(
200
);
// Q input
const
inputQ
=
element
(
by
.
id
(
"
Q
"
));
await
inputQ
.
clear
();
await
browser
.
sleep
(
200
);
await
inputQ
.
sendKeys
(
"
-1
"
);
await
browser
.
sleep
(
200
);
calcPage
.
checkCalcButtonEnabled
(
false
);
// upstream item
const
upstream
=
element
(
by
.
id
(
"
amont
"
));
// should be displayed in error
expect
(
await
upstream
.
getAttribute
(
'
class
'
)).
toContain
(
"
node-error
"
);
});
it
(
"
add basin, invalid data in Q input
"
,
async
()
=>
{
// start page
await
navBar
.
clickNewCalculatorButton
();
await
browser
.
sleep
(
200
);
// open prébarrages calculator
await
listPage
.
clickMenuEntryForCalcType
(
30
);
await
browser
.
sleep
(
200
);
// "add basin" button
const
addBasinBtn
=
element
(
by
.
id
(
"
add-basin
"
));
await
addBasinBtn
.
click
();
await
browser
.
sleep
(
200
);
// upstream item
const
upstream
=
element
(
by
.
id
(
"
amont
"
));
await
upstream
.
click
();
await
browser
.
sleep
(
200
);
// invalid data in Q input
const
inputQ
=
element
(
by
.
id
(
"
Q
"
));
await
inputQ
.
clear
();
await
browser
.
sleep
(
200
);
await
inputQ
.
sendKeys
(
"
-1
"
);
await
browser
.
sleep
(
200
);
// calculate button disabled ?
calcPage
.
checkCalcButtonEnabled
(
false
);
// upstream item displayed in error ?
expect
(
await
upstream
.
getAttribute
(
'
class
'
)).
toContain
(
"
node-error
"
);
// valid data in Q input
await
inputQ
.
clear
();
await
browser
.
sleep
(
200
);
await
inputQ
.
sendKeys
(
"
1
"
);
await
browser
.
sleep
(
200
);
// calculate button still disabled ? (the basin is not connected to anything)
calcPage
.
checkCalcButtonEnabled
(
false
);
// upstream item displayed not in error ?
expect
(
await
upstream
.
getAttribute
(
'
class
'
)).
not
.
toContain
(
"
node-error
"
);
});
});
});
This diff is collapsed.
Click to expand it.
e2e/calculator.po.ts
+
7
−
0
View file @
170981ea
...
...
@@ -221,6 +221,13 @@ export class CalculatorPage {
return
await
cloneButton
.
click
();
}
// check that "compute" button is in given enabled/disabled state
checkCalcButtonEnabled
(
enabled
:
boolean
)
{
const
calcButton
=
this
.
getCalculateButton
();
expect
(
calcButton
.
isEnabled
()).
toBe
(
enabled
);
return
calcButton
;
}
async
changeSelectValue
(
elt
:
ElementFinder
,
index
:
number
)
{
await
elt
.
click
();
const
optionId
=
"
.cdk-overlay-container mat-option:nth-of-type(
"
+
(
index
+
1
)
+
"
)
"
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment