-
Notifications
You must be signed in to change notification settings - Fork 238
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix formatting issues in code blocks
- Loading branch information
Showing
11 changed files
with
103 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"}'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"}'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters