diff --git a/package.json b/package.json index 500dc412d..86cfc5b28 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "build:services": "yarn workspaces foreach -pt --topological-dev --verbose -R --from @standardnotes/services run build", "build:api": "yarn workspaces foreach -pt --topological-dev --verbose -R --from @standardnotes/api run build", "e2e": "lerna run start:test-server --scope=@standardnotes/snjs", + "e2e:test": "yarn dlx mocha-headless-chrome --timeout 1800000 -f http://localhost:9001/mocha/test.html", "reset": "find . -type dir -name node_modules | xargs rm -rf && rm -rf yarn.lock && yarn install", "release:prod": "lerna version --conventional-commits --yes -m \"chore(release): publish\"", "publish:prod": "lerna publish from-git --yes --no-verify-access --loglevel verbose", diff --git a/packages/snjs/mocha/lib/AppContext.js b/packages/snjs/mocha/lib/AppContext.js index 4d4d19ebd..09c452df0 100644 --- a/packages/snjs/mocha/lib/AppContext.js +++ b/packages/snjs/mocha/lib/AppContext.js @@ -693,21 +693,21 @@ export class AppContext { payAmount: 59.0, }) - await Utils.sleep(2) + await Utils.sleep(2, 'Waiting for premium features to be activated') } catch (error) { console.warn( `Mock events service not available. You are probably running a test suite for home server: ${error.message}`, ) - } - try { - await HomeServer.activatePremiumFeatures(this.email, options.subscriptionPlanName, options.expiresAt) + try { + await HomeServer.activatePremiumFeatures(this.email, options.subscriptionPlanName, options.expiresAt) - await Utils.sleep(1, 'Waiting for premium features to be activated') - } catch (error) { - console.warn( - `Home server not available. You are probably running a test suite for self hosted setup: ${error.message}`, - ) + await Utils.sleep(1, 'Waiting for premium features to be activated') + } catch (error) { + console.warn( + `Home server not available. You are probably running a test suite for self hosted setup: ${error.message}`, + ) + } } } }