test: fix e2e testing setup

This commit is contained in:
Mo
2023-01-03 11:00:12 -06:00
parent 76d2d2112b
commit a447fa1ad7
5 changed files with 11 additions and 17 deletions

View File

@@ -178,7 +178,7 @@ Due to mounted volumes, we recommend running the setup as a root user. If you wi
1. Once the server has finished rebooting, log back into the server and start the Standard Notes server process: 1. Once the server has finished rebooting, log back into the server and start the Standard Notes server process:
```shell ```shell
cd standalone cd self-hosted
./server.sh start ./server.sh start
``` ```

View File

@@ -40,16 +40,18 @@ Object.assign(window, SNLibrary);
### E2E Tests ### E2E Tests
To run a stable server environment for E2E tests that is up to date with production, clone the [e2e repository](https://github.com/standardnotes/e2e), then run: To run a stable server environment for E2E tests that is up to date with production, clone the [self-hosted repository](https://github.com/standardnotes/self-hosted), then run:
In self-hosted repo:
``` ```
yarn install --immutable yarn && yarn start
yarn start:local-server
``` ```
Wait for the `All services are up!` message. Wait for the `All services are up!` message.
Once the server infrastructure is ready, and you've built all packages, you can run the test suite in the browser via: Once the server infrastructure is ready, and you've built all packages, you can run the test suite in the browser via:
In app repo:
``` ```
yarn start:server:e2e yarn start:server:e2e
``` ```

View File

@@ -115,15 +115,7 @@ export class SNApiService
public loadHost(): string { public loadHost(): string {
const storedValue = this.storageService.getValue<string | undefined>(StorageKey.ServerHost) const storedValue = this.storageService.getValue<string | undefined>(StorageKey.ServerHost)
this.host = this.host = storedValue || this.host
storedValue ||
this.host ||
((
window as {
_default_sync_server?: string
}
)._default_sync_server as string)
return this.host return this.host
} }

View File

@@ -1,5 +1,7 @@
export const DefaultServerPort = 3123
export function getDefaultHost() { export function getDefaultHost() {
return 'http://localhost:3123' return `http://localhost:${DefaultServerPort}`
} }
export function getDefaultMockedEventServiceUrl() { export function getDefaultMockedEventServiceUrl() {

View File

@@ -17,8 +17,6 @@
const syncServerHostName = urlParams.get('sync_server_host_name') ?? 'syncing-server-proxy'; const syncServerHostName = urlParams.get('sync_server_host_name') ?? 'syncing-server-proxy';
const bail = urlParams.get('bail') === 'false' ? false : true; const bail = urlParams.get('bail') === 'false' ? false : true;
window._default_sync_server = `http://${syncServerHostName}:3123`;
Object.assign(window, SNCrypto); Object.assign(window, SNCrypto);
Object.assign(window, SNLibrary); Object.assign(window, SNLibrary);
@@ -102,4 +100,4 @@
<div id="mocha"></div> <div id="mocha"></div>
</body> </body>
</html> </html>