Skip to content

Commit

Permalink
add embed-widget to ci environment
Browse files Browse the repository at this point in the history
  • Loading branch information
ericlln committed Jan 8, 2025
1 parent ce0a9fd commit 5d3167a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"lint:packages": "eslint \"packages/*/src/**/*.{ts,tsx,js,jsx}\"",
"preview": "lerna run --scope=@deephaven/{code-studio,embed-widget} preview --stream",
"preview:app": "lerna run --scope=@deephaven/code-studio preview --stream",
"preview:embed-widget": "lerna run --scope=@deephaven/embed-widget preview --stream",
"prestart": "npm run build:necessary",
"start": "run-p watch:types start:*",
"start:app": "lerna run start --scope=@deephaven/code-studio --stream",
Expand Down
2 changes: 1 addition & 1 deletion packages/embed-widget/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default defineConfig(({ mode }) => {

let port = Number.parseInt(env.PORT, 10);
if (Number.isNaN(port) || port <= 0) {
port = 4030;
port = 4010;
}

const baseURL = new URL(env.BASE_URL, `http://localhost:${port}/`);
Expand Down
24 changes: 16 additions & 8 deletions playwright-ci.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,22 @@ import DefaultConfig from './playwright.config';

const config: PlaywrightTestConfig = {
...DefaultConfig,
webServer: {
// Only start the main code-studio server right now
// To test embed-widget, should have an array set for `webServer` and run them all separately as there's a port check
command: 'BASE_URL=/ide/ npm run preview:app -- -- -- --no-open', // Passing flags through npm is fun
port: 4000,
timeout: 60 * 1000,
reuseExistingServer: false,
},
webServer: [
{
command: 'BASE_URL=/ide/ npm run preview:app -- -- -- --no-open', // Passing flags through npm is fun
port: 4000,
timeout: 60 * 1000,
reuseExistingServer: false,
},
{
command:
'BASE_URL=/iframe/widget/ npm run preview:embed-widget -- -- -- --no-open',
port: 4010,
timeout: 60 * 1000,
reuseExistingServer: false,
},
],

// Applies to the npm command and CI, but CI will get overwritten in the CI config
reporter: [['github'], ['html']],
};
Expand Down
3 changes: 1 addition & 2 deletions tests/shortcuts.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ test('shortcut downloads logs', async ({ page }) => {
});

test('shortcut downloads logs in full screen error', async ({ page }) => {
// Go to embed-widget page without url parameter to trigger a full screen error
await gotoPage(page, 'localhost:4010');
await gotoPage(page, 'localhost:4010/iframe/widget');

const downloadPromise = page.waitForEvent('download');
await page.keyboard.press('ControlOrMeta+Alt+Shift+KeyL');
Expand Down

0 comments on commit 5d3167a

Please sign in to comment.