Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
alfa
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Show more breadcrumbs
OZG-Cloud
app
alfa
Commits
f68ae96d
Commit
f68ae96d
authored
6 months ago
by
OZGCloud
Browse files
Options
Downloads
Patches
Plain Diff
E2E improve user init sync
parent
6190f976
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
alfa-client/apps/alfa-e2e/src/e2e/main-tests/init-users.cy.ts
+34
-18
34 additions, 18 deletions
...-client/apps/alfa-e2e/src/e2e/main-tests/init-users.cy.ts
alfa-client/apps/alfa-e2e/src/support/user-util.ts
+5
-0
5 additions, 0 deletions
alfa-client/apps/alfa-e2e/src/support/user-util.ts
with
39 additions
and
18 deletions
alfa-client/apps/alfa-e2e/src/e2e/main-tests/init-users.cy.ts
+
34
−
18
View file @
f68ae96d
...
@@ -5,7 +5,7 @@ import { HeaderE2EComponent } from '../../page-objects/header.po';
...
@@ -5,7 +5,7 @@ import { HeaderE2EComponent } from '../../page-objects/header.po';
import
{
MainPage
,
waitForSpinnerToDisappear
}
from
'
../../page-objects/main.po
'
;
import
{
MainPage
,
waitForSpinnerToDisappear
}
from
'
../../page-objects/main.po
'
;
import
{
login
,
writeUserIdsIntoFile
}
from
'
../../support/cypress-helper
'
;
import
{
login
,
writeUserIdsIntoFile
}
from
'
../../support/cypress-helper
'
;
import
{
exist
}
from
'
../../support/cypress.util
'
;
import
{
exist
}
from
'
../../support/cypress.util
'
;
import
{
DatabaseUser
}
from
'
../../support/user-util
'
;
import
{
areUsersSynced
,
DatabaseUser
}
from
'
../../support/user-util
'
;
registerLocaleData
(
localeDe
,
'
de
'
,
localeDeExtra
);
registerLocaleData
(
localeDe
,
'
de
'
,
localeDeExtra
);
...
@@ -13,26 +13,42 @@ describe('Init users', () => {
...
@@ -13,26 +13,42 @@ describe('Init users', () => {
const
mainPage
:
MainPage
=
new
MainPage
();
const
mainPage
:
MainPage
=
new
MainPage
();
const
header
:
HeaderE2EComponent
=
mainPage
.
getHeader
();
const
header
:
HeaderE2EComponent
=
mainPage
.
getHeader
();
it
(
'
should login and logout all users
'
,
()
=>
{
it
(
'
should login sabine
'
,
()
=>
{
[
syncUser
(
DatabaseUser
.
SABINE
);
DatabaseUser
.
SABINE
,
});
DatabaseUser
.
DOROTHEA
,
DatabaseUser
.
PETER
,
it
(
'
should login dorothea
'
,
()
=>
{
DatabaseUser
.
EMIL
,
syncUser
(
DatabaseUser
.
DOROTHEA
);
DatabaseUser
.
ADELHEIT
,
});
DatabaseUser
.
LUDWIG
,
it
(
'
should login peter
'
,
()
=>
{
DatabaseUser
.
RICHARD
,
syncUser
(
DatabaseUser
.
PETER
);
DatabaseUser
.
ZONK
,
});
].
forEach
(
syncUser
);
it
(
'
should login emil
'
,
()
=>
{
syncUser
(
DatabaseUser
.
EMIL
);
});
it
(
'
should login adelheit
'
,
()
=>
{
syncUser
(
DatabaseUser
.
ADELHEIT
);
});
it
(
'
should login ludwig
'
,
()
=>
{
syncUser
(
DatabaseUser
.
LUDWIG
);
});
it
(
'
should login richard
'
,
()
=>
{
syncUser
(
DatabaseUser
.
RICHARD
);
});
it
(
'
should write user ids to file
'
,
()
=>
{
if
(
!
areUsersSynced
())
{
writeUserIdsIntoFile
();
writeUserIdsIntoFile
();
}
});
});
function
syncUser
(
user
:
DatabaseUser
)
{
function
syncUser
(
user
:
DatabaseUser
)
{
if
(
!
areUsersSynced
())
{
login
(
user
);
login
(
user
);
waitForSpinnerToDisappear
();
waitForSpinnerToDisappear
();
exist
(
header
.
getLogo
());
exist
(
header
.
getLogo
());
header
.
getCurrentUserProfile
().
getUserIconButton
().
click
();
header
.
getCurrentUserProfile
().
getUserIconButton
().
click
();
header
.
getCurrentUserProfile
().
getLogoutButton
().
click
();
header
.
getCurrentUserProfile
().
getLogoutButton
().
click
();
}
}
}
});
});
This diff is collapsed.
Click to expand it.
alfa-client/apps/alfa-e2e/src/support/user-util.ts
+
5
−
0
View file @
f68ae96d
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
* Die sprachspezifischen Genehmigungen und Beschränkungen
* Die sprachspezifischen Genehmigungen und Beschränkungen
* unter der Lizenz sind dem Lizenztext zu entnehmen.
* unter der Lizenz sind dem Lizenztext zu entnehmen.
*/
*/
import
{
isNotEmpty
}
from
'
@alfa-client/tech-shared
'
;
import
{
isEmpty
}
from
'
lodash-es
'
;
import
{
isEmpty
}
from
'
lodash-es
'
;
import
{
UserE2E
}
from
'
../model/user
'
;
import
{
UserE2E
}
from
'
../model/user
'
;
import
{
UsermanagerUserE2E
}
from
'
../model/usermanager
'
;
import
{
UsermanagerUserE2E
}
from
'
../model/usermanager
'
;
...
@@ -51,6 +52,10 @@ export function getUserId(username: Username) {
...
@@ -51,6 +52,10 @@ export function getUserId(username: Username) {
return
userIds
[
username
];
return
userIds
[
username
];
}
}
export
function
areUsersSynced
():
boolean
{
return
isNotEmpty
(
userIds
);
}
export
function
initUsermanagerUsers
()
{
export
function
initUsermanagerUsers
()
{
// initUsermanagerData([
// initUsermanagerData([
// getUserManagerUserSabine(),
// getUserManagerUserSabine(),
...
...
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