Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
profwebfrontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
s87777
profwebfrontend
Commits
3f109bc9
Commit
3f109bc9
authored
1 year ago
by
s87777
Browse files
Options
Downloads
Patches
Plain Diff
Mocha Test funktionieren
parent
82bb8a51
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/test/UserManagment.spec.js
+12
-11
12 additions, 11 deletions
src/test/UserManagment.spec.js
with
12 additions
and
11 deletions
src/test/UserManagment.spec.js
+
12
−
11
View file @
3f109bc9
const
{
Builder
,
By
,
until
}
=
require
(
"
selenium-webdriver
"
);
const
assert
=
require
(
"
assert
"
);
const
{
after
}
=
require
(
"
node:test
"
);
//const { createUser } = require("../backend/userapi");
describe
(
"
User Managment Test
"
,
function
()
{
...
...
@@ -38,11 +39,11 @@ describe("User Managment Test", function () {
await
driver
.
quit
();
});
/*
after(async function (){
await createUser("Flo", "flo@some-host.de","12abcAB!", false);
});
*/
//
after(async function (){
//
await createUser("Flo", "flo@some-host.de","12abcAB!", false);
//
});
it
(
"
listing all users and admins
"
,
async
function
(){
const
userJohn
=
await
driver
.
findElement
(
By
.
className
(
"
user-John
"
)).
isDisplayed
();
assert
.
strictEqual
(
userJohn
,
true
,
"
Der User John wurde nicht gefunden.
"
);
...
...
@@ -122,15 +123,15 @@ describe("User Managment Test", function () {
});
it
(
"
delete user
"
,
async
function
(){
await
driver
.
findElement
(
By
.
className
(
"
deleteButton-
Flo
"
)).
click
();
await
driver
.
findElement
(
By
.
className
(
"
deleteButton-
Max
"
)).
click
();
await
driver
.
sleep
(
500
);
// Überprüfen das "
Flo
" nicht mehr in der Benutzerliste vorhanden ist
const
is
Flo
Deleted
=
await
driver
.
findElement
(
By
.
className
(
"
user-
Flo
"
)).
isDisplayed
().
then
(
// Überprüfen das "
Max
" nicht mehr in der Benutzerliste vorhanden ist
const
is
Max
Deleted
=
await
driver
.
findElement
(
By
.
className
(
"
user-
Max
"
)).
isDisplayed
().
then
(
()
=>
false
,
(
error
)
=>
error
.
toString
().
includes
(
"
no such element
"
),
);
assert
.
strictEqual
(
is
Flo
Deleted
,
true
,
"
Der Benutzer '
Flo
' wurde nicht gelöscht.
"
);
assert
.
strictEqual
(
is
Max
Deleted
,
true
,
"
Der Benutzer '
Max
' wurde nicht gelöscht.
"
);
});
it
(
"
login with new account
"
,
async
function
(){
...
...
@@ -182,8 +183,8 @@ describe("User Managment Test", function () {
const
isDialogOpen
=
await
driver
.
findElement
(
By
.
className
(
"
addUserDialog
"
)).
isDisplayed
();
assert
.
strictEqual
(
isDialogOpen
,
true
,
"
Der Dialog wurde nicht geöffnet.
"
);
await
driver
.
findElement
(
By
.
className
(
"
inputUsername
"
)).
sendKeys
(
"
Max
"
);
await
driver
.
findElement
(
By
.
className
(
"
inputEmail
"
)).
sendKeys
(
"
max
@some-host.de
"
);
await
driver
.
findElement
(
By
.
className
(
"
inputUsername
"
)).
sendKeys
(
"
Tim
"
);
await
driver
.
findElement
(
By
.
className
(
"
inputEmail
"
)).
sendKeys
(
"
tim
@some-host.de
"
);
await
driver
.
findElement
(
By
.
className
(
"
inputPassword
"
)).
sendKeys
(
""
);
await
driver
.
findElement
(
By
.
className
(
"
addButton
"
)).
click
();
...
...
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