11const path = require ( 'path' )
22const exec = require ( 'child_process' ) . exec
33const { expect } = require ( 'expect' )
4-
4+ const figures = require ( 'figures' )
5+ const debug = require ( 'debug' ) ( 'codeceptjs:test' )
56const runner = path . join ( __dirname , '/../../bin/codecept.js' )
67const codecept_dir = path . join ( __dirname , '/../data/sandbox/configs/pageObjects' )
78const codecept_run = `${ runner } run`
@@ -16,13 +17,14 @@ describe('CodeceptJS PageObject', () => {
1617 it ( 'should fail if page objects was failed' , done => {
1718 exec ( `${ config_run_config ( 'codecept.fail_po.js' ) } --debug` , ( err , stdout ) => {
1819 const lines = stdout . split ( '\n' )
20+ debug ( stdout )
1921 expect ( lines ) . toEqual (
2022 expect . arrayContaining ( [
2123 expect . stringContaining ( 'File notexistfile.js not found in' ) ,
2224 expect . stringContaining ( '-- FAILURES' ) ,
23- expect . stringContaining ( '- I.seeFile("notexistfile.js")') ,
24- expect . stringContaining ( '- I.seeFile("codecept.class.js")') ,
25- expect . stringContaining ( '- I.amInPath(".")') ,
25+ expect . stringContaining ( figures . cross + ' I.seeFile("notexistfile.js")') ,
26+ expect . stringContaining ( figures . tick + ' I.seeFile("codecept.class.js")') ,
27+ expect . stringContaining ( figures . tick + ' I.amInPath(".")') ,
2628 ] ) ,
2729 )
2830 expect ( stdout ) . toContain ( 'FAIL | 0 passed, 1 failed' )
0 commit comments