I'm trying to install/use this cypress plugin https://github.com/bjowes/cypress-ntlm-auth for my automation tests so I can login to an application that uses ntlm authenticator, but I cannot use npm install --save-dev cypress-ntlm-auth command cause of corporate security policies. I've downloaded the zip repo release of this plugin and also have cypress installed, but I don't know the exact steps to do this without npm install.
I've tried adding this in the cypress/plugins/index.js file:
const ntlmAuth = require('cypress-ntlm-auth-3.2.5/test/e2e/cypress/plugins/index.ts');
module.exports = (on, config) => {
config = ntlmAuth.initNtlmAuth(config);
return config;
}
and also added this is cypress/support/index.js file:
import "cypress-ntlm-auth-master/src/commands"
but I have the following error while trying to open cypress: Error: Cannot find module 'cypress-ntlm-auth-3.2.5/test/e2e/cypress/plugins/index.ts' (the index.ts file is in the mentioned location)
I think I might be missing some installing/configuration steps. Can someone help?
Assuming you unzipped to node_modules, this is the difference between an npm install (left) and a zip (right).
Try hacking this
rename the unzipped src to dist
add http-mitm-proxy
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case 'uname' in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../../../http-mitm-proxy/bin/mitm-proxy.js" "$@"
ret=$?
else
node "$basedir/../../../http-mitm-proxy/bin/mitm-proxy.js" "$@"
ret=$?
fi
exit $ret
add http-mitm-proxy.cmd
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0\..\..\..\http-mitm-proxy\bin\mitm-proxy.js" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
node "%~dp0\..\..\..\http-mitm-proxy\bin\mitm-proxy.js" %*
)
These two files are also found in /node_modules/.bin with the file names cypress-ntlm and cypress-ntlm.cmd, which may be the critical bit, so copy them there as well.
I think using yarn might help : yarn add cypress-ntlm-auth
Install yarn by : npm install yarn -g