mirror of
https://github.com/logto-io/logto.git
synced 2025-03-10 22:22:45 -05:00
test(ui): init smoke testing (#1771)
* test(ui): init smoke testing * fix(test): logto url env key
This commit is contained in:
parent
a9f99db54e
commit
6a2e604926
20 changed files with 591 additions and 35 deletions
2
.github/workflows/integration-test.yml
vendored
2
.github/workflows/integration-test.yml
vendored
|
@ -112,4 +112,4 @@ jobs:
|
|||
cd /tmp/tests/packages/integration-tests
|
||||
pnpm start
|
||||
env:
|
||||
LOGTO_URL: http://localhost:3001
|
||||
INTEGRATION_TESTS_LOGTO_URL: http://localhost:3001
|
||||
|
|
7
packages/integration-tests/jest.config.ui.ts
Normal file
7
packages/integration-tests/jest.config.ui.ts
Normal file
|
@ -0,0 +1,7 @@
|
|||
import { merge, Config } from '@silverhand/jest-config';
|
||||
|
||||
const config: Config.InitialOptions = merge({
|
||||
preset: 'jest-puppeteer',
|
||||
});
|
||||
|
||||
export default config;
|
|
@ -6,10 +6,12 @@
|
|||
"license": "MPL-2.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"test": "pnpm test:api && pnpm test:ui",
|
||||
"test:api": "jest -i ./tests/api",
|
||||
"test:ui": "jest -i --config=jest.config.ui.ts ./tests/ui",
|
||||
"lint": "eslint --ext .ts src tests",
|
||||
"lint:report": "pnpm lint --format json --output-file report.json",
|
||||
"start": "jest -i"
|
||||
"start": "pnpm test"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jest/types": "^28.1.3",
|
||||
|
@ -21,15 +23,18 @@
|
|||
"@silverhand/jest-config": "1.0.0-rc.3",
|
||||
"@silverhand/ts-config": "1.0.0-rc.2",
|
||||
"@types/jest": "^28.1.6",
|
||||
"@types/jest-environment-puppeteer": "^5.0.2",
|
||||
"@types/node": "^16.0.0",
|
||||
"dotenv": "^16.0.0",
|
||||
"eslint": "^8.21.0",
|
||||
"got": "^11.8.2",
|
||||
"jest": "^28.1.3",
|
||||
"jest-puppeteer": "^6.1.1",
|
||||
"node-fetch": "^2.6.7",
|
||||
"openapi-schema-validator": "^12.0.0",
|
||||
"openapi-types": "^12.0.0",
|
||||
"prettier": "^2.7.1",
|
||||
"puppeteer": "^16.1.0",
|
||||
"text-encoder": "^0.0.4",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "^4.7.4"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { demoAppApplicationId } from '@logto/schemas/lib/seeds';
|
||||
import { getEnv } from '@silverhand/essentials';
|
||||
|
||||
export const logtoUrl = getEnv('LOGTO_URL');
|
||||
export const logtoUrl = getEnv('INTEGRATION_TESTS_LOGTO_URL');
|
||||
|
||||
export const discoveryUrl = `${logtoUrl}/oidc/.well-known/openid-configuration`;
|
||||
|
||||
|
|
8
packages/integration-tests/tests/ui/smoke.test.ts
Normal file
8
packages/integration-tests/tests/ui/smoke.test.ts
Normal file
|
@ -0,0 +1,8 @@
|
|||
import { logtoUrl } from '@/constants';
|
||||
|
||||
describe('smoke testing', () => {
|
||||
it('opens with app element', async () => {
|
||||
await page.goto(new URL('/sign-in', logtoUrl).href);
|
||||
await expect(page.$('#app')).resolves.not.toBeNull();
|
||||
});
|
||||
});
|
598
pnpm-lock.yaml
generated
598
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue