Merge pull request #799 from hashicorp/docs-add-temporary-manual-end-to-end-test-procedure

Docs add temporary manual end to end test procedure
This commit is contained in:
Carlos Alcaide Corvo authored and GitHub committed 2021-10-13 14:20:03 -07:00
commit 8aa7cfe5ee
3 files changed
+43 -3

No files matched your search

+16
View File
@@ -156,6 +156,22 @@ We rely on `ember-a11y-testing` to validate accessibility in acceptance tests.
If you write acceptance tests, please ensure at least one validation per
route using `await a11yAudit();`.
### Running end to end Tests
**The end-to-end test suite is supported for Mac, x64 and arm64 (M1) chips.**
*Be aware this is a temporary process that can suffer changes and eventually will be automated.*
This process will explain how to run end to end test in your local environment. The process will assume next:
- You already run the Boundary UI [installation process](https://github.com/hashicorp/boundary-ui#installation).
- You have Boundary installed, see [the installation guide](https://learn.hashicorp.com/tutorials/boundary/getting-started-install?in=boundary/getting-started).
Steps:
- Open a terminal and run `$ boundary dev`.
- Open another terminal and navigate to `$ boundary-ui/ui/desktop` folder.
- Run `$ yarn run e2e` and tests will start run.
- You can check the screenshots the tests take: `desktop/tests/end2end/screenshots`.
### Deploying
TBD
+2 -1
View File
@@ -37,7 +37,8 @@
"pretest": "yarn clean:coverage",
"test": "npm-run-all lint test:*",
"test:ember": "cross-env COVERAGE=true ember exam --random",
"e2e": "npx playwright test --headed",
"e2e": "yarn run build && yarn run e2e:dev",
"e2e:dev": "npx playwright test --headed",
"postinstall": "cd electron-app && yarn install",
"posttest": "ember coverage-merge && yarn clean:coverage"
},
@@ -10,10 +10,33 @@ const generateScreenshotPath = (fileName) => {
return path.join(screenshotPath, fileName).concat(screenshotFormat);
};
// Todo: move this function to a test helpers file so it could be used by other tests.
// Returns the executable path for the Boundary binary the test suite will run.
const returnExecutablePath = (platform, arch) => {
try {
// Just mac
if (platform === 'darwin') {
if (arch === 'x64') {
// Intel chips
return 'electron-app/out/Boundary-darwin-x64/Boundary.app/Contents/MacOS/Boundary';
} else if (arch === 'arm64') {
// M1 chips
return 'electron-app/out/Boundary-darwin-arm64/Boundary.app/Contents/MacOS/Boundary';
} else {
throw new Error('The test suite is not compatible with your arch.');
}
} else {
throw new Error('The test suite is not compatible with your Platform.');
}
} catch (error) {
console.error(error);
}
};
const executablePath = returnExecutablePath(process.platform, process.arch);
test.beforeEach(async () => {
electronApp = await electron.launch({
executablePath:
'electron-app/out/Boundary-darwin-arm64/Boundary.app/Contents/MacOS/Boundary',
executablePath: executablePath,
env: {
NODE_ENV: 'test',
BYPASS_APP_UPDATER: true,