test: fix e2e testing setup
This commit is contained in:
@@ -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
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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() {
|
||||||
|
|||||||
@@ -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>
|
||||||
Reference in New Issue
Block a user