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

Basic test verifying if demo account is working properly #8442

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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
9 changes: 9 additions & 0 deletions packages/twenty-e2e-testing/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,21 @@ export default defineConfig({
name: 'Login setup',
testMatch: /login\.setup\.ts/, // finds all tests matching this regex, in this case only 1 test should be found
},
{
name: 'Demo check',
use: {
...devices['Desktop Chrome'],
},
testMatch: /demo\/demo_basic\.spec\.ts/,
},
{
name: 'chromium',
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
testMatch: /all\/.+\.spec\.ts/,
},
{
name: 'firefox',
Expand All @@ -55,6 +63,7 @@ export default defineConfig({
storageState: path.resolve(__dirname, '.auth', 'user.json'),
},
dependencies: ['Login setup'],
testMatch: /all\/.+\.spec\.ts/,
},

//{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { test, expect } from '../lib/fixtures/screenshot';
import { test, expect } from '../../lib/fixtures/screenshot';

test.describe('Basic check', () => {
test('Checking if table in Companies is visible', async ({ page }) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { test, expect } from '@playwright/test';
import { sh } from '../drivers/shell_driver';
import { sh } from '../../drivers/shell_driver';

test.describe('', () => {
BOHEUS marked this conversation as resolved.
Show resolved Hide resolved
test('Testing logging', async ({ page }) => {
Expand Down
14 changes: 14 additions & 0 deletions packages/twenty-e2e-testing/tests/demo/demo_basic.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { test, expect } from '../../lib/fixtures/screenshot';

test('Fail if demo account is working properly @demo-only', async ({
BOHEUS marked this conversation as resolved.
Show resolved Hide resolved
page,
}) => {
await page.goto('https://demo.twenty.com/');
await page.getByRole('button', { name: 'Continue With Email' }).click();
await page.getByRole('button', { name: 'Continue', exact: true }).click();
await page.getByRole('button', { name: 'Sign in' }).click();
Comment on lines +7 to +9
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: No input validation or error handling for failed button clicks

await expect(page.getByText('Welcome to Twenty')).not.toBeVisible();
await expect(page.getByText('Server’s on a coffee break')).toBeVisible({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

syntax: Special quote character 's is used instead of standard apostrophe. This may cause issues with string matching.

timeout: 10000,
});
});
Loading