Skip to content

Commit 6c3a880

Browse files
committed
add test for log commands
1 parent 89afffe commit 6c3a880

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

test/e2e/commands/log-e2e-specs.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { buildWdIoOptions } from '../helpers';
2+
import { remote as wdio } from 'webdriverio';
3+
4+
describe('log', function () {
5+
let chai;
6+
/** @type {import('webdriverio').Browser} */
7+
let driver;
8+
9+
before(async function () {
10+
chai = await import('chai');
11+
const chaiAsPromised = await import('chai-as-promised');
12+
13+
chai.should();
14+
chai.use(chaiAsPromised.default);
15+
16+
driver = await wdio(buildWdIoOptions('Root'));
17+
});
18+
19+
after(async function () {
20+
try {
21+
if (driver) {
22+
await driver.deleteSession();
23+
}
24+
} finally {
25+
driver = null;
26+
}
27+
});
28+
29+
it('should get the list of available logs', async function () {
30+
(await driver.getLogTypes()).should.eql(['server']);
31+
});
32+
33+
it('should throw an error when an invalid type is given', async function () {
34+
await driver.getLogs('INVALID_LOG_TYPE').should.rejected;
35+
});
36+
37+
it('should get server logs', async function () {
38+
(await driver.getLogs('server')).should.be.an('array');
39+
});
40+
});

0 commit comments

Comments
 (0)