I keep getting an error when running a basic sample with Nightwatch.js + Testing Library:
[Ecosia Search With TL] Test Suite
==================================
ℹ Connected to localhost on port 9515 (1077ms).
Using: chrome (87.0.4280.66) on Mac OS X platform.
Running: Demo test ecosia.org
matcher.test is not a function
FAILED: 1 errors (935ms)
_________________________________________________
TEST FAILURE: 1 error during execution; 0 tests failed, 0 passed (2.779s)
✖ ecosiaSearchWithTL
– Demo test ecosia.org (935ms)
Error: [object Object]
at processTicksAndRejections (internal/process/task_queues.js:97:5)
npm ERR! Test failed. See above for more details.
This is my only test:
const { getQueriesFrom } = require('@testing-library/nightwatch')
module.exports = {
async beforeEach(browser) {
await browser.url('https://www.ecosia.org/')
},
async 'Demo test ecosia.org'(browser) {
const { getByRole } = getQueriesFrom(browser)
const searchBox = await getByRole('searchbox', { name: /search form/i })
browser.setValue(searchBox, 'nightwatch')
const submit = await getByRole('button', { name: /submit/i })
browser.click(submit)
browser.end()
}
}
My nightwatch.conf.js
:
module.exports = {
src_folders: ['tests'],
webdriver: {
start_process: true,
port: 9515,
server_path: "node_modules/.bin/chromedriver",
},
test_settings: {
default: {
desiredCapabilities : {
browserName: "chrome"
}
}
}
};
Any idea why I keep getting that error? It works flawlessly without Testing Library.