i writing tests nightwatchjs , require uname , pword basic authentication.
i aware of ability pass these creds via url.
however on site working on, passing credentials in via url breaks of sites javascript.
does know way of passing creds usual popup box?
the basic idea make 2 get()
requests - first 1 credentials in url log in , second 1 without - @ point you'll logged in.
in nightwatch.js
there setup()
test initialization function can define in separate utils/helpers file , require in each test:
var utils = require("./utils.js"); module.exports = { setup: utils.setup, // rest of test }
where utils.setup
function @ least contain "get" request credentials inside. downside of approach having these require()
calls in every test file have. i'm not familiar nightwatch.js, there better way have global setup/teardown, see:
Comments
Post a Comment