Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OLAT CI-CD Testing Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor 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
Lars Oliver Dam
OLAT CI-CD Testing Project
Commits
117eb955
Commit
117eb955
authored
11 years ago
by
Joël Krähemann
Browse files
Options
Downloads
Patches
Plain Diff
OO-550: implemented checkGroupChat test case.
parent
e020e979
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/test/java/org/olat/instantMessaging/FunctionalInstantMessagingTest.java
+89
-14
89 additions, 14 deletions
...olat/instantMessaging/FunctionalInstantMessagingTest.java
with
89 additions
and
14 deletions
src/test/java/org/olat/instantMessaging/FunctionalInstantMessagingTest.java
+
89
−
14
View file @
117eb955
...
...
@@ -68,6 +68,7 @@ public class FunctionalInstantMessagingTest {
null
,
"Hello world!"
,
"Clear sky."
,
null
,
};
@Deployment
(
testable
=
false
)
...
...
@@ -99,8 +100,7 @@ public class FunctionalInstantMessagingTest {
initialized
=
true
;
}
}
@Ignore
@Test
@RunAsClient
public
void
checkGroupChat
(
@Tutor1
Selenium
tutor0
,
@Student1
Selenium
student0
,
@Student2
Selenium
student1
,
@Student3
Selenium
student2
)
...
...
@@ -136,51 +136,118 @@ public class FunctionalInstantMessagingTest {
/* message #0 */
Dialog
dialog
=
new
Dialog
(
student0
,
group
.
get
(
0
),
GROUP_CHAT_MESSAGE
[
0
]);
Dialog
.
Action
action
=
dialog
.
new
LoginAction
(
user
.
get
(
0
));
dialog
.
getPreProcessor
().
add
(
action
);
action
=
dialog
.
new
OnlineContactsAction
(
0
);
dialog
.
getPreProcessor
().
add
(
action
);
action
=
dialog
.
new
OfflineContactsAction
(
0
);
dialog
.
getPreProcessor
().
add
(
action
);
action
=
dialog
.
new
UsersAction
(
0
);
dialog
.
getPreProcessor
().
add
(
action
);
action
=
dialog
.
new
LogoutAction
();
dialog
.
getPreProcessor
().
add
(
action
);
GROUP_CHAT_DIALOG
.
add
(
dialog
);
/* message #1 */
dialog
=
new
Dialog
(
student1
,
group
.
get
(
0
),
GROUP_CHAT_MESSAGE
[
1
]);
dialog
=
new
Dialog
(
student0
,
group
.
get
(
0
),
GROUP_CHAT_MESSAGE
[
1
]);
action
=
dialog
.
new
ModifySettingsAction
(
tutor0
,
new
FunctionalGroupsSiteUtil
.
MembersConfiguration
[]{
MembersConfiguration
.
CAN_SEE_COACHES
,
});
dialog
.
getPreProcessor
().
add
(
action
);
action
=
dialog
.
new
LoginAction
(
user
.
get
(
0
));
dialog
.
getPreProcessor
().
add
(
action
);
action
=
dialog
.
new
OnlineContactsAction
(
1
);
dialog
.
getPreProcessor
().
add
(
action
);
action
=
dialog
.
new
CheckUserAction
(
tutor
.
get
(
0
).
getFirstName
(),
tutor
.
get
(
0
).
getLastName
());
action
=
dialog
.
new
CheckUserAction
(
tutor
.
get
(
0
).
getFirstName
(),
tutor
.
get
(
0
).
getLastName
(),
true
,
false
);
dialog
.
getPreProcessor
().
add
(
action
);
action
=
dialog
.
new
OfflineContactsAction
(
0
);
dialog
.
getPreProcessor
().
add
(
action
);
action
=
dialog
.
new
LogoutAction
();
dialog
.
getPreProcessor
().
add
(
action
);
GROUP_CHAT_DIALOG
.
add
(
dialog
);
/* message #2 */
dialog
=
new
Dialog
(
student0
,
group
.
get
(
0
),
GROUP_CHAT_MESSAGE
[
2
]);
//TODO:JK implement me
action
=
dialog
.
new
ModifySettingsAction
(
tutor0
,
new
FunctionalGroupsSiteUtil
.
MembersConfiguration
[]{
MembersConfiguration
.
CAN_SEE_COACHES
,
MembersConfiguration
.
CAN_SEE_PARTICIPANTS
,
});
dialog
.
getPreProcessor
().
add
(
action
);
action
=
dialog
.
new
LoginAction
(
user
.
get
(
0
));
dialog
.
getPreProcessor
().
add
(
action
);
action
=
dialog
.
new
OnlineContactsAction
(
1
);
dialog
.
getPreProcessor
().
add
(
action
);
action
=
dialog
.
new
CheckUserAction
(
tutor
.
get
(
0
).
getFirstName
(),
tutor
.
get
(
0
).
getLastName
(),
true
,
false
);
dialog
.
getPreProcessor
().
add
(
action
);
action
=
dialog
.
new
CheckUserAction
(
user
.
get
(
1
).
getFirstName
(),
user
.
get
(
1
).
getLastName
(),
false
,
true
);
dialog
.
getPreProcessor
().
add
(
action
);
action
=
dialog
.
new
CheckUserAction
(
user
.
get
(
2
).
getFirstName
(),
user
.
get
(
2
).
getLastName
(),
false
,
true
);
dialog
.
getPreProcessor
().
add
(
action
);
GROUP_CHAT_DIALOG
.
add
(
dialog
);
/* message #3 */
dialog
=
new
Dialog
(
student0
,
group
.
get
(
0
),
GROUP_CHAT_MESSAGE
[
3
]);
//TODO:JK implement me
dialog
=
new
Dialog
(
student1
,
group
.
get
(
0
),
GROUP_CHAT_MESSAGE
[
3
]);
/* message #4 */
dialog
=
new
Dialog
(
student0
,
group
.
get
(
0
),
GROUP_CHAT_MESSAGE
[
4
]);
action
=
dialog
.
new
OnlineContactsAction
(
0
);
action
=
dialog
.
new
LoginAction
(
user
.
get
(
1
));
dialog
.
getPreProcessor
().
add
(
action
);
action
=
dialog
.
new
OnlineContactsAction
(
2
);
dialog
.
getPreProcessor
().
add
(
action
);
action
=
dialog
.
new
CheckUserAction
(
tutor
.
get
(
0
).
getFirstName
(),
tutor
.
get
(
0
).
getLastName
(),
true
,
false
);
dialog
.
getPreProcessor
().
add
(
action
);
action
=
dialog
.
new
CheckUserAction
(
user
.
get
(
0
).
getFirstName
(),
user
.
get
(
0
).
getLastName
(),
true
,
false
);
dialog
.
getPreProcessor
().
add
(
action
);
action
=
dialog
.
new
VerifyMessageAction
(
new
String
[]{
GROUP_CHAT_MESSAGE
[
3
],
});
dialog
.
getPostProcessor
().
add
(
action
);
GROUP_CHAT_DIALOG
.
add
(
dialog
);
/* message #4 */
dialog
=
new
Dialog
(
student0
,
user
.
get
(
2
),
GROUP_CHAT_MESSAGE
[
4
]);
GROUP_CHAT_DIALOG
.
add
(
dialog
);
//TODO:JK implement me
/* message #5 */
dialog
=
new
Dialog
(
student2
,
group
.
get
(
0
),
GROUP_CHAT_MESSAGE
[
5
]);
action
=
dialog
.
new
LoginAction
(
user
.
get
(
2
));
dialog
.
getPreProcessor
().
add
(
action
);
action
=
dialog
.
new
VerifyMessageAction
(
new
String
[]{
GROUP_CHAT_MESSAGE
[
4
],
});
dialog
.
getPostProcessor
().
add
(
action
);
GROUP_CHAT_DIALOG
.
add
(
dialog
);
/* chat */
/*
* chat - run the dialogs with its pre and post processors
*/
for
(
Dialog
current:
GROUP_CHAT_DIALOG
){
Assert
.
assertTrue
(
current
.
chat
());
}
...
...
@@ -440,17 +507,25 @@ public class FunctionalInstantMessagingTest {
public
class
CheckUserAction
extends
Action
{
private
String
firstname
;
private
String
surname
;
private
boolean
onlineContacts
;
private
boolean
offlineContacts
;
public
CheckUserAction
(
String
firstname
,
String
surname
){
public
CheckUserAction
(
String
firstname
,
String
surname
,
boolean
onlineContacts
,
boolean
offlineContacts
){
this
.
firstname
=
firstname
;
this
.
surname
=
surname
;
this
.
onlineContacts
=
onlineContacts
;
this
.
offlineContacts
=
offlineContacts
;
}
@Override
public
boolean
process
(
Dialog
dialog
)
{
String
name
=
surname
+
", "
+
firstname
;
if
(
ArrayUtils
.
contains
(
functionalInstantMessagingUtil
.
findOnlineContacts
(
browser
).
toArray
(),
name
)){
boolean
isOnline
=
ArrayUtils
.
contains
(
functionalInstantMessagingUtil
.
findOnlineContacts
(
browser
).
toArray
(),
name
);
boolean
isOffline
=
ArrayUtils
.
contains
(
functionalInstantMessagingUtil
.
findOfflineContacts
(
browser
).
toArray
(),
name
);
if
((
onlineContacts
&&
isOnline
)
||
(
offlineContacts
&&
isOffline
)){
return
(
true
);
}
else
{
return
(
false
);
...
...
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