Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

:feat: (electron) show 'create demo budget' button on all envs #2197

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions packages/desktop-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,15 @@ First start the dev server:
```sh
HTTPS=true yarn start
```

Next, navigate to the root of your project folder, run the standartised docker container, and launch the visual regression tests from within it.

```sh
# Run docker container
docker run --rm --network host -v $(pwd):/work/ -w /work/ -it mcr.microsoft.com/playwright:v1.37.0-jammy /bin/bash
docker run --rm --network host -v $(pwd):/work/ -w /work/ -it mcr.microsoft.com/playwright:v1.40.1-jammy /bin/bash

# If you recieve an error such as "docker: invalid reference format", please instead use the following command:
docker run --rm --network host -v ${pwd}:/work/ -w /work/ -it mcr.microsoft.com/playwright:v1.37.0-jammy /bin/bash
# If you receive an error such as "docker: invalid reference format", please instead use the following command:
docker run --rm --network host -v ${pwd}:/work/ -w /work/ -it mcr.microsoft.com/playwright:v1.40.1-jammy /bin/bash

# Run the VRT tests: important - they MUST be ran against a HTTPS server
E2E_START_URL=https://192.168.0.178:3001 yarn vrt
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-client/e2e/accounts.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ test.describe('Accounts', () => {
configurationPage = new ConfigurationPage(page);

await page.goto('/');
await configurationPage.createTestFile();
await configurationPage.createDemoFile();
});

test.afterAll(async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-client/e2e/budget.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ test.describe('Budget', () => {
configurationPage = new ConfigurationPage(page);

await page.goto('/');
budgetPage = await configurationPage.createTestFile();
budgetPage = await configurationPage.createDemoFile();

// Move mouse to corner of the screen;
// sometimes the mouse hovers on a budget element thus rendering an input box
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-client/e2e/mobile.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ test.describe('Mobile', () => {
height: 600,
});
await page.goto('/');
await configurationPage.createTestFile();
await configurationPage.createDemoFile();
});

test.afterEach(async () => {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions packages/desktop-client/e2e/page-models/configuration-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ export class ConfigurationPage {
this.heading = page.getByRole('heading');
}

async createTestFile() {
await this.page.getByRole('button', { name: 'Create test file' }).click();
async createDemoFile() {
await this.page.getByRole('button', { name: 'Create demo file' }).click();
return new BudgetPage(this.page);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-client/e2e/reports.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test.describe('Reports', () => {
configurationPage = new ConfigurationPage(page);

await page.goto('/');
await configurationPage.createTestFile();
await configurationPage.createDemoFile();
});

test.afterAll(async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-client/e2e/rules.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test.describe('Rules', () => {
configurationPage = new ConfigurationPage(page);

await page.goto('/');
await configurationPage.createTestFile();
await configurationPage.createDemoFile();
});

test.afterAll(async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-client/e2e/schedules.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test.describe('Schedules', () => {
configurationPage = new ConfigurationPage(page);

await page.goto('/');
await configurationPage.createTestFile();
await configurationPage.createDemoFile();
});

test.afterAll(async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-client/e2e/settings.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test.describe('Settings', () => {
configurationPage = new ConfigurationPage(page);

await page.goto('/');
await configurationPage.createTestFile();
await configurationPage.createDemoFile();
});

test.afterAll(async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-client/e2e/transactions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test.describe('Transactions', () => {
configurationPage = new ConfigurationPage(page);

await page.goto('/');
await configurationPage.createTestFile();
await configurationPage.createDemoFile();
});

test.afterAll(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ export function BudgetList() {
onClick={() => onCreate({ testMode: true })}
style={{ marginLeft: 15 }}
>
Create test file
Create demo file
</Button>
)}
</View>
Expand Down
21 changes: 8 additions & 13 deletions packages/desktop-client/src/components/manager/ConfigServer.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import React, { useState, useEffect } from 'react';

import {
isNonProductionEnvironment,
isElectron,
} from 'loot-core/src/shared/environment';
import { isElectron } from 'loot-core/src/shared/environment';

import { useActions } from '../../hooks/useActions';
import { useNavigate } from '../../hooks/useNavigate';
Expand Down Expand Up @@ -197,15 +194,13 @@ export function ConfigServer() {
Don’t use a server
</Button>

{isNonProductionEnvironment() && (
<Button
type="primary"
style={{ marginLeft: 15 }}
onClick={onCreateTestFile}
>
Create test file
</Button>
)}
<Button
type="primary"
style={{ marginLeft: 15 }}
onClick={onCreateTestFile}
>
Create demo file
</Button>
</>
)}
</View>
Expand Down
6 changes: 6 additions & 0 deletions upcoming-release-notes/2197.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Enhancements
authors: [MatissJanis]
---

Show "create demo budget" button on first config screen