Compare commits

..

99 Commits

Author SHA1 Message Date
Simon Larsen
b4e1404828 Merge branch 'master' of github.com-simon:OneUptime/oneuptime 2023-05-15 10:55:00 +01:00
Simon Larsen
48edfd9812 Merge pull request #442 from OneUptime/monitoring
Monitoring
2023-05-14 21:27:37 +01:00
Simon Larsen
e494fabd48 Merge pull request #443 from OneUptime/dependabot/npm_and_yarn/Probe/xml2js--removed
Bump xml2js from 0.4.23 to  in /Probe
2023-05-12 18:57:39 +01:00
dependabot[bot]
dec65d701a Bump xml2js from 0.4.23 to in /Probe
Bumps [xml2js](https://github.com/Leonidas-from-XIV/node-xml2js) from 0.4.23 to .
- [Commits](https://github.com/Leonidas-from-XIV/node-xml2js/commits)

---
updated-dependencies:
- dependency-name: xml2js
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-12 10:59:19 +00:00
Simon Larsen
ed8f9ea839 Merge pull request #389 from munyanezaarmel/home-test
home tests
2023-05-12 11:50:27 +01:00
Simon Larsen
e3421a72df Delete DockerFile 2023-05-12 11:02:43 +01:00
Simon Larsen
6868fc299e Update playwright.yml 2023-05-12 11:01:28 +01:00
Simon Larsen
4362923ff6 Merge pull request #437 from Sillyboi2001/Common/Billing
Test cases for Common/Billing
2023-05-12 11:00:38 +01:00
Silas Okpugie
e25995c617 made some changes 2023-05-10 12:31:01 +01:00
Silas Okpugie
72ebe62b86 Test cases for Common/Billing 2023-05-08 18:40:31 +01:00
Munyaneza Armel
ce32efd51d added dockerfile 2023-05-01 18:38:10 +02:00
Munyaneza Armel
0c1425f430 Update playwright.yml 2023-04-26 16:34:54 +02:00
Munyaneza Armel
27f38db033 fixing errors 2023-04-26 15:52:14 +02:00
Munyaneza Armel
9059fa530e added tests 2023-04-22 14:17:12 +02:00
Munyaneza Armel
7f32989720 added tests 2023-04-22 14:07:01 +02:00
armel
527026d7b4 added tests 2023-04-22 13:54:38 +02:00
armel
34101de6d0 fixed lint 2023-04-20 10:52:00 +02:00
armel
5d82d7d619 fix lint 2023-04-20 10:27:14 +02:00
armel
1f7b124594 fixing errors 2023-04-19 17:08:58 +02:00
armel
6d5d9416f8 fixed workfile 2023-04-19 16:47:08 +02:00
armel
d0d2162a51 fixed env 2023-04-19 16:33:58 +02:00
armel
69d93e4330 fixing env 2023-04-19 16:29:49 +02:00
armel
0cb2a98047 fixing env 2023-04-19 16:29:09 +02:00
armel
5fc4fa60ed fixing env variables 2023-04-19 16:29:09 +02:00
armel
24c30f884e added environment variables 2023-04-19 16:29:07 +02:00
armel
4f823062c5 fixing tests 2023-04-19 16:29:07 +02:00
armel
95f324fa80 fixing tests 2023-04-19 16:29:07 +02:00
armel
6cab95c41b fixing tests 2023-04-19 16:29:06 +02:00
armel
46bbc2cf96 fixing workfile 2023-04-19 16:29:03 +02:00
armel
b354cd0f25 fixing workfile 2023-04-19 16:29:02 +02:00
armel
173d2c7cde fixing workfile 2023-04-19 16:29:02 +02:00
armel
cf795c1633 fixing workfile 2023-04-19 16:29:02 +02:00
armel
ab31200f45 running localhost 2023-04-19 16:29:00 +02:00
armel
d5d4da389f running on localhost 2023-04-19 16:28:59 +02:00
unknown
b288dbb694 fix errors 2023-04-19 16:28:58 +02:00
unknown
ccdc3f92dd fixed errors 2023-04-19 16:28:57 +02:00
unknown
af3a6b2f3f fixed errors 2023-04-19 16:28:57 +02:00
unknown
99da78d7db fixed errors 2023-04-19 16:28:56 +02:00
unknown
254bae0956 fixed errors 2023-04-19 16:28:53 +02:00
unknown
2c1f094acd npm to yarn 2023-04-19 16:28:52 +02:00
unknown
49563e9cbe added test script 2023-04-19 16:28:52 +02:00
unknown
bf506e23d7 added playwright in dev 2023-04-19 16:28:51 +02:00
unknown
f9645979c2 fixed package.json 2023-04-19 16:28:51 +02:00
unknown
cf2ff65de5 added playwright in dev 2023-04-19 16:28:50 +02:00
unknown
6a248478d2 added playwright workflow 2023-04-19 16:28:50 +02:00
unknown
bc593b18e0 home tests 2023-04-19 16:28:49 +02:00
unknown
6182d84d57 home tests 2023-04-19 16:28:49 +02:00
aphilas
87ee6674c7 Clean up tests
- Flatten nested describe calls
- Replace it with test
2023-04-19 16:28:48 +02:00
aphilas
78f2b0b4c5 Delete Common/Types/Role 2023-04-19 16:28:48 +02:00
aphilas
70bcc80b5e Add test Common/Types/JSON 2023-04-19 16:28:48 +02:00
aphilas
8bffd8a9b7 Add test Common/Types/ListData 2023-04-19 16:28:42 +02:00
aphilas
0e6a365046 Add test Common/Types/PositiveNumber 2023-04-19 16:28:41 +02:00
aphilas
ad70f1e09d Add test Common/Types/Role 2023-04-19 16:28:41 +02:00
aphilas
4ff2b5a2da Add test Common/Types/Sleep 2023-04-19 16:28:40 +02:00
aphilas
39801c9c0d Add test Common/Types/Typeof 2023-04-19 16:28:40 +02:00
aphilas
75bb276349 Add test Common/Types/ArrayUtil 2023-04-19 16:28:40 +02:00
Simon Larsen
72ca3ac51e fix lint. 2023-04-19 16:28:40 +02:00
Simon Larsen
d1decf9143 update lock and docker compose 2023-04-19 16:28:40 +02:00
Simon Larsen
ddaea04182 fix preinstall script 2023-04-19 16:28:40 +02:00
Simon Larsen
d0ca7d9067 make scripts docker compatible. 2023-04-19 16:28:39 +02:00
Simon Larsen
837de39cf7 make script support docker 2023-04-19 16:28:39 +02:00
Simon Larsen
4fb07bfa83 Make docker file for OneUptime 2023-04-19 16:28:39 +02:00
Simon Larsen
b292c61341 add notes email 2023-04-19 16:28:39 +02:00
Simon Larsen
46cf642b8f add more email types 2023-04-19 16:28:39 +02:00
Simon Larsen
9e1fa1e008 fix fmt 2023-04-19 16:28:39 +02:00
Simon Larsen
1631836e29 add model columns 2023-04-19 16:28:38 +02:00
Simon Larsen
c1b2e1ef83 fix job name 2023-04-19 16:28:38 +02:00
Simon Larsen
0806fbe36e Update README.md 2023-04-19 16:28:38 +02:00
Simon Larsen
1ba205b4d6 Update README.md 2023-04-19 16:28:37 +02:00
Simon Larsen
3381931fed fix typo 2023-04-19 16:28:37 +02:00
Simon Larsen
57e3a50e41 fix ip type 2023-04-19 16:28:35 +02:00
Simon Larsen
4238dbd651 fix ip tests 2023-04-19 16:28:35 +02:00
Simon Larsen
3beb60362d fix ip address tests 2023-04-19 16:28:35 +02:00
dependabot[bot]
856f46cfce Bump vm2 from 3.9.15 to 3.9.16 in /Workflow
Bumps [vm2](https://github.com/patriksimek/vm2) from 3.9.15 to 3.9.16.
- [Release notes](https://github.com/patriksimek/vm2/releases)
- [Changelog](https://github.com/patriksimek/vm2/blob/master/CHANGELOG.md)
- [Commits](https://github.com/patriksimek/vm2/compare/3.9.15...3.9.16)

---
updated-dependencies:
- dependency-name: vm2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-19 16:28:35 +02:00
dependabot[bot]
4de9193e28 Bump vm2 from 3.9.15 to 3.9.16 in /CommonServer
Bumps [vm2](https://github.com/patriksimek/vm2) from 3.9.15 to 3.9.16.
- [Release notes](https://github.com/patriksimek/vm2/releases)
- [Changelog](https://github.com/patriksimek/vm2/blob/master/CHANGELOG.md)
- [Commits](https://github.com/patriksimek/vm2/compare/3.9.15...3.9.16)

---
updated-dependencies:
- dependency-name: vm2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-19 16:28:35 +02:00
dependabot[bot]
bf0f2d2f79 Bump vm2 from 3.9.15 to 3.9.16 in /Probe
Bumps [vm2](https://github.com/patriksimek/vm2) from 3.9.15 to 3.9.16.
- [Release notes](https://github.com/patriksimek/vm2/releases)
- [Changelog](https://github.com/patriksimek/vm2/blob/master/CHANGELOG.md)
- [Commits](https://github.com/patriksimek/vm2/compare/3.9.15...3.9.16)

---
updated-dependencies:
- dependency-name: vm2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-19 16:28:35 +02:00
Munyaneza Armel
f0483c9df6 Merge branch 'OneUptime:master' into home-test 2023-04-19 15:36:40 +02:00
armel
fa524ed2e1 fixing tests 2023-04-18 18:12:06 +02:00
armel
9e272ff85b fixing tests 2023-04-18 17:47:23 +02:00
armel
7b3249155e fixing tests 2023-04-18 17:31:43 +02:00
armel
fe655b0e3a fixing workfile 2023-04-18 17:23:01 +02:00
armel
9e987fd899 fixing workfile 2023-04-18 17:14:24 +02:00
armel
f428ae12aa fixing workfile 2023-04-18 17:11:47 +02:00
armel
7d75f9eed2 fixing workfile 2023-04-18 17:09:27 +02:00
armel
5cd0fc9853 running localhost 2023-04-18 16:56:27 +02:00
armel
73c1eb2b78 running on localhost 2023-04-18 16:36:24 +02:00
unknown
ddda137c12 fix errors 2023-03-20 14:41:57 +02:00
unknown
0d44b0ca13 fixed errors 2023-03-19 21:24:11 +02:00
unknown
001a4b153b fixed errors 2023-03-19 21:14:55 +02:00
unknown
4556a7e322 fixed errors 2023-03-19 20:52:15 +02:00
unknown
bf7707b2a9 fixed errors 2023-03-19 20:35:02 +02:00
unknown
a834045b00 npm to yarn 2023-03-19 20:17:56 +02:00
unknown
155af6e9a8 added test script 2023-03-19 19:44:32 +02:00
unknown
59ae6d7e56 added playwright in dev 2023-03-19 19:23:50 +02:00
unknown
d4c3e287a6 fixed package.json 2023-03-19 19:16:53 +02:00
unknown
3c5e169b58 added playwright in dev 2023-03-19 19:06:14 +02:00
unknown
f4000b1dd3 added playwright workflow 2023-03-19 18:46:54 +02:00
unknown
89fd950af9 home tests 2023-03-19 18:32:08 +02:00
unknown
4fca7fc0ee home tests 2023-03-19 12:16:37 +02:00
13 changed files with 13992 additions and 392 deletions

29
.github/workflows/playwright.yml vendored Normal file
View 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

View 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

File diff suppressed because it is too large Load Diff

View File

@@ -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" />

View File

@@ -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>

File diff suppressed because it is too large Load Diff

View File

@@ -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"
}
}

View File

@@ -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 */

View 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/);
});
});

View 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/);
}
});
});

View 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/);
});

View 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/);
}
});

View File

@@ -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",