Adds an end-to-end test for the Admin UI using Playwright. This test uses the Admin UI to create the necessary resources to connect to a target. The test then uses the CLI to start a session and checks in the Admin UI that a session is created
34 lines
822 B
JavaScript
34 lines
822 B
JavaScript
/* eslint-disable no-undef */
|
|
const { execSync } = require('child_process');
|
|
|
|
/**
|
|
* Checks that the boundary cli is available
|
|
*/
|
|
exports.checkBoundaryCli = async () => {
|
|
try {
|
|
execSync('which boundary');
|
|
} catch (e) {
|
|
throw new Error('boundary does not exist on the path');
|
|
}
|
|
};
|
|
|
|
/**
|
|
* Uses the boundary CLI to authenticate to the specified Boundary instance
|
|
*/
|
|
exports.authenticateBoundaryCli = async () => {
|
|
try {
|
|
execSync(
|
|
'boundary authenticate password' +
|
|
' -addr=' +
|
|
process.env.BOUNDARY_ADDR +
|
|
' -auth-method-id=' +
|
|
process.env.E2E_PASSWORD_AUTH_METHOD_ID +
|
|
' -login-name=' +
|
|
process.env.E2E_PASSWORD_ADMIN_LOGIN_NAME +
|
|
' -password=env://E2E_PASSWORD_ADMIN_PASSWORD'
|
|
);
|
|
} catch (e) {
|
|
console.log(`${e.stderr}`);
|
|
}
|
|
};
|