Функция щелчка в backstopjs не работает при попытке войти с помощью backstopjs - PullRequest
0 голосов
/ 27 ноября 2018

Я пытаюсь войти в систему, чтобы перейти на следующую страницу для визуального тестирования в backstopjs.По какой-то причине я не могу выполнить функцию щелчка, так как backstopjs не определяет мою команду щелчка.Ниже приведен фрагмент backstop.json для соответствующего действия { "label": "Faethm Dashboard", "cookiePath": "backstop_data/engine_scripts/cookies.json", "url": "https://xxxxxx.com.au/dickyco", "keyPressSelectors": [ { "selector": "#email", "keyPress": "Xxxxxxxxx@gmsil.com" }, { "selector": "#password", "keyPress": "abcd!" }, { "selector":".ant-btn sc-kEYyzF hTZeXz", "keyPress":"click()" }

В моем терминале появляется следующая ошибка

    Puppeteer encountered an error while running scenario "Faethm Dashboard"
TimeoutError: waiting for selector "body.root " failed: timeout 30000ms exceeded
      COMMAND | Executing core for "report"
      compare | Reference image not found Test_Faethm_Dashboard_0__0_appleMacPro.png
      compare | OK: Faethm Homepage Test_Faethm_Homepage_0_document_0_appleMacPro.png
       report | Test completed...
       report | 1 Passed
       report | 1 Failed
       report | Writing browser report
       report | Resources copied
       report | Copied configuration to: /Users/faethm/Desktop/VisualTest/backstopjs-example/backstop_data/html_report/config.js
      COMMAND | Executing core for "openReport"
   openReport | Attempting to ping 
   openReport | Remote not found. Opening backstop_data/html_report/index.html
       report | *** Mismatch errors found ***
      COMMAND | Command "report" ended with an error after [0.112s]
      COMMAND | Error: Mismatch errors found.
                    at /Users/faethm/Desktop/VisualTest/backstopjs-example/node_modules/backstopjs/core/command/report.js:116:17
                    at process._tickCallback (internal/process/next_tick.js:68:7)
      COMMAND | Command "test" ended with an error after [34.755s]
      COMMAND | Error: Mismatch errors found.
                    at /Users/faethm/Desktop/VisualTest/backstopjs-example/node_modules/backstopjs/core/command/report.js:116:17
                    at process._tickCallback (internal/process/next_tick.js:68:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! backstopjs-example@1.0.0 test:visual: `rm -rf backstop_data/bitmaps_test && backstop test`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the backstopjs-example@1.0.0 test:visual script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/faethm/.npm/_logs/2018-11-27T00_46_49_521Z-debug.log

1 Ответ

0 голосов
/ 22 января 2019

Попробуйте удалить свой клик из раздела «keyPressSelectors» и использовать встроенное свойство clickSelector после.

«clickSelector»: «.ant-btn sc-kEYyzF hTZeXz»

...