mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
Fix formatting issues in code blocks
This commit is contained in:
@@ -14,7 +14,7 @@ export interface CategoryProps {
|
||||
onChange: (value: Array<CategoryCheckboxValue>) => void;
|
||||
initialValue?: undefined | Array<CategoryCheckboxValue>;
|
||||
isLastCategory: boolean;
|
||||
dataTestId?: string | undefined;
|
||||
dataTestId?: string | undefined;
|
||||
}
|
||||
|
||||
enum CategoryCheckboxValueState {
|
||||
|
||||
@@ -12,7 +12,6 @@ export interface RadioButton {
|
||||
value: string;
|
||||
sideTitle?: string | undefined;
|
||||
sideDescription?: string | undefined;
|
||||
|
||||
}
|
||||
|
||||
export interface ComponentProps {
|
||||
|
||||
@@ -59,7 +59,7 @@ const TextArea: FunctionComponent<ComponentProps> = (
|
||||
<textarea
|
||||
autoFocus={props.autoFocus}
|
||||
placeholder={props.placeholder}
|
||||
data-testid={props.dataTestId}
|
||||
data-testid={props.dataTestId}
|
||||
className={`${className || ''}`}
|
||||
value={text}
|
||||
onChange={(e: React.ChangeEvent<HTMLTextAreaElement>) => {
|
||||
|
||||
@@ -35,7 +35,7 @@ const Welcome: FunctionComponent<ComponentProps> = (
|
||||
onClick={() => {
|
||||
props.onClickShowProjectModal();
|
||||
}}
|
||||
dataTestId='create-new-project-button'
|
||||
dataTestId="create-new-project-button"
|
||||
/>
|
||||
}
|
||||
/>
|
||||
|
||||
@@ -14,7 +14,9 @@ export const HTTP_PROTOCOL: Protocol =
|
||||
|
||||
export const BASE_URL: URL = URL.fromString(`${HTTP_PROTOCOL}${HOST}`);
|
||||
|
||||
export const IS_USER_REGISTERED: boolean = env('E2E_TEST_IS_USER_REGISTERED') === 'true';
|
||||
export const REGISTERED_USER_EMAIL: string = env('E2E_TEST_REGISTERED_USER_EMAIL') || '';
|
||||
export const REGISTERED_USER_PASSWORD: string = env('E2E_TEST_REGISTERED_USER_PASSWORD') || '';
|
||||
|
||||
export const IS_USER_REGISTERED: boolean =
|
||||
env('E2E_TEST_IS_USER_REGISTERED') === 'true';
|
||||
export const REGISTERED_USER_EMAIL: string =
|
||||
env('E2E_TEST_REGISTERED_USER_EMAIL') || '';
|
||||
export const REGISTERED_USER_PASSWORD: string =
|
||||
env('E2E_TEST_REGISTERED_USER_PASSWORD') || '';
|
||||
|
||||
@@ -1,37 +1,45 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
import { test, expect, Page } from '@playwright/test';
|
||||
import { BASE_URL, IS_USER_REGISTERED } from '../../Config';
|
||||
import Faker from 'Common/Utils/Faker';
|
||||
import URL from 'Common/Types/API/URL';
|
||||
test.describe('Account Registration', () => {
|
||||
test('should register a new account', async ({ page }) => {
|
||||
test('should register a new account', async ({ page }: { page: Page }) => {
|
||||
if (IS_USER_REGISTERED) {
|
||||
// pass this test if user is already registered
|
||||
return;
|
||||
}
|
||||
|
||||
if(IS_USER_REGISTERED) {
|
||||
// pass this test if user is already registered
|
||||
return;
|
||||
}
|
||||
await page.goto(
|
||||
URL.fromString(BASE_URL.toString())
|
||||
.addRoute('/accounts/register')
|
||||
.toString()
|
||||
);
|
||||
await page.getByTestId('email').click();
|
||||
await page.getByTestId('email').fill(Faker.generateEmail().toString());
|
||||
await page.getByTestId('email').press('Tab');
|
||||
await page.getByTestId('name').fill('sample');
|
||||
await page.getByTestId('name').press('Tab');
|
||||
await page.getByTestId('companyName').fill('sample');
|
||||
await page.getByTestId('companyName').press('Tab');
|
||||
await page.getByTestId('companyPhoneNumber').fill('+15853641376');
|
||||
await page.getByTestId('companyPhoneNumber').press('Tab');
|
||||
await page.getByTestId('password').fill('sample');
|
||||
await page.getByTestId('password').press('Tab');
|
||||
await page.getByTestId('confirmPassword').fill('sample');
|
||||
await page.getByTestId('Sign Up').click();
|
||||
|
||||
// wait for navigation with base url
|
||||
await page.waitForURL(
|
||||
URL.fromString(BASE_URL.toString())
|
||||
.addRoute('/dashboard/welcome')
|
||||
.toString()
|
||||
);
|
||||
expect(page.url()).toBe(
|
||||
URL.fromString(BASE_URL.toString())
|
||||
.addRoute('/dashboard/welcome')
|
||||
.toString()
|
||||
);
|
||||
|
||||
await page.goto(URL.fromString(BASE_URL.toString()).addRoute('/accounts/register').toString());
|
||||
await page.getByTestId('email').click();
|
||||
await page.getByTestId('email').fill(Faker.generateEmail().toString());
|
||||
await page.getByTestId('email').press('Tab');
|
||||
await page.getByTestId('name').fill('sample');
|
||||
await page.getByTestId('name').press('Tab');
|
||||
await page.getByTestId('companyName').fill('sample');
|
||||
await page.getByTestId('companyName').press('Tab');
|
||||
await page.getByTestId('companyPhoneNumber').fill('+15853641376');
|
||||
await page.getByTestId('companyPhoneNumber').press('Tab');
|
||||
await page.getByTestId('password').fill('sample');
|
||||
await page.getByTestId('password').press('Tab');
|
||||
await page.getByTestId('confirmPassword').fill('sample');
|
||||
await page.getByTestId('Sign Up').click();
|
||||
|
||||
// wait for navigation with base url
|
||||
await page.waitForURL(URL.fromString(BASE_URL.toString()).addRoute('/dashboard/welcome').toString());
|
||||
expect(page.url()).toBe(URL.fromString(BASE_URL.toString()).addRoute('/dashboard/welcome').toString());
|
||||
|
||||
await page.getByTestId('create-new-project-button').click();
|
||||
|
||||
});
|
||||
|
||||
})
|
||||
await page.getByTestId('create-new-project-button').click();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,25 +1,35 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
import { test, expect, Page } from '@playwright/test';
|
||||
import { BASE_URL } from '../../Config';
|
||||
import URL from 'Common/Types/API/URL';
|
||||
|
||||
|
||||
test.describe('check live and health check of the app', () => {
|
||||
|
||||
test('check if app status is ok', async ({ page }) => {
|
||||
await page.goto(`${URL.fromString(BASE_URL.toString()).addRoute("/status").toString()}`);
|
||||
const content = await page.content();
|
||||
test('check if app status is ok', async ({ page }: { page: Page }) => {
|
||||
await page.goto(
|
||||
`${URL.fromString(BASE_URL.toString())
|
||||
.addRoute('/status')
|
||||
.toString()}`
|
||||
);
|
||||
const content: string = await page.content();
|
||||
expect(content).toContain('{"status":"ok"}');
|
||||
});
|
||||
|
||||
test('check if app is ready', async ({ page }) => {
|
||||
await page.goto(`${URL.fromString(BASE_URL.toString()).addRoute("/status/ready").toString()}`);
|
||||
const content = await page.content();
|
||||
test('check if app is ready', async ({ page }: { page: Page }) => {
|
||||
await page.goto(
|
||||
`${URL.fromString(BASE_URL.toString())
|
||||
.addRoute('/status/ready')
|
||||
.toString()}`
|
||||
);
|
||||
const content: string = await page.content();
|
||||
expect(content).toContain('{"status":"ok"}');
|
||||
});
|
||||
|
||||
test('check if app is live', async ({ page }) => {
|
||||
await page.goto(`${URL.fromString(BASE_URL.toString()).addRoute("/status/live").toString()}`);
|
||||
const content = await page.content();
|
||||
test('check if app is live', async ({ page }: { page: Page }) => {
|
||||
await page.goto(
|
||||
`${URL.fromString(BASE_URL.toString())
|
||||
.addRoute('/status/live')
|
||||
.toString()}`
|
||||
);
|
||||
const content: string = await page.content();
|
||||
expect(content).toContain('{"status":"ok"}');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -20,6 +20,8 @@ test.describe('check if pages loades with its title', () => {
|
||||
.getByRole('link', { name: 'OneUptime', exact: true })
|
||||
.click();
|
||||
|
||||
await expect(page).toHaveURL(URL.fromString(BASE_URL.toString()).toString());
|
||||
await expect(page).toHaveURL(
|
||||
URL.fromString(BASE_URL.toString()).toString()
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -8,6 +8,8 @@ test.beforeEach(async ({ page }: { page: Page }) => {
|
||||
test('sign up button', async ({ page }: { page: Page }) => {
|
||||
await page.getByTestId('Sign-up').click();
|
||||
await expect(page).toHaveURL(
|
||||
URL.fromString(BASE_URL.toString()).addRoute('/accounts/register').toString()
|
||||
URL.fromString(BASE_URL.toString())
|
||||
.addRoute('/accounts/register')
|
||||
.toString()
|
||||
);
|
||||
});
|
||||
|
||||
@@ -1,24 +1,35 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
import { test, expect, Page } from '@playwright/test';
|
||||
import { BASE_URL } from '../../Config';
|
||||
import URL from 'Common/Types/API/URL';
|
||||
|
||||
test.describe('check live and health check of the app', () => {
|
||||
|
||||
test('check if app status is ok', async ({ page }) => {
|
||||
await page.goto(`${URL.fromString(BASE_URL.toString()).addRoute("/ingestor/status").toString()}`);
|
||||
const content = await page.content();
|
||||
test('check if app status is ok', async ({ page }: { page: Page }) => {
|
||||
await page.goto(
|
||||
`${URL.fromString(BASE_URL.toString())
|
||||
.addRoute('/ingestor/status')
|
||||
.toString()}`
|
||||
);
|
||||
const content: string = await page.content();
|
||||
expect(content).toContain('{"status":"ok"}');
|
||||
});
|
||||
|
||||
test('check if app is ready', async ({ page }) => {
|
||||
await page.goto(`${URL.fromString(BASE_URL.toString()).addRoute("/ingestor/status/ready").toString()}`);
|
||||
const content = await page.content();
|
||||
test('check if app is ready', async ({ page }: { page: Page }) => {
|
||||
await page.goto(
|
||||
`${URL.fromString(BASE_URL.toString())
|
||||
.addRoute('/ingestor/status/ready')
|
||||
.toString()}`
|
||||
);
|
||||
const content: string = await page.content();
|
||||
expect(content).toContain('{"status":"ok"}');
|
||||
});
|
||||
|
||||
test('check if app is live', async ({ page }) => {
|
||||
await page.goto(`${URL.fromString(BASE_URL.toString()).addRoute("/ingestor/status/live").toString()}`);
|
||||
const content = await page.content();
|
||||
test('check if app is live', async ({ page }: { page: Page }) => {
|
||||
await page.goto(
|
||||
`${URL.fromString(BASE_URL.toString())
|
||||
.addRoute('/ingestor/status/live')
|
||||
.toString()}`
|
||||
);
|
||||
const content: string = await page.content();
|
||||
expect(content).toContain('{"status":"ok"}');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -19,6 +19,12 @@ spec:
|
||||
image: {{ printf "%s/%s/%s:%s" $.Values.image.registry $.Values.image.repository "e2e" $.Values.image.tag }}
|
||||
env:
|
||||
{{- include "oneuptime.env.common" . | nindent 14 }}
|
||||
- name: E2E_TEST_IS_USER_REGISTERED
|
||||
value: {{ $.Values.cronJobs.e2e.isUserRegistered }}
|
||||
- name: E2E_TEST_REGISERED_USER_EMAIL
|
||||
value: {{ $.Values.cronJobs.e2e.registeredUserEmail }}
|
||||
- name: E2E_TEST_REGISERED_USER_PASSWORD
|
||||
value: {{ $.Values.cronJobs.e2e.registeredUserPassword }}
|
||||
restartPolicy: Never
|
||||
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user