I ran this command
$ docker run --rm -it -v ${PWD}/:/tests testcafe/testcafe:latest 'chromium:headless --no-sandbox' '/tests/**/*'
and i get this error:
ERROR Cannot prepare tests due to an error.
TypeError: Cannot read property 'Date' of undefined
at /merchant-tests/node_modules/moment-duration-format/test/vendor/qunit.js:22:16
at Object.<anonymous> (/merchant-tests/node_modules/moment-duration-format/test/vendor/qunit.js:11:2)
I'm not sure if that is because i used a date function in the test
import { t } from 'testcafe';
import BasePage from '../base-page';
export default class Contract extends BasePage {
async ContractDetails() {
const currentDate = new Date().getDay() + '/' + new Date().getMonth() + '/' + new Date().getFullYear();
await t
.click(await this.SelectDropDown('Contract Type'))
.click(await this.SelectDropDownValue('Payconiq'))
.typeText(await this.GetTextInputField('contractStartDate'), currentDate)
.typeText(await this.GetTextInputField('contractSignDate'), currentDate)
.click(await this.SelectDropDown('Reseller'))
.click(await this.SelectDropDownValue('KBC'))
await t
.expect((await this.GetSaveNextButton()).nth(5).hasAttribute('disabled')).notOk()
.click((await this.GetSaveNextButton()).nth(5));
const consoleError = await this.GetConsoleError();
await t.expect(consoleError).eql(0, 'Number is expected instead of: ' + consoleError);
}
}