wswebcreation / webdriver-image-comparison

MIT License
43 stars 35 forks source link

Invalid Chai property: toEqual. Did you mean "equal"? #61

Closed aabdullin closed 4 years ago

aabdullin commented 4 years ago

Environment (please complete the following information):

Config of the automation framework + plugin WDIO, Docker, WDIO Image comparison

Describe the bug The baseline is created. While running test

To Reproduce

        it('Navigate to create new environment', () => {
            leftMenuPageComp.dblClick_mnuEnvs();
            browser.saveFullPageScreen('_EnvScreen', {  });
            expect(browser.checkFullPageScreen('_EnvScreen', {  })).toEqual(0);

            leftSnackMenuPageComp.click_mnuCreateEnv();

[Include code or an example repository that can easily be set up]

Expected behavior Test suppose to pass or show the difference

Log

➜  wdio git:(poc-wdio-image-comparison-service) ✗ make run-chrome suite=smoke.basic.js
docker-compose -f docker/docker-compose.yml exec -T test_env_chrome bash -c "./node_modules/.bin/wdio wdio.conf.chrome.local.js --baseUrl=https://******** --spec smoke.basic.js"

Execution of 1 spec files started at 2020-04-14T01:23:57.999Z

[0-0] RUNNING in chrome - /test/specs/smoke.basic.js
[0-0]  SEE THIS -> Run id: 79037693
[0-0] Error in "Platform - Create user and role full scenario Create env  Navigate to create new env"
Invalid Chai property: toEqual. Did you mean "equal"?
[0-0] Error in "Platform - Create user and role full scenario Create env  Feed in env details and submit"
element ("#envForm_name") still not existing after 90000ms
[0-0] Error in "Platform - Create user and role full scenario Create env  Check env is visible in the list of envs"
element ("//input[@placeholder='Filter ...']") still not clickable after 90000ms
[0-0] FAILED in chrome - /test/specs/smoke.basic.js

 "dot" Reporter:
..FFF

 "spec" Reporter:
------------------------------------------------------------------
[chrome  linux #0-0] Spec: /workspace/test/specs/smoke.basic.js
[chrome  linux #0-0] Running: chrome on linux
[chrome  linux #0-0] Session ID: 4d3b127257bdaf965051b15e715b8976
[chrome  linux #0-0]
[chrome  linux #0-0] Platform - Create user and **** full scenario
[chrome  linux #0-0]     Login
[chrome  linux #0-0]        ✓ Login to *****
[chrome  linux #0-0]
[chrome  linux #0-0]     Create env
[chrome  linux #0-0]        ✓ Top menu go to services section
[chrome  linux #0-0]        ✖ Navigate to create new env
[chrome  linux #0-0]        ✖ Feed in env details and submit
[chrome  linux #0-0]        ✖ Check env is visible in the list of envs
[chrome  linux #0-0]
[chrome  linux #0-0] 2 passing (3m 13.8s)
[chrome  linux #0-0] 3 failing
[chrome  linux #0-0]
[chrome  linux #0-0] 1) Create env  Navigate to create new env
[chrome  linux #0-0] Invalid Chai property: toEqual. Did you mean "equal"?
[chrome  linux #0-0] Error: Invalid Chai property: toEqual. Did you mean "equal"?
[chrome  linux #0-0]     at Object.proxyGetter [as get] (/workspace/node_modules/chai/lib/chai/utils/proxify.js:75:17)
[chrome  linux #0-0]     at Context.<anonymous> (/workspace/test/pages/_test-modules/services.env.module.js:20:68)
[chrome  linux #0-0]

Additional context

wswebcreation commented 4 years ago

@aabdullin

First of all you don't need to write your tests like this

it('Navigate to create new environment', () => {
            leftMenuPageComp.dblClick_mnuEnvs();

            browser.saveFullPageScreen('_EnvScreen', {  });
            expect(browser.checkFullPageScreen('_EnvScreen', {  })).toEqual(0);

            leftSnackMenuPageComp.click_mnuCreateEnv();

The browser.saveFullPageScreen('_EnvScreen', { }); is not needed if you use the browser.checkFullPageScreen('_EnvScreen', { }), check also the docs about that

Last but not least, the chai error is not related to this module, it depends on the testrunner you use. Please check the docs of your testrunner for the appropriate syntax for the expect library