-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy pathbot-message-and-hear-tests.js
More file actions
60 lines (48 loc) · 2.11 KB
/
bot-message-and-hear-tests.js
File metadata and controls
60 lines (48 loc) · 2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Variables and functions shared by all tests
let common = require('../common/common');
let tm = require('../common/test-messages');
let btm = require('../common/bot-test-messages');
let framework = common.framework;
let testInfo = common.testInfo;
describe('User Created Room to create a Test Bot', () => {
// Add the common setup/tear down logic for initial test space
let userCreatedSpace = require('../common/before-after-user-created-room.js');
userCreatedSpace.registerBeforeAndAfterHooks();
describe('User sends message and bot may respond', () => {
// loop through user message tests..
tm.runUserMessageTests(framework, testInfo, tm.testMessages);
///* botShouldRespond = */true);
});
describe('bot sends messages', () => {
// loop through bot message tests..
btm.runBotMessageTests(framework, testInfo, btm.botTestMessages);
///* shouldFail = */false);
});
describe('Bot Created Rooms Tests', () => {
// Add the common setup/tear down logic for initial test space
let botCreatedSpace = require('../common/before-after-bot-created-room.js');
botCreatedSpace.registerBeforeAndAfterHooks();
describe('Bot adds a user to space who iteracts with bot', () => {
before(() => {
testInfo.config.testName = 'bot adds an allowed user to the room';
return common.botAddUsersToSpace(framework, testInfo,
[common.userPerson.emails[0]]);
});
after(() => {
testInfo.config.testName = 'removes allowed user from the room';
return common.botRemoveUserFromSpace(framework, testInfo, common.userPerson.emails[0],
0, /* numDisallowedUsersInSpace */
false, /* isDisallowedUser */);
});
describe('User sends message and bot may respond', () => {
// loop through user message tests..
tm.runUserMessageTests(framework, testInfo, tm.testMessages);
});
describe('bot sends messages', () => {
// loop through bot message tests..
btm.runBotMessageTests(framework, testInfo, btm.botTestMessages);
///* shouldFail = */false);
});
});
});
});