Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run the UI tests with the COOP/COEP headers #103

Merged
merged 11 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,12 @@ jobs:
fail-fast: false
matrix:
# try the latest stable and potential pre-releases
jupyterlite_version: ["jupyterlite-core -U", "jupyterlite-core --pre"]
jupyterlite_version: ["jupyterlite-core -U", "jupyterlite-core -U --pre"]
project: ["default", "crossoriginisolated"]
# the latest stable release is not compatible for now
exclude:
- jupyterlite_version: "jupyterlite-core -U"
project: "crossoriginisolated"

steps:
- name: Checkout
Expand Down Expand Up @@ -250,7 +255,7 @@ jobs:
- name: Execute integration tests
working-directory: ui-tests
run: |
jlpm playwright test
jlpm playwright test --project ${{ matrix.project }}

- name: Upload Playwright Test report
if: always()
Expand Down
3 changes: 2 additions & 1 deletion ui-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"scripts": {
"build": "yarn run clean && python build.py",
"clean": "rimraf dist",
"start": "cd dist && python -m http.server -b 127.0.0.1 8000",
"start": "python -m http.server -b 127.0.0.1 8000 --directory dist",
"start:crossoriginisolated": "npx static-handler --cors --coop --coep --corp ./dist",
"start:detached": "yarn run start&",
"test": "playwright test",
"test:debug": "PWDEBUG=1 playwright test",
Expand Down
20 changes: 20 additions & 0 deletions ui-tests/playwright.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,33 @@ module.exports = {
trace: 'on-first-retry',
video: 'retain-on-failure'
},
projects: [
{
name: 'default',
use: {
baseURL: 'http://localhost:8000'
}
},
{
name: 'crossoriginisolated',
use: {
baseURL: 'http://localhost:8080'
}
}
],
retries: 1,
webServer: [
{
command: 'yarn start',
port: 8000,
timeout: 120 * 1000,
reuseExistingServer: true
},
{
command: 'yarn start:crossoriginisolated',
port: 8080,
timeout: 120 * 1000,
reuseExistingServer: true
}
]
};
19 changes: 18 additions & 1 deletion ui-tests/tests/jupyterlite_xeus.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ test.describe('General Tests', () => {
test('xeus-python should execute some code', async ({ page }) => {
await page.goto('lab/index.html');

// Launch a Python notebook
const xpython = page.locator('[title="Python 3.11 (XPython)"]').first();
await xpython.click();

Expand All @@ -44,4 +43,22 @@ test.describe('General Tests', () => {
'jupyter-xeus-execute.png'
);
});

test('the kernel should have access to the file system', async ({ page }) => {
await page.goto('lab/index.html');

// Create a Python notebook
const xpython = page.locator('[title="Python 3.11 (XPython)"]').first();
await xpython.click();

await page.notebook.save();

await page.notebook.setCell(0, 'code', 'import os; os.listdir()');
await page.notebook.runCell(0);

const cell = await page.notebook.getCellOutput(0);
const cellContent = await cell?.textContent();
const name = 'Untitled.ipynb';
expect(cellContent).toContain(name);
});
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading