mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 08:42:13 +02:00
Compare commits
99 Commits
monitoring
...
6.0.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b4e1404828 | ||
|
|
48edfd9812 | ||
|
|
e494fabd48 | ||
|
|
dec65d701a | ||
|
|
ed8f9ea839 | ||
|
|
e3421a72df | ||
|
|
6868fc299e | ||
|
|
4362923ff6 | ||
|
|
e25995c617 | ||
|
|
72ebe62b86 | ||
|
|
ce32efd51d | ||
|
|
0c1425f430 | ||
|
|
27f38db033 | ||
|
|
9059fa530e | ||
|
|
7f32989720 | ||
|
|
527026d7b4 | ||
|
|
34101de6d0 | ||
|
|
5d82d7d619 | ||
|
|
1f7b124594 | ||
|
|
6d5d9416f8 | ||
|
|
d0d2162a51 | ||
|
|
69d93e4330 | ||
|
|
0cb2a98047 | ||
|
|
5fc4fa60ed | ||
|
|
24c30f884e | ||
|
|
4f823062c5 | ||
|
|
95f324fa80 | ||
|
|
6cab95c41b | ||
|
|
46bbc2cf96 | ||
|
|
b354cd0f25 | ||
|
|
173d2c7cde | ||
|
|
cf795c1633 | ||
|
|
ab31200f45 | ||
|
|
d5d4da389f | ||
|
|
b288dbb694 | ||
|
|
ccdc3f92dd | ||
|
|
af3a6b2f3f | ||
|
|
99da78d7db | ||
|
|
254bae0956 | ||
|
|
2c1f094acd | ||
|
|
49563e9cbe | ||
|
|
bf506e23d7 | ||
|
|
f9645979c2 | ||
|
|
cf2ff65de5 | ||
|
|
6a248478d2 | ||
|
|
bc593b18e0 | ||
|
|
6182d84d57 | ||
|
|
87ee6674c7 | ||
|
|
78f2b0b4c5 | ||
|
|
70bcc80b5e | ||
|
|
8bffd8a9b7 | ||
|
|
0e6a365046 | ||
|
|
ad70f1e09d | ||
|
|
4ff2b5a2da | ||
|
|
39801c9c0d | ||
|
|
75bb276349 | ||
|
|
72ca3ac51e | ||
|
|
d1decf9143 | ||
|
|
ddaea04182 | ||
|
|
d0ca7d9067 | ||
|
|
837de39cf7 | ||
|
|
4fb07bfa83 | ||
|
|
b292c61341 | ||
|
|
46cf642b8f | ||
|
|
9e1fa1e008 | ||
|
|
1631836e29 | ||
|
|
c1b2e1ef83 | ||
|
|
0806fbe36e | ||
|
|
1ba205b4d6 | ||
|
|
3381931fed | ||
|
|
57e3a50e41 | ||
|
|
4238dbd651 | ||
|
|
3beb60362d | ||
|
|
856f46cfce | ||
|
|
4de9193e28 | ||
|
|
bf0f2d2f79 | ||
|
|
f0483c9df6 | ||
|
|
fa524ed2e1 | ||
|
|
9e272ff85b | ||
|
|
7b3249155e | ||
|
|
fe655b0e3a | ||
|
|
9e987fd899 | ||
|
|
f428ae12aa | ||
|
|
7d75f9eed2 | ||
|
|
5cd0fc9853 | ||
|
|
73c1eb2b78 | ||
|
|
ddda137c12 | ||
|
|
0d44b0ca13 | ||
|
|
001a4b153b | ||
|
|
4556a7e322 | ||
|
|
bf7707b2a9 | ||
|
|
a834045b00 | ||
|
|
155af6e9a8 | ||
|
|
59ae6d7e56 | ||
|
|
d4c3e287a6 | ||
|
|
3c5e169b58 | ||
|
|
f4000b1dd3 | ||
|
|
89fd950af9 | ||
|
|
4fca7fc0ee |
29
.github/workflows/playwright.yml
vendored
Normal file
29
.github/workflows/playwright.yml
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
name: Playwright Tests
|
||||
on:
|
||||
push:
|
||||
branches: [ main, master ]
|
||||
pull_request:
|
||||
branches: [ main, master ]
|
||||
jobs:
|
||||
test:
|
||||
timeout-minutes: 60
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
BASE_URL: https://test.oneuptime.com
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: Install Playwright Browsers
|
||||
run: npx playwright install --with-deps
|
||||
- name: Run Playwright tests
|
||||
run: cd Playwright && npm install && npx playwright install && npx playwright test
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: always()
|
||||
with:
|
||||
name: playwright-report
|
||||
path: playwright-report/
|
||||
retention-days: 30
|
||||
298
Common/Tests/Types/Billing/SubscriptionPlan.test.ts
Normal file
298
Common/Tests/Types/Billing/SubscriptionPlan.test.ts
Normal file
@@ -0,0 +1,298 @@
|
||||
import SubscriptionPlan, {
|
||||
PlanSelect,
|
||||
} from '../../../Types/Billing/SubscriptionPlan';
|
||||
import { JSONObject } from '../../../Types/JSON';
|
||||
import BadDataException from '../../../Types/Exception/BadDataException';
|
||||
|
||||
describe('SubscriptionPlan', () => {
|
||||
const monthlyPlanId: string = 'monthly_plan_id';
|
||||
const yearlyPlanId: string = 'yearly_plan_id';
|
||||
const name: string = 'Test Plan';
|
||||
const monthlySubscriptionAmountInUSD: number = 0;
|
||||
const yearlySubscriptionAmountInUSD: number = 0;
|
||||
const order: number = 1;
|
||||
const trialPeriodInDays: number = 30;
|
||||
const env: JSONObject = {
|
||||
SUBSCRIPTION_PLAN_1: 'Free,monthly_plan_id,yearly_plan_id,0,0,1,7',
|
||||
SUBSCRIPTION_PLAN_2:
|
||||
'Growth,growth_monthly_plan_id,growth_yearly_plan_id,9,99,2,14',
|
||||
};
|
||||
|
||||
describe('constructor', () => {
|
||||
it('should create a new SubscriptionPlan object', () => {
|
||||
const plan: SubscriptionPlan = new SubscriptionPlan(
|
||||
monthlyPlanId,
|
||||
yearlyPlanId,
|
||||
name,
|
||||
monthlySubscriptionAmountInUSD,
|
||||
yearlySubscriptionAmountInUSD,
|
||||
order,
|
||||
trialPeriodInDays
|
||||
);
|
||||
expect(plan.getMonthlyPlanId()).toEqual(monthlyPlanId);
|
||||
expect(plan.getYearlyPlanId()).toEqual(yearlyPlanId);
|
||||
expect(plan.getName()).toEqual(name);
|
||||
expect(plan.getPlanOrder()).toEqual(order);
|
||||
expect(plan.getTrialPeriod()).toEqual(trialPeriodInDays);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getMonthlyPlanId', () => {
|
||||
it('should return the monthly plan ID', () => {
|
||||
const getMonthlyPlanId: string = 'monthly_plan_id';
|
||||
expect(getMonthlyPlanId).toEqual(monthlyPlanId);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getYearlyPlanId', () => {
|
||||
it('should return the yearly plan ID', () => {
|
||||
const getYearlyPlanId: string = 'yearly_plan_id';
|
||||
expect(getYearlyPlanId).toEqual(yearlyPlanId);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getPlanOrder', () => {
|
||||
it('should return the plan order', () => {
|
||||
const getPlanOrder: number = 1;
|
||||
expect(getPlanOrder).toEqual(order);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getTrialPeriod', () => {
|
||||
it('should return the trial period in days', () => {
|
||||
const getTrialPeriod: number = 30;
|
||||
expect(getTrialPeriod).toEqual(trialPeriodInDays);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getName', () => {
|
||||
it('should return the plan name', () => {
|
||||
const getName: string = 'Test Plan';
|
||||
expect(getName).toEqual(name);
|
||||
});
|
||||
});
|
||||
|
||||
describe('isFreePlan', () => {
|
||||
it('should return true if plan is free with monthlyId', () => {
|
||||
const isFreePlan: boolean = SubscriptionPlan.isFreePlan(
|
||||
'monthly_plan_id',
|
||||
env
|
||||
);
|
||||
expect(isFreePlan).toBe(true);
|
||||
});
|
||||
it('should return true if plan is free with yearlyId', () => {
|
||||
const isFreePlan: boolean = SubscriptionPlan.isFreePlan(
|
||||
'yearly_plan_id',
|
||||
env
|
||||
);
|
||||
expect(isFreePlan).toBe(true);
|
||||
});
|
||||
});
|
||||
describe('isCustomPricingPlan', () => {
|
||||
it('should return false if plan is not custom pricing', () => {
|
||||
const isCustomPricingPlan: boolean =
|
||||
SubscriptionPlan.isCustomPricingPlan(monthlyPlanId, env);
|
||||
expect(isCustomPricingPlan).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getSubscriptionPlans', () => {
|
||||
it('should return an array of SubscriptionPlan objects', () => {
|
||||
const subscriptionPlans: SubscriptionPlan[] =
|
||||
SubscriptionPlan.getSubscriptionPlans(env);
|
||||
|
||||
expect(subscriptionPlans.length).toBe(2);
|
||||
expect(subscriptionPlans?.[0]?.getName()).toBe('Free');
|
||||
expect(subscriptionPlans?.[0]?.getYearlyPlanId()).toBe(
|
||||
'yearly_plan_id'
|
||||
);
|
||||
});
|
||||
});
|
||||
describe('isValidPlanId', () => {
|
||||
it('should return true if plan ID is valid', () => {
|
||||
const isValidPlanId: boolean = SubscriptionPlan.isValidPlanId(
|
||||
'growth_monthly_plan_id',
|
||||
env
|
||||
);
|
||||
expect(isValidPlanId).toBe(true);
|
||||
});
|
||||
});
|
||||
describe('getPlanSelect', () => {
|
||||
it('should return the plan name if valid planId is passed', () => {
|
||||
new SubscriptionPlan(
|
||||
monthlyPlanId,
|
||||
'yearly_plan_id',
|
||||
PlanSelect.Free,
|
||||
0,
|
||||
0,
|
||||
2,
|
||||
30
|
||||
);
|
||||
const result: PlanSelect = SubscriptionPlan.getPlanSelect(
|
||||
monthlyPlanId,
|
||||
env
|
||||
);
|
||||
expect(result).toBe(PlanSelect.Free);
|
||||
});
|
||||
it('should throw an error if invalid PlanId is passed', () => {
|
||||
SubscriptionPlan.getSubscriptionPlanById = jest
|
||||
.fn()
|
||||
.mockReturnValue(undefined);
|
||||
expect(() => {
|
||||
SubscriptionPlan.getPlanSelect('invalid-plan-id', env);
|
||||
}).toThrow(BadDataException);
|
||||
});
|
||||
});
|
||||
describe('getYearlySubscriptionAmountInUSD', () => {
|
||||
it('should return the yearly subscription amount', () => {
|
||||
const getYearlySubscriptionAmountInUSD: number = 0;
|
||||
expect(getYearlySubscriptionAmountInUSD).toEqual(
|
||||
yearlySubscriptionAmountInUSD
|
||||
);
|
||||
});
|
||||
});
|
||||
describe('getMonthlySubscriptionAmountInUSD', () => {
|
||||
it('should return the yearly subscription amount', () => {
|
||||
const getMonthlySubscriptionAmountInUSD: number = 0;
|
||||
expect(getMonthlySubscriptionAmountInUSD).toEqual(
|
||||
monthlySubscriptionAmountInUSD
|
||||
);
|
||||
});
|
||||
});
|
||||
describe('isFeatureAccessibleOnCurrentPlan', () => {
|
||||
it('should return false if the feature is not accessible on current plan', () => {
|
||||
const env: JSONObject = {
|
||||
SUBSCRIPTION_PLAN_1:
|
||||
'Free,monthly_plan_id,yearly_plan_id,0,0,1,7',
|
||||
SUBSCRIPTION_PLAN_2:
|
||||
'Growth,growth_monthly_plan_id,growth_yearly_plan_id,9,99,2,14',
|
||||
};
|
||||
const featureSubscriptionPlan: SubscriptionPlan =
|
||||
new SubscriptionPlan(
|
||||
'growth_monthly_plan_id',
|
||||
'growth_yearly_plan_id',
|
||||
PlanSelect.Growth,
|
||||
9,
|
||||
99,
|
||||
2,
|
||||
14
|
||||
);
|
||||
const currentSubscriptionPlan: SubscriptionPlan =
|
||||
new SubscriptionPlan(
|
||||
'monthly_plan_id',
|
||||
'yearly_plan_id',
|
||||
PlanSelect.Free,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
7
|
||||
);
|
||||
const result: boolean =
|
||||
SubscriptionPlan.isFeatureAccessibleOnCurrentPlan(
|
||||
PlanSelect.Growth,
|
||||
PlanSelect.Free,
|
||||
env
|
||||
);
|
||||
expect(featureSubscriptionPlan.getPlanOrder()).toBeGreaterThan(
|
||||
currentSubscriptionPlan.getPlanOrder()
|
||||
);
|
||||
expect(result).toBe(false);
|
||||
});
|
||||
it('should return true if the feature is on the current plan', () => {
|
||||
const env: JSONObject = {
|
||||
SUBSCRIPTION_PLAN_1:
|
||||
'Free,monthly_plan_id,yearly_plan_id,0,0,3,7',
|
||||
SUBSCRIPTION_PLAN_2:
|
||||
'Growth,growth_monthly_plan_id,growth_yearly_plan_id,9,99,2,14',
|
||||
};
|
||||
const featureSubscriptionPlan: SubscriptionPlan =
|
||||
new SubscriptionPlan(
|
||||
'growth_monthly_plan_id',
|
||||
'growth_yearly_plan_id',
|
||||
PlanSelect.Growth,
|
||||
9,
|
||||
99,
|
||||
2,
|
||||
14
|
||||
);
|
||||
const currentSubscriptionPlan: SubscriptionPlan =
|
||||
new SubscriptionPlan(
|
||||
monthlyPlanId,
|
||||
'yearly_plan_id',
|
||||
PlanSelect.Free,
|
||||
0,
|
||||
0,
|
||||
3,
|
||||
7
|
||||
);
|
||||
const result: boolean =
|
||||
SubscriptionPlan.isFeatureAccessibleOnCurrentPlan(
|
||||
PlanSelect.Growth,
|
||||
PlanSelect.Free,
|
||||
env
|
||||
);
|
||||
expect(featureSubscriptionPlan.getPlanOrder()).toBeLessThan(
|
||||
currentSubscriptionPlan.getPlanOrder()
|
||||
);
|
||||
expect(result).toBe(true);
|
||||
});
|
||||
});
|
||||
describe('getSubscriptionPlanFromPlanSelect', () => {
|
||||
it('should return the correct SubscriptionPlan when a valid planSelect is provided', () => {
|
||||
const plan: SubscriptionPlan =
|
||||
SubscriptionPlan.getSubscriptionPlanFromPlanSelect(
|
||||
PlanSelect.Growth,
|
||||
env
|
||||
);
|
||||
expect(plan).toEqual(plan);
|
||||
expect(plan.getName()).toEqual(PlanSelect.Growth);
|
||||
});
|
||||
it('should throw a BadDataException when an invalid planSelect is provided', () => {
|
||||
const planSelect: PlanSelect = PlanSelect.Scale;
|
||||
SubscriptionPlan.getSubscriptionPlans = jest
|
||||
.fn()
|
||||
.mockReturnValue([]);
|
||||
expect(() => {
|
||||
SubscriptionPlan.getSubscriptionPlanFromPlanSelect(
|
||||
planSelect,
|
||||
env
|
||||
);
|
||||
}).toThrow(BadDataException);
|
||||
});
|
||||
});
|
||||
describe('isYearlyPlan', () => {
|
||||
it('should return true if yearly plan exists', () => {
|
||||
const planId: string = 'growth_yearly_plan_id';
|
||||
const plan: SubscriptionPlan = new SubscriptionPlan(
|
||||
'monthly-plan-id',
|
||||
planId,
|
||||
'Growth',
|
||||
10,
|
||||
100,
|
||||
2,
|
||||
7
|
||||
);
|
||||
SubscriptionPlan.getSubscriptionPlanById(planId, env);
|
||||
expect(plan?.getYearlyPlanId()).toBe(planId);
|
||||
});
|
||||
});
|
||||
describe('isUnpaid', () => {
|
||||
it('should return true if the subscription status is unpaid', () => {
|
||||
const subscriptionStatus: string =
|
||||
'incomplete' ||
|
||||
'ncomplete_expired' ||
|
||||
'past_due' ||
|
||||
'canceled' ||
|
||||
'unpaid';
|
||||
const result: boolean =
|
||||
SubscriptionPlan.isUnpaid(subscriptionStatus);
|
||||
expect(result).toBe(true);
|
||||
});
|
||||
it('should return false if the subscription status is active', () => {
|
||||
const subscriptionStatus: string = 'active';
|
||||
const result: boolean =
|
||||
SubscriptionPlan.isUnpaid(subscriptionStatus);
|
||||
expect(result).toBe(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
10975
Home/package-lock.json
generated
10975
Home/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -33,9 +33,10 @@
|
||||
<div class="mx-auto max-w-2xl lg:mx-0 lg:max-w-xl lg:flex-shrink-0 lg:pt-8">
|
||||
<div class="mt-24 sm:mt-32 lg:mt-16">
|
||||
<a href="https://github.com/oneuptime/oneuptime" target="_blank" class="inline-flex space-x-6">
|
||||
<span class="rounded-full bg-indigo-600/10 px-3 py-1 text-sm font-semibold leading-6 text-indigo-600 ring-1 ring-inset ring-indigo-600/10">Open Source</span>
|
||||
<span class="rounded-full bg-indigo-600/10 px-3 py-1 text-sm font-semibold leading-6 text-indigo-600 ring-1 ring-inset ring-indigo-600/10"
|
||||
>Open Source</span>
|
||||
<span class="inline-flex items-center space-x-2 text-sm font-medium leading-6 text-gray-600">
|
||||
<span>Star us on GitHub</span>
|
||||
<span title="star-us-on-github">Star us on GitHub</span>
|
||||
<!-- Heroicon name: mini/chevron-right -->
|
||||
<svg class="h-5 w-5 text-gray-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
||||
<path fill-rule="evenodd" d="M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z" clip-rule="evenodd" />
|
||||
|
||||
@@ -241,7 +241,7 @@
|
||||
</nav>
|
||||
<div class="hidden items-center justify-end md:flex md:flex-1 lg:w-0">
|
||||
<a href="/accounts" class="whitespace-nowrap text-base font-medium text-gray-500 hover:text-gray-900">Sign in</a>
|
||||
<a href="/accounts/register" class="ml-8 inline-flex items-center justify-center whitespace-nowrap rounded-md border border-transparent bg-indigo-600 px-4 py-2 text-base font-medium text-white shadow-sm hover:bg-indigo-700 hover:text-white">Sign up</a>
|
||||
<a href="/accounts/register" class="ml-8 inline-flex items-center justify-center whitespace-nowrap rounded-md border border-transparent bg-indigo-600 px-4 py-2 text-base font-medium text-white shadow-sm hover:bg-indigo-700 hover:text-white" data-testid="Sign-up">Sign up</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -315,7 +315,7 @@
|
||||
|
||||
<a href="/enterprise/overview" class="text-base font-medium text-gray-900 hover:text-gray-700">Enterprise</a>
|
||||
|
||||
<a href="/enterprise/demo" class="text-base font-medium text-gray-900 hover:text-gray-700">Request Demo</a>
|
||||
<a href="/enterprise/demo" class="text-base font-medium text-gray-900 hover:text-gray-700" data-testid="Request-demo">Request Demo</a>
|
||||
|
||||
<a href="/support" class="text-base font-medium text-gray-900 hover:text-gray-700">Support</a>
|
||||
</div>
|
||||
|
||||
2910
Playwright/package-lock.json
generated
2910
Playwright/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -3,11 +3,17 @@
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {},
|
||||
"scripts": {
|
||||
"test": "playwright test"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"@playwright/test": "^1.31.2"
|
||||
"@playwright/test": "^1.31.2",
|
||||
"@types/node": "^18.15.13"
|
||||
},
|
||||
"dependencies": {
|
||||
"jest": "^29.5.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ export default defineConfig({
|
||||
testDir: './tests',
|
||||
/* Maximum time one test can run for. */
|
||||
timeout: 30 * 1000,
|
||||
// globalTimeout: 600 * 1000,
|
||||
expect: {
|
||||
/**
|
||||
* Maximum time expect() should wait for the condition to be met.
|
||||
@@ -38,7 +39,7 @@ export default defineConfig({
|
||||
// baseURL: 'http://localhost:3000',
|
||||
|
||||
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
|
||||
trace: 'on-first-retry',
|
||||
trace: 'on',
|
||||
},
|
||||
|
||||
/* Configure projects for major browsers */
|
||||
|
||||
27
Playwright/tests/Home/Landing.spec.ts
Normal file
27
Playwright/tests/Home/Landing.spec.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { test, expect, Page } from '@playwright/test';
|
||||
|
||||
const BASE_URL: string =
|
||||
process.env['BASE_URL' as keyof typeof process.env] ||
|
||||
'https://test.oneuptime.com/';
|
||||
|
||||
test.beforeEach(async ({ page }: { page: Page }) => {
|
||||
await page.goto(BASE_URL);
|
||||
});
|
||||
test.describe('check if pages loades with its title', () => {
|
||||
test('has title', async ({ page }: { page: Page }) => {
|
||||
await expect(page).toHaveTitle(
|
||||
/OneUptime | One Complete SRE and DevOps platform./
|
||||
);
|
||||
});
|
||||
test('oneUptime link navigate to homepage', async ({
|
||||
page,
|
||||
}: {
|
||||
page: Page;
|
||||
}) => {
|
||||
await page
|
||||
.getByRole('link', { name: 'OneUptime', exact: true })
|
||||
.click();
|
||||
|
||||
await expect(page).toHaveURL(/.*test\.oneuptime\.com/);
|
||||
});
|
||||
});
|
||||
60
Playwright/tests/Home/Navigation.spec.ts
Normal file
60
Playwright/tests/Home/Navigation.spec.ts
Normal file
@@ -0,0 +1,60 @@
|
||||
import { test, expect, ElementHandle, Page } from '@playwright/test';
|
||||
const BASE_URL: string =
|
||||
process.env['BASE_URL' as keyof typeof process.env] ||
|
||||
'https://test.oneuptime.com/';
|
||||
|
||||
test.beforeEach(async ({ page }: { page: Page }) => {
|
||||
await page.goto(BASE_URL);
|
||||
});
|
||||
test.describe('navigation bar', () => {
|
||||
test('product page', async ({ page }: { page: Page }) => {
|
||||
await page.getByRole('button', { name: 'Products' }).click();
|
||||
await page.getByRole('button', { name: 'Products' }).hover();
|
||||
await expect(page.getByRole('button', { name: 'Products' })).toHaveText(
|
||||
/Products/
|
||||
);
|
||||
await expect(
|
||||
page.getByRole('button', { name: 'Products' })
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
page.getByRole('button', { name: 'Products' })
|
||||
).toBeInViewport();
|
||||
});
|
||||
test('pricing page', async ({ page }: { page: Page }) => {
|
||||
await page.getByRole('link', { name: 'Pricing' }).click();
|
||||
await page.getByRole('link', { name: 'Pricing' }).hover();
|
||||
await expect(page.getByRole('link', { name: 'Pricing' })).toHaveText(
|
||||
/Pricing/
|
||||
);
|
||||
await expect(page.getByRole('link', { name: 'Pricing' })).toBeVisible();
|
||||
await expect(
|
||||
page.getByRole('link', { name: 'Pricing' })
|
||||
).toBeInViewport();
|
||||
await expect(page).toHaveURL(/.*pricing/);
|
||||
});
|
||||
test('Enterprise', async ({ page }: { page: Page }) => {
|
||||
await page.getByRole('link', { name: 'Enterprise' }).click();
|
||||
await page.getByRole('link', { name: 'Enterprise' }).hover();
|
||||
await expect(
|
||||
page.getByRole('link', { name: 'Enterprise' })
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
page.getByRole('link', { name: 'Enterprise' })
|
||||
).toBeInViewport();
|
||||
await expect(page.getByRole('link', { name: 'Enterprise' })).toHaveText(
|
||||
/Enterprise/
|
||||
);
|
||||
await expect(page).toHaveURL(/.*enterprise\/overview/);
|
||||
});
|
||||
test('Request Demo', async ({ page }: { page: Page }) => {
|
||||
const requestDemo: ElementHandle<Element> | null = await page.$(
|
||||
"[data-testid='Request-demo']"
|
||||
);
|
||||
|
||||
if (requestDemo) {
|
||||
await requestDemo.click();
|
||||
await requestDemo.hover();
|
||||
await expect(page).toHaveURL(/.*enterprise\/demo/);
|
||||
}
|
||||
});
|
||||
});
|
||||
13
Playwright/tests/Home/SignIn.spec.ts
Normal file
13
Playwright/tests/Home/SignIn.spec.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { test, expect, Page } from '@playwright/test';
|
||||
|
||||
const BASE_URL: string =
|
||||
process.env['BASE_URL' as keyof typeof process.env] ||
|
||||
'https://test.oneuptime.com/';
|
||||
|
||||
test.beforeEach(async ({ page }: { page: Page }) => {
|
||||
await page.goto(BASE_URL);
|
||||
});
|
||||
test('sign in button ', async ({ page }: { page: Page }) => {
|
||||
await page.getByRole('link', { name: 'Sign in' }).click();
|
||||
await expect(page).toHaveURL(/.*accounts/);
|
||||
});
|
||||
18
Playwright/tests/Home/SignUp.spec.ts
Normal file
18
Playwright/tests/Home/SignUp.spec.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { test, expect, ElementHandle, Page } from '@playwright/test';
|
||||
|
||||
const BASE_URL: string =
|
||||
process.env['BASE_URL' as keyof typeof process.env] ||
|
||||
'https://test.oneuptime.com/';
|
||||
|
||||
test.beforeEach(async ({ page }: { page: Page }) => {
|
||||
await page.goto(BASE_URL);
|
||||
});
|
||||
test('sign up button', async ({ page }: { page: Page }) => {
|
||||
const signUpButton: ElementHandle<Element> | null = await page.$(
|
||||
"[data-testid='Sign-up']"
|
||||
);
|
||||
if (signUpButton) {
|
||||
await signUpButton.click();
|
||||
await expect(page).toHaveURL(/.*accounts\/register/);
|
||||
}
|
||||
});
|
||||
32
Probe/package-lock.json
generated
32
Probe/package-lock.json
generated
@@ -4096,9 +4096,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/saml2-js": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/saml2-js/-/saml2-js-4.0.1.tgz",
|
||||
"integrity": "sha512-tVg2LFsIGLhf6d2I/nFdcXz8akQ+JJqiuhudNbaEqK18az3/ueDMu/RC8nr8QDnDmgBMieFqUwSMxgWr9hYErg==",
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/saml2-js/-/saml2-js-4.0.2.tgz",
|
||||
"integrity": "sha512-03EEy/d55+4Ltl6jXAcRY1Fkrcpwt3K6a0T4N4Bfq5IKu9TbJqYG5AoXSi1P4lKvwvxQ99v5RPeoffSsumRrEg==",
|
||||
"dependencies": {
|
||||
"@xmldom/xmldom": "^0.8.6",
|
||||
"async": "^3.2.0",
|
||||
@@ -4106,18 +4106,12 @@
|
||||
"underscore": "^1.8.0",
|
||||
"xml-crypto": "^3.0.1",
|
||||
"xml-encryption": "^3.0.2",
|
||||
"xml2js": "^0.4.0",
|
||||
"xmlbuilder2": "^2.4.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10.x"
|
||||
}
|
||||
},
|
||||
"node_modules/sax": {
|
||||
"version": "1.2.4",
|
||||
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
|
||||
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
|
||||
},
|
||||
"node_modules/semver": {
|
||||
"version": "6.3.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
|
||||
@@ -4705,26 +4699,6 @@
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/xml2js": {
|
||||
"version": "0.4.23",
|
||||
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz",
|
||||
"integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==",
|
||||
"dependencies": {
|
||||
"sax": ">=0.6.0",
|
||||
"xmlbuilder": "~11.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/xmlbuilder": {
|
||||
"version": "11.0.1",
|
||||
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz",
|
||||
"integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==",
|
||||
"engines": {
|
||||
"node": ">=4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/xmlbuilder2": {
|
||||
"version": "2.4.1",
|
||||
"resolved": "https://registry.npmjs.org/xmlbuilder2/-/xmlbuilder2-2.4.1.tgz",
|
||||
|
||||
Reference in New Issue
Block a user