forked from appium/appium-windows-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlog-e2e-specs.js
More file actions
40 lines (32 loc) · 995 Bytes
/
log-e2e-specs.js
File metadata and controls
40 lines (32 loc) · 995 Bytes
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
import { buildWdIoOptions } from '../helpers';
import { remote as wdio } from 'webdriverio';
describe('log', function () {
let chai;
/** @type {import('webdriverio').Browser} */
let driver;
before(async function () {
chai = await import('chai');
const chaiAsPromised = await import('chai-as-promised');
chai.should();
chai.use(chaiAsPromised.default);
driver = await wdio(buildWdIoOptions('Root'));
});
after(async function () {
try {
if (driver) {
await driver.deleteSession();
}
} finally {
driver = null;
}
});
it('should get the list of available logs', async function () {
(await driver.getLogTypes()).should.eql(['server']);
});
it('should throw an error when an invalid type is given', async function () {
await driver.getLogs('INVALID_LOG_TYPE').should.be.rejected;
});
it('should get server logs', async function () {
(await driver.getLogs('server')).should.be.an('array');
});
});