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

v0.24 #11

Merged
merged 64 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
6caa780
If an object is disabled, then the relationships to that object shoul…
gitstart-app[bot] Aug 21, 2024
614a818
Add logging on currentWorkspaceMember query (#6706)
charlesBochet Aug 21, 2024
aa4ae53
[Fix] field does not appear directly after creation (#6708)
ijreilly Aug 21, 2024
612a875
Remove performance logs (#6709)
charlesBochet Aug 21, 2024
7964132
Fix webhook issue (#6711)
charlesBochet Aug 21, 2024
c2cf8b4
Bump version to 0.23.2
charlesBochet Aug 21, 2024
da5dfb7
corrected targetableobject being undefined when clicked on create tas…
ehconitin Aug 21, 2024
663acd5
Trigger workflow run manually (#6696)
thomtrp Aug 21, 2024
be50a62
Check workflow version is valid before publishing (#6702)
thomtrp Aug 21, 2024
da4bd73
Fix logging error in webhook system
charlesBochet Aug 21, 2024
eab202f
Make workspaceMemberId optional in JWT for workspaces that are not AC…
charlesBochet Aug 21, 2024
9898ca3
TWNTY-6135 - Improve Data Importer Select Matching (#6338)
gitstart-app[bot] Aug 22, 2024
579c2eb
6687 change messaging import cron job to run every minute (#6704)
bosiraphael Aug 22, 2024
0a77003
Update workflow version struct (#6716)
thomtrp Aug 22, 2024
1030ff4
Created a specific scroll wrapper context per scroll wrapper and made…
ehconitin Aug 22, 2024
1eeeae8
6686 Add try catch on every cron job, and send exception to exception…
bosiraphael Aug 22, 2024
7ca091f
Add isInactive to FieldMetadata decorator (#6623)
gitstart-app[bot] Aug 22, 2024
6f9aa1e
6654 serverless functions add a deploy button disable deploy when aut…
martmull Aug 23, 2024
4c5fc23
chore: upgrade aws-sdk v2 to v3 (#6643) (#6693)
naineel1209 Aug 23, 2024
981f311
Fix addition of new option in select field if there are no existing o…
ijreilly Aug 23, 2024
ee6180a
[Fix] Prevent fields name conflicts with composite subfields names (#…
ijreilly Aug 23, 2024
f9af25b
Fix sentry issue (#6719)
martmull Aug 23, 2024
5d8162d
Added hotkeyScopes to serverless functions in settings (#6710)
ehconitin Aug 23, 2024
873a4c1
Fix serverless save when name empty (#6720)
martmull Aug 23, 2024
e49acae
Visualize Workflows (#6697)
Devessier Aug 23, 2024
6467da5
Fix table re-renders on update field (#6722)
lucasbordeau Aug 23, 2024
55685d3
Fix currency field edition form (#6723)
gitstart-app[bot] Aug 26, 2024
1d6a1f6
Fix twenty-front performances (#6744)
charlesBochet Aug 26, 2024
c4f0292
Increase front build max memory usage for sourcemaps build
charlesBochet Aug 26, 2024
d622803
[Fix] Move save button to top on field edit (#6739)
ijreilly Aug 26, 2024
b1fbf4b
E2E tests (#6717)
BOHEUS Aug 27, 2024
d61d585
View becomes blank after deleting select (#6703)
gitstart-app[bot] Aug 27, 2024
33e4556
Added sync status on the FE (#6730)
ehconitin Aug 27, 2024
8f9b942
Increase front build max memory usage for sourcemaps build
charlesBochet Aug 27, 2024
ef4f2e4
Fix Website build CD (#6751)
charlesBochet Aug 27, 2024
f6fd92a
[POC] add graphql query runner (#6747)
Weiko Aug 27, 2024
eb49cb2
Fix twenty-front build (#6752)
Weiko Aug 27, 2024
81fa3f0
6256 refactor messaging module to remove all provider specific code a…
bosiraphael Aug 27, 2024
9f69383
Add function execution throttler (#6742)
thomtrp Aug 27, 2024
5ce1e6b
Improve record table scroll look (#6753)
charlesBochet Aug 27, 2024
e771793
6655 remove field direction in message and add it in mcma (#6743)
bosiraphael Aug 27, 2024
e6a55f2
5617 Create CalendarOngoingStaleCron Job (#6748)
bosiraphael Aug 27, 2024
8dd772a
Fix post merge conflicts on messaging services
charlesBochet Aug 27, 2024
374931b
Fix post merge conflicts on messaging services
charlesBochet Aug 27, 2024
da23ca3
Fix message direction seeds (#6760)
bosiraphael Aug 28, 2024
ff1adb0
Add workflow statuses (#6765)
thomtrp Aug 28, 2024
e2eaffc
Added "Add record" button in kanban view column headers dropdown (#6649)
ehconitin Aug 28, 2024
e7bbc7d
Fix participant listeners (#6767)
bosiraphael Aug 28, 2024
5deb0ab
added "reply in gmail" button (#6754)
ehconitin Aug 28, 2024
747a154
fix: defaultHomePagePath to be last visited page or alphatically firs…
Nabhag8848 Aug 28, 2024
0531eb5
Removed drag grip and accent is now tertiary in hidden fields (#6650)
ehconitin Aug 28, 2024
7c894fe
Improve Data Importer Select Matching - Post Merge Updates (#6750)
gitstart-app[bot] Aug 28, 2024
c87ccfa
refactor graphql query runner connection mapper (#6771)
Weiko Aug 28, 2024
7a9a43b
Add composite Emails field and forbid creation of Email field type (#…
gitstart-app[bot] Aug 29, 2024
9a3f29b
fix: relation and record chip height (#6758)
Nabhag8848 Aug 29, 2024
9fafb2c
fix/6759: reduce icon size in note grip menu to 16px and adjust conta…
kant-github Aug 29, 2024
ebfdc6c
Added ability to search objects and fields (#6775)
ehconitin Aug 29, 2024
cd06ae2
chore(*): remove unused code (#6781)
AMoreaux Aug 29, 2024
b05361e
Fixed record table fetch more scroll bug (#6790)
lucasbordeau Aug 29, 2024
0d21ccd
0.24 changelog (#6787)
Bonapara Aug 29, 2024
8982a58
Bump version to 0.24 (#6789)
thomtrp Aug 29, 2024
4070305
Update wording on soft deletes
charlesBochet Aug 29, 2024
f5913f1
v0.24.0
JarWarren Aug 29, 2024
0e9461d
repair yarn.lock
JarWarren Aug 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
27 changes: 27 additions & 0 deletions .github/workflows/playwright.yml.bak
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Playwright Tests
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm install -g yarn && yarn
- name: Install Playwright Browsers
run: yarn playwright install --with-deps
- name: Run Playwright tests
run: yarn test:e2e companies
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ dist
storybook-static
*.tsbuildinfo
.eslintcache
.cache
.nyc_output
test-results/
2 changes: 1 addition & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
},
"start": {
"cache": true,
"dependsOn": ["^typecheck","^build"]
"dependsOn": ["^build"]
},
"lint": {
"executor": "@nx/eslint:lint",
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@
"apollo-server-express": "^3.12.0",
"apollo-upload-client": "^17.0.0",
"archiver": "^7.0.1",
"aws-sdk": "^2.1658.0",
"axios": "^1.6.2",
"bcrypt": "^5.1.1",
"better-sqlite3": "^9.2.2",
Expand Down Expand Up @@ -190,7 +189,6 @@
"tslib": "^2.3.0",
"tsup": "^8.2.4",
"type-fest": "4.10.1",
"typeorm": "patch:[email protected]#./packages/twenty-server/patches/typeorm+0.3.20.patch",
"typescript": "5.3.3",
"use-context-selector": "^2.0.0",
"use-debounce": "^10.0.0",
Expand Down Expand Up @@ -223,6 +221,7 @@
"@nx/storybook": "18.3.3",
"@nx/vite": "18.3.3",
"@nx/web": "18.3.3",
"@playwright/test": "^1.46.0",
"@sentry/types": "^7.109.0",
"@storybook/addon-actions": "^7.6.3",
"@storybook/addon-coverage": "^1.0.0",
Expand Down
22 changes: 21 additions & 1 deletion packages/twenty-e2e-testing/.env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,22 @@
# Note that provide always without trailing forward slash to have expected behaviour
FRONTEND_BASE_URL="http://localhost:3001"
FRONTEND_BASE_URL=http://localhost:3001
CI_DEFAULT_BASE_URL=https://demo.twenty.com
[email protected]
[email protected]
[email protected]
DEFAULT_PASSWORD=Applecar2025
WEBSITE_URL=https://twenty.com

# === DO NOT USE, WORK IN PROGRESS ===
# This URL must have trailing forward slash as all REST API endpoints have object after it
# Documentation for REST API: https://twenty.com/developers/rest-api/core#/
# REST_API_BASE_URL=http://localhost:3000/rest/

# Documentation for GraphQL API: https://twenty.com/developers/graphql/core
# GRAPHQL_BASE_URL=http://localhost:3000/graphql

# Without this key, all API tests will fail, to generate this key
# Log in to Twenty workspace, go to Settings > Developers, generate new key and paste it here
# In order to use it, header Authorization: Bearer token must be used
# This key works for both REST and GraphQL API
# API_DEV_KEY=fill_with_proper_key
15 changes: 10 additions & 5 deletions packages/twenty-e2e-testing/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
node_modules/
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
test-results/
playwright-report/
blob-report/
playwright/.cache/
run_results/
playwright-report/.last-run.json
results/
run_results/.playwright-artifacts-0/
run_results/.playwright-artifacts-1/
.auth/
11 changes: 9 additions & 2 deletions packages/twenty-e2e-testing/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Twenty e2e Testing

## Install
## Prerequisite

Don't forget to install the browsers before launching the tests :
Installing the browsers:

```
yarn playwright install
Expand Down Expand Up @@ -35,3 +35,10 @@ yarn run test:e2e <filename>
```
yarn run test:e2e:debug
```

## Q&A

#### Why there's `path.resolve()` everywhere?
That's thanks to differences in root directory when running tests using commands and using IDE. When running tests with commands,
the root directory is `twenty/packages/twenty-e2e-testing`, for IDE it depends on how someone sets the configuration. This way, it
ensures that no matter which IDE or OS Shell is used, the result will be the same.
33 changes: 33 additions & 0 deletions packages/twenty-e2e-testing/config/customreporter.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import {
Reporter,
FullConfig,
Suite,
TestCase,
TestResult,
FullResult,
} from '@playwright/test/reporter';

class CustomReporter implements Reporter {
constructor(options: { customOption?: string } = {}) {
console.log(
`my-awesome-reporter setup with customOption set to ${options.customOption}`,
);
}

onBegin(config: FullConfig, suite: Suite) {
console.log(`Starting the run with ${suite.allTests().length} tests`);
}

onTestBegin(test: TestCase) {
console.log(`Starting test ${test.title}`);
}

onTestEnd(test: TestCase, result: TestResult) {
console.log(`Finished test ${test.title}: ${result.status}`);
}

onEnd(result: FullResult) {
console.log(`Finished the run: ${result.status}`);
}
}
export default CustomReporter;
13 changes: 13 additions & 0 deletions packages/twenty-e2e-testing/drivers/shell_driver.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { exec } from 'child_process';

export async function sh(cmd) {
return new Promise((resolve, reject) => {
exec(cmd, (err, stdout, stderr) => {
if (err) {
reject(err);
} else {
resolve({ stdout, stderr });
}
});
});
}
14 changes: 0 additions & 14 deletions packages/twenty-e2e-testing/e2e/companies.spec.ts

This file was deleted.

32 changes: 32 additions & 0 deletions packages/twenty-e2e-testing/lib/fixtures/screenshot.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { test as base } from '@playwright/test';
import path from 'path';

const date = new Date();

export const test = base.extend<{ screenshotHook: void }>({
screenshotHook: [
async ({ page, browserName }, use, workerInfo) => {
// here everything is the same as beforeEach()
// goto is to go to website as login setup saves the cookies of logged-in user, not the state of browser
await page.goto('/');
await use(); // here is the code of test
// here everything is the same as afterEach()
// automatic fixture of making screenshot after each test
await page.screenshot({
path: path.resolve(
__dirname,
'..',
'..',
'results',
'screenshots',
`${workerInfo.project.name}`,
browserName,
`${date.toISOString()}.png`,
),
});
},
{ auto: true }, // automatic fixture runs with every test
],
});

export { expect } from '@playwright/test';
86 changes: 64 additions & 22 deletions packages/twenty-e2e-testing/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,43 +1,85 @@
import { defineConfig, devices } from '@playwright/test';

import { config } from 'dotenv';
import path from 'path';

config();

/* === Run your local dev server before starting the tests === */

/**
* See https://playwright.dev/docs/test-configuration.
* See https://playwright.dev/docs/trace-viewer to Collect trace when retrying the failed test
*/
export default defineConfig({
testDir: 'e2e',
/* Run tests in files in parallel */
fullyParallel: true,
reporter: 'html',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
testDir: '.',
outputDir: 'run_results/', // directory for screenshots and videos
snapshotPathTemplate: '{testDir}/__screenshots__/{testFilePath}/{arg}{ext}', // just in case, do not delete it
fullyParallel: true, // false only for specific tests, overwritten in specific projects or global setups of projects
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined, // undefined = amount of projects * amount of tests
timeout: 30 * 1000, // timeout can be changed
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: process.env.FRONTEND_BASE_URL ?? 'http://localhost:3001',
baseURL: process.env.CI
? process.env.CI_DEFAULT_BASE_URL
: (process.env.FRONTEND_BASE_URL ?? 'http://localhost:3001'),
trace: 'retain-on-failure', // trace takes EVERYTHING from page source, records every single step, should be used only when normal debugging won't work
screenshot: 'on', // either 'on' here or in different method in modules, if 'on' all screenshots are overwritten each time the test is run
headless: true, // instead of changing it to false, run 'yarn test:e2e:debug' or 'yarn test:e2e:ui'
testIdAttribute: 'data-testid', // taken from Twenty source
viewport: { width: 1920, height: 1080 }, // most laptops use this resolution
launchOptions: {
slowMo: 500, // time in milliseconds between each step, better to use it than explicitly define timeout in tests
},
},

/* Configure projects for major browsers */
expect: {
timeout: 5000,
},
reporter: [['html', { open: 'never' }]],
projects: [
{
name: 'Login setup',
testMatch: /login\.setup\.ts/, // finds all tests matching this regex, in this case only 1 test should be found
},
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
use: {
...devices['Desktop Chrome'],
storageState: path.resolve(__dirname, '.auth', 'user.json'), // takes saved cookies from directory
},
dependencies: ['Login setup'], // forces to run login setup before running tests from this project - CASE SENSITIVE
},

{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
use: {
...devices['Desktop Firefox'],
storageState: path.resolve(__dirname, '.auth', 'user.json'),
},
dependencies: ['Login setup'],
},

{
name: 'webkit',
use: { ...devices['Desktop Safari'] },
},
//{
// name: 'webkit',
// use: { ...devices['Desktop Safari'] },
//},

{
name: 'Google Chrome',
use: { ...devices['Desktop Chrome'], channel: 'chrome' },
},
/* Test against mobile viewports. */
// {
// name: 'Mobile Chrome',
// use: { ...devices['Pixel 5'] },
// },
// {
// name: 'Mobile Safari',
// use: { ...devices['iPhone 12'] },
// },

/* Test against branded browsers. */
//{
// name: 'Microsoft Edge',
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
//},
//{
// name: 'Google Chrome',
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
//},
],
});
19 changes: 19 additions & 0 deletions packages/twenty-e2e-testing/tests/companies.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { test, expect } from '../lib/fixtures/screenshot';
import { config } from 'dotenv';
import path = require('path');
config({ path: path.resolve(__dirname, '..', '.env') });

test.describe('Basic check', () => {
test('Checking if table in Companies is visible', async ({ page }) => {
await expect(page.getByTestId('tooltip').nth(0)).toHaveText('Companies');
await expect(page.getByTestId('tooltip').nth(0)).toBeVisible();
expect(page.url()).toContain('/companies');
await expect(page.locator('table')).toBeVisible();
await expect(page.locator('tbody > tr')).toHaveCount(13); // shouldn't be hardcoded in case of tests on demo
});

test('', async ({ page }) => {
await page.getByRole('link', { name: 'Opportunities' }).click();
await expect(page.locator('table')).toBeVisible();
});
});
18 changes: 18 additions & 0 deletions packages/twenty-e2e-testing/tests/login.setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { test as setup, expect } from '@playwright/test';
import path from 'path';

setup('Login test', async ({ page }) => {
await page.goto('/');
await page.getByRole('button', { name: 'Continue With Email' }).click();
await page.getByPlaceholder('Email').fill(process.env.DEFAULT_LOGIN);
await page.getByRole('button', { name: 'Continue', exact: true }).click();
await page.getByPlaceholder('Password').fill(process.env.DEFAULT_PASSWORD);
await page.getByRole('button', { name: 'Sign in' }).click();
await expect(page.getByText('Welcome to Twenty')).not.toBeVisible();

// End of authentication steps.

await page.context().storageState({
path: path.resolve(__dirname, '..', '.auth', 'user.json'),
});
});
Loading