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
90d86963
Commit
90d86963
authored
2 years ago
by
François Grand
Browse files
Options
Downloads
Patches
Plain Diff
test(e2e): check calculated parameter remains the same when copying a structure
refs
#567
parent
0c8bf1f8
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
e2e/calculator.po.ts
+22
-0
22 additions, 0 deletions
e2e/calculator.po.ts
e2e/parallel-structures.e2e-spec.ts
+55
-0
55 additions, 0 deletions
e2e/parallel-structures.e2e-spec.ts
with
77 additions
and
0 deletions
e2e/calculator.po.ts
+
22
−
0
View file @
90d86963
...
...
@@ -123,6 +123,28 @@ export class CalculatorPage {
return
await
button
.
isPresent
();
}
/**
* @returns true if "fixed mode" button linked to an input is selected
*/
async
inputIsInFixedMode
(
input
:
ElementFinder
):
Promise
<
boolean
>
{
// get parent (div.container)
const
container
=
await
this
.
findParentContainer
(
input
);
// find fixed radio button
const
button
:
ElementFinder
=
container
.
element
(
by
.
css
(
"
mat-button-toggle.radio_fix
"
));
return
await
button
.
getAttribute
(
"
ng-reflect-checked
"
)
===
"
true
"
;
}
/**
* @returns true if "calculated mode" button linked to an input is selected
*/
async
inputIsInCalculatedMode
(
input
:
ElementFinder
):
Promise
<
boolean
>
{
// get parent (div.container)
const
container
=
await
this
.
findParentContainer
(
input
);
// find calc radio button
const
button
:
ElementFinder
=
container
.
element
(
by
.
css
(
"
mat-button-toggle.radio_cal
"
));
return
await
button
.
getAttribute
(
"
ng-reflect-checked
"
)
===
"
true
"
;
}
async
hasResults
()
{
return
(
await
this
.
presentAndVisible
(
"
fixedvar-results fixed-results > .fixed-results-container
"
)
...
...
This diff is collapsed.
Click to expand it.
e2e/parallel-structures.e2e-spec.ts
0 → 100644
+
55
−
0
View file @
90d86963
import
{
ListPage
}
from
"
./list.po
"
;
import
{
Navbar
}
from
"
./navbar.po
"
;
import
{
browser
,
by
,
element
}
from
"
protractor
"
;
import
{
CalculatorPage
}
from
"
./calculator.po
"
;
import
{
PreferencesPage
}
from
"
./preferences.po
"
;
describe
(
"
Check calculated parameter remains the same when copying a structure
"
,
()
=>
{
let
listPage
:
ListPage
;
let
navBar
:
Navbar
;
let
calcPage
:
CalculatorPage
;
let
prefPage
:
PreferencesPage
;
beforeAll
(
async
()
=>
{
listPage
=
new
ListPage
();
navBar
=
new
Navbar
();
calcPage
=
new
CalculatorPage
();
prefPage
=
new
PreferencesPage
();
});
beforeEach
(
async
()
=>
{
// disable evil option "empty fields on module creation"
await
prefPage
.
navigateTo
();
await
prefPage
.
disableEvilEmptyFields
();
await
browser
.
sleep
(
200
);
});
fit
(
""
,
async
()
=>
{
// open "fish ladder: cross walls" calculator
await
navBar
.
clickNewCalculatorButton
();
await
listPage
.
clickMenuEntryForCalcType
(
10
);
await
browser
.
sleep
(
200
);
// check L in first structure calc toggle is not checked
const
L1
=
calcPage
.
getInputById
(
"
0_L
"
);
// const h11 = calcPage.getInputById("0_h1");
// set L to calculated in first structure
await
calcPage
.
setParamMode
(
L1
,
"
cal
"
);
// check L calc toggle is checked
expect
(
await
calcPage
.
inputIsInCalculatedMode
(
L1
)).
toBe
(
true
);
// copy 1st structure
const
copyStruct
=
calcPage
.
getCopyStructureButton
();
await
copyStruct
.
click
();
// check L in first structure is still in "calc" state
expect
(
await
calcPage
.
inputIsInCalculatedMode
(
L1
)).
toBe
(
true
);
// // check L in second structure is still in "fix" state
const
L2
=
calcPage
.
getInputById
(
"
1_L
"
);
expect
(
await
calcPage
.
inputIsInFixedMode
(
L2
)).
toBe
(
true
);
});
});
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