File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change 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+ } ) ;
You can’t perform that action at this time.
0 commit comments