samedi 23 janvier 2021

Error while creating test cases using Testcafe with Vue JS as "listener" argument must be a function

Detailed Code :

`import VueSelector from 'testcafe-vue-selector';`
import {selector} from 'testcafe';

fixture `TODO list test`
.page `http://127.0.0.1:8000/`;

test('Check list item', async t => {
const todoItem    = VueSelector('todo-item');
const todoItemVue = await todoItem.getVue();

await t
    .expect(todoItemVue.props.priority).eql('High')
    .expect(todoItemVue.state.isActive).eql(false)
    .expect(todoItemVue.computed.text).eql('Item 1');
});

Added Below line to Package.jason under script tag:

 "test": "testcafe all tests/test/home.e2e.js --app \"npm run dev\" --app-init-delay 10000 -S -s screenshots"

Executing below commands to terminal

 1. npm run dev

  2. npm run test

Error While executing Test case:

ERROR TypeError: "listener" argument must be a function
at _addListener (events.js:239:11)
at Server.addListener (events.js:297:10)
at new Server (_http_server.js:269:10)
at createServer (http.js:34:10)
at new Proxy (/var/www/html/Re-EventHelp/node_modules/testcafe-hammerhead/lib/proxy/index.js:91:20)
at new TestCafe (/var/www/html/Re-EventHelp/node_modules/testcafe/src/testcafe.js:30:41)
at Object.construct (/var/www/html/Re-EventHelp/node_modules/import-lazy/index.js:19:20)
at Object.createTestCafe [as default] (/var/www/html/Re-EventHelp/node_modules/testcafe/src/index.js:74:22)
at <anonymous>
at process._tickDomainCallback (internal/process/next_tick.js:228:7)

Aucun commentaire:

Enregistrer un commentaire