I have a .testcaferc.js
as below
module.exports = {
userVariables: {
stress_test_num_rep: 200,
}
}
and some simple code to test it
import { Selector, t } from 'testcafe';
import { setTimeout } from "timers/promises";
const { userVariables } = require('testcafe');
const num_rep = userVariables.stress_test_run_rep;
I set a breakpoint below this code block, the userVariables
is correct, it’s { stress_test_num_rep: 200, }
but num_rep
is undefined
However, what’s more interesting is if I evaluate userVariables.stress_test_run_rep
several times in debug console (VSCode), it’s value will appear.
I want to get this num_rep
, how could I do it? From the official example this should not be an async method, shouldn’t it?
2
Answers
There’s a spelling mistake. ‘userVariables’ has a ‘stress_test_num_rep’ property, but you try to get the ‘stress_test_run_rep’ property.