diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index 47812f385..4ccdb9ab5 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -26,19 +26,21 @@ jobs: - name: Setup Node and pnpm uses: silverhand-io/actions-node-pnpm-run-steps@v2 - - name: Build - run: pnpm -r build - - - name: Package + - name: Build and package if: matrix.env != 'cloud' - run: ./.scripts/package.sh + run: | + pnpm -r build + ./.scripts/package.sh - - name: Package + - name: Build and package (Cloud) if: matrix.env == 'cloud' - run: ./.scripts/package.sh + run: | + pnpm -r build + ./.scripts/package.sh env: IS_CLOUD: 1 CONSOLE_PUBLIC_URL: / + ADMIN_ENDPOINT: http://localhost:3002 - uses: actions/upload-artifact@v3 with: diff --git a/packages/integration-tests/package.json b/packages/integration-tests/package.json index 48caf600a..de2d1da1c 100644 --- a/packages/integration-tests/package.json +++ b/packages/integration-tests/package.json @@ -13,9 +13,9 @@ "build": "rm -rf lib/ && tsc -p tsconfig.test.json --sourcemap", "test:only": "NODE_OPTIONS=--experimental-vm-modules jest", "test": "pnpm build && pnpm test:api && pnpm test:ui", - "test:api": "pnpm test:only -i ./lib/tests/api", - "test:ui": "pnpm test:only -i --config=jest.config.ui.js ./lib/tests/ui", - "test:ui-cloud": "pnpm test:only -i --config=jest.config.ui.js ./lib/tests/ui-cloud", + "test:api": "pnpm test:only -i ./lib/tests/api/", + "test:ui": "pnpm test:only -i --config=jest.config.ui.js ./lib/tests/ui/", + "test:ui-cloud": "pnpm test:only -i --config=jest.config.ui.js ./lib/tests/ui-cloud/", "lint": "eslint --ext .ts src", "lint:report": "pnpm lint --format json --output-file report.json", "start": "pnpm test" diff --git a/packages/integration-tests/src/tests/ui-cloud/smoke.test.ts b/packages/integration-tests/src/tests/ui-cloud/smoke.test.ts index 135ee9ff5..b71712c29 100644 --- a/packages/integration-tests/src/tests/ui-cloud/smoke.test.ts +++ b/packages/integration-tests/src/tests/ui-cloud/smoke.test.ts @@ -1,3 +1,5 @@ +import path from 'path'; + import { logtoCloudUrl, logtoConsoleUrl } from '#src/constants.js'; import { generatePassword } from '#src/utils.js'; @@ -8,7 +10,7 @@ import { generatePassword } from '#src/utils.js'; describe('smoke testing for cloud', () => { const consoleUsername = 'admin'; const consolePassword = generatePassword(); - const adminTenantUrl = logtoConsoleUrl; // In dev mode, the console URL is actually for admin tenant + const adminTenantUrl = new URL(logtoConsoleUrl); // In dev mode, the console URL is actually for admin tenant it('opens with app element and navigates to sign-in page', async () => { const navigation = page.waitForNavigation({ waitUntil: 'networkidle0' }); @@ -16,6 +18,8 @@ describe('smoke testing for cloud', () => { await navigation; await expect(page.waitForSelector('#app')).resolves.not.toBeNull(); - expect(page.url()).toBe(adminTenantUrl); + expect(page.url()).toBe( + new URL(path.join(adminTenantUrl.pathname, '/register'), adminTenantUrl).toString() + ); }); });