-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
afca8ac
commit 5a04fc3
Showing
9 changed files
with
838 additions
and
2,774 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,4 +29,5 @@ companion.txt | |
/route-d.json | ||
/service.json | ||
/zips | ||
outsideplugins.scala | ||
outsideplugins.scala | ||
playwright-report |
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,3 +1,7 @@ | ||
node_modules | ||
.DS_Store | ||
stats.json | ||
/test-results/ | ||
/playwright-report/ | ||
/blob-report/ | ||
/playwright/.cache/ |
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { defineConfig, devices } from '@playwright/test'; | ||
|
||
export default defineConfig({ | ||
testDir: './tests', | ||
fullyParallel: true, | ||
timeout: 12000, | ||
forbidOnly: !!process.env.CI, | ||
retries: process.env.CI ? 2 : 0, | ||
workers: process.env.CI ? 1 : undefined, | ||
reporter: 'html', | ||
use: { | ||
/* Base URL to use in actions like `await page.goto('/')`. */ | ||
baseURL: 'http://otoroshi.oto.tools:9999', | ||
trace: 'on-first-retry', | ||
}, | ||
projects: [ | ||
{ | ||
name: 'setup', | ||
testMatch: /.*\.setup\.js/ | ||
}, | ||
{ | ||
name: 'chromium', | ||
use: { | ||
...devices['Desktop Chrome'], | ||
// Use prepared auth state. | ||
storageState: 'playwright/.auth/user.json', | ||
}, | ||
dependencies: ['setup'] | ||
}, | ||
|
||
{ | ||
name: 'firefox', | ||
use: { | ||
...devices['Desktop Firefox'], | ||
// Use prepared auth state. | ||
storageState: 'playwright/.auth/user.json', | ||
}, | ||
dependencies: ['setup'] | ||
} | ||
] | ||
}); | ||
|
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"cookies": [ | ||
{ | ||
"name": "otoroshi-session", | ||
"value": "eyJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7ImJvdXNyIjoiTnRuN3U0ZzVkT0lMQ3V0T0dZN0xiQmVZZnhZMG1MeDQ5dUNMUGFjS3ZKdFRpVmF3OXpEdDU1cUxMU2g0Y255MiJ9LCJleHAiOjE3MzQzNjA2MjAsIm5iZiI6MTczNDEwMTQyMCwiaWF0IjoxNzM0MTAxNDIwfQ.zNLQdWjxCpAconS36kmiOKdJ9pP4E3X8fQawctv5Nog", | ||
"domain": ".oto.tools", | ||
"path": "/", | ||
"expires": 1734360620.163286, | ||
"httpOnly": true, | ||
"secure": false, | ||
"sameSite": "Lax" | ||
} | ||
], | ||
"origins": [] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"cookies": [ | ||
{ | ||
"name": "otoroshi-session", | ||
"value": "eyJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7ImJvdXNyIjoiZ0ZrTHVTNFhFVG1ldndZVk1PVThxZHFleUtqTTF1WGpGUkdDVDJUQ3BpeVpVS0EwRkE0YWlDVUNzN0FZV3A2cyJ9LCJleHAiOjE3MzQzNjM3NjgsIm5iZiI6MTczNDEwNDU2OCwiaWF0IjoxNzM0MTA0NTY4fQ.jQiIwMJwvcBKR5M6bK1UZV-DSPktvvk0ibPgYTOg2So", | ||
"domain": ".oto.tools", | ||
"path": "/", | ||
"expires": 1734363768.209069, | ||
"httpOnly": true, | ||
"secure": false, | ||
"sameSite": "Lax" | ||
} | ||
], | ||
"origins": [] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { test as setup, expect } from '@playwright/test'; | ||
import path from 'path'; | ||
|
||
const authFile = path.join(__dirname, '../playwright/.auth/user.json'); | ||
|
||
setup('authenticate', async ({ page }) => { | ||
// Perform authentication steps. Replace these actions with your own. | ||
await page.goto('/'); | ||
await page.getByRole('button', { name: 'Login', exact: true }).click(); | ||
await page.locator('input[name="email"]').click(); | ||
await page.locator('input[name="email"]').fill('[email protected]'); | ||
await page.locator('input[name="email"]').press('Tab'); | ||
await page.locator('input[name="password"]').fill('password'); | ||
await page.getByRole('button', { name: 'Login' }).click(); | ||
|
||
await page.waitForURL('/bo/dashboard'); | ||
|
||
await expect(page.locator('#content-scroll-container img')).toBeVisible(); | ||
|
||
await page.context().storageState({ path: authFile }); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
const { test, expect } = require('@playwright/test'); | ||
|
||
const SECTIONS = { | ||
MANAGE_RESOURCES: 'Manage resources', | ||
CONFIGURATION: 'Configuration', | ||
ANALYTICS: 'Analytics', | ||
NETWORKING: 'Networking', | ||
SESSIONS: 'Sessions', | ||
TOOLING: 'Tooling', | ||
} | ||
|
||
async function showTableOfEntity(page, section, tab, expected) { | ||
await page.goto('/'); | ||
|
||
await page.getByText(section).click(); | ||
await page | ||
.locator(`div[title^="${tab}"]`).click(); | ||
|
||
await expect(page.locator('#content-scroll-container')).toContainText(expected ? expected : tab); | ||
} | ||
|
||
test('Show Routes', async ({ page }) => showTableOfEntity(page, SECTIONS.MANAGE_RESOURCES, 'Routes')); | ||
test('Show Services', async ({ page }) => showTableOfEntity(page, SECTIONS.MANAGE_RESOURCES, 'Services')); | ||
test('Show Admins', async ({ page }) => showTableOfEntity(page, SECTIONS.MANAGE_RESOURCES, 'Administrator', 'All administrators')); | ||
test('Show Data Exporters', async ({ page }) => showTableOfEntity(page, SECTIONS.MANAGE_RESOURCES, 'Data exporters')); | ||
test('Show Apikeys', async ({ page }) => showTableOfEntity(page, SECTIONS.MANAGE_RESOURCES, 'Apikeys')); | ||
test('Show Auth. modules', async ({ page }) => showTableOfEntity(page, SECTIONS.MANAGE_RESOURCES, 'Auth. modules', 'Authentication modules')); | ||
test('Show Backends', async ({ page }) => showTableOfEntity(page, SECTIONS.MANAGE_RESOURCES, 'Backends')); | ||
test('Show Drafts', async ({ page }) => showTableOfEntity(page, SECTIONS.MANAGE_RESOURCES, 'Drafts')); | ||
test('Show Error Templates', async ({ page }) => showTableOfEntity(page, SECTIONS.MANAGE_RESOURCES, 'Error Templates', 'Error templates')); | ||
test('Show JWT verifiers', async ({ page }) => showTableOfEntity(page, SECTIONS.MANAGE_RESOURCES, 'JWT verifiers', 'Jwt verifiers')); | ||
test('Show Service Groups', async ({ page }) => showTableOfEntity(page, SECTIONS.MANAGE_RESOURCES, 'Service groups', 'Groups')); | ||
test('Show TCP Services', async ({ page }) => showTableOfEntity(page, SECTIONS.MANAGE_RESOURCES, 'TCP services', 'Tcp services')); | ||
test('Show Teams', async ({ page }) => showTableOfEntity(page, SECTIONS.MANAGE_RESOURCES, 'Teams')); | ||
test('Show Wasm Plugins', async ({ page }) => showTableOfEntity(page, SECTIONS.MANAGE_RESOURCES, 'Wasm Plugins', 'Wasm plugins')); | ||
|
||
test('Show Cluster members', async ({ page }) => showTableOfEntity(page, SECTIONS.NETWORKING, 'Cluster members')); | ||
test('Show Connected tunnels', async ({ page }) => showTableOfEntity(page, SECTIONS.NETWORKING, 'Connected tunnels')); | ||
test('Show Eureka servers', async ({ page }) => showTableOfEntity(page, SECTIONS.NETWORKING, 'Eureka servers')); | ||
|
||
test('Show Resources loader', async ({ page }) => showTableOfEntity(page, SECTIONS.TOOLING, 'Resources loader')); | ||
|
||
test('Show Danger zone', async ({ page }) => showTableOfEntity(page, SECTIONS.CONFIGURATION, 'Danger zone')); | ||
|
||
test('Show Alerts log', async ({ page }) => showTableOfEntity(page, SECTIONS.ANALYTICS, 'Alerts log')); | ||
test('Show Analytics', async ({ page }) => showTableOfEntity(page, SECTIONS.ANALYTICS, 'Analytics')); | ||
test('Show Audit log', async ({ page }) => showTableOfEntity(page, SECTIONS.ANALYTICS, 'Audit log')); | ||
test('Show Events log', async ({ page }) => showTableOfEntity(page, SECTIONS.ANALYTICS, 'Events log')); | ||
test('Show Global Status', async ({ page }) => showTableOfEntity(page, SECTIONS.ANALYTICS, 'Global Status', 'Global status')); | ||
|
Oops, something went wrong.