2018-11-22 04:58:45 +08:00
|
|
|
const Page = require('./page');
|
|
|
|
const Send = require('./chat/send');
|
|
|
|
const Clear = require('./chat/clear');
|
2018-11-23 00:19:29 +08:00
|
|
|
const Copy = require('./chat/copy');
|
2018-11-22 04:58:45 +08:00
|
|
|
|
2018-11-23 00:19:29 +08:00
|
|
|
describe('Chat', () => {
|
2018-11-22 04:58:45 +08:00
|
|
|
|
2018-11-23 00:19:29 +08:00
|
|
|
test('Send message', async () => {
|
2018-11-22 04:58:45 +08:00
|
|
|
const test = new Send();
|
2018-11-23 00:19:29 +08:00
|
|
|
let response;
|
2018-11-22 04:58:45 +08:00
|
|
|
try {
|
|
|
|
await test.init(Page.getArgs());
|
2018-11-23 00:19:29 +08:00
|
|
|
response = await test.test();
|
2018-11-22 04:58:45 +08:00
|
|
|
} catch (e) {
|
|
|
|
console.log(e);
|
2018-11-23 00:19:29 +08:00
|
|
|
} finally {
|
2018-11-22 04:58:45 +08:00
|
|
|
await test.close();
|
|
|
|
}
|
2018-11-23 00:19:29 +08:00
|
|
|
expect(response).toBe(true);
|
2018-11-22 04:58:45 +08:00
|
|
|
});
|
|
|
|
|
2018-11-23 00:19:29 +08:00
|
|
|
test('Clear chat', async () => {
|
2018-11-22 04:58:45 +08:00
|
|
|
const test = new Clear();
|
2018-11-23 00:19:29 +08:00
|
|
|
let response;
|
2018-11-22 04:58:45 +08:00
|
|
|
try {
|
|
|
|
await test.init(Page.getArgs());
|
2018-11-23 00:19:29 +08:00
|
|
|
response = await test.test();
|
|
|
|
} catch (e) {
|
|
|
|
console.log(e);
|
|
|
|
} finally {
|
2018-11-22 04:58:45 +08:00
|
|
|
await test.close();
|
2018-11-23 00:19:29 +08:00
|
|
|
}
|
|
|
|
expect(response).toBe(true);
|
|
|
|
});
|
|
|
|
|
|
|
|
test('Copy chat', async () => {
|
|
|
|
const test = new Copy();
|
|
|
|
let response;
|
|
|
|
try {
|
|
|
|
await test.init(Page.getArgs());
|
|
|
|
response = await test.test();
|
2018-11-22 04:58:45 +08:00
|
|
|
} catch (e) {
|
|
|
|
console.log(e);
|
2018-11-23 00:19:29 +08:00
|
|
|
} finally {
|
2018-11-22 04:58:45 +08:00
|
|
|
await test.close();
|
|
|
|
}
|
2018-11-23 00:19:29 +08:00
|
|
|
expect(response).toBe(true);
|
2018-11-22 04:58:45 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
});
|